Jump to content

Problem with Accel and Jerk settings for Marlin


Recommended Posts

Posted (edited) · Problem with Accel and Jerk settings for Marlin

Using Cura 2.5 and 2.6, my printer is set up as a custom printer using GCode flavor "RepRap (Marlin/Sprinter)".

In Cura I have these as my settings:

Print Accel: 800

Travel Accel: 850

Print Jerk: 10

Travel Jerk: 15

According to documentation (http://marlinfw.org/docs/gcode/M204.html and http://marlinfw.org/docs/gcode/M205.html) this should produce the following Gcode:

M204 P800 T850

M205 X10 Y10

What I find in the GCode instead is:

M204 S850

M205 X15

M204 S800

M205 X10

Using Cura I set both accelerations to 800 and both Jerk to 10.  Then I pulled the settings from the firmware using M503 and this is what I got:

Recv: echo:Acceleration (units/s2): P R T

Recv: echo:  M204 P800.00 R1000.00 T800.00

Recv: echo:Advanced: S T B X Z E

Recv: echo:  M205 S0.00 T0.00 B20000 X10.00 Y20.00 Z2.70 E5.00

So clearly Cura is not setting Y jerk and not interpreting the M205 reading correctly.  How could I fix this?

Edited by Guest
  • Link to post
    Share on other sites

    Posted · Problem with Accel and Jerk settings for Marlin

    According to this:


    You can't set the Y jerk differently than the X jerk with Marlin and Sprinter (other firmwares let you). So you will have to use the lower jerk value for the 2 axes.

    There is a reason for this. Jerk is not the derivative of acceleration in Marlin. Instead it should be called "instant velocity change" or some other name. Jerk is a bad name. Marlin uses jerk only to determine the max velocity allowed at each junction. so if you are printing a circle and the cad made it a 10 sided circle and you are approaching the next line segment to print it looks at the two velocity vectors before and after that intersection. Then it subtract the 2 vel vectors to get the instantaneous velocity change at that corner. Then it gets the magnitude (speed change) of that vector. Then if that speed is > than the "jerk" speed it reduces the speed for that junction by the ratio you are over the jerk speed.

    Real example: print speed is 100mm/sec. printing the corner of a cube (90 degree corner). The magnitude of speed change is 140mm/sec. If jerk is 10mm/sec then it will divide the speed by 14 and you get 7mm/sec max junction speed at the corner.

    This is a crappy algorithm if the two speeds going into and out of the corner are different but if speeds are the same then it works most of the time. It does not allow a different jerk speed for Y versus X.

  • Link to post
    Share on other sites

    Posted · Problem with Accel and Jerk settings for Marlin

    The current Marlin source does expect M205 to have separate X and Y values. It used to only take an X value which it then used for both X and Y as the reprap wiki describes. I can't see that adding the Y value will break old Marlin's so I have submitted a PR to make the M205 have both the X and Y values (which will be the same value) and it should work for both old and new Marlins. We will see...

  • Link to post
    Share on other sites

    Posted · Problem with Accel and Jerk settings for Marlin

    Aside from the M205 X10 Y10 issue (which will only work with the most current version of Marlin firmware), I believe Cura is behaving properly:

    This is setting the parameters before a Travel Move:

    M204 S850

    M205 X15

    These are setting the parameters before Print Moves:

    M204 S800

    M205 X10

    The above setting match your requests in Cura, it is just send these commands before each Travel or Print moves instead of what you are expecting with the M204 command. I believe Cura is adhering to the Lowest Common Denominator when generating gCode so that it can remain compatible with as many variations and versions of Firmware for 3D Printers as possible.

    Also, the M503 only reports what is in the Firmware or EEPROM. Note that the above M204 and M205 do not alter EEPROM and Firmware is, well, firm...it cannot be changed without burning new firmware. So what is being currently used may not be what M503 reports.

    If you want to have your Accel & Jerk settings set as the default, and EEPROM writing is enabled on your Firmware, you need to use the M500 command to save them in EEPROM and then DON'T change them during printing with the M204 and M205 commands (ie: disable Accel & Jerk settings in Cura)

    Hope this helps.

  • Link to post
    Share on other sites

    Create an account or sign in to comment

    You need to be a member in order to leave a comment

    Create an account

    Sign up for a new account in our community. It's easy!

    Register a new account

    Sign in

    Already have an account? Sign in here.

    Sign In Now
    • Our picks

      • UltiMaker Cura 5.3 stable released
        In this stable release, Cura 5.3 achieves yet another huge leap forward in 3D printing thanks to material interlocking! As well as introducing an expanded recommended print settings menu and lots of print quality improvements. Not to mention, a whole bunch of new printer profiles for non-UltiMaker printers!
          • Thanks
          • Like
        • 56 replies
      • Here it is. The new UltiMaker S7
        The UltiMaker S7 is built on the success of the UltiMaker S5 and its design decisions were heavily based on feedback from customers.
        So what’s new?
        The obvious change is the S7’s height. It now includes an integrated Air Manager. This filters the exhaust air of every print and also improves build temperature stability. To further enclose the build chamber the S7 only has one magnetically latched door.
        The build stack has also been completely redesigned. A PEI-coated flexible steel build plate makes a big difference to productivity. Not only do you not need tools to pop a printed part off. But we also don’t recommend using or adhesion structures for UltiMaker materials (except PC, because...it’s PC). Along with that, 4 pins and 25 magnets make it easy to replace the flex plate perfectly – even with one hand.
        The re-engineered print head has an inductive sensor which reduces noise when probing the build plate. This effectively makes it much harder to not achieve a perfect first layer, improving overall print success. We also reversed the front fan direction (fewer plastic hairs, less maintenance), made the print core door magnets stronger, and add a sensor that helps avoid flooding.

        The UltiMaker S7 also includes quality of life improvements:
        Reliable bed tilt compensation (no more thumbscrews) 2.4 and 5 GHz Wi-Fi A 1080p camera (mounted higher for a better view) Compatibility with 280+ Marketplace materials Compatibility with S5 project files (no reslicing needed) And a whole lot more  
        Curious to see the S7 in action?
        We’re hosting a free tech demo on February 7.
        It will be live and you can ask any questions to our CTO, Miguel Calvo.
        Register here for the Webinar
          • Like
        • 18 replies
      • UltiMaker Cura Alpha 🎄 Tree Support Spotlight 🎄
        Are you a fan of tree support, but dislike the removal process and the amount of filament it uses? Then we would like to invite you to try this special release of UltiMaker Cura. Brought to you by our special community contributor @thomasrahm
        We generated a special version of Cura 5.2 called 5.3.0 Alpha + Xmas. The only changes we introduced compared to UltiMaker Cura 5.2.1 are those which are needed for the new supports. So keep in mind, this is not a sneak peek for Cura 5.3 (there are some really cool new features coming up) but a spotlight release highlighting this new version of tree supports.  
          • Like
        • 29 replies
    • Create New...