|
HF-TMC51x0 Driver (TMC5130 & TMC5160) 0.1.0-dev
Hardware Agnostic C++ Driver for the TMC51x0 (TMC5130 & TMC5160)
|
DcStep configuration structure. More...
#include <tmc51x0_types.hpp>
Public Member Functions | |
| DcStepConfig ()=default | |
| Default constructor. | |
| DcStepConfig (float min_vel, Unit vel_unit=Unit::RevPerSec, float pwm_time_us=0.0F, DcStepStallSensitivity sensitivity=DcStepStallSensitivity::MODERATE) | |
| Helper constructor for quick setup. | |
Public Attributes | |
| float | min_velocity {0.0F} |
| Minimum velocity threshold for DcStep activation. | |
| Unit | velocity_unit {Unit::Steps} |
| Unit for velocity threshold. | |
| float | pwm_on_time_us {0.0F} |
| PWM on-time limit for commutation (user-friendly) | |
| DcStepStallSensitivity | stall_sensitivity {DcStepStallSensitivity::MODERATE} |
| Stall detection sensitivity. | |
| bool | stop_on_stall {false} |
| Enable stop on stall. | |
DcStep configuration structure.
User-friendly configuration for DcStep automatic commutation mode. DcStep allows the motor to run near its load limit without losing steps by automatically reducing velocity when overloaded. The motor operates in fullstep mode at the target velocity or at reduced velocity if overloaded.
|
default |
Default constructor.
Initializes with DcStep disabled (min_velocity = 0). All fields use default member initializers.
|
inline |
Helper constructor for quick setup.
Creates a DcStep configuration with typical settings:
| min_vel | Minimum velocity for DcStep activation |
| vel_unit | Unit for velocity threshold |
| pwm_time_us | PWM on-time limit in microseconds (0 = auto-calculate) |
| sensitivity | Stall detection sensitivity |
| float tmc51x0::DcStepConfig::min_velocity {0.0F} |
Minimum velocity threshold for DcStep activation.
Below this velocity, motor operates in normal microstep mode. In DcStep operation, motor operates at minimum this velocity even when blocked.
Set to the lowest operating velocity where DcStep gives reliable detection.
| float tmc51x0::DcStepConfig::pwm_on_time_us {0.0F} |
PWM on-time limit for commutation (user-friendly)
Controls the reference pulse width for DcStep load measurement. Must be optimized for robust operation with maximum motor torque.
Higher value = higher torque and higher velocity capability Lower value = operation down to lower velocity (as set by min_velocity)
Should be set slightly above effective blank time (TBL from CHOPCONF). Lower limit: TBL clock cycles + n (where n = 1-100 for typical motor)
Range: 0.1-85.3µs (for 12MHz clock) or 0.1-42.7µs (for 24MHz clock)
| DcStepStallSensitivity tmc51x0::DcStepConfig::stall_sensitivity {DcStepStallSensitivity::MODERATE} |
Stall detection sensitivity.
Controls stall detection threshold in DcStep mode. Higher sensitivity detects stalls earlier but may trigger false positives.
| bool tmc51x0::DcStepConfig::stop_on_stall {false} |
Enable stop on stall.
If true, motor stops (VACTUAL = 0) when stall is detected. Motor remains stopped until RAMP_STAT.event_stop_sg flag is read.
| Unit tmc51x0::DcStepConfig::velocity_unit {Unit::Steps} |
Unit for velocity threshold.
Specifies the unit used for min_velocity field. Unit for velocity threshold