|
HF-TMC9660 Driver 0.1.0-dev
Hardware Agnostic C++ Driver for the TMC9660
|
Hardware 8-segment acceleration/dec-acc profile controller. More...
#include <tmc9660.hpp>
Classes | |
| struct | RampConfig |
| Configuration structure for ramp auto-configuration. More... | |
Public Member Functions | |
| bool | enable (bool on) noexcept |
| Enable or disable the ramp generator block. | |
| bool | setAcceleration (uint32_t a1, uint32_t a2, uint32_t a_max) noexcept |
| Set acceleration segments A1, A2, Amax (µ units/s²). | |
| bool | setDeceleration (uint32_t d1, uint32_t d2, uint32_t d_max) noexcept |
| Set deceleration segments D1, D2, Dmax (µ units/s²). | |
| bool | setVelocities (uint32_t v_start, uint32_t v_stop, uint32_t v1, uint32_t v2, uint32_t v_max) noexcept |
| Configure velocity thresholds and limits. | |
| bool | setTiming (uint16_t t_vmax_cycles, uint16_t t_zero_wait_cycles) noexcept |
| Timing constraints at Vmax and between moves. | |
| bool | enableFeedForward (bool enable_vel_ff, bool enable_accel_ff, uint16_t accel_ff_gain, tmc9660::tmcl::AccelerationFFShift accel_ff_shift) noexcept |
| Enable hardware feed-forward terms and set gain/shift. | |
| bool | setDirectVelocityMode (bool enable) noexcept |
| Direct-velocity mode instead of classic PI velocity loop. | |
| bool | getRampVelocity (int32_t &velocity) noexcept |
| Get the current target velocity calculated by the ramp controller. | |
| bool | getRampPosition (int32_t &position) noexcept |
| Get the current target position calculated by the ramp controller. | |
| bool | configureAuto (const RampConfig &config) noexcept |
| Auto-configure ramp parameters. | |
Private Member Functions | |
| Ramp (TMC9660 &parent) noexcept | |
Private Attributes | |
| TMC9660 & | driver |
Friends | |
| class | TMC9660 |
Hardware 8-segment acceleration/dec-acc profile controller.
Covers all ramp generator and feedforward parameters:
|
inlineexplicitprivatenoexcept |
|
noexcept |
Auto-configure ramp parameters.
Configures acceleration, deceleration, velocity thresholds, and feedforward parameters based on high-level motion profile requirements.
| config | Ramp configuration (see RampConfig) |
Enable or disable the ramp generator block.
| on | True to enable, false to disable (RAMP_ENABLE). |
|
noexcept |
Enable hardware feed-forward terms and set gain/shift.
This allows the ramp generator to use feed-forward terms for velocity and acceleration.
| enable_vel_ff | Enable the VELOCITY_FEEDFORWARD feature (VELOCITY_FEEDFORWARD_ENABLE) |
| enable_accel_ff | Enable the ACCELERATION_FEEDFORWARD feature (ACCELERATION_FEEDFORWARD_ENABLE) |
| accel_ff_gain | ACCELERATION_FF_GAIN (0…65535) |
| accel_ff_shift | ACCELERATION_FF_SHIFT enum (tmc9660::tmcl::AccelerationFFShift) |
|
noexcept |
Get the current target position calculated by the ramp controller.
| [out] | position | The current ramp target position (RAMP_POSITION, param 70) |
|
noexcept |
Get the current target velocity calculated by the ramp controller.
| [out] | velocity | The current ramp target velocity (RAMP_VELOCITY, param 69) |
|
noexcept |
Set acceleration segments A1, A2, Amax (µ units/s²).
| a1 | First acceleration (RAMP_A1) |
| a2 | Second acceleration (RAMP_A2) |
| a_max | Top acceleration (RAMP_AMAX) |
|
noexcept |
Set deceleration segments D1, D2, Dmax (µ units/s²).
| d1 | Second deceleration (RAMP_D1) |
| d2 | First deceleration (RAMP_D2) |
| d_max | Top deceleration (RAMP_DMAX) |
|
noexcept |
Direct-velocity mode instead of classic PI velocity loop.
| enable | True to enable direct velocity mode (DIRECT_VELOCITY_MODE) |
|
noexcept |
Timing constraints at Vmax and between moves.
| t_vmax_cycles | Minimum time at VMAX (RAMP_TVMAX) |
| t_zero_wait_cycles | Wait time at end of ramp (RAMP_TZEROWAIT) |
|
noexcept |
Configure velocity thresholds and limits.
| v_start | Start velocity (RAMP_VSTART) |
| v_stop | Stop velocity (RAMP_VSTOP) |
| v1 | Velocity threshold 1 (RAMP_V1) |
| v2 | Velocity threshold 2 (RAMP_V2) |
| v_max | Maximum velocity (RAMP_VMAX) |
|
private |