- Posts: 224
- Thank you received: 0
How to get MPG input (hm2_7i96s.0.inm.00.enc0-count) to move axis
1 year 8 months ago #320365
by slowpoke
I just connected up a MPG type encoder to inputs 0 & 1 on TB-3 of a 7i96s. I can see hm2_7i96s.0.inm.00.enc0-count moving as expected when I rotate the MPG.
So now how would I go about getting that count to actually move the Z axis?
Worth noting that I also have a functioning pair of jog buttons, I envision using either method (buttons or MPG) to move the axis manually)
Thanks
So now how would I go about getting that count to actually move the Z axis?
Worth noting that I also have a functioning pair of jog buttons, I envision using either method (buttons or MPG) to move the axis manually)
Thanks
Please Log in to join the conversation.
1 year 8 months ago #320375
by PCW
Replied by PCW on topic How to get MPG input (hm2_7i96s.0.inm.00.enc0-count) to move axis
its a bit involved, you can look here for the basic hal setup
linuxcnc.org/docs/html/examples/mpg.html
(that happens to use a software encoder counter but the basics are the same)
Note that there are jog enable,count and scale pins for both axis and joints
The joint pins are active before homing and the axis pins are active after homing.
You could also search the forum for "MPG" as there may be a MPG setup using similar
hardware as yours.
linuxcnc.org/docs/html/examples/mpg.html
(that happens to use a software encoder counter but the basics are the same)
Note that there are jog enable,count and scale pins for both axis and joints
The joint pins are active before homing and the axis pins are active after homing.
You could also search the forum for "MPG" as there may be a MPG setup using similar
hardware as yours.
Please Log in to join the conversation.
1 year 8 months ago #320843
by slowpoke
I now have the MPG working for the X axis and it was super simple (the example above gave me what I needed, and I only needed 4 lines to get it working
#MPG
setp axis.x.jog-scale 0.001
setp axis.x.jog-enable true
net encoder-counts <= hm2_7i96s.0.inm.00.enc1-count
net encoder-counts => axis.x.jog-counts
#MPG ENDS
I have switches to manually jog, so I will use those to move significant distances, and then use the MPG to home in on the desired position, should make for a user friendly experience.
I will likely upgrade to ball-screws to fix the backlash, however at least now when I change direction the backlash is automatically dealt with.
I 3D printed a belt cover and mounted the X-MPG where the old manual cross slide hand wheel was.
Thanks for all your help, a Mesa board and HAL make customization really easy.
Replied by slowpoke on topic How to get MPG input (hm2_7i96s.0.inm.00.enc0-count) to move axis
Well thanks for that.its a bit involved, you can look here for the basic hal setup
linuxcnc.org/docs/html/examples/mpg.html
(that happens to use a software encoder counter but the basics are the same)
Note that there are jog enable,count and scale pins for both axis and joints
The joint pins are active before homing and the axis pins are active after homing.
You could also search the forum for "MPG" as there may be a MPG setup using similar
hardware as yours.
I now have the MPG working for the X axis and it was super simple (the example above gave me what I needed, and I only needed 4 lines to get it working
#MPG
setp axis.x.jog-scale 0.001
setp axis.x.jog-enable true
net encoder-counts <= hm2_7i96s.0.inm.00.enc1-count
net encoder-counts => axis.x.jog-counts
#MPG ENDS
I have switches to manually jog, so I will use those to move significant distances, and then use the MPG to home in on the desired position, should make for a user friendly experience.
I will likely upgrade to ball-screws to fix the backlash, however at least now when I change direction the backlash is automatically dealt with.
I 3D printed a belt cover and mounted the X-MPG where the old manual cross slide hand wheel was.
Thanks for all your help, a Mesa board and HAL make customization really easy.
Attachment not found
Please Log in to join the conversation.
Time to create page: 0.397 seconds
