Jump to content

acceleration in Marlin


Dim3nsioneer

Recommended Posts

Posted · acceleration in Marlin

This is a question for the Marlin experts:

Is it possible that one of you could quickly summarize how Marlin (or Sprinter) is doing the acceleration?

Obviously it doesn't do it separately for each GCODE command line but takes a few code lines together. What are the criteria? When does it accelerate/decelerate and when not?

 

  • Link to post
    Share on other sites

    Posted · acceleration in Marlin

    I've been working on this the last week to get the time estimate of Cura improved (I'm down to 97% accuracy in the estimate)

    Acceleration is planned over 16 moves maximum. What it does it tries to figure out at which speed it should take the intersections, which depends on the changes in speed at that intersection.

    It's quite a bit of code, which has quite some details, it boils down to this:

    https://github.com/Ultimaker/CuraEngine/blob/master/timeEstimate.cpp

     

  • Link to post
    Share on other sites

    Posted · acceleration in Marlin

    I've been working on this the last week to get the time estimate of Cura improved (I'm down to 97% accuracy in the estimate)

    [...]

     

    To have an accurate time estimate in Cura soon, it feels a bit like christmas... :smile:

     

  • Link to post
    Share on other sites

    Posted · acceleration in Marlin

    My quick summary. If "jerk" is zero then it's simple - every line segment would start from a stop, accelerate to max velocity, maintain that velocity as long as possible and then decelerate to 0 at the last possible moment so that it ends the segment with a deceleration ramp. But in practice it doesn't come to a complete stop at each segment so it's similar but starting at a particular velocity, ramping up, maintaining max speed (if it gets there) and then decelerating to be at the proper next vertex speed when it gets to that vertex.

    The "jerk" setting is not zero. The jerk setting is not the official definition of jerk but similar. It sets the velocity at the vertexes where any two line segments come together - the idea is that for a circle of 20 line segments the change in angle is minor and you shouldn't have to come to a complete stop 20 times. So it calculates the "delta" velocity vector from one instant before the vertex to one instant afterwards and keeps that delta below the jerk value. So if jerk is 20mm/sec (default i think) and two vertexes are in a straight line you can go unlimited speed from one vertex to the next. If the vertexes are a 90 degree corner then the minimum speed at the vertex will be sqrt(2)*20 or 28mm/sec. The more gradual the change in direction the faster you are allowed to go. The worst case - 180 degree change in direction implies max speed at vertex at 10mm/sec.

    Now you have to calculate all these max speeds 16 segments ahead and work backwards to "now" and figure out what your max speed is along the whole path.

     

  • 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

      • Introducing the UltiMaker Factor 4
        We are happy to announce the next evolution in the UltiMaker 3D printer lineup: the UltiMaker Factor 4 industrial-grade 3D printer, designed to take manufacturing to new levels of efficiency and reliability. Factor 4 is an end-to-end 3D printing solution for light industrial applications
          • Thanks
          • Like
        • 3 replies
      • UltiMaker Cura 5.7 stable released
        Cura 5.7 is here and it brings a handy new workflow improvement when using Thingiverse and Cura together, as well as additional capabilities for Method series printers, and a powerful way of sharing print settings using new printer-agnostic project files! Read on to find out about all of these improvements and more. 
         
          • Like
        • 26 replies
    ×
    ×
    • Create New...