MAFR — Motion Axis Fault Reset

Description
Section titled “Description”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.
Operands
Section titled “Operands”| 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. |
Scan Behavior
Section titled “Scan Behavior”Prescan
Section titled “Prescan”Nothing. Error is 0 at power-up.
Rung-condition-in is false
Section titled “Rung-condition-in is false”Nothing.
Rung-condition-in is true
Section titled “Rung-condition-in is true”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.
Postscan
Section titled “Postscan”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.
Axis Members
Section titled “Axis Members”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. |
Example
Section titled “Example”Scenario: A reset pushbutton on the feeder panel acknowledges an axis fault on Feed.
Tags:
Fault_Reset— Axis fault reset, BOOLFeed— stepper axis
Rung 1:
—|XIC Fault_Reset|———[MAFR Feed]———Scan 1 — Fault_Reset = 0, Feed.Error = 1. The fault stands.

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

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.
See Also
Section titled “See Also”- 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