<p>Buried in a bug tracker entry for a seemingly unrelated issue, I found what seems to be the solution:</p>

<blockquote>
  <p>@johanmga, I've discovered the velocity jumps here come from using "classic jerk" computations, and happen whether or not s-curve acceleration is enabled.</p>
  
  <p>Try uncommenting <code>//#define JUNCTION_DEVIATION</code> in Configuration_adv.h; that will disable classic jerk and use the junction deviation math instead.</p>
  
  <p>Also for reference, issue #12403 is actively tracking the layer shift issue (please comment there too if you have more information on problems/solutions), and #12540 is has more information on classic jerk vs. junction deviation.</p>
</blockquote>

<p><a href="https://github.com/MarlinFirmware/Marlin/issues/12491#issuecomment-443464603" rel="nofollow noreferrer">https://github.com/MarlinFirmware/Marlin/issues/12491#issuecomment-443464603</a></p>

<p>It seems that the "classic jerk" code no longer works and produces erroneous motion to the steppers under some conditions (dependent on G-code contents), whereas the Ender 3 default configuration file is still using it.</p>

<p>With the default <code>JUNCTION_DEVIATION_MM</code> of 0.02, things worked right away, but printing was so slow that I could plausibly attribute it working just to the slowness.  But increasing it up to 0.1 via the menus got the speed closer to what I'm used to, and it's still printing with no layer shifts.</p>

<p>I've posted my results in the tracker in hopes that they'll lead to discovery of the root cause: <a href="https://github.com/MarlinFirmware/Marlin/issues/12403#issuecomment-519305409" rel="nofollow noreferrer">https://github.com/MarlinFirmware/Marlin/issues/12403#issuecomment-519305409</a></p>

<p>Another issue on the tracker seems to have more detail:</p>

<p><a href="https://github.com/MarlinFirmware/Marlin/issues/12540#issuecomment-442793326" rel="nofollow noreferrer">https://github.com/MarlinFirmware/Marlin/issues/12540#issuecomment-442793326</a></p>

CC BY-SA 4.0
2021-01-14T16:19:06.030Z
I subsequently did have more layer shifts, and never identified the root cause, but I haven't had a single one since upgrading the controller board to SKR mini E3.
R.. GitHub STOP HELPING ICE
CC BY-SA 4.0
2019-08-07T23:22:30.900Z
2019-08-08T05:21:52.850Z
2019-08-08T05:21:52.850Z
R.. GitHub STOP HELPING ICE
<p>Since upgrading from the manufacturer's firmare to recent Marlin (first 1.1.9, then 2.0.x git HEAD), I've been having significant model-dependent (didn't happen for first few things I tried to print; other prints reproduce it reliably) layer shifting on the Y axis. It's always in the positive Y direction, usually by 1-3 mm at a time.</p>

<p><img src="https://i.sstatic.net/2Xdkv.jpg" alt="aborted prints showing layer shifts"></p>

<p>I first suspected mechanical problems (see: <a href="https://3dprinting.stackexchange.com/q/10768/11157">Ender 3 has developed a tendancy to skip Y steps</a>), but reverting the firmware confirmed that it's a firmware problem.</p>

<p>A number of bug tracker entries for Marlin indicate that there are significant ongoing layer shift problems:</p>

<ul>
<li><a href="https://github.com/MarlinFirmware/Marlin/issues/9768" rel="nofollow noreferrer">https://github.com/MarlinFirmware/Marlin/issues/9768</a></li>
<li><a href="https://github.com/MarlinFirmware/Marlin/issues/10446" rel="nofollow noreferrer">https://github.com/MarlinFirmware/Marlin/issues/10446</a></li>
<li><a href="https://github.com/MarlinFirmware/Marlin/issues/12403" rel="nofollow noreferrer">https://github.com/MarlinFirmware/Marlin/issues/12403</a></li>
</ul>

<p>But most end up getting closed. Some people say reverting to 1.1.9 from 2.0.x helped; others say 1.1.9 is EOL and to use 2.0.x. Is there a solution? How do I get a working version of Marlin (new enough to have Linear Advance 1.5, which was my motivation for upgrading) on Ender 3?</p>

<marlin><creality-ender-3><firmware><layer-shifting>
Y-axis layer shifts with recent Marlin on Ender 3
R.. GitHub STOP HELPING ICE
# Y-axis layer shifts with recent Marlin on Ender 3

(Asked by: username_0 on 2019-08-07)

Since upgrading from the manufacturer's firmare to recent Marlin (first 1.1.9, then 2.0.x git HEAD), I've been having significant model-dependent (didn't happen for first few things I tried to print; other prints reproduce it reliably) layer shifting on the Y axis. It's always in the positive Y direction, usually by 1-3 mm at a time.

![aborted prints showing layer shifts](https://i.sstatic.net/2Xdkv.jpg)

I first suspected mechanical problems (see: [Ender 3 has developed a tendancy to skip Y steps](https://3dprinting.stackexchange.com/q/10768/11157)), but reverting the firmware confirmed that it's a firmware problem.

A number of bug tracker entries for Marlin indicate that there are significant ongoing layer shift problems:

* <https://github.com/MarlinFirmware/Marlin/issues/9768>
* <https://github.com/MarlinFirmware/Marlin/issues/10446>
* <https://github.com/MarlinFirmware/Marlin/issues/12403>

But most end up getting closed. Some people say reverting to 1.1.9 from 2.0.x helped; others say 1.1.9 is EOL and to use 2.0.x. Is there a solution? How do I get a working version of Marlin (new enough to have Linear Advance 1.5, which was my motivation for upgrading) on Ender 3?

**Tags:** marlin, creality-ender-3, firmware, layer-shifting

---

## 1 answers

### Answer by username_0 on 2019-08-07. Score: 1 | Accepted answer

Buried in a bug tracker entry for a seemingly unrelated issue, I found what seems to be the solution:

> @johanmga, I've discovered the velocity jumps here come from using "classic jerk" computations, and happen whether or not s-curve acceleration is enabled.
>
> Try uncommenting `//#define JUNCTION_DEVIATION` in Configuration\_adv.h; that will disable classic jerk and use the junction deviation math instead.
>
> Also for reference, issue #12403 is actively tracking the layer shift issue (please comment there too if you have more information on problems/solutions), and #12540 is has more information on classic jerk vs. junction deviation.

<https://github.com/MarlinFirmware/Marlin/issues/12491#issuecomment-443464603>

It seems that the "classic jerk" code no longer works and produces erroneous motion to the steppers under some conditions (dependent on G-code contents), whereas the Ender 3 default configuration file is still using it.

With the default `JUNCTION_DEVIATION_MM` of 0.02, things worked right away, but printing was so slow that I could plausibly attribute it working just to the slowness. But increasing it up to 0.1 via the menus got the speed closer to what I'm used to, and it's still printing with no layer shifts.

I've posted my results in the tracker in hopes that they'll lead to discovery of the root cause: <https://github.com/MarlinFirmware/Marlin/issues/12403#issuecomment-519305409>

Another issue on the tracker seems to have more detail:

<https://github.com/MarlinFirmware/Marlin/issues/12540#issuecomment-442793326>

> **Comments:**
> **username_0**: I subsequently did have more layer shifts, and never identified the root cause, but I haven't had a single one since upgrading the controller board to SKR mini E3.  

---

