This also sets the IS Frequency to 37Hz for X and Y, disables Dynamic Frequency mode, and enables Linear Advance with a gain of 0.18.
- G0-G1: Linear Move
- G2-G3: Arc or Circle Move
- G4: Dwell
- G5: Bézier Cubic Spline Move
- G6: Direct Stepper Move
- G10: Retract
- G11: Recover
- G12: Clean the Nozzle
- G17-G19: CNC Workspace Planes
- G20: Inch Units
- G21: Millimeter Units
- G26: Mesh Validation Pattern
- G27: Park toolhead
- G28: Auto Home
- G29: Bed Leveling
- G29: Bed Leveling (3-Point)
- G29: Bed Leveling (Linear)
- G29: Bed Leveling (Manual)
- G29: Bed Leveling (Bilinear)
- G29: Bed Leveling (Unified)
- G30: Single Z-Probe
- G31: Dock Sled
- G32: Undock Sled
- G33: Delta Auto Calibration
- G34: Z Steppers Auto-Alignment
- G34: Mechanical Gantry Calibration
- G35: Tramming Assistant
- G38.2-G38.5: Probe target
- G42: Move to mesh coordinate
- G53: Move in Machine Coordinates
- G54-G59.3: Select Workspace
- G60: Stored Positions
- G61: Return to Saved Position
- G76: Probe temperature calibration
- G80: Cancel Current Motion Mode
- G90: Absolute Positioning
- G91: Relative Positioning
- G92: Set Position
- G425: Backlash Calibration
- M0-M1: Unconditional stop
- M3: Spindle CW / Laser On
- M4: Spindle CCW / Laser On
- M5: Spindle / Laser Off
- M7-M9: Coolant Controls
- M10-M11: Vacuum / Blower Control
- M16: Expected Printer Check
- M17: Enable Steppers
- M18, M84: Disable steppers
- M20: List SD Card
- M21: Init SD card
- M22: Release SD card
- M23: Select SD file
- M24: Start or Resume SD print
- M25: Pause SD print
- M26: Set SD position
- M27: Report SD print status
- M28: Start SD write
- M29: Stop SD write
- M30: Delete SD file
- M31: Report Print Time
- M32: Select and Start
- M33: Get Long Path
- M34: SDCard Sorting
- M42: Set Pin State
- M43: Pins Debugging
- M43 T: Toggle Pins
- M48: Probe Repeatability Test
- M73: Set Print Progress
- M75: Start Print Job Timer
- M76: Pause Print Job Timer
- M77: Stop Print Job Timer
- M78: Print Job Stats
- M80: Power On
- M81: Power Off
- M82: E Absolute
- M83: E Relative
- M85: Inactivity Shutdown
- M86: Hotend Idle Timeout
- M87: Disable Hotend Idle Timeout
- M92: Set Axis Steps-per-unit
- M100: Free Memory
- M102: Configure Bed Distance Sensor
- M104: Set Hotend Temperature
- M105: Report Temperatures
- M106: Set Fan Speed
- M107: Fan Off
- M108: Break and Continue
- M109: Wait for Hotend Temperature
- M110: Set / Get Line Number
- M111: Debug Level
- M112: Full Shutdown
- M113: Host Keepalive
- M114: Get Current Position
- M115: Firmware Info
- M117: Set LCD Message
- M118: Serial print
- M119: Endstop States
- M120: Enable Endstops
- M121: Disable Endstops
- M122: TMC Debugging
- M123: Fan Tachometers
- M125: Park Head
- M126: Baricuda 1 Open
- M127: Baricuda 1 Close
- M128: Baricuda 2 Open
- M129: Baricuda 2 Close
- M140: Set Bed Temperature
- M141: Set Chamber Temperature
- M143: Set Laser Cooler Temperature
- M145: Set Material Preset
- M149: Set Temperature Units
- M150: Set RGB(W) Color
- M154: Position Auto-Report
- M155: Temperature Auto-Report
- M163: Set Mix Factor
- M164: Save Mix
- M165: Set Mix
- M166: Gradient Mix
- M190: Wait for Bed Temperature
- M191: Wait for Chamber Temperature
- M192: Wait for Probe temperature
- M193: Wait For Laser Cooler Temperature
- M200: Volumetric Extrusion Diameter
- M201: Print / Travel Move Limits
- M203: Set Max Feedrate
- M204: Set Starting Acceleration
- M205: Set Advanced Settings
- M206: Set Home Offsets
- M207: Firmware Retraction Settings
- M208: Firmware Recover Settings
- M209: Set Auto Retract
- M210: Homing Feedrate
- M211: Software Endstops
- M217: Filament swap parameters
- M218: Set Hotend Offset
- M220: Set Feedrate Percentage
- M221: Set Flow Percentage
- M226: Wait for Pin State
- M240: Trigger Camera
- M250: LCD Contrast
- M255: LCD Sleep/Backlight Timeout
- M256: LCD Brightness
- M260: I2C Send
- M261: I2C Request
- M265: Scan I2C Bus
- M280: Servo Position
- M281: Edit Servo Angles
- M282: Detach Servo
- M290: Babystep
- M300: Play Tone
- M301: Set Hotend PID
- M302: Cold Extrude
- M303: PID autotune
- M304: Set Bed PID
- M305: User Thermistor Parameters
- M306: Model Predictive Temp. Control
- M309: Set Chamber PID
- M350: Set micro-stepping
- M351: Set Microstep Pins
- M355: Case Light Control
- M360: SCARA Theta A
- M361: SCARA Theta-B
- M362: SCARA Psi-A
- M363: SCARA Psi-B
- M364: SCARA Psi-C
- M380: Activate Solenoid
- M381: Deactivate Solenoids
- M400: Finish Moves
- M401: Deploy Probe
- M402: Stow Probe
- M403: MMU2 Filament Type
- M404: Filament Width Sensor Nominal Diameter
- M405: Filament Width Sensor On
- M406: Filament Width Sensor Off
- M407: Read Filament Width
- M410: Quickstop
- M412: Filament Runout
- M413: Power-loss Recovery
- M414: LCD language
- M420: Bed Leveling State
- M421: Set Mesh Value
- M422: Set Z Motor XY
- M423: X Twist Compensation
- M425: Backlash compensation
- M428: Home Offsets Here
- M430: Power Monitor
- M486: Cancel Objects
- M493: Fixed-Time Motion
- M494: FT Motion Trajectory Smoothing
- M500: Save Settings
- M501: Restore Settings
- M502: Factory Reset
- M503: Report Settings
- M504: Validate EEPROM contents
- M510: Lock Machine
- M511: Unlock Machine
- M512: Set Passcode
- M524: Abort SD print
- M540: Endstops Abort SD
- M550: Machine Name
- M552: Ethernet IP Address, Network IF
- M553: Ethernet Subnet Mask
- M554: Ethernet Gateway IP Address
- M569: Set TMC Stepping Mode
- M575: Serial baud rate
- M592: Nonlinear Extrusion Control
- M593: ZV Input Shaping
- M600: Filament Change
- M603: Configure Filament Change
- M605: Multi Nozzle Mode
- M665: Delta Configuration
- M665: SCARA Configuration
- M666: Set Delta endstop adjustments
- M666: Dual endstop offsets
- M672: Duet Smart Effector sensitivity
- M701: Load filament
- M702: Unload filament
- M710: Controller Fan settings
- M808: Repeat Marker
- M810-M819: G-code macros
- M820: Report G-code macros
- M851: XYZ Probe Offset
- M852: Bed Skew Compensation
- M860-M869: I2C Position Encoders
- M871: Probe temperature config
- M876: Handle Prompt Response
- M900: Linear Advance Factor
- M906: Stepper Motor Current
- M907: Trimpot Stepper Motor Current
- M908: Set Trimpot Pins
- M909: Report DAC Stepper Current
- M910: Commit DAC to EEPROM
- M911: TMC OT Pre-Warn Condition
- M912: Clear TMC OT Pre-Warn
- M913: Set Hybrid Threshold Speed
- M914: TMC Bump Sensitivity
- M915: TMC Z axis calibration
- M916: L6474 Thermal Warning Test
- M917: L6474 Overcurrent Warning Test
- M918: L6474 Speed Warning Test
- M919: TMC Chopper Timing
- M920: TMC Homing Current
- M928: Start SD Logging
- M951: Magnetic Parking Extruder
- M993: Back up flash settings to SD
- M994: Restore flash from SD
- M995: Touch Screen Calibration
- M997: Firmware update
- M999: STOP Restart
- M7219: MAX7219 Control
- T0-T7: Select or Report Tool
- T?-Tx: MMU2 Special Commands
This page is under construction and may not have complete or up-to-date information.
Description
The Fixed-Time Motion planner (FTM) is a successor to the Marlin optimized planner. FTM was originally developed by Ulendo.io as an add-on to support their Filtered B-Spline motion solution.
FTM currently supports Cartesian and Core kinematics. It may be extended for Delta in the future. The FT_MOTION feature can be enabled at the same time as Marlin’s integrated ZV Input Shaper, but these features do not share settings. It has its own implementation of Linear Advance (aka Pressure Advance) with its own gain parameter separate from M900.
FTM can be enabled and disabled while the machine is running — and even within a print job if that helps! So if you prefer the integrated ZV Input Shaper for some prints and 2HEI Input Shaping for others you won’t need to re-flash the firmware.
G-code M493 allows you to enable or disable Fixed-Time Motion, change the current Input Shaper mode, and set parameters for its own Linear Advance and Input Shaping.
Input Shaper Tuning
It’s not easy to attach an accelerometer to most printer boards, so Marlin doesn’t provide accelerometor-based tuning. If you have a device that can record acceleration you can use it. But the easiest way to tune Input Shaping is to print a ringing tower that goes through a range of frequencies, then examine the appearance of the ringing tower to choose the best frequencies for each axis.
1. Get the Test Model
Download the Ringing Tower STL which you will slice and use for the print test. For a CoreXY printer you should rotate the model 45 degrees, which isolates the A and B components of the motion system.
2. Prepare the Slicer
Use a slicer that provides custom G-code macros for layer change. For example you can open Kiri:Moto or download Prusa Slicer. If you use Cura you may need to install the Post Processing Plugin from the Cura Marketplace if it is not already installed.
- In the the Starting G-code enable Fixed-Time Motion with something like:
M493 S1 XY C2 D0 ; Enable ZVD Input Shaping - For Kiri:Moto (testing 15Hz to 60Hz):
- Enable Infill ⏵ Fill Type ⏵ Vase.
- Under Setup ⏵ Machine ⏵ Gcode Macros ⏵ Layer add:
M493 XY A{(layer < 2 ? 0 : 15 + 45.0 * (layer - 2) / 297)} ; (Hz) XY Input Shaping Test
- For Prusa Slicer (testing 15Hz to 60Hz):
- Enable Spiral vase.
- Under Printer Settings ⏵ After layer change G-code add:
M493 XY A{(layer_num < 2 ? 0 : 15 + 45.0 * (layer_num - 2) / 297)} ; (Hz) XY Input Shaping Test
- In Cura, you’ll first need to add the
InputShaping.pyfile located here to your Cura “scripts” folder. Reopen Cura, enable Spiralize Outer Contour and set Minimum Layer Time to 0. Then go to Extensions ⏵ Post Processing ⏵ Modify G-Code. Click Add a script in the window that opens and use the dropdown menu to find Input Shaping. Make sure the Motion planning type dropdown is set to M493. The default frequency settings will let you test a range of 15Hz to 60Hz.
3. Slice and Print
Slice and print the tower using 0.2mm layer height using the highest reasonable speed. When you examine the results it should be obvious where ringing is reduced the most on each axis. To get the Hz value for a given Z height, use the formula:
15 + 45 * (z / 0.2 - 2) / 297
4. Analyze the Result
Measure the height of the best looking layer, divide by the layer height, subtracting two layers. For example:
- The least X ringing appears at height 20mm. So we calculate
15 + 45 * (20 / 0.2 - 2) / 297and get a result of 29.84Hz. - Send the command
M493 X A29.84to apply the frequency to X motion. (For Y you would useM493 Y A29.84.)
More Resources
TH3D Studio has created an Input Shaper Calculator that you can use to get the Slicer G-code you need and calculate the Hz value based on the best-looking layers.
Dynamic Shaping
Once you have the basic Input Shaping tuned, you may want to do further testing to see how the resonance changes as the Z height increases. Z height can affect the machine resonance whether the bed or the gantry moves in Z due to changes in the center of mass. Tuning according to the changing Z-height is more complicated than just printing a test model, and is best done with an accelerometer. Machine vendors should consider tuning at the factory and provide tuned profile settings for the popular slicers.
Notes
The K factor for FTM Linear Advance is now set with M900 K.
Usage
M493 [A<Hz>] [C<0|1|2|3|4|5|6|7|8>] [D<0|1|2>] [E] [F<scale>] [I<zeta>] [Q<vtol>] [S<0|1>] [T<0|1>] [X] [Y] [Z] Parameters
[A<Hz>] | Set the Base Frequency for Input Shaping on the specified axes. |
[C<0|1|2|3|4|5|6|7|8>] | Set the vibration compensator [input shaper] mode for the specified axes.
|
[D<0|1|2>] | Set the Dynamic Frequency mode. (Available when there is a Z axis and/or Extruder to follow.)
|
[E] | Flag to apply |
[F<scale>] | Set the Frequency Scaling factor for Input Shaping on the specified axes. |
[I<zeta>] | Set the Zeta for Input Shaping on the specified axes. |
[Q<vtol>] | Set the Vibration Tolerance for Input Shaping on the specified axes. |
[S<0|1>] | Set Fixed-Time Motion mode enabled / disabled.
|
[T<0|1>] | Set the state for Axis Synchronization.
|
[X] | Flag to apply |
[Y] | Flag to apply |
[Z] | Flag to apply |
Examples
Enable Fixed-Time Motion with Linear Advance gain 0.22
M493 S1
M900 K0.22Enable Fixed-Time Motion with ZVD Input Shaping on X and Y
M493 S1 XY C2 A37 D0
M900 K0.18