Skip to content

MAFR — Motion Axis Fault Reset

Category
Motion
Type
Output
Availability
Stepper, servo and DC axes (Explorer ▸ Axes)

MAFR instruction block: a block labelled MAFR with one row, Axis: Feed


MAFR (Motion Axis Fault Reset) clears the Error bit of an axis and restarts its watchdog timer. On an axis with a TMC2130 driver it also reads the driver’s fault register, which clears the driver’s own latch, and pulses the Enable line. If the cause is still present the fault returns: a driver fault re-asserts on the next scan, a watchdog fault after another watchdog period. Use MAFR behind a reset pushbutton or a mode change so an operator can acknowledge a fault. Do not hold MAFR true permanently; it would clear every fault the instant it appears and you would never see one.


Operand Type Format Valid Range Required Description
Axis Axis Axis name Any axis in Explorer ▸ Axes that has a driver Yes The axis whose fault is cleared.

Nothing. Error is 0 at power-up.

Nothing.

On this scan and every scan the rung stays true, Error = 0 and the watchdog’s mismatch timer is reset. On a TMC2130 axis the driver’s GSTAT register is read and the Enable pin is pulsed off and on. Nothing else changes: the drive stays as it was, a move or jog in progress continues.

Nothing.

What sets Error:

Cause Detected by Comes back after MAFR if
Watchdog mismatch: the axis is commanded to move and is not moving, or moving when it should not, for longer than Watchdog ms Axis service every scan The mismatch is still there Watchdog ms later
TMC2130 driver fault (over-temperature, short to ground) Driver service, SPI The driver still reports the fault on the next read

A step/dir driver without diagnostics can only raise the watchdog cause.


Motion status lives on the axis, not on a per-instruction tag.

Member Data type Set by Cleared by Description
Error BOOL Watchdog mismatch, TMC2130 driver fault MAFR Axis fault. This is the member MAFR writes.
Watchdog INT (ms) Axis properties (default 500); your logic may overwrite — Tolerance before a mismatch becomes Error.
DriverOn BOOL MSO MSF The drive is enabled. Not touched by MAFR.
EN BOOL MAM, MAJ, MAG while a command is active Command complete, MAS, MSF A motion command is engaged.
IP BOOL Axis service while steps are being produced Motion stops Motion in process.
DN BOOL MAM reaching its target, MSR Next MAM or MAJ Instruction done.
PC BOOL Same as DN Same as DN Process complete.
InMotion BOOL Axis service Axis service Steps produced this scan.
Dir BOOL Axis service Axis service 1 = forward.
ActualPos REAL Axis service every scan — Position in axis units.
CmdPos REAL MAM, MAG, MSR — Commanded target in axis units.
Counts DINT Axis service every scan MSR, ResetCounts Raw step counts.
RedefinePos REAL MSR — Value of the last MSR.
ResetCounts BOOL Your logic (write 1) Firmware, after zeroing Zero the counts without an MSR.

Scenario: A reset pushbutton on the feeder panel acknowledges an axis fault on Feed.

Tags:

  • Fault_Reset — Axis fault reset, BOOL
  • Feed — stepper axis

Rung 1:

—|XIC Fault_Reset|———[MAFR Feed]———

Scan 1 — Fault_Reset = 0, Feed.Error = 1. The fault stands.

Figure 1 — MAFR rung false: Fault_Reset off, wire dark

Scan 2 — Fault_Reset = 1. Feed.Error = 0 and the watchdog timer restarts.

Figure 2 — MAFR rung true: Fault_Reset on, the wire lit through the block

Values before and after: Feed.Error 1 → 0. In the offline simulator nothing raises a fault on a plain step/dir axis, so to try this rung set Feed.Error to 1 in the Tag Browser while simulating (axis output members are editable there) and then close Fault_Reset.


  • MSF — Motion Servo Off (drop the drive on a fault)
  • MAS — Motion Axis Stop
  • MSO — Motion Servo On
  • Motion Instructions — Category index

A fault stops nothing by itself. Error is a status bit. The drive stays enabled and a jog keeps jogging. If a fault must drop the axis, write it: XIC Feed.Error → MSF Feed on its own rung.

Pulse it. Put the reset behind a pushbutton or a one-shot. A held MAFR masks every future fault.

Tuning the watchdog. A slow ramp or a heavy load can trip the default 500 ms on a legitimate start. Raise Watchdog in the axis properties, or write the member from the ladder, rather than resetting faults automatically.

Applies to LadderIDE >=1.2.2 · Last reviewed 2026-09-11 · Screenshots verified 2026-09-11