The stepper motors usually have a constant acceleration profile (trapezoidal profile) of an even jerk limit profile (S-curve profile). In linear motion, it seems possible to conserve proportion between x and y speed as shown enter image description here My confusion starts when the direction of motion changed so the proportion of speed must change too.

That impossible to join two velocity profiles except we decrease the speed of both axis down to zero then start ramping up with a new profile which means the 3D printer will stop and move for every G-Code segment that apparently not true. So my question is how does the firmware deal with these problems joining velocity profile?

  • 1
    $\begingroup$ Different firmware deals with this differently. Are you asking about a specific flavor of firmware or brand of printer? $\endgroup$
    – Davo
    Mar 18, 2021 at 19:27
  • $\begingroup$ @Davo just for general idea will be okay. My inspection start from marlin then grbr I still don’t quite understand how it deal with this.I just found some research that suggests to bend the corner with Bezier curve. $\endgroup$
    – M lab
    Mar 18, 2021 at 21:32

1 Answer 1


The answer depends on the kinematics model in use. In Marlin there are at least:

Classic jerk

The "jerk", in units of mm/s not the expected mm/s³, is actually a "maximum instantaneous change" in velocity. Without any jerk (set to 0), your analysis would be correct, and all changes in direction would require slowing down to 0 velocity. However, with jerk, it's only necessary to slow down enough to make the necessary instantaneous change in velocity components less than the jerk limit. For a very slight change in direction (e.g. going around a curve approximated by line segments) this amounts to no slowdown at all. However, in this naive model, arbitrarily many bounded instantaneous velocity changes can happen in an arbitrarily small amount of time, essentially requiring unbounded acceleration capability and leading to missed steps/layer shifts.

Junction deviation

At each junction between segments where direction changes, the acceleration profile is executed as if the motion were cutting the corner in an arc, deviating from the exact corner by a distance of the configured junction deviation parameter. The actual step path still follows the sharp corner.


I'm not really familiar with S-curve acceleration, but as I understand it it's a more advanced model fitting smooth curves to the travel path so that velocity can vary continuously, with bounded acceleration, rather than having jump discontinuities.

Klipper firmware also has a model very close to junction deviation, which its documentation explains clearly.

  • $\begingroup$ I mainly focused on jerk limit or constant acceleration profile. I still don't get how to make acceleration constant or jerk constant around the corner. Could you please explain more on that. $\endgroup$
    – M lab
    Mar 19, 2021 at 10:11
  • $\begingroup$ They're not constant. The model has acceleration bounded by the configured limit except as points of discontinuity, where the acceleration is formally infinite and the second-and-higher-order part of the velocity is bounded by the (misnamed) "jerk" limit. $\endgroup$ Mar 19, 2021 at 18:23
  • $\begingroup$ If accelleration is infinite so jerk is infinit too isn't it? $\endgroup$
    – M lab
    Mar 21, 2021 at 18:06

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .