|
HF-TMC51x0 Driver (TMC5130 & TMC5160) 0.1.0-dev
Hardware Agnostic C++ Driver for the TMC51x0 (TMC5130 & TMC5160)
|
CoolStep configuration structure. More...
#include <tmc51x0_types.hpp>
Public Member Functions | |
| CoolStepConfig ()=default | |
| Default constructor. | |
| CoolStepConfig (uint16_t lower_sg, uint16_t upper_sg, float min_vel, float max_vel, Unit vel_unit=Unit::RevPerSec) | |
| Helper constructor for common configuration. | |
Public Attributes | |
| uint16_t | lower_threshold_sg {0} |
| Lower StallGuard2 threshold for current increase. | |
| uint16_t | upper_threshold_sg {0} |
| Upper StallGuard2 threshold for current decrease. | |
| CoolStepIncrementStep | increment_step {CoolStepIncrementStep::STEP_2} |
| Current increment step width. | |
| CoolStepDecrementSpeed | decrement_speed {CoolStepDecrementSpeed::EVERY_8} |
| Current decrement speed. | |
| CoolStepMinCurrent | min_current {CoolStepMinCurrent::HALF_IRUN} |
| Minimum current percentage. | |
| bool | enable_filter {false} |
| Enable StallGuard2 filter (reduces measurement rate by 4x) | |
| float | min_velocity {0.0F} |
| Lower velocity threshold for CoolStep activation. | |
| float | max_velocity {0.0F} |
| Upper velocity threshold for CoolStep activation. | |
| Unit | velocity_unit {Unit::Steps} |
| Unit for velocity thresholds. | |
CoolStep configuration structure.
User-friendly configuration for CoolStep automatic current reduction feature. CoolStep automatically reduces motor current when load is low, saving energy and reducing heat.
|
default |
Default constructor.
Initializes with CoolStep disabled (semin=0). All fields use default member initializers.
|
inline |
Helper constructor for common configuration.
Creates a CoolStep configuration with typical settings:
| lower_sg | Lower SG threshold (0-1023, 0 to disable CoolStep) |
| upper_sg | Upper SG threshold (0-1023, must be > lower_sg) |
| min_vel | Minimum velocity for CoolStep activation |
| max_vel | Maximum velocity for CoolStep activation |
| vel_unit | Unit for velocity thresholds |
| CoolStepDecrementSpeed tmc51x0::CoolStepConfig::decrement_speed {CoolStepDecrementSpeed::EVERY_8} |
Current decrement speed.
| bool tmc51x0::CoolStepConfig::enable_filter {false} |
Enable StallGuard2 filter (reduces measurement rate by 4x)
| CoolStepIncrementStep tmc51x0::CoolStepConfig::increment_step {CoolStepIncrementStep::STEP_2} |
Current increment step width.
| uint16_t tmc51x0::CoolStepConfig::lower_threshold_sg {0} |
Lower StallGuard2 threshold for current increase.
When SG_RESULT falls below this value, CoolStep increases current. Range: 0-1023 (actual SG_RESULT values)
Set to 0 to disable CoolStep.
| float tmc51x0::CoolStepConfig::max_velocity {0.0F} |
Upper velocity threshold for CoolStep activation.
CoolStep is disabled above this velocity. Set to match the upper limit of velocity range where StallGuard2 gives stable results.
| CoolStepMinCurrent tmc51x0::CoolStepConfig::min_current {CoolStepMinCurrent::HALF_IRUN} |
Minimum current percentage.
| float tmc51x0::CoolStepConfig::min_velocity {0.0F} |
Lower velocity threshold for CoolStep activation.
CoolStep is disabled below this velocity. Set to match the lower limit of velocity range where StallGuard2 gives stable results.
| uint16_t tmc51x0::CoolStepConfig::upper_threshold_sg {0} |
Upper StallGuard2 threshold for current decrease.
When SG_RESULT is equal to or above this value enough times, CoolStep decreases current. Range: 0-1023 (actual SG_RESULT values)
Must be greater than lower_threshold_sg for CoolStep to function properly.
| Unit tmc51x0::CoolStepConfig::velocity_unit {Unit::Steps} |
Unit for velocity thresholds.
Specifies the unit used for min_velocity and max_velocity fields. Unit for velocity thresholds