<p>The answer depends on the kinematics model in use. In Marlin there are at least:</p>
<h2>Classic jerk</h2>
<p>The &quot;jerk&quot;, in units of mm/s not the expected mm/s³, is actually a &quot;maximum instantaneous change&quot; 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.</p>
<h2>Junction deviation</h2>
<p>At each junction between segments where direction changes, the acceleration profile is executed <em>as if</em> 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.</p>
<h2>Others</h2>
<p>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.</p>
<p>Klipper firmware also has a model very close to junction deviation, which its documentation explains clearly.</p>

CC BY-SA 4.0
2021-03-19T10:11:07.460Z
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.
M lab
CC BY-SA 4.0
2021-03-19T18:23:35.577Z
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.
R.. GitHub STOP HELPING ICE
CC BY-SA 4.0
2021-03-21T18:06:23.277Z
If accelleration is infinite so jerk is infinit too isn't it?
M lab
CC BY-SA 4.0
2021-03-18T22:05:36.173Z
2021-03-18T22:05:36.173Z
R.. GitHub STOP HELPING ICE
<p>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
<a href="https://i.sstatic.net/9TKk4.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/9TKk4.png" alt="enter image description here" /></a>
My confusion starts when the direction of motion changed so the proportion of speed must change too.</p>
<p>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?</p>

CC BY-SA 4.0
2021-03-18T19:27:15.620Z
Different firmware deals with this differently. Are you asking about a specific flavor of firmware or brand of printer?
Davo
CC BY-SA 4.0
2021-03-18T21:32:56.050Z
@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.
M lab
<firmware><acceleration>
What does the velocity profile of the motors look like when they change direction?
M lab
# What does the velocity profile of the motors look like when they change direction?

(Asked by: username_0 on 2021-03-18)

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](https://i.sstatic.net/9TKk4.png)](https://i.sstatic.net/9TKk4.png)
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?

**Tags:** firmware, acceleration

> **Comments:**
> **username_1**: Different firmware deals with this differently. Are you asking about a specific flavor of firmware or brand of printer?  
> **username_0**: @username_1 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.  

---

## 1 answers

### Answer by username_2 on 2021-03-18. Score: 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.

## Others

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.

> **Comments:**
> **username_0**: 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.  
> **username_2**: 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.  
> **username_0**: If accelleration is infinite so jerk is infinit too isn't it?  

---

