|
HF-TMC9660 Driver 0.1.0-dev
Hardware Agnostic C++ Driver for the TMC9660
|
Subsystem for velocity control (FOC middle loop). More...
#include <tmc9660.hpp>
Classes | |
| struct | VelocityConfig |
| Configuration structure for velocity control auto-configuration. More... | |
Private Member Functions | |
| VelocityControl (TMC9660 &parent) noexcept | |
Private Attributes | |
| TMC9660 & | driver |
Friends | |
| class | TMC9660 |
Subsystem for velocity control (FOC middle loop).
Controls motor velocity using a PI controller that outputs torque commands. Covers TMCL parameters 123–139.
This control loop operates at a downsampled frequency relative to PWM. Velocity feedback can come from various sensors (ABN, Hall, SPI encoder).
|
inlineexplicitprivatenoexcept |
|
noexcept |
Auto-configure velocity control parameters.
Configures velocity sensor selection, PI gains, scaling, and other velocity control parameters based on high-level characteristics.
| config | Velocity control configuration (see VelocityConfig) |
|
noexcept |
Read actual velocity.
| [out] | velocity | Measured velocity. |
|
noexcept |
|
noexcept |
|
noexcept |
|
noexcept |
|
noexcept |
|
noexcept |
|
noexcept |
|
noexcept |
Read stop-on-velocity-deviation settings.
| [out] | max_error | Configured max deviation. |
| [out] | soft_stop | Soft/hard stop flag. |
|
noexcept |
Read velocity loop downsampling.
| [out] | divider | Factor. |
|
noexcept |
Read current velocity meter mode.
| [out] | mode | Current mode. |
|
noexcept |
Read velocity meter hysteresis.
| [out] | hysteresis | Hysteresis. |
|
noexcept |
Read velocity meter switch threshold.
| [out] | threshold | Threshold. |
|
noexcept |
Read velocity offset.
| [out] | offset | Offset in RPM. |
|
noexcept |
Read velocity-PI error.
| [out] | error | PI error. |
|
noexcept |
Read velocity-PI integrator.
| [out] | integrator | Integrator value. |
|
noexcept |
Read velocity scaling factor.
| [out] | factor | Scale factor. |
|
noexcept |
Read velocity feedback sensor.
| [out] | sel | Sensor selection. |
|
noexcept |
|
noexcept |
|
noexcept |
|
noexcept |
|
noexcept |
|
noexcept |
|
noexcept |
Configure stop-on-velocity-deviation.
| max_error | Max allowed deviation. |
| soft_stop | true for ramp down, false for hard stop. |
|
noexcept |
Set target velocity.
| velocity | Target velocity (internal units). |
|
noexcept |
Set velocity loop downsampling.
| divider | Downsample factor. |
|
noexcept |
Configure velocity PI gains.
| p | P gain. |
| i | I gain. |
|
noexcept |
Set velocity meter hysteresis.
| hysteresis | Hysteresis value. |
|
noexcept |
Set velocity meter switch threshold.
| threshold | Threshold value. |
|
noexcept |
Set velocity PI normalization.
| p_norm | P-term norm. |
| i_norm | I-term norm. |
|
noexcept |
Set velocity offset.
| offset | Offset in RPM. |
|
noexcept |
Set velocity scaling factor.
| factor | Scale factor. |
|
noexcept |
Select velocity feedback sensor.
| sel | Sensor selection. |
|
noexcept |
Stop velocity control (SYSTEM_OFF).
|
private |