Welcome! Log In Create A New Profile

Advanced

Speed profile (jerk, acceleration)

Posted by printman 
Speed profile (jerk, acceleration)
July 19, 2015 03:44PM
Hi all!

I'm playing with the settings of my printer (jerk and acceleration).

This is my testing code:

M201 X20000 # max acc [mm/s^2]
M204 S6000 # acc [mm/s^2]
M205 X0 # jerk
M203 X100 # max feed rate [mm/s]

G0 X100
G0 X-100

The program moves printing head from X = 0 to X = 100 mm in 1 second and goes back to X = 0 in the next second. I've measured total time to be 2 seconds, so it corresponds.
The distance of one part is 100 mm, acceleration is 100 mm/s^2, max speed 100 mm/s, max acceleration is big so that it wouldn't limit us.
I've tried to understand the principle of jerk & acceleration and what is the max speed of movement resulting from my testing code.

The picture showing my idea (how I imagine it could work):


It must definitely be wrong here, because the max speed in the picture above is 50 mm/s and if I set max feed rate from 100 to 50 (changing M203 X100 to M203 X50), the movement is 2x slower (4 seconds in total). I thought it could take the same time as before (2 seconds in total) because max speed during the movement should be 50 mm/s.

I'm quite struggling with theory & practise. My questions here:

1. M204 S6000 - does it mean 6000 mm/min/s or mm/s/s (mm/s^2) ? Marlin source code says it is in mm/s^2, so I've tried to set it to 100 mm/s^2 (M204 S6000) and total time was 4 seconds. It slowly accelerates and decelerates. It is way too much I would say for 100 mm/s^2.
2. How the jerk can be set to 0 ? I've read that it is the max of acceleration change. In that case, the machine wouldn't accelerate at all, which means no movement. However it moves quite fastsmiling smiley
3. What would actually the picture (graph of the movement) look like for my code?

Edited 1 time(s). Last edit at 07/19/2015 03:46PM by printman.
Re: Speed profile (jerk, acceleration)
August 18, 2015 05:07AM
No one has experience with that? :-(
Re: Speed profile (jerk, acceleration)
August 18, 2015 05:47AM
1 M204 units are normally mm/sec^2. Speed units in M commands are mm/min.

2. Many firmwares based on the Bresenham algorithm can't compute acceleration from standstill, so the jerk cannot be set to zero. Some firmwares that generate precise stepper motor pulse timings instead of using Bresenham (e.g. RepRapFirmware) can handle zero jerk speed. However, it is not desirable to use zero jerk speed because it means that the head will come to a standstill at every corner, no matter how shallow the corner angle is, which makes printing curves very slow (because a curve is approximated as a series of straight lines).

3. You should include a feed rate parameter on your G0 command e.g. F6000, otherwise it will use whatever the last feed rate was, which may be lower than the speed you want it to accelerate to.

4. Use v^2 = u^2 + 2as to calculate the speed change during a steady acceleration of a given distance, where v is the final speed, u is the initial speed, a is the acceleration and s is the distance moved. If you plug in your values, I think you will find that the distance to reach 100mm/sec @ 6000 mm/sec^2 acceleration is much less than 50mm, so there will be a constant-speed plateau on your graph.



Large delta printer [miscsolutions.wordpress.com], E3D tool changer, Robotdigg SCARA printer, Crane Quad and Ormerod

Disclosure: I design Duet electronics and work on RepRapFirmware, [duet3d.com].
Re: Speed profile (jerk, acceleration)
August 18, 2015 06:51PM
There's a widget to plot velocity graphs at [prusaprinters.org]
Sorry, only registered users may post in this forum.

Click here to login