How to get MPG input (hm2_7i96s.0.inm.00.enc0-count) to move axis
- slowpoke
 - Offline
 - Elite Member
 - 
				
			 
		Less
		More
		
			
	
		- Posts: 206
 - Thank you received: 28
 
			
	
						01 Feb 2025 22:46		 -  01 Feb 2025 22:47		#320365
		by slowpoke
	
	
		
			
	
	
			 		
													
	
				How to get MPG input (hm2_7i96s.0.inm.00.enc0-count) to move axis was created 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
		Last edit: 01 Feb 2025 22:47  by slowpoke.			
			Please Log in or Create an account to join the conversation.
- PCW
 - 
				
											 - Offline
 - Moderator
 - 
				
			 
		Less
		More
		
			
	
		- Posts: 17380
 - Thank you received: 5068
 
			
	
						02 Feb 2025 01:01				#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.
		The following user(s) said Thank You: slowpoke 	
			Please Log in or Create an account to join the conversation.
- slowpoke
 - Offline
 - Elite Member
 - 
				
			 
		Less
		More
		
			
	
		- Posts: 206
 - Thank you received: 28
 
			
	
						06 Feb 2025 20:29				#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.
Attachments:
		The following user(s) said Thank You: tommylight 	
			Please Log in or Create an account to join the conversation.
		Time to create page: 0.071 seconds