LinuxCNC S-Curve Accelerations

More
5 years 3 months ago #216578 by arvidb
Replied by arvidb on topic LinuxCNC S-Curve Accelerations

Right now simple_tp.c is embedded in control.c *snip*
To be precise, simple_tp.c is embedded in motmod. It is used not just by control.c, but as shown above most of the files in src/emc/motion/ touch the state of the three jog planners - free_tp, teleop_tp, and ext_offset_tp - which are all instantiations of simple_tp. But yeah, motmod would have to be broken up, and simple_tp "untangled" from it, if one wants to have a free-standing HAL component that did jog planning.

So, Grotius, that "untangling" needs to be done whether you want to replace the simple_tp in motmod or split motmod up to have a modular jogging planner. A modular planner doesn't make things easier.

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

More
5 years 3 months ago #216581 by cmorley
Replied by cmorley on topic LinuxCNC S-Curve Accelerations
Ah yes - I didn't scroll your list :)
that's alot of entanglement :(

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

More
5 years 3 months ago #216588 by automata
Replied by automata on topic LinuxCNC S-Curve Accelerations
Hi,

The way to analyz3 and limit the jerk is to break it into two orthogonal parts.
1. Tangential jerk - along the path
2. Normal jerk - normal to the path.

Tangential jerk can be limited by modifying the trajectory while normal jerk would require modification of the path.
As you pointed out transition from a line to arc or vice versa would give rise to infinite jerk. But this would be normal to the instantaneous motion detection.
Method to limit normal jerk would be to use clothoids or splines or beziers to model the blending path.
Ruckig or similar techniques can be used to limit tangential jerk by modifying the position vs time i.e., Trajectory
- automata

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

More
5 years 3 months ago #216601 by automata
Replied by automata on topic LinuxCNC S-Curve Accelerations

Hi,

It's in general a good idea to test the s-curve implementation from within a component. It will keep it simple. But then
you also need a component style gcode reader, including function's like "start from line" etc.

My current strategy after more coding today :
- Read the gcode file into a vector of paths. A path is a motion from M3 to M5. Or a rapid G0.
A path has a total motion lenght.

- The Ruckig lib will perform the motion of each path. Today i did this succesfully in a 1ms live mode.
Then during execution of the motion, parameters like acc_max, vel_max, jerk_max can be modified during the motion!
This is realy great! Also moving backwards, motion reverse is no problem.

- In the above stage's no real x,y,z interpolation is done so far. Just one DoFs is used for a lineair path planning.
Imagine arc lenght's and line lenght's combined as a total path lenght.

As a result of the above implemenation :

The tcp x,y,z and tcp euler x,y,z interpolation can be done from the position of the one DoFs.
With this result the kinematic model can be driven.
The kinematic model, for example a 6 axis robot can then use a 6 DoFs system that control's the kinematic model motion.


 
Hi Grotius,
Excellent strategy to make a separate motion hal module for testing and proveout.
I am also working on simillar lines to making a multiaxes motion planner and playout module.
From my point of view, LinuxCNC does the entire motion planning in the realtime context (same as ruckig as it is an online planner).
However, the main task entrusted to linuxcnc is playout of pre-known gcode. This implies that planning is inherently a non-realtime activity.
I am side stepping the feed override issue though and do have a good solution for that too with my strategy (one that has been commercially deployed in more than a few thousands of machines worldwide from my previous job).
The motion plan of a path can be represented as a queue of third order (for jerk limited planning) polynomials. The complete plan can be optimized offline (i.e. in the non-rt part of the program i.e. in milltask in LinuxCNC) and the result will be a series of polynomials.
P_1 = A_1t^3 + B_1t^2 + C_1t + D_1, valid from 0-tf_1 with startpoint of the axes as Xs_1, Ys_1,Zs_1,As_1,Bs_1,Cs_1,Us_1,Vs_1,Ws_1 and end point as Xf_1,Yf_1,Zf_1,Af_1,Bf_1,Cf_1,Uf_1,Vf_1,Wf_1. here P_1 represents the distance travelled along the path represented by the polynomial. Simillrly an arc representation can also be made with P_n representing either the distance moved on the arc OR even the angle advanced along the arc movement as it is monotonic increasing. Only constraint on P_n has to be is that it is monotonic and can be scaled between 0-1.

The motion or the realtime module does only a playout of the polynomials with a known time advance parameter which is the servo-thread time i.e. 1ms in most installations although it can be different. The polynomial is sampled at servo-thread time and new values of P_n are computed and using the Xs_n and Xf_n the value of the X coordinate can be derived.

The feed override can be handled by changing the time-advance parameter. So in order to slow down from the planned rate, the polynomial is sampled at a rate lower than 1ms (servo time) and vice versa for faster movement.

Now the trajectory planning i.e. computation of the polynomials can be done with a standard trapezoidal planner. Tangential Jerk limitation can be added by replacing the acceleration and deceleration polynomials with 2 or 3 3rd order polynomials that perserve the average acceleration and execution time (strategy outlined here  forum.linuxcnc.org/38-general-linuxcnc-q...accelerations#102589 ).

Grotius let me know if you would like testers for your component.
-automata

 
The following user(s) said Thank You: Grotius

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

More
5 years 3 months ago - 5 years 3 months ago #216629 by Grotius
Replied by Grotius on topic LinuxCNC S-Curve Accelerations
Hi,

A video of the Ruckig lib testing a 6 axis arciera robot.
The robot perform's a gcode. A square 200x200mm and a square 50x50mm. Every square is a path starting at p{0,0,0}.
The video shows the acceleration at begin of path, deacceleration to end of path.

During the video i set a backward's move with a negative max_velocity value. Then the program is doing reverse motion.
Also i change the max_velocity during the move. During the path planning, value's can be changed.

user-images.githubusercontent.com/448801...9db-ffe94792e164.mp4

This implies that planning is inherently a non-realtime activity.
In my code example, the path planning is performed realtime at the servo-thread.

I am side stepping the feed override issue
In my code example setting the feed override is as simple as set the max_velocity to a different value.
Increasing the jerk value, will also invoke the live max_velocity i have seen.

one thing i will have to think about is how to calculate a gcode corner g-force impact, and anticipate on this.

Grotius let me know if you would like testers for your component.
-automata
The github code is updated. But in a few day's i maybe have something plug and play to download.





 
Last edit: 5 years 3 months ago by Grotius.

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

More
5 years 2 months ago #216653 by Grotius
Replied by Grotius on topic LinuxCNC S-Curve Accelerations
A video with oscilloscope.
The following user(s) said Thank You: Clive S, zz912

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

Time to create page: 1.019 seconds
Powered by Kunena Forum