- Posts: 224
- Thank you received: 115
LinuxCNC S-Curve Accelerations
- Becksvill
- Offline
- Elite Member
-
Please Log in or Create an account to join the conversation.
- chris@cnc
- Offline
- Platinum Member
-
- Posts: 529
- Thank you received: 140
Yes, the machine will no longer be precise. She will always be lagging behind. This type of acceleration is often used on toolchanger, tailstock or turretaxis. Everywhere there when the position does not have to be interpolated with a 2nd axis. Now if that is needed you can always install a servo that already has the function and do not have to make linuxcnc imprecise.arvidb wrote:
But if you modify the calculated acceleration, then you also modify the speed of the tool in each instant in time, and thereby also its position at that time. If you multiply the preset (constant) acceleration value of the linear planner with a value < 1.0, then you will need to accelerate for a longer time to reach the target velocity.
Of course, modifying the LinuxCNC's motion planner is always the better solution. Practically an incredibly complex job outside of my mind. Well then I don't want to keep you from work any longer.
Take a look in your servodriver manual. Maybe you find some acceleration parameter including s-curve, jerk limit, bell-shaped acceleration/deceleratio. Maybe it's enough for smooth operation.Becksvill wrote:when your ready I have a 6 ton high speed cnc mill and can help out testing. really want to see jerk limited stuff come to linuxcnc!
Please Log in or Create an account to join the conversation.
- arvidb
- Offline
- Platinum Member
-
- Posts: 459
- Thank you received: 158
But even if you did modify only the acc-cmd, how would you use it to control your machine? If I'm not mistaken, pretty much all configs use the motor-pos-cmd as the setpoint for the PID controller (that then outputs a velocity command to +/-10 V outputs, or to stepgens). So you really do need to have the pos-cmd itself change in a way that doesn't lead to infinite jerk.
Please Log in or Create an account to join the conversation.
- Grotius
- Offline
- Platinum Member
-
- Posts: 2419
- Thank you received: 2349
The problem of c coding or mathematical knowledge is solved.
Attached a component that uses a scurve header only library.
#include "scurve.h" to your component or c code or c++ code.
I think with this example users can retrieve all the info related to the scurve's acc, dcc, timestamp points, etc.
For interpolating on arc's just give the arclenght to the function. And then interpolate the result to the arc bow.
This can be done by % pathlenght interpolation.
The output is printed with rtapi into the terminal. This is done by setting the debug to 1.
The function call from the component, wich is a line (path) of 100mm :
Rtapi result :
Now you can imagine what to do. Just play around with the code.
It has jerk, initial velocity and end velocity implemented. It has also a sampler if max velocity can not be reached.
Attached code is a "c kernel style" derivate from my original work at : github.com/grotius-cnc/S-curve-motion-pl...g/releases/tag/1.0.1
test.c
scurve.h
Please Log in or Create an account to join the conversation.
- arvidb
- Offline
- Platinum Member
-
- Posts: 459
- Thank you received: 158
You are ignoring initial velocity here, in the calculation for distance (Sa).Grotius wrote:
Code:V = Jm*(t*t)/2; V+=tr.Vo; // Add initial velocity. A = Jm*t; Sa = 0*t + Jm*(t*t*t)/6;
Sa = Jm*(t*t*t)/6 + tr.Vo*t.
This is probably the same bug that I reported here (and that you never replied to)? From the plots in that post you seem to have a similar problem with end velocity.
Please Log in or Create an account to join the conversation.
- Grotius
- Offline
- Platinum Member
-
- Posts: 2419
- Thank you received: 2349
Thank you for your reply.
I think you have to look at "V+=Traject.initialVelocity"
The plotted graph's at github show everything is printed ok when using vo and ve parameters.
If they where not ok. I would have seen that.
I spotted and repaired a rtapi print output with empty value's when T1, T2, T3 are 0.
Now it print's only when T1>0 , T2>0, T3>0.
Initial velocity and end velocity are just working. It was printing a empty value at line 0 of the rtapi print output.
So it was looking like a bug.
Here a function input as :
Mention the output resolution is quite low at a 1 sec interval.
Please Log in or Create an account to join the conversation.