Hello Guest it is March 29, 2024, 09:55:24 AM

Author Topic: Jogging multiple Axes  (Read 1029 times)

0 Members and 1 Guest are viewing this topic.

Jogging multiple Axes
« on: July 17, 2022, 05:05:49 PM »
Is there a way to program a button to jog two different axes at once, such as X and Z?

Offline Bill_O

*
  •  563 563
    • View Profile
Re: Jogging multiple Axes
« Reply #1 on: July 19, 2022, 03:57:52 PM »
The only way I can think of is to do it as a gcode command.
So you would have to have a set position.
That position could be changed with a register.
Re: Jogging multiple Axes
« Reply #2 on: July 19, 2022, 04:23:50 PM »
Thanks but that's not what I need to do.  I want to JOG two axes with one button.  Your response is not an option.

Re: Jogging multiple Axes
« Reply #3 on: July 19, 2022, 04:33:45 PM »
What are you wanting to jog to axis for? 
Is it for a gantry type machine or do you have something else in mind?  I'm looking now to see what can be done to jog two axis with a single button.
Chad Byrd
Re: Jogging multiple Axes
« Reply #4 on: July 19, 2022, 04:37:43 PM »
I have a 4 axis foam cutter that moves a wire in two planes.  2 that move in the y plane and 2 that move in the z plane.  Instead of holding the two keys on the keyboard simultaneously, I would like to use one button to move each set of axes.
Re: Jogging multiple Axes
« Reply #5 on: July 19, 2022, 04:47:21 PM »
Are they independent of each other, or are they slaved?  I have never used slaved motors, but I assume they would jog together. 

Either way....
This will do what you want.  It is linked to the jog velocity, so changing the Jog Rate % in the jogging tab will adjust how fast this jogs.

So, make your button or buttons to jog your multiple axis.
I have noted on the first instance the conditions for the JogVelocityStart  and JogVelocityStop. 
inst, Axis#, and Direction. 
You may want to add 1 button to jog Postive and another button to jog Negative.

Once you make your button, do the following.
Put this in the Down Script for the button
--Start Jogging
local inst = mc.mcGetInstance()
mc.mcJogVelocityStart(inst, 0, 1) --inst, Axis#, Direction 1 is positive and -1 is negative.
mc.mcJogVelocityStart(inst, 1, 1)

Put this in the Up Script for the button
--Stop Jogging
local inst = mc.mcGetInstance()
mc.mcJogVelocityStop(inst, 0) --inst, Axis#
mc.mcJogVelocityStop(inst, 1)
Chad Byrd
Re: Jogging multiple Axes
« Reply #6 on: July 20, 2022, 08:30:41 PM »
I thought that was the right way , I just didn't know how to execute it.  Thanks!
Re: Jogging multiple Axes
« Reply #7 on: July 21, 2022, 08:49:58 AM »
No problem.
In my testing, it didn’t jogged perfectly synced.  So I would be aware of that. I assume it is from reading the 1st axis slightly ahead of the 2nd axis on the button press
Chad Byrd
Re: Jogging multiple Axes
« Reply #8 on: July 22, 2022, 01:06:17 AM »
Hi,
in order to jog two or more axes together precisely would require coordinated movement which in turn requires that Mach offer multi axis trajectory data to the motion controller.

To my knowledge that is not how Mach jogging works.

My understanding is that Mach jogs one axis at a time. What Mach might do is to jog first the X axis  closely followed by the Y axis, and repeat. If this happened often enough
and fast enough you might get the desired effect of two axes moving at once. What would not happen is that one axis would move in a precisely coordinated manner, lets say X moves 50mm and Y
also moves 50mm.

May I suggest that you could write some macros, with each macro enacting a small but coordinated moment, something like this:

m500()
mc.mcCntlGcodeExecute(inst,"g91/n,g1x0.1y0.1/n,g90")
end

Note this is just a sketch, this macro would need a ton of work to run, just the idea is that each time this macro ran the X and Y axes would move 0.1mm in coordinated fashion.
You might have another macro, say m501(), that would go in the other direction. Note also that I transition to incremental mode to execute the move and then transition back to absolute
mode. That's fine if you started in absolute mode but would cock up if you started in incremental mode. In practice you have to test that on each occasion.

Craig
'I enjoy sex at 73.....I live at 71 so its not too far to walk.'
Re: Jogging multiple Axes
« Reply #9 on: July 22, 2022, 06:27:29 AM »
It is possible and the question has been solved.  Thanks.