Uneven motion in GCode spiral when Max Jerk Limit is low

Discussions and file drops for Auggie
Post Reply
Joakim
Old Timer
Posts: 56
Joined: Mon Sep 17, 2012 5:48 am

Uneven motion in GCode spiral when Max Jerk Limit is low

Post by Joakim »

Running the 1mmspiral.tap GCode file on my K40 I noticed uneven circular motion, like motors was constantly changing speed.
Turning on Motor Stats I got the oscillating motor output as shown on the first screen capture.

Settings:
Feedrate = 3000 mm/s, Lookahead = 20, Constant velocity on = 0.05, Max Jerk Limit = 5000.

Rerunning the GCode and raising Max Jerk Limit to 50000 (10x) stopped the motor oscillation and motion was again smooth (Second screen capture).

Is this the expected effect when lowering Max Jerk Limit?

(The 1mmspiral.tap is a special case, with only arcs and no lines)

Joakim
Attachments
Steppers, Jerk Limit 50000 - 1.48a.jpg
Steppers, Jerk Limit 5000, Oscillating  - 1.48a.jpg
User avatar
ArtF
Global Moderator
Global Moderator
Posts: 4591
Joined: Sun Sep 05, 2010 6:14 am
Contact:

Re: Uneven motion in GCode spiral when Max Jerk Limit is low

Post by ArtF »

Hi J:

  Yes, Id expect that. Lets discuss why for a second as it may help others as well..

The CV in Auggie is unique, its based not on accel as in Mach3, but on a defined
radial distance. (In your case .005 , which is very very small by the way..). The radial
distance you select as well as the length of your line segments in any file will define
just how much the jerk setting affects the end result.

  To best tune Auggie for a system, its best to understand the magic in CV , and
how the variables affect each other. First, lets talk about how lines are joined..

  Lets say you have 6 lines in a row, could be a spiral or any collection of moves..
We want to join them together to run as quickly and smoothly as possible.

  Auggie preplans all moves every time you add another. If you have 10 moves in the queue
and add an 11th, all the previous 10 are re-planned as well to ensure you move as quick
and as smoothly as possible. During this replanning, Jerk is always considered and no
motion will be allowed the exceeds the jerk setting. Keep this in mind.

So we need to join line 1 to line 2 .. we look at the last 1/3rd of line 1 and the first 1/3rd
of line 2, We calculate the best hermitic curve to join the two together that allows the maximum
speed that will not exceed jerk. The maximum radius of the curve is what you set as the CV curve.

  Every curve has an implied acceleration, I chose hermites because I can calculate the max accel
easily in the curve so long as its entered at zero accel or decel, and leaves it with zero accel or decel.

  So we have a rule," all joining curves must be entered at a steady speed, and they are ensured to leave
at the same speed" . Now the accel in the curve, as implied by the formulas of that type of curve, will generate
jerk dependant on its radius and speed, even though it was entered and will leave at a steady speed. The radius here
is very important. The larger the radius, the higher the allowed speed to enter the joining curve.
Also, the line lengths being joined are important. This is because since we must  enter and leave all joining
curves at zero accel, only the middle 1/3 of any line segment can use acceleration, and to match the jerk,
you must accel and decel back to zero during that 1/3rd segment.

  OK, so the above, even if not followed, shows that your jerk setting will be more limiting as the CV radius shrinks.
A CV radius of zero then equals exact stop mode. As it increased, for any jerk setting, maximum speed and smoothness
for that jerk setting increases up to the maximum that jerk setting can support.

  The question many will have then, is "How do I select a CV radius? ". Since the jerk will be proportional
to the selected CV radius, its important to have some sort of benchmark to compare against.  Setting a CV
of 1" doesn't mean you will have 1" corners, it means the maximum corner would be 1". The actual radius
will be a function of the jerk limit, and the speed in the segment.. higher the jerk and speed, the larger the CV
will be in reality. At a maximum it can only be 1/3 or any line segment being joined to another.

  So, "How DO I know what CV radius to use? "

My benchmark is Mach3. Mach3 uses a line blending CV .. Consider a Mach3 system running 2 lines,
a move from 0,0 to 10,0 and then a line to 10,10. So a corner of a box. Lets say for example that
Mach3 in that move will get up to 300" / min. It need to start decelerate the X axis 1" before the end
in order to stop in time. As it starts to decel the X, it starts to accel the Y. This creates a joining CV
curve ( from arc to ellipsoid ) from one axis to the other. the radius of this shape will be 1" if both
X and Y accel is the same of an ellipsoid with a X of 1" and a Y of another radius. So in Mach3,
the max CV radius on such a system is 1". Seems a large setting, but its only effective on higher
speeds, as in Auggie, the higher the speed, the greater the radius it will attempt to use, limited by
1/3 of the joining segments length.

  I use from 10mm to 25mm generally myself. This allows the jerk limitation to be reduced in
the selected arc radii. Limiting to a very small value would amplify the jerk limiters response. 

  Its a complex dance, but my advice is to use a .5" or 15mm CV , tune jerk for good performance,
and then shrink CV setting for jobs where you find it may cause any trouble, but keep in mind
that similar systems on mach3 would likely have very much higher CV radii if one computed them
as a comparative term.

  Sorry to drone on, but it does help to have in mind how the planner works when trying to
tune. Everyone's response  to Jerk will differ based on their numbers and how their motors are
tuned, very few will find their perfect Jerk is the same as someone else.

Art




Joakim
Old Timer
Posts: 56
Joined: Mon Sep 17, 2012 5:48 am

Re: Uneven motion in GCode spiral when Max Jerk Limit is low

Post by Joakim »

Art:
The original assumption I had (and a wrong one) for setting Max. CV radius was: My laser beam is approx. 0.1mm and I want no more than half the beam diameter in error => Max CV = 0.05mm. This will make sure that cuts are accurate ...

After you explain how tings are related, I see, that this very small Max CV limits the jerk planer in an unwanted manner and doesn't control, what I intended.

Assume that Max CV is set to 15mm, how can I be sure, that a circle with diameter of 20mm will not end up as 18mm, 25mm or an ellipse?

What I am looking for is a way to run a simulation with current parameters of the GCode and get a readout of the max path error for that job?

This way it would be possible to tune parameters for the given machine and job.

Can I use G61 and G64 Pxx be used to control exact stop and CV max error in jobs (have not checked if they are implemented).
User avatar
ArtF
Global Moderator
Global Moderator
Posts: 4591
Joined: Sun Sep 05, 2010 6:14 am
Contact:

Re: Uneven motion in GCode spiral when Max Jerk Limit is low

Post by ArtF »

Hi J:

They arent yet turned on. BUT, the CV will have no effect on accuracy of circles and such, it will
affect only the motion from one move to another, for example as you move from a line into a circle,
or on the corners of a box. The best way to see the effect is to run a square with various settings,
youll see worst case a round corner of your setting.

Art
Post Reply

Who is online

Users browsing this forum: No registered users and 53 guests