HF-TMC51x0 Driver (TMC5130 & TMC5160) 0.1.0-dev
Hardware Agnostic C++ Driver for the TMC51x0 (TMC5130 & TMC5160)
Loading...
Searching...
No Matches
tmc51x0::MicrostepChangeOptions Struct Reference

Options for changing microstep resolution (CHOPCONF.MRES) More...

#include <tmc51x0_types.hpp>

Public Attributes

bool preserve_physical_units {true}
 Preserve physical meaning of position and motion profile on MRES change.
 
bool require_standstill {true}
 Require standstill before changing MRES.
 
bool rescale_encoder {true}
 Reapply encoder scaling after MRES change (if encoder is configured)
 

Detailed Description

Options for changing microstep resolution (CHOPCONF.MRES)

The TMC51x0 uses microsteps as the native unit for position (XACTUAL/XTARGET) and as the physical base for the internal ramp generator timing (velocity/acceleration scaling). Changing microstep resolution therefore changes the meaning of stored register values unless they are rescaled.

These options control whether the driver preserves the physical meaning of positions and motion profiles when MRES changes.

Member Data Documentation

◆ preserve_physical_units

bool tmc51x0::MicrostepChangeOptions::preserve_physical_units {true}

Preserve physical meaning of position and motion profile on MRES change.

When true (default), the driver rescales all dependent registers so that:

  • Physical position remains unchanged (XACTUAL/XTARGET/X_COMPARE rescaled)
  • Motion profile remains unchanged in user units (VMAX/VSTART/VSTOP/V1 + AMAX/A1/DMAX/D1 rewritten)

When false, the driver performs a "raw" MRES change and does not touch other registers.

◆ require_standstill

bool tmc51x0::MicrostepChangeOptions::require_standstill {true}

Require standstill before changing MRES.

When true (default), the driver rejects MRES changes unless the motor is in standstill. This avoids discontinuities while moving.

◆ rescale_encoder

bool tmc51x0::MicrostepChangeOptions::rescale_encoder {true}

Reapply encoder scaling after MRES change (if encoder is configured)

Encoder mapping uses microsteps internally (ENC_CONST and deviation thresholds), so it typically must be recalculated after MRES changes to preserve physical meaning.


The documentation for this struct was generated from the following file: