Adding a Mpg to a 7i85s

More
04 May 2018 13:45 #110201 by rodw
Replied by rodw on topic Adding a Mpg to a 7i85s
I'm not sure I got the right pins as I'm used to master branch which has some differences to earlier versions which I think Tormach is running
loadrt or2 names=xen yen zen
addf xen
addf yen
addf zen

# the next 3 signals are already defined
net sxp.xen-button => xen.in0
net sxp.yen-button => yen.in0
net sxp.zen-button => zen.in0

net jog-mode <= halui.mode.is-teleop
net jog-mode => xen.in1
net jog-mode => yen.in1
net jog-mode => zen.in1

net xen.out => axis.0.jog-enable
net yen.out => axis.1.jog-enable
net zen.out => axis.2.jog-enable

There is a pin that turns on when you are on the jog mode in halui. We'll use that as your missing input that you thought you needed a switch for. I might have the wrong one becasue you are jogging joints not axes (which is what I use in master). So have a look at the modes in halui and watch those pins in halshow. See where this takes you after testing and debugging.
The following user(s) said Thank You: Clive S

Please Log in or Create an account to join the conversation.

More
04 May 2018 14:09 #110203 by rodw
Replied by rodw on topic Adding a Mpg to a 7i85s
Actually when I think about it as Techno said, you can only jog when the right mode is selected anyway so you can probably just setp the in1 values to 1 but tying it to the halui pin would be an interesting exercise (and probably a better solution)
setp xen.in1 1
setp yen.in1 1
setp zen.in1 1

Please Log in or Create an account to join the conversation.

More
04 May 2018 14:32 - 04 May 2018 15:46 #110205 by Clive S
Replied by Clive S on topic Adding a Mpg to a 7i85s
Thank you for your time Rod. Unfortunately I will be away all next week so won't have time to test but I will report back on my return.

I have debugged it to here: this is the error message : custom_encoder.hal:26: Signal name 'xen.out' must not be the same as a pin.

loadrt or2 names=xen,yen,zen

addf xen servo-thread
addf yen servo-thread
addf zen servo-thread

net sxp.xen-button => xen.in0
net sxp.yen-button => yen.in0
net sxp.zen-button => zen.in0

net jog-mode <= halui.mode.is-teleop
net jog-mode => xen.in1
net jog-mode => yen.in1
net jog-mode => zen.in1

net xen.out => axis.0.jog-enable
net yen.out => axis.1.jog-enable
net zen.out => axis.2.jog-enable


Not sure how to correct this.
Last edit: 04 May 2018 15:46 by Clive S.

Please Log in or Create an account to join the conversation.

More
04 May 2018 20:58 #110220 by rodw
Replied by rodw on topic Adding a Mpg to a 7i85s
I probably should have added a signal name
net xen-out xen.out => axis.0.jog-enable
The following user(s) said Thank You: Clive S

Please Log in or Create an account to join the conversation.

More
05 May 2018 08:19 #110240 by Clive S
Replied by Clive S on topic Adding a Mpg to a 7i85s

I probably should have added a signal name
net xen-out xen.out => axis.0.jog-enable


Thank you again Rod Success. I must have played with this for over 100 hours. this is the custom.hal so far:

loadrt or2 names=xen,yen,zen
addf xen servo-thread
addf yen servo-thread
addf zen servo-thread

net sxp.xen-button => xen.in0
net sxp.yen-button => yen.in0
net sxp.zen-button => zen.in0

net jog-mode <= halui.mode.is-manual
net jog-mode => xen.in1
net jog-mode => yen.in1
net jog-mode => zen.in1

net xen-out xen.out => axis.0.jog-enable
net yen-out yen.out => axis.1.jog-enable
net zen-out zen.out => axis.2.jog-enable


setp axis.0.jog-vel-mode 0
net x-jog-counter <= hm2_5i25.0.encoder.01.count
net x-jog-counter => axis.0.jog-counts
setp axis.0.jog-vel-mode true
setp axis.0.jog-scale 0.000984

setp axis.1.jog-vel-mode 0
net y-jog-counter <= hm2_5i25.0.encoder.02.count
net y-jog-counter => axis.1.jog-counts
setp axis.1.jog-vel-mode true
setp axis.1.jog-scale 0.000984

setp axis.2.jog-vel-mode 0
net z-jog-counter <= hm2_5i25.0.encoder.03.count
net z-jog-counter => axis.2.jog-counts
setp axis.2.jog-vel-mode true
setp axis.2.jog-scale 0.000984

This all works fine.:)
Now. Also is it beneficial to set the mpg encoder to "times 4 mode" I notice that the mpg turned very slowly each click give me 4 values.

And should I add a low-pass filter component in series with the jog count. if so how?

Please Log in or Create an account to join the conversation.

More
21 May 2018 08:36 #110949 by Clive S
Replied by Clive S on topic Adding a Mpg to a 7i85s
My mpg's are working now with the custom.hal attached.

Is it beneficial to set the mpg encoder to "times 4 mode" I notice that the mpg turned very slowly each click give me 4 values.

Should I add a low-pass filter component in series with the jog count. if so how? so that it smooths out the indent click on the mpg


File Attachment:

File Name: custom_enc...5-21.hal
File Size:1 KB
Attachments:

Please Log in or Create an account to join the conversation.

More
21 May 2018 14:13 #110962 by Clive S
Replied by Clive S on topic Adding a Mpg to a 7i85s
Ok update now I seem to have the ilowpass working.

But still need to figure out if I need to set the mpg encoder to "times 4 mode" if so what benefit would it bring.

File Attachment:

File Name: custom_enc...pass.hal
File Size:2 KB
Attachments:

Please Log in or Create an account to join the conversation.

More
22 May 2018 06:42 #111018 by rodw
Replied by rodw on topic Adding a Mpg to a 7i85s
Clive, my MPG is set up like this
# --- 7i76e ENCODER SETUP ---
setp hm2_7i76e.0.encoder.00.scale -1
setp hm2_7i76e.0.encoder.00.counter-mode 1

I wonder if you are going 4000 times slower than I am?

I never did get the ilowpass working so I'll be reviewing your hal file...

Please Log in or Create an account to join the conversation.

More
22 May 2018 11:00 #111026 by Clive S
Replied by Clive S on topic Adding a Mpg to a 7i85s

Clive, my MPG is set up like this
# --- 7i76e ENCODER SETUP ---
setp hm2_7i76e.0.encoder.00.scale -1
setp hm2_7i76e.0.encoder.00.counter-mode 1

I wonder if you are going 4000 times slower than I am?

I never did get the ilowpass working so I'll be reviewing your hal file...


Rod. Not sure what you mean by "4000 times slower" are you referring to my spindle encoder?

Regarding the ilowpass I have now done some tests and it is working as it should I believe.
This is the relevant bit:-
# X MPG ilowpass
setp ilowpass.mpgX.scale 10 ### this is is multiplied by the "setp axis.0.jog-scale 0.0000492"
setp ilowpass.mpgX.gain 0.01 ### The gain I believe has to be between 0-1

setp axis.0.jog-vel-mode 0
net x-jog-counter <= hm2_5i25.0.encoder.01.count
net x-jog-counter => ilowpass.mpgX.in

net ilowpass-0-out ilowpass.mpgX.out
net ilowpass-0-out => axis.0.jog-counts

setp axis.0.jog-vel-mode true
setp axis.0.jog-scale 0.0000492 ### this give me 5mm travel for one complete turn of the mpg 100 clicks.

By adjusting the gain above certainly smooths out the jog click on the mpg.

Q. I still can not find the answer as to whether (or if I need to) use the "times 4 mode" or is this just for software encoding?

Please Log in or Create an account to join the conversation.

More
22 May 2018 12:00 #111027 by rodw
Replied by rodw on topic Adding a Mpg to a 7i85s
I did try ilowpass and ended up with 1 click on the MPG being 1 metre based on the example in the docs which was not pretty when I used to getting 1mm per click! So I took it out! :woohoo: :woohoo: :woohoo: What a Crash!!!!!

I did eventually work out I had to change a scale somewhere else when adding in the ilowpass so I've been meaning to try again but I'm off to a conference for 3 days.

I still don't quite understand why you are using such strange values for axis.0.jog-scale because mine is set in device units. My MPG scale is marked x1, x10, x100 so it was a bit unintuitive to me because on the advice of a mate x1 = .01mm, x10 = 0.10mm, x100 = 1mm of movement, so I had to change the scale selections around to match.

Please Log in or Create an account to join the conversation.

Time to create page: 0.094 seconds
Powered by Kunena Forum