Understanding the motion planner + settings

Post anything you want to discuss with others about the software.

Understanding the motion planner + settings

Postby Robertspark » Tue Aug 01, 2017 10:09 pm

In need of a little guidance (before I post something that is wrong in a discussion that I'm having elsewhere).

The application is plasma and I'm in need of understanding the motion planner a little more / clarifying what I think I know and how it relates to UCCNC. :roll:

Configuration >> General Settings tab.

Corner Error Max: default (as installed) setting 0.03 units [say the units are mm for this topic as most of the world is metric]

I suspect that most users don't understand, consider or change this setting in relation to their machine setup?

As I understand it, this is the allowable rounding error at corners (in simple terms), and from the manual "This parameter sets the maximal interpolation error at the connection between
two path points and works in constant velocity mode only."

With regards to plasma cutting where we are seeking high constant velocity feedrates, in my opinion we need to adjust this value relative to our machine parameters (and possibly even to the material we are cutting [kerf compensation? changes with ampage + material + thickness]).

I cannot talk about others settings as I only know my own really well, and I've not built many machines execpt my own and tried to understand and experiment on it regarding settings.

In UCCNC, my X&Y acceleration is presently 3000mm/sec/sec (~0.3g) which is high, but from what I've read from Jim Colt, an acceptable target. 8th post down http://www.plasmaspider.com/viewtopic.php?t=18054
In Mach3, my X&Y acceleration was 300 - 400 mm/sec/sec (~0.03g) before loosing steps (with a smooth stepper and the rest of the setup the same with tuned drives).

My machine has 5mm HTD belts, on 20T pulleys, direct drive, 200 step motors, and 10uStep drives set, hence 20 steps / unit [mm], and a resolution of 0.05mm per step. (very course, but remember this is plasma)

hence leaving the Corner Error Max at 0.03mm is pointless (in my opinion) as it's less than my machines minimum resolution.....

Also I believe we need to consider Centripetal acceleration, and I don't believe many people do [I may be wrong however...]
The best "simple" explanation I have found is here, and look at example #1, expand the webpage for the answer (show me the solution)
https://www.khanacademy.org/science/phy ... celeration

hence for a Corner Error Max of 0.03mm, with an acceleration of 3000mm/sec, the feedrate in the corners must slow down to ~9.48mm/sec (570mm/min) before accelerating back up to the desired feedrate

And our target feedrate for plasma could be around 300in/min (fairly common) up to 400"/min (less common, but probably the limit of most hobby machines) or higher in commercial machines
300"/min = 7620mm/min (127mm/sec)

If I set the Corner Error Max at the step resolution of 0.05mm, this would increase the feedrate to 12.2mm/s (735mm/min), although in my opion we could actually go higher for a "better" setting.

"better" because it would be realistic with what we are trying to do.....

With plasma, you have to ask yourself what would be the absolute minimum corner radius you could cut. I would argue that it would the 1/2 the kerf width which is equivelent to the cutting tool on a milling machine, you can never cut an insider corner less than the selected tool radius.

In plasma, the kerf is between 0.5mm (45A /0.8mm) up to 2.5mm (85A, 19mm), although in my application it ranges between 0.5mm to about 2mm, with 1.0 to 1.2mm being the common static setting allowance for offset compensation (as there is also some bevel to take account too)

Say the kerf is 1.0mm, then the minimum corner radius will be 0.5mm, say 1/2 to 2/3rds of this for a safe margin say about 0.3mm (10x default setting) which would then bring our maximum corner feedrate up to 30mm/sec (1800mm/min) to keep within the range of the Corner Error Max tolerance.

Going back to Centripetal Acceleration we know that at a feedrate of 7620mm/min the minimum radius we could cut without droping the feedrate would be ~5.4mm, hence the machine must begin lowering the feedrate 5.4mm from the corner, before reaching the minimum feedrate in the corner of 1800mm/min, before accelerating back up to 7620mm/min on an inside corner

External corners are not normally an issue (unless it's art work) because you can normally loop the corners and get a tight 90º corner (in plasma).

I guess what I'm asking is have I understood the Corner Error Max setting correctly, and should we look to adjust it from the default value relative to the application (in plasma, likley upwards, in precision milling maybe downwards?) in order to improve corner feedrate and minimise the amount of acceleration and deceleration that may be being experianced by setting this value too low (especially maybe if you have a whole load of small lines that are making up your g-code).

An interesting point in Plasma is for holes (or small radius arcs [small as in less than 25mm radius]), you normally lower the linear feedrate to 60% in order than the hole does not come out with an internal bevel (i.e. the plasma arc gets a chance to blow the material out of the hole, whilst it spins and lags the cut), hence this would then lower the "accepatble" feedrate from 7620 to ~5080mm/min, and the minimum radius before the feedrate is lower than considered "acceptable" to ~2.4mm before and after the corner.

Note: I have struggled to understand why I am able to increase the acceleration from the low values in Mach3 (0.03g) up to the much higher values in UCCNC (0.3g) where in Mach3 I began to loose steps and stall the steppers (more correctly they locked out on error). With the same drives and setup just swapping out the Ethernet Smooth Stepper for the UC motion controller.

I can acctually increase the acceleration much higher, but the jerk under acceleration and deceleration can become quite pronounced (in one axis, requires a brace) before the toothed belts begin to slip their pullies (in both axis) [they have a high degree of wrap + tension + are 20mm belts so have a good contact ratio and are steel wire cored]
Robertspark
 
Posts: 1892
Joined: Sat Sep 03, 2016 4:27 pm

Re: Understanding the motion planner + settings

Postby beefy » Wed Aug 02, 2017 7:31 pm

Robertspark wrote:Note: I have struggled to understand why I am able to increase the acceleration from the low values in Mach3 (0.03g) up to the much higher values in UCCNC (0.3g) where in Mach3 I began to loose steps and stall the steppers (more correctly they locked out on error). With the same drives and setup just swapping out the Ethernet Smooth Stepper for the UC motion controller.

I can acctually increase the acceleration much higher, but the jerk under acceleration and deceleration can become quite pronounced (in one axis, requires a brace) before the toothed belts begin to slip their pullies (in both axis) [they have a high degree of wrap + tension + are 20mm belts so have a good contact ratio and are steel wire cored]


Hi Rob,

regarding that point, I was looking into stepper acceleration some time ago and how you'd implement it with a microcontroller.

If memory recalls correctly, there's actually an ideal formula for the timing of the steps during acceleration and deceleration, i.e. it's not simply a linear closing of the step "gaps" for acceleration and visa versa for deceleration. Perhaps Cncdrive have implemented much better control of the timing of the step pulses so they adhere much closer to these formulas, and thus can acheive better accel/decel rates.

Just my guess.

Keith.
beefy
 
Posts: 449
Joined: Mon Sep 05, 2016 10:34 am

Re: Understanding the motion planner + settings

Postby Robertspark » Wed Aug 02, 2017 8:29 pm

Keith,

Yes I agree, the biggest issue with acceleration is the first few steps of the accel / decel, that's where the stall (drive error) is likley to occur given the acceleration goes from nothing to infiniate in the first step

it's discussed here in a bit more detail
http://www.atmel.com/images/doc8017.pdf
Robertspark
 
Posts: 1892
Joined: Sat Sep 03, 2016 4:27 pm

Re: Understanding the motion planner + settings

Postby cncdrive » Wed Aug 02, 2017 9:53 pm

Guys,

Jerk is the first derivative of the acceleration, in other words jerk is the change rate of the acceleration which is 0 when there is a constant acceleration and so it is also 0 when there is constant velocity movement, because then again the acceleration is not changing.
With a trapezoidal acceleration profile Jerk is not 0 at only points, when the acceleration changes at those points the jerk is a 1(t) like function, a unit step, because the acceleration changes in 0 time from the original value to the new value.
S-curve acceleration profiling helps to reduce the jerk, because the acceleration changes as an exponent function in the beginning, so the amplitude of the jerk is lower and it is no more an 1(t) function,
however the total time of the acceleration will become a bit longer and hence the execution time of the path will be longer.
So, S-curve acceleration is not magic and is not cure for everything, it has both both advantages and disadvantages. There are applications where it is really useful and there are others when trapezoidal profiling is the better way to go.

Talking about the motion planner parameters:
The Corner error means the max. distance from the corner of 2 points of the path.
The controller will never make a larger error from the corner and it may make upto the set error value if it is required to keep the target speed between any 2 points.
There is a description with drawing on the 34 and 35. page of the UCCNC manual.

The linear error is a bit different, because that also defines a distance from the joint of 2 points, but the difference is how this information is used.
The parameter value means for the controller that it can join the 2 neighbour vecrors to a single line if the distance is lower than the set value, so it can speed up the path execution.

You begin to loose steps with Mach3 using the same acceleration in Mach3 which still works fine in the UCCNC is because the Mach3 trajectory planner is not perfect,
it has a problem which was never corrected that it often overaccelerates and deccelerates your settings. It more often over deccelerating. We've measured this out a few times and with avarage accel settings it overaccelerates usually upto 2 times while with extreme settings, when the axes have very different acceleration values we measured out upto 8x overaccelerations and deccelerations.
When this happens is when the motor looses steps and finally this forces the user to downtune the acceleration parameter to at least half the value of what otherwise the axis is capable to handle if Mach3 would obey the accel settings.
cncdrive
Site Admin
 
Posts: 4695
Joined: Tue Aug 12, 2014 11:17 pm

Re: Understanding the motion planner + settings

Postby Robertspark » Wed Aug 02, 2017 10:15 pm

cncdrive wrote:Talking about the motion planner parameters:
The Corner error means the max. distance from the corner of 2 points of the path.
The controller will never make a larger error from the corner and it may make upto the set error value if it is required to keep the target speed between any 2 points.
There is a description with drawing on the 34 and 35. page of the UCCNC manual.


Yes, that I believe I understand from my first post + it's associated calculation.
But....
Looking at this sentance:
cncdrive wrote:The controller will never make a larger error from the corner and it may make upto the set error value if it is required to keep the target speed between any 2 points.

So, it is correct to state that the feedrate is just the target, i.e. if the Corner Error is set too low, the feedrate will have to drop in order for the planner / motion controller to keep to the Maximum Allowable Corner error because of Centripetal acceleration.
So, we should select an appropriate Corner Error Max value relative to the machine / element we are doing because it may affect both the feedrate and possibly the path execution by the controller having to make more steps than are nessesary (because the Kerf / Tool Diameter is greater than the Corner Error Max setting)?

cncdrive wrote:The linear error is a bit different, because that also defines a distance from the joint of 2 points, but the difference is how this information is used.
The parameter value means for the controller that it can join the 2 neighbour vecrors to a single line if the distance is lower than the set value, so it can speed up the path execution.

The minimum value of this should equal the single step distance [1/ (steps per unit) ], then anything less than this is of no benefit.
This parameter could also therefore be approximatly equal to 1/2 the kerf width of a laser / plasma or tool diameter? So that the motion controller / planner will ignore short vectors less than the tool radius which cannot be cut practically?


cncdrive wrote:You begin to loose steps with Mach3 using the same acceleration in Mach3 which still works fine in the UCCNC is because the Mach3 trajectory planner is not perfect,
it has a problem which was never corrected that it often overaccelerates and deccelerates your settings. It more often over deccelerating. We've measured this out a few times and with avarage accel settings it overaccelerates usually upto 2 times while with extreme settings, when the axes have very different acceleration values we measured out upto 8x overaccelerations and deccelerations.
When this happens is when the motor looses steps and finally this forces the user to downtune the acceleration parameter to at least half the value of what otherwise the axis is capable to handle if Mach3 would obey the accel settings.

I remember reading about this somewhere previous (probably here, somewhere ... mind going...)
Robertspark
 
Posts: 1892
Joined: Sat Sep 03, 2016 4:27 pm

Re: Understanding the motion planner + settings

Postby Robertspark » Wed Aug 02, 2017 10:23 pm

Robertspark wrote:
cncdrive wrote:The linear error is a bit different, because that also defines a distance from the joint of 2 points, but the difference is how this information is used.
The parameter value means for the controller that it can join the 2 neighbour vecrors to a single line if the distance is lower than the set value, so it can speed up the path execution.

The minimum value of this should equal the single step distance [1/ (steps per unit) ], then anything less than this is of no benefit.
This parameter could also therefore be approximatly equal to 1/2 the kerf width of a laser / plasma or tool diameter? So that the motion controller / planner will ignore short vectors less than the tool radius which cannot be cut practically?



On second thoughts.... setting this to 1/2 the kerf width of the laser / plasma or tool diameter is probably not correct, because is you had a small curve or zigzag of tool path made up of single lines (less than the tool radius), the motion planner would therefore ignore it.......... minimum setting would therefore still be 1/(steps per unit) though
Robertspark
 
Posts: 1892
Joined: Sat Sep 03, 2016 4:27 pm

Re: Understanding the motion planner + settings

Postby cncdrive » Wed Aug 02, 2017 11:14 pm

So, it is correct to state that the feedrate is just the target, i.e. if the Corner Error is set too low, the feedrate will have to drop in order for the planner / motion controller to keep to the Maximum Allowable Corner error because of Centripetal acceleration.
So, we should select an appropriate Corner Error Max value relative to the machine / element we are doing because it may affect both the feedrate and possibly the path execution by the controller having to make more steps than are nessesary (because the Kerf / Tool Diameter is greater than the Corner Error Max setting)?


Yes, the feedrate is the target and the constraints are the acceleration parameters and the CV parameters, because the controller is not allowed to make a larger error than what you allow it to do,
so it has to drop the feedrate if it is physically not possible to follow the path with the set error value using the programmed feedrate.

And yes, you should select the corner error parameter to the actual job. For example if the customer defines that the corners must be as sharp as max. R0.5 then you can't define for example 1 value corner error, because then it is possible that the controller will make a larger error than 0.5, upto 1 value if it is required to maintain the programmed feed on the path at the corner.

The minimum value of this should equal the single step distance [1/ (steps per unit) ], then anything less than this is of no benefit.


And again yes, if the corner error is lower than 1 step then there is no benefit, because the controller is not allowed to even round one step distance.

This parameter could also therefore be approximatly equal to 1/2 the kerf width of a laser / plasma or tool diameter? So that the motion controller / planner will ignore short vectors less than the tool radius which cannot be cut practically?

On second thoughts.... setting this to 1/2 the kerf width of the laser / plasma or tool diameter is probably not correct, because is you had a small curve or zigzag of tool path made up of single lines (less than the tool radius), the motion planner would therefore ignore it.......... minimum setting would therefore still be 1/(steps per unit) though


It depends on the path. I mean yes, it depends on if the path is a zig-zag and how the vectors are connected. There are cases when it ignores it, it has to ignore it to obey the rules/constraints of the settings.
If for example there are lots of short lines looking at about the same distance and then there is a break, e.g. a 45°one and you have sat the stop at angle to above that and then again small lines looking at the same new distance then the controller will unify the first short lines upto the break point and then will unify the short lines after that and will make a corner between the 2 unified vectors.
cncdrive
Site Admin
 
Posts: 4695
Joined: Tue Aug 12, 2014 11:17 pm

Re: Understanding the motion planner + settings

Postby Robertspark » Thu Aug 03, 2017 6:09 am

Thanks Balazs, much appreciated for taking the time on this one.

Anyone interested in reading about tempest, here is the original posts http://www.machsupport.com/forum/index. ... ic=12042.0

(Must admit I don't understand the 6th and 9th order bits)
Robertspark
 
Posts: 1892
Joined: Sat Sep 03, 2016 4:27 pm

Re: Understanding the motion planner + settings

Postby Robertspark » Thu Aug 03, 2017 9:56 am

Arcs and circles - G2/G3

Presume none of these have any affect on programmed [commanded] Arcs and Circles:
Linear error max; Linear addition length max; Linear unity length max; Corner error max.

However Arc Radius Tolerance..... I took this to be only only effective in using G2/G3 in radius format (G2 X Y Z R) in determining the center point accuracy [hence minimum setting should really only ever equal minimum step resolution [ 1 / (steps per unit) ]. (I personally don't use radius format, so this setting requires no consideration in my case)


What I'm asking is there any path shortening that can occur with programmed G2/G3 motion which I presume will use Bresenham's algorithm in X & Y steps of motion within the motion planner from the Linear error max / Linear addition length max / Linear unity length max / Corner error max settings, OR will the motion planner will just try to follow Bresenham's algorithm for X,Y & Z motion as close as possible to the minimum step resolution [ 1 / (steps per unit) ]?


(consider the pixel dots in the below linked images equivalent to an X & Y motion step in CNC for simplicity for anyone learning / reading about this for the first time / just getting into CNC)
really this only affects you if you have course step resolutions (like in my case with a direct belt drive on toothed pulleys) or if you are cutting small circles or want "ultimate precision" [air bearing precision / tolerance], but worth knowing about in the back of your mind how shapes are formed in CNC via interpolation of multiple axis (i.e it's not normally a micron perfect line / circle but a combination of axis steps)
Image
Robertspark
 
Posts: 1892
Joined: Sat Sep 03, 2016 4:27 pm

Re: Understanding the motion planner + settings

Postby Battwell » Fri Aug 18, 2017 12:38 pm

i know that however my planner is set up- ovals machine very slow compared to target feed rate ! even if they are created as arcs.
Uc300eth on router and mill.
UK uccnc powered machine sales. https://cncrouter.uk/atc-cnc-routers.htm
Automateanything/duzzit cnc/mercury cnc
Battwell
 
Posts: 819
Joined: Sun Sep 25, 2016 7:39 pm
Location: South Wales. Uk


Return to General discussion about the UCCNC software

Who is online

Users browsing this forum: Bing [Bot] and 6 guests