Tuning Jerk/Accel/Speed settings



  • Hey guys, I just updated my board to RRF 3.0 and decided it was also time to retune my printer's movement settings. The settings I had previously worked, but I was getting pretty bad over extrusion at corners and line ends, and I know my settings were all very conservative. This whole process has turned into a big mess because I just don't even know where to start. Now my prints look like poo and I can't seem to get anything to calibrate the way I'd like.

    Any suggestions on which settings to tune first?

    I started by tuning speed, as my printer is on the bigger side (475 x 480 travel). Seems I can handle 500mm/s no problem. I don't have any intent of driving that value any higher since I don't ever see myself pushing 300mm/s during a print, and during jogging moves, homing, and travel outside of a print it's plenty fast.

    Next I set my jerk settings real low to start, and tuned my acceleration. I wasn't ever able to get any of my motors to skip. I had X and Y max accelerations set in the realm of 100,000 mm/s, which was absolutely ridiculous. For travel moves, that was fine, but obviously, when applied to a print, that caused some pretty nasty defects and a lot of vibration. I ended up settling on an accel value of like 2500 mm/s for my X and Y axes.

    Lastly, I tuned jerk. Again, I got some pretty ridiculous values, but ended up stepping it back around 1500 mm/min for my X and Y axes.

    After a bit of frustration, I found @Phaedrux's post about tuning macros for all this stuff. I've been trying to use those macros to tune my machine, but even with that awesome menu, it's difficult because I really have no good starting reference point of values that at least work.

    Does anyone have suggestions of a good starting point for all these settings (Extruder values included) for a larger machine? I'm struggling.

    Once again, thank you all in advanced!

    P.S. My Z axis is nicely tuned in. Since it's relatively heavy and driven by ballscrews, it was relatively easy to find a value for each parameter that was way too high and work from there.


  • Moderator

    Assuming you have basic calibration out of the way...

    The volumetric extrusion rate of your hotend will be the limiting factor. Once you know that you can find a print speed/layer height/extrusion width combo that maximizes the extrusion rate and produces a good surface finish.

    I think this is too often overlooked in 3D printing. When I see people say they are printing at 200mm/s I have to wonder what layer height and extrusion width are they using? What is their acceleration and jerk values? Is the surface quality any good? Is the part strong?

    Take this for example:
    ecf5100a-2603-4fe2-85af-ed0cf2e3707b-image.png

    One is printing at 55mm/s and the other at 125mm/s. But the volumetric rate is the same, and if you sliced the same model with those two different profiles for layer height and extrusion width, total print time will be roughly the same. (slightly less for the 0.3 layer profile due to less repetition of movement).

    Depending on what you're printing, one or the other may make more sense, but the point is that print speed is almost irrelevant as long as you are maximizing your volumetric rate, you will be completing the print in as little time as possible.

    In addition to the melt rate limit, you'll have to be able to cool the extruded plastic fast enough. So your cooling solution needs to be sufficient, and minimum layer time will be practical limit on speed at the other end.

    You can use some calculators to find the theoretical limits for top speed and acceleration, but by the sounds of it they are already well above practical values for qualities sake on your printer.

    Now you don't mention much about your printers mechanical setup, but your sig says Hephaestus, which would be quite rigid. But as a general rule I would suggest that you set your maximum X Y speed to be equal to your travel move speed. That way when you use the speed factor slider you won't be able to increase your travel speeds to dangerous levels.

    For travel acceleration, using the acceleration calculator to find the max for your motors/power supply without losing torque would be a start. In practice, you'd probably find the travel moves to be particularly violent, and this can have a negative impact on quality from ringing, and from the nozzle dragging filament at the end of an extrusion move causing stringing or blobs.

    To find this speed/accel combo for travel moves, I would do a dry run of a larger model to get a feel for what travel moves would actually look like. Adjust the speed factor and travel acceleration during the print. You'll be able to tell the difference between sluggish movement and rough jerky movement. (for my coreXY travel is 175mm/s and 2500 accel and 1500mm/min jerk. Anything more is too rough and may skip steps if it catches a curled edge.)

    Once you have travels set up, you can move onto print moves. For external perimeters, I use the max speed that maximizes my volumetric flow, and then limit that for quality using acceleration and jerk. First I tune for jerk by setting acceleration to the same as the travel acceleration and then adjusting jerk until it sounds smooth. I know that's subjective, but trust me, you can tell the difference between smooth motion, sluggish motion, and smooth but rapid motion. (For me that's 1200mm/min for external walls, and 1500mm/min for infill)

    Now that print speed and jerk is set. You can use a test cube for ringing testing to dial in wall acceleration. Just start low and increase it every few layers and repeat until you've got no ringing. Something like this scaled up to 100mm cubed works well. ringtest.stl

    You may also find dynamic acceleration adjustment useful.

    For internal features acceleration is less critical because ringing doesn't really matter, so I usually use a value in between the external wall and travel values.

    At that point I tune for retraction distance and speed using a simple retraction tower. Using firmware retraction allows you to change the values every few layers. Within about two cycles you can get it dialed in pretty well. For me, 1mm retraction and 60mm/s retract and 45mm/s unretract seems to work best (titan aero)

    With retraction done pressure advance is next. I use the simple cube/cylinder method described here: https://duet3d.dozuki.com/Wiki/Pressure_advance#Section_Methods_of_finding_the_right_amount_of_pressure_advance

    Make sure your extruder max speed/accel/jerk values are sufficiently high to allow pressure advance to work optimally.

    Once you find the right PA value, you may need to reduce retraction distance slightly and increase the skin/infill wall overlap.

    I should also mention that I usually use Cura because it allows for detailed control over speed/accel/jerk values per move type. This gives me a great deal of control, but it also means that those values are baked into the gcode and cannot be changed on the fly during a print. Disable those features during live tuning obviously.

    Prusa slicer allows control over speed and acceleration for some moves but not jerk.

    If you use a slicer that doesn't give you that level of control, you can at least use M204 to set separate acceleration values for print and travel moves.


  • Moderator

    There's this older post as well that goes a bit more specifically into the extruder calibration which would preceed the speed tuning.

    https://forum.duet3d.com/topic/8145/where-to-start-with-a-comprehensive-extrusion-calibration?_=1580931855294


  • Moderator

    @Phaedrux Awesome post! Could you create a wiki page based on this, and the previous post on extruder calibration? I donโ€™t think thereโ€™s one yet.

    Ian


  • Moderator

    @droftarts yes I have a rough draft document that goes into a full calibration with all this and more that's in the works. I should polish it up and push it out.



  • @Phaedrux Amazing post! Thank you!

    I started right at the top and figured I'd get my extruder all figured out. My steps/mm were spot on at the theoretical value, so that step was quick and easy. Next I decided to find the max rate I could extrude filament through a given nozzle at a given temperature. I used that as an input to a little excel file I wrote similar to the one you posted an image of above. The issue is, the max theoretical print speed I'm getting seems crazy low. At 210C, I'm able to extrude filament through a 0.8mm nozzle at a max of around 8mm/s before my extruder begins to skip. That boiled down to a max print speed of around 26mm/s at a 0.2mm layer height, which seems crazy low. In the past, I've printed at 60mm/s with the same extruder, temperature, layer height, and nozzle without any missed steps or grinded filament. Any ideas why my theoretical max speed is almost half what I know to be possible?

    (I should note that I calculated the volumetric extrusion rate a bit differently than you noted in your other post. My math doesn't assume the shape of a printed line to be a perfect rectangle. However, the difference in values is not enough that it really changes the point of my above post).


  • Moderator

    I'd have to see your math and compare it to mine.

    Here is my spreadsheet if you're interested. It has a lot more other things as well.

    https://www.dropbox.com/s/ihe3rl58z7sdyfu/Calculators.xlsx?dl=0



  • @Phaedrux Mind if I send you the excel sheet in this thread?



  • @Phaedrux Also, I should note that after looking a bit closer, it wasn't my extruder that was skipping, but rather the bondtech gears becoming unmeshed. I tried increasing the pressure on the gears, but then I went too far and the printer started grinding the filament real bad, so now I have to clean that up.


  • Moderator

    @wcj97 said in Tuning Jerk/Accel/Speed settings:

    @Phaedrux Mind if I send you the excel sheet in this thread?

    It's your thread. Do as you wish. ๐Ÿ‘





  • @Phaedrux Ha! I realized where I messed up immediately after posting that file. I determined my max volumetric flow rate to be the max speed I could move my extruder for a given temp/nozzle size, multiplied by the area of the nozzle orifice. That would be incorrect. I fixed that calculation so that now it's the max extruder speed multiplied by the cross-sectional area of the filament and my numbers look much more appealing now. Something more like 110mm/s print feedrate. This is why it's important to always double-check your math, I guess.



  • Here's the updated spreadsheet, just in case anyone else would like to take a gander and maybe make use.Extrusion_Speed_Calculator.xlsx



  • This post is deleted!

  • Moderator

    @wcj97 said in Tuning Jerk/Accel/Speed settings:

    Here's the updated spreadsheet, just in case anyone else would like to take a gander and maybe make use.Extrusion_Speed_Calculator.xlsx

    Yeah that looks reasonable. The exact shape of the extrudate isn't super critical. It's just a ballpark limit to work within. I usually suggest a 10% safety margin to allow for instances where the amount of plastic being pushed is heavy enough and continuous enough to cool the hotend significantly enough to temporarily drop your volumetric throughput. Such as may occur in large areas of solid infill.

    We're just measuring a brief instance of volumetric throughput. What we really should be measuring and modeling is the melt rate of the plastic in relation to the thermal system of the hotend, including pressure feedback, elasticity, drag/friction, expansion, etc, etc, but that's way beyond complex and a bit superfluous for our needs. We just need to know how much plastic we can reliably extrude in a time frame long enough to capture 99% of all printing moves.



  • @Phaedrux Coming back to this thread for a quick question regarding jerk (instantaneous speed change).

    The instantaneous speed setting is the speed the motor can jump to before acceleration is taken into account, correct? So if my max speed for my extruder is 6mm/s, and I set my instantaneous speed settings to 360mm/min (6mm/s), acceleration isn't being taken into account at all, right? The controller is assuming that it can instantaneously accelerate from 0 to 6mm/s?

    Currently, performance is good at my current jerk values, which are set well above my max speed. I guess what I'm asking is: at this point, increasing jerk or acceleration settings doesn't really make any difference right? I've already told my printer that it can instantaneously jump to extrusion speeds well beyond my max speed, so does increasing my jerk values from here (or making any change to my accel values for that matter) have any affect at this point?


  • Moderator

    @wcj97 said in Tuning Jerk/Accel/Speed settings:

    if my max speed for my extruder is 6mm/s

    That may be the max for extrusion, but not the max for retraction. So don't set your extruder M203 that low.

    You'll want to set your extruder jerk higher than that as well so that your retractions can be faster and so that pressure advance can quickly change direction.

    The extrusion speed is so low that it doesn't really matter, but retraction and pressure advance can be much quicker.

    The extruder doesn't have a lot of mass to throw around like the other axis do, it's just rotation, so your jerk/accel can be quite high without issue (without skipping of course). Basically you can set the max speed and jerk/accel high enough that they ever really come into play. That allows pressure advance and retraction and the acceleration and jerk of the XY axis to dictate.



  • @wcj97 No. "Jerk" doesn't work like that in RRF firmware. Jerk is never applied at the start of a move. (True instantaneous speed change is actually impossible in any case). Think of it as a speed change threshold which gets applied when a the object is in motion and there is a change of direction. So instead of one move slowing down to a complete standstill before the next move starts, the move will slow down to the instantaneous speed change threshold (jerk) instead, and the next move commences at that speed. Given that any print move will be a combination of XY and E, and the speed will be the lowest of any of those axes at any point in time, then the only time that extruder jerk would be applied to a print move is if it is set to give a lower speed than X or Y, in which case it would slow down the entire print move. There are only two (I think) instances where extruder jerk is applied. One is when using pressure advance, and I can't remember the other. But in both cases, setting extruder high rather than low is the way to go.



  • @deckingman said in Tuning Jerk/Accel/Speed settings:

    Jerk is never applied at the start of a move.

    How does the start of the move look like? I had an assumption that start of the move, since going from 0, will always use acceleration from 0 but I had issues with new Orion sensor triggering falsely and the guy's from precise piezo asked me to set the Z jerk to 0 as Z move would "jump to jerk speed" and that triggers the Orion. I made the change and solved the problem so looks like that jerk value do affect the start of the move.


  • administrators

    @deckingman said in Tuning Jerk/Accel/Speed settings:

    "Jerk" doesn't work like that in RRF firmware. Jerk is never applied at the start of a move.

    It does in recent versions of RRF if you set the jerk policy to 1 in M566.



  • @dc42 this is interesting. why would

    M566 X500.00 Y500.00 Z0.00 E6.00

    not trigger my piezo on G30 while

    M566 X1500.00 Y1500.00 Z50.00 E6.00

    will trigger G30 when the bed starts to rise?

    that's the only M566 in all the files, I never set P to 1 ?

    It is confusing me. I kept the M566Z0 as I didn't notice any difference in print behavior between Z0 and Z50 and with Z0 piezo sensor works ok. Why I would like to know how it actually behaves is I was thinking about adding support of RRF to the gcodestat so that I can calculate precise print time from a g-code, but I'm waiting for the few more 3.x versions as I see you are still changing things ๐Ÿ™‚



  • @dc42 said in Tuning Jerk/Accel/Speed settings:

    @deckingman said in Tuning Jerk/Accel/Speed settings:

    "Jerk" doesn't work like that in RRF firmware. Jerk is never applied at the start of a move.

    It does in recent versions of RRF if you set the jerk policy to 1 in M566.

    I missed that - thanks (and thank goodness its optional)



  • I seem to recall having similar behavior displayed on my machine when commissioning the Z axis. It wasn't related to a piezo probe, but merely the fact that jerk was "being applied" from a stand still. I'm not certain of this, but it rang a bell for sure. I even remember making a thread about my Z axis making noises at one point.


  • Moderator

    @arhi said in Tuning Jerk/Accel/Speed settings:

    @dc42 this is interesting. why would

    M566 X500.00 Y500.00 Z0.00 E6.00

    not trigger my piezo on G30 while

    M566 X1500.00 Y1500.00 Z50.00 E6.00

    will trigger G30 when the bed starts to rise?

    that's the only M566 in all the files, I never set P to 1 ?

    It is confusing me. I kept the M566Z0 as I didn't notice any difference in print behavior between Z0 and Z50 and with Z0 piezo sensor works ok. Why I would like to know how it actually behaves is I was thinking about adding support of RRF to the gcodestat so that I can calculate precise print time from a g-code, but I'm waiting for the few more 3.x versions as I see you are still changing things ๐Ÿ™‚

    Having Z jerk set to 0 would cause stuttering in X and Y when using mesh bed compensation since it would be trying to slow down to nothing in X and Y while it waited for the Z axis to adjust position.

    The gcode wiki entry for M566 is instructional here.

    https://duet3d.dozuki.com/Wiki/Gcode#Section_M566_Set_allowable_instantaneous_speed_change

    When mesh bed compensation is used, movement may be jerky if the allowed Z jerk is too low, because the Z speed needs to change abruptly as the head moves between squares in the mesh.

    The default jerk policy is 0, which replicates the behaviour of earlier versions of RRF (jerk is only applied between two printing moves, or between two travel moves, and only if they both involve XY movement or neither does). Changing the jerk policy to 1 allows jerk to be applied between any pair of moves.


  • Moderator

    @deckingman said in Tuning Jerk/Accel/Speed settings:

    I missed that - thanks (and thank goodness its optional)

    I've had good results with jerk policy 1, I think mainly because it reduces the pause time between the end of a print move and the start of a travel move. Since before jerk was only being applied between two consecutive print moves or travel moves, but not between print moves and travel moves.


Log in to reply