Welcome! Log In Create A New Profile

Advanced

Acceleration and Jerk - great unknown....

Posted by Downunder35m 
Acceleration and Jerk - great unknown....
April 28, 2016 10:28AM
I recently noticed that problems with failing prints are getting more frequent.
Also that some of these fails are related to printers not being calibrated properly or being used with wrong settings due to a lack of understanding.
Today I will try to shed some light on the great myths behind the topics of "ACCELERATION" and "JERK".

I guess it is best to start by explaining what the terms actually mean and how the affect our prints.
Acceleration is what it sound like - it defines how our axis and extruders can accelerate.
You crank it and it goes faster from zero to the set speed, at least in theory anyway.
But why is it so important to have it adjusted just right?
After all it should not matter how long it takes to get to full speed during a move? Or does it?
The answer is yes and no.
Let me explain why:
At slow speed of under 20mm/s only an acceleration setting that is far too high would impact your prints while everything will be barely noticed.
But if you want to proper speeds out of your machine it suddenly becomes important to consider moving masses and how fast a stepper motor can accelerate them without loosing steps.
This bring me to another thing that I have to addres for the understanding: Motor micro stepping.
The common thinking is that a 1/16 or even 1/256 stepping for your motors would would give you far greater accuracy.
In theory this is true but in real life physics come to play a role.
The lower the micro stepping the less torque the motor will have!
Also high stepping rates affect the CPU performance, at least on 8bit boards.
Some extruders run with a few thausand steps per mm - these steps need to be timed and processed! winking smiley
But that is another topic, I just mentioned it for the general understanding, so if in doubt read up on micro stepping and the issues involved with it.
Back to speeds:
Once you have to move a big heated bed with a glass plate and aluminium base at high speeds you will know that vibrations and missed steps can be a pain.
The acceleartion settings make sure the motor will use a ramp to get from the previous speed to the set speed.
The higher the acceleration setting the steeper this ramp will be.
Final goal is to set the acceleration setting within the physical capabilites of the hardware and stepper driver.
You have two ways of doing this.
A) Tune the settings for a safe speed that is satisfying enough and just make sure all runs smooth.
cool smiley Tune the settings based on max speed you machine is capable of in terms of movement.
The first is quite easy, the second takes time and will cause some frustration along the way.
Ok, how to find settings that actually work?
The first thing you want to make sure is that all driving gear is properly adjusted and tensioned!
No use maxing out the machine is it is falling apart along the way winking smiley
Now set the Jerk to a low value of under 10.
In my testes there is little to no difference in the levels between 10 and 1, only 0 brings the movement to a full stop when changing directions.
Next is to generate some Gcode to bring the motor to the max.
You can either disable the cold extrusion prevention and make dry runs or waste some filament if you want to adjust other settings along the way as well.
A nice cube with a solid infill of around 100x100mm should be enough to get the motors to full speed.
You want to watch out of missing steps and weird noises during the infill.
If suddenly the infill start too early or too late you might want to crank down the acceleration a bit.
If all looks good and well increase the speed and adjust the acceleartion higher.
You will reach the point where either you infill totally fails to bond or where you can't increase the speed without making a mess.
At this point you note the acceleration and crank it back by about 10% to a nice and even value.
X-Y are important here, Z is usually not a problem due to the increased steps per mm anyway but should be checked if you have extrusion problems at high speeds especially when combined with a lot of retractions.
Now the machine should know how fast it can move the bed and print head winking smiley
Next would be the Jerk....

What is Jerk and what changes if I used higher or lower values?
A common misconception seems to be that the Jerk defines how fast an axis can change direction.
If you think about it than it makes no sense at all as no axis ever changes the direction LOL
Another trap is to think the Jerk is only good for short moves like tight infills with changing directions.
The truth is that the Jerk defines how fast a directional change can happen with the current print or movement speed.
Hmm... Too complicated to understand? Let my make it simple....
Our various acceleration setting define how fast an axis can get to full speed or from full speed to a stop.
The Jerk define how fast for example your print head can change the direction - in the worst case like like during infills by 180°.
Imagine you drive your car at 100km/h and you want to make a direct 90° turn - it would be impossible.
First you need to slow down one direction (acceleration!) than you have to make sure the other direction starts fast enough (again acceleration) and is able to do so without loosing direction - the JERK!
So if we assume you car and the driver has no mass at all plus total tracking like on glue and the driver would survive the forces you could do a direct 90° turn at 100km/h.
For our printer it means the Jerk tells the firmware how to adjust the acceleration and speed so no steps are lost to perfom the desired change in direction.
Basically it is a means to take moving masses into consideration.
To fully test the Jerk and get it to a realistic maximum you also need to adjust the acceleration sooner or later again as the two are closely related.
A quite simple test is a triangular infill with an an angle of around 10° - like a wedge.
While the head moves left and right the distance travelled constantly get shorter.
At some stage acceleartion has no real affect anymore as the lines will be too short to reach full speed.
I mainly go with my hearing to set the Jerk at this point.
There is a destinct difference between smooth printng moves and those that struggle - it just sounds wrong and you will know what I mean if you ever wondered about weird noises during complex prints that did not turn out 100%.
As a general rule of thumb I use around 40 for my laser and around 20 for my printer due to the higher weight of the moving masses involved.
Once the accelleration works as it should the Jerk only makes sure that all directional changes happen as they should.
So if:
1. The motor currents are correct.
2. The acceleration is within reasonable limits.
3. The print speed is not totally too high.
And your print still wanders off in one direction you should crank down the Jerk.
Otherwise you should be fine with a setting of 20, 10 if you have cheap hardware and around 40 to 80 if you have everything tuned to perfection on really good hardware.

To sum it up:
The acceleration defines how fast you can change speed, the Jerk defines how fast you can change direction!
Stay realistic!
A normal 8bit CPU like in a Mega2560 is well capable of calculating 10000 steps per second.
But that means all the steps that happen!
If you already need a thausand steps for a full turn of your axis motor and even more for you extruder is only a question of simple math to realise that speeds of 200mm/s are totally unrealistic without serious troubles.
So if you struggle to get high speeds you might want to check you steppings winking smiley
For example a 20 tooth pulley with a motor that requires 200 steps per full revolution will be capable of an accuracy of around 0.1mm with 1/8 stepping.
At 1/16 stepping this would come down to around 0.05mm of accuracy.
Don't know about you but I certainly don't need an accuracy that is higher than what is within realistic expectations...
Once you managed to get higher speeds by optimising acceleration and jerk setting you want to push the machine to the limit - don't say no as I was in the same boat winking smiley
When you get there remind yourself that these two settings are only a small part of the big equasion.
There are limits in terms of how fast you can heat the plastic to a usable temp.
There are limits on how fast your extruder can feed the filament when there is little to no time to get it through the nozzle.
And of course there are all those limits imposed by the genral design and the hardware itself.
3D printing is not a race it is an art.
So you want to to tune your machine to work as fast and accurate as possible but not to turn it into track car that has no purpose on a normal road.
Re: Acceleration and Jerk - great unknown....
April 28, 2016 11:23AM
This is an excellent post on the mysterious subject of acceleration and jerk. Thank you very much.

I'd like to ask a question about the lower end of the spectrum. What if I am not after the speed? I want to print slow but get the best possible print quality. There is a trade-off between speed and quality so lowering acceleration and jerk should help. How low can I get? Would getting too low create problems? You wrote that for jerk there is no visible difference for values lower than 10. For acceleration?

Thanks again.
Re: Acceleration and Jerk - great unknown....
April 28, 2016 11:45AM
If you are not after top speed then it all is not that importent to get 100% right.
But it still makes sense to optimise for a really smooth ride.
The jerk only needs to be lower than 20 if you encounter serious issues, it won't affect you too much at low speeds.
The acceleration however can make a big difference.
At slow speeds you don't have to worry too much about moving masses so you can use quite high acceleration values without seeing any negative impact in most cases.
But let me give you an example from MarlinKimbra:
The standard M201 command sets the acceleration for mormal moves.
The M204 manages it differently for print and travel moves.
If you have huge differences here it means you machine has to slow down quite a bit for the next move in the command line if the buffer requires it.
Having closely matching values means there is little to no speed difference happening and you get a much smoother ride.
In other Marlin releases this is defined through default and max acceleration settings in the firmware without considering a difference between print and normal moves.
So in your case you could set you desired slow speed with a complex print and crank up the values until you see really smooth and jitter free movements and cornering.
Once you got that there is little to no point in going higher as long as you don't need much higher speeds.
Sorry, only registered users may post in this forum.

Click here to login