Hello Guest it is November 16, 2019, 07:05:20 PM

Author Topic: USB MPG Rotary Encoder  (Read 4020 times)

0 Members and 1 Guest are viewing this topic.

USB MPG Rotary Encoder
« on: August 19, 2011, 04:29:01 AM »
I am trying to create a plugin for a custom USB MPG using the ShuttlePro example in the SDK.

Is there any documentation that explains what all those variables are for in the example? Its not clear to me how to tell MACH to simply move a specific number of steps. I don't own a ShuttlePro so I can't single step through the code to see that all the variables do and my attempts to modify the code to work with my encoder have resulted in either continuous jogging or no movement at all. Basically I don't know what I'm supposed to do with some of the variables used in the example.

For starters, what are the following for?

MainPlanner->m_Increment
_setup->Rotation

I hope someone can shed some light on this or point me in the right direction.

Offline BR549

*
  •  6,916 6,916
    • View Profile
Re: USB MPG Rotary Encoder
« Reply #1 on: August 19, 2011, 01:08:59 PM »

NEVER MIND I just saw where it is using USB sorry.



IF you just want to use the encoder as an MPG then that function is built into Mach3. Wire the encoder to the port ands set it up as an encoder then config the MPG function to those pins/port. Calibrate the MPG function .
THEN Use the Jog flyout to setup the function as to the axis movements and instant mpg.

That is unless you just want to play with programming a plugin.

Just a thought, (;-) TP
« Last Edit: August 19, 2011, 01:11:12 PM by BR549 »
Re: USB MPG Rotary Encoder
« Reply #2 on: August 26, 2011, 09:19:15 PM »
I was already using the MPG through the LPT port. After my mobo died, it took me over 3 weeks to locate a new one with built-in LPT port and this one doesn't like the LPT2 card I was using for the MPG. That's when I got fed up and decided it was time to eliminate my dependence on the LPT port.

Anyways, I finally realized my mistake, I was trying to compile the SDK samples in VS2008. Once I switched to VS2003, I was able to single step through code and actually see proper values for the variables and figured out what most of them are for.

So I now have the MPG working through USB which is great. Once less LPT card in my system.