3dSynth

Tutorials / Custom G-code

Open in the interactive tutorials reader

---
title: Tutorial 13 Understanding Motion Continuity
description: Why printers slow down at corners. Jerk, Junction Deviation, and Lookahead.
---

Tutorial 13 Understanding Motion Continuity

1. Lesson Header

2. Concept Introduction

The Cornering Problem.
Imagine running full speed and turning 90 degrees instantly. You can't. You have to slow down, turn, and speed up.
Printers face the same physics.
- Stop-and-Go: Older machines stopped completely at every corner.
- Constant Velocity: Impossible for sharp corners (infinite acceleration required).
- Lookahead: The firmware reads ahead (buffers 16-32 commands) to calculate the maximum safe cornering speed.

3. Machine State Explanation

Jerk / Junction Deviation.
- Jerk (Classic Marlin): The instant speed change allowed. E.g., if moving 50mm/s X, and switching to 50mm/s Y, the instantaneous velocity change vector is huge. Jerk limits this jump.
- Junction Deviation (Modern): Calculates the centripetal force of a virtual arc in the corner.

4. Command Breakdown

Set Jerk (M205)

- Syntax: M205 X[jerk] Y[jerk]. - Typical: M205 X10 Y10. - Effect: Higher Jerk = Faster corners, more vibration. Lower Jerk = Slower corners, smoother.

5. Minimal Working Example

Zig-Zag Path.
A path with many sharp corners will reveal the motion planner's behavior.

G1 X0 Y0 F3000
G1 X10 Y10
G1 X0 Y20
G1 X10 Y30
G1 X0 Y40

6. Visual Representation

The Velocity Profile:

Interactive preview is available in the interactive reader.

7. Build Exercise

Task: Create a "Vibration Test".
1. Print a long straight line (Reference).
2. Print a high-frequency zig-zag (Sawtooth wave) with 1mm amplitude and 1mm period.
3. Observe the printer shaking.

Solution:

G1 X0 Y0
; Straight
G1 X100 Y0 F3000

; Zig-Zag
G1 X0 Y10
G1 X1 Y11
G1 X2 Y10
G1 X3 Y11
G1 X4 Y10
...

8. Deep Insight Section

Why Circles are Hard for Slicers.
Slicers turn circles into many small straight lines (segments).
If the segments are too small (e.g., 0.1mm), the printer's processor gets overwhelmed calculating the cornering speed for thousands of lines per second. This causes "stuttering".
Arc Welding: A technique to replace thousands of G1 lines with a single G2 arc command (Lesson 15), solving the stutter.

9. Common Failure Modes

  1. Blobs on Corners: If Jerk is too low, the nozzle dwells in the corner too long, melting a blob.
  2. Ringing/Ghosting: If Jerk is too high, the sudden direction change causes the frame to oscillate like a guitar string.

10. Real-World Application

High Speed Printing (Klipper).
Firmware like Klipper uses advanced "Input Shaping" to cancel out these vibrations, allowing much higher cornering speeds without ghosting.

11. Final Clean Version

Save this as lesson13.gcode.

; Lesson 13 - The Shaker
G28
G1 Z0.3

; Standard Jerk
M205 X10 Y10
G1 X10 Y10 F6000
G1 X100 Y10 ; Fast move
G1 X10 Y10  ; Fast move

; Low Jerk (Smooth but slow corners)
M205 X1 Y1
G1 X10 Y20
G1 X20 Y30
G1 X30 Y20
G1 X40 Y30
G1 X50 Y20

; High Jerk (Bang-Bang)
M205 X20 Y20
G1 X10 Y40
G1 X20 Y50
G1 X30 Y40
G1 X40 Y50
G1 X50 Y40

M205 X10 Y10 ; Restore default
G28 X0 Y0

12. Stretch Challenge

Challenge: Write a G-code file that draws a 5-pointed star.
The sharp 36-degree angles at the points are a perfect test for cornering logic.

Answer Key:

; Star Logic
G1 X50 Y100 ; Top
G1 X80 Y10  ; Bottom Right
G1 X10 Y60  ; Left
G1 X90 Y60  ; Right
G1 X20 Y10  ; Bottom Left
G1 X50 Y100 ; Close