- Posts: 210
- Thank you received: 0
Setting up MPG with per-axis jog scale
Where things get interesting, and where I haven't found great examples, is in having a different scale for one axis. X, Y, and Z can share the same common set but it doesn't make much sense for me to jog the rotary table at 0.001 degrees per pulse. At least, not at this point.
My interested was peaked by this recent thread that discussed MPG setup and two slightly different ways of accomplishing it. I was left thinking that the look-up table or bitwise MUX might be the best way to go about it but was having some difficulty moving from the simple example provided to implementing my (condensed) truth table below.
Attachment not found
Any hints to get me started?
Please Log in to join the conversation.
Please Log in to join the conversation.
pretty easy actually.
Please Log in to join the conversation.
cmorley wrote: pretty easy actually
So is walking, but try telling that to a toddler.
Thanks for pointing me in the right direction. I'm still trying to get into the mindset of HAL.
Please Log in to join the conversation.
Sparky961 wrote: Where things get interesting, and where I haven't found great examples, is in having a different scale for one axis. X, Y, and Z can share the same common set but it doesn't make much sense for me to jog the rotary table at 0.001 degrees per pulse. At least, not at this point.
The solution here is probably to have one mux for linear and another for rotary. Drive them both from the same selector and take the output to appropriate axes.
Please Log in to join the conversation.
My selection switches aren't binary coded. It's just one output for each selection, so it requires that I use a MUX rather wastefully in my opinion. If there's a more elegant way to do this, I'd be happy to see it. Otherwise I'm happy to have something that works well.
You'll see I have a "TODO" near the end. I'd like to have the MPG disabled by LinuxCNC during motion and other times where safety might be an issue. I'm not sure where to look to complete that part.
[Side note: I tried to paste the code inside CODE tags but the forum complained that "You have too many links in your message, please decrease it!" - So file is attached.]
Attachment not found
Please Log in to join the conversation.
Please Log in to join the conversation.
Please Log in to join the conversation.
Sparky961 wrote: Ok, that's great. Now if I only want the LED on the MPG lit when active, would I use the halui.mode.is-auto pin, inverted? Or would there be other modes where it gets ignored?
I am not sure. I would set up a halmeter to watch that pin during operation and see what happens.
I know that, in the Axis GUI, the keyboard and gamepad jog-modes are disabled in MDI mode too (ie, with the MDI tab selected)
You might need to use halui.mode-is-manual.
Please Log in to join the conversation.
However, I've taken a slightly different approach and instead connected the logic that drives the LED (any axis selected on the MPG = ON) and also connected that to halui.mode.manual so that selecting an axis on the MPG now changes to the manual mode so I don't need to touch the PC.
When I was working on this I also noticed that my indicator would light when the machine "Power" was off, which is undesired. I used the halui.machine.is-on bit to enable the MPG.
I have yet to test what happens when running a program and an axis is selected with the MPG. I'm hoping that it gets ignored, at least until the program is finished executing.
Please Log in to join the conversation.
