Hello Guest it is April 18, 2024, 09:29:24 PM

Author Topic: Fine jogging of A-axis issue  (Read 1829 times)

0 Members and 1 Guest are viewing this topic.

Fine jogging of A-axis issue
« on: September 17, 2020, 05:04:58 PM »
I've created a Jogging panel which has radio buttons for selecting 1mm, 0.1mm, 0.01mm and 0.001mm increments as well as one for Continuous.
I've been using this for well over a year and it works fine in X,Y & Z
However, I've now fitted an A-axis and it only jogs when I select the 1mm and 0.1mm radio buttons. 1mm represents 1 degree etc.

The Issue is that it should jog to a resolution of 0.01mm (0.01 degrees) because I've got 10,000 steps/revolution and a 3.6:1 reduction on the belt drive. That means 100 steps for 1 degree which is what I get when I command the A-axis to 360degrees and it comes back to the start.

I've just tried a series of program moves at 0.01degrees and it's happy to execute those moves.

The jog increments are set using the Left Up Script of the radio buttons
This is what I do for each button...

local inst = mc.mcGetInstance()
local rc

rc = mc.mcJogSetInc(inst, mc.X_AXIS, 0.01)

It's interesting that you don't need to set the Y or Z axis, they all seem to use the same one. I can replace that line with A-AXIS and the X,Y and Z all increment 0.01 but the A-AXIS doesn't move.

The actual jog is triggered by the Left Down Action Event of the A+ jog button being set to Jog A+. Clearly this correctly hooked up else it wouldn't work on the 1mm and 0.1mm jog increments.

So it looks to me like there's a bug that's preventing the A-AXIS responding to the higher resolutions. Something is different about the way it's handling those.

There must be a shared variable somewhere that's being set to the increment used by the Jog X+ and Jog A+ buttons. That's clearly being set correctly because when I select the 0.01mm radio button, the X,Y & Z axes increment correctly, but not the A axis.

Any ideas? It looks like a bug to me.
Re: Fine jogging of A-axis issue
« Reply #1 on: September 22, 2020, 05:30:31 PM »
I've just explored this a little more because I wrote it a long time ago and wanted to check out a few things.

The first thing to note is the the funcion...
rc = mc.mcJogSetInc(inst, mc.X_AXIS, 0.01)
... doesn't affect the jog increment that actually gets used. It only sets the internal variable which is what I use to highlight the correct radio button.

The actual jog increment is set by the Left Up Action event of the radio button such as Jog Inc. 1 which selects the job increment from the table set up in Control Configuration->General Tab

Note:-If you leave this out and rely on the mc_JogSetInc() function, it doesn't work.

So the question comes down to this... Why doesn't the A-axis respond to the 0.01 increment in the table when the resolution I'm using should output a single pulse to the Servo Motor?
The counts/unit is 100, so a jog of 0.01 ought to output a single count.

If I set the counts/unit to 100.0001, I can get it to react to a step of 0.01, but obviously that's not a satisfactory solution. So this looks like a rounding error to me.


Re: Fine jogging of A-axis issue
« Reply #2 on: October 07, 2020, 12:02:23 PM »
Does anyone have any idea why this problem exists?

I've bodged a usable jog increment for the A-axis by filling in the jog table with an increment of 0.011 which generates a pulse when 0.01 doesn't.

If I had to guess, I'd say that in the general jog routine that calculates how many steps to output, it fails to output a single step when the jog increment exactly equals the jog step * counts per unit.

In my case that's 0.01 x 100=1 so that should output 1 step. Obviously if it's less than one step you don't want to ouptut it, so maybe there's a >1 instead of >=1 test in there to clip the output?

Everything works fine in program mode, this is only an issue with the maths in the jog mode.
Can someone try this out and see why it doesn't work? All you have to do is to set the jog step to 0.01 and the axis counts/unit to 100 and see if you get a step. If not, why not?