scurve trajectory planner

More
1 year 9 months ago - 1 year 9 months ago #319640 by hmnijp
Replied by hmnijp on topic scurve trajectory planner

 I always set with a P value the maximum allowed deviation of a given path. So now I am not really sure. Can I just calculate something?     
 
Yes. Such smoothing is not optimal. The value of P should certainly be the limit of deviation from the programmed path.

I am also concerned about the compression algorithm that creates polygons if you increase the ‘P’ value. I have prepared a comparison with the old path planner:
 
 

It shows that first the polyline is compressed by an algorithm similar to Douglas-Peucker, then the large lines are connected by a b-spline whose radius of curvature is limited by acceleration.  This creates constant changes in velocity, acceleration and deceleration that are bad for milling. The most important thing for milling is to maintain a stable speed. The optimum solution would be to drive with minimum curvature over the entire trajectory. The last image shows the difference in 3D milling.
 
 

The old planner produces a path with minimal curvature, but it always tends to move inside the curve. A similar effect can be seen in this animation comparing "Moving Average" and "CCMA": 
github.com/UniBwTAS/ccma/raw/master/figures/demo.gif


I also have a problem when the trajectory is plotted with a lot of smoothing errors - it randomly moves far outside the limits:


I can provide all the programs I used for the comparison, maybe it will help to fix the errors. 
Last edit: 1 year 9 months ago by hmnijp.
The following user(s) said Thank You: tivoi, Darium

Please Log in or Create an account to join the conversation.

More
1 year 9 months ago - 1 year 9 months ago #319641 by hmnijp
Replied by hmnijp on topic scurve trajectory planner
Another important issue is the jerk and acceleration at the segment junction. 
 
 
 

The coordinated velocity and acceleration values on the TP pins look correct. But the values for each axis individually have instantaneous velocity changes (0xVel to 2xVel) at the segment junction, and acceleration jerks that exceed the limits (over 100K). This looks like a calculation error.

On a polyline path it makes a jolt with a frequency of 10-100ms. 
With this speed signal, the servos and PIDs go crazy and can't work.



And the last less important problem I saw is that on a non-realtime system TPMOD stops working when trying to load a programme larger than ~100-200 lines. Therefore, simulation and testing have to be performed only on a realtime system

I would like to express my gratitude. Thank you very much Grotius for doing a great job despite some problems that can be solved. The linuxcnc tp has been in need of improvement for a long time. 
I can provide all the programs I used for the comparison, maybe it will help to fix the errors.
Last edit: 1 year 9 months ago by hmnijp.
The following user(s) said Thank You: tommylight, Grotius, Aciera, RDA, Beef, LCR

Please Log in or Create an account to join the conversation.

More
1 year 9 months ago #319643 by juliankoenig87
Yes. It looks the same with my 4 axis machines. Normal tp works with different machine setups without a problem. The scurve tp jumps all over the place! But. Only if a fourth axis (rotary, A) is involved. 3 axis programms without a problem.

Looks also that the axis gui is not really "connected". Preview an tp are working without connection.

Please Log in or Create an account to join the conversation.

More
1 year 9 months ago #319662 by ihavenofish
hmmm

Please Log in or Create an account to join the conversation.

More
1 year 9 months ago - 1 year 9 months ago #319704 by Beef
Replied by Beef on topic scurve trajectory planner
I think this issue with the deviation being higher than the P value specifies may be resolved in the correct_trim_length() method, by calculating the angle between the segments and calculating this max_trim so that it doesn't exceed P. I have to do some more digging in the meantime and wrap my head around this.
Code:
void filletizer::correct_trim_length(const emcmot_segment& seg, double& max_trim){     max_trim=seg.tag.fields_float[3]; // Gcode path deviation.     // Trim conditions.     if(max_trim<=1e-6){         max_trim = 0;     }     // Let the trim be valid if done from both sides.     if (max_trim >= (seg.length_netto * 0.5)) {         max_trim = (seg.length_netto * 0.5)-1e-3;     } }

The code is very readable and well commented.
Last edit: 1 year 9 months ago by Beef.
The following user(s) said Thank You: Grotius

Please Log in or Create an account to join the conversation.

More
1 year 9 months ago - 1 year 9 months ago #319705 by Grotius
Replied by Grotius on topic scurve trajectory planner
@Hmnijp,

Thank you for contribution.
Will first look into the joint.0 & joint.1 velocity spikes. As the planner is
not involved in calculating these values.

@Beef,

I already tested a spline using deviation.
I like the idea of Hmnijp, the industrial example.
 
Last edit: 1 year 9 months ago by Grotius.
The following user(s) said Thank You: Beef, hmnijp

Please Log in or Create an account to join the conversation.

Time to create page: 0.110 seconds
Powered by Kunena Forum