|
HF-TMC9660 Driver 0.1.0-dev
Hardware Agnostic C++ Driver for the TMC9660
|
Subsystem for position control (FOC outer loop). More...
#include <tmc9660.hpp>
Classes | |
| struct | PositionConfig |
| Configuration structure for position control auto-configuration. More... | |
Private Member Functions | |
| PositionControl (TMC9660 &parent) noexcept | |
Private Attributes | |
| TMC9660 & | driver |
Friends | |
| class | TMC9660 |
Subsystem for position control (FOC outer loop).
Controls motor position using a PI controller that outputs velocity commands. Covers TMCL parameters 142–157, 161–170.
This control loop operates at a downsampled frequency relative to velocity loop. Position feedback can come from various sensors (ABN, SPI encoder).
|
inlineexplicitprivatenoexcept |
|
noexcept |
Auto-configure position control parameters.
Configures position sensor selection, PI gains, scaling, limits, and other position control parameters based on high-level characteristics.
| config | Position control configuration (see PositionConfig) |
|
noexcept |
Read actual position.
| [out] | position | Measured position. |
|
noexcept |
Read event-stop settings.
| [out] | settings | Stop conditions. |
|
noexcept |
Read home-switch position.
| [out] | position | Position value. |
|
noexcept |
Read last reference position.
| [out] | position | Position value. |
|
noexcept |
|
noexcept |
Read high position limit.
| [out] | limit | Maximum allowed position. |
|
noexcept |
Read low position limit.
| [out] | limit | Minimum allowed position. |
|
noexcept |
Read position loop downsampling.
| [out] | divider | Factor. |
|
noexcept |
Read position-PI error.
| [out] | error | PI error. |
|
noexcept |
Read position-PI integrator.
| [out] | integrator | Integrator value. |
|
noexcept |
Read position reached threshold.
| [out] | threshold | Latch threshold. |
|
noexcept |
Read position scaling factor.
| [out] | factor | Scale factor. |
|
noexcept |
Read position feedback sensor.
| [out] | sel | Sensor selection. |
|
noexcept |
Read reference switch enable mask.
| [out] | enable | Mask. |
|
noexcept |
Read switch latch settings.
| [out] | setting | Latch behavior. |
|
noexcept |
Read switch polarity/swap config.
| [out] | config | Config. |
|
noexcept |
Read reference search mode.
| [out] | mode | Search sequence. |
|
noexcept |
Read reference search speed.
| [out] | speed | Search velocity. |
|
noexcept |
Read reference positioning speed.
| [out] | speed | Approach speed. |
|
noexcept |
Read right-limit-switch position.
| [out] | position | Position value. |
|
noexcept |
Read stop-on-position-deviation settings.
| [out] | max_error | Configured max deviation. |
| [out] | soft_stop | Soft/hard stop flag. |
|
noexcept |
Configure event-stop settings.
| settings | Stop conditions. |
|
noexcept |
Set high position limit.
| limit | Maximum allowed position. |
|
noexcept |
Set low position limit.
| limit | Minimum allowed position. |
|
noexcept |
Set position loop downsampling.
| divider | Downsample factor. |
|
noexcept |
Configure position PI gains.
| p | P gain. |
| i | I gain. |
|
noexcept |
Set position PI normalization.
| p_norm | P-term norm. |
| i_norm | I-term norm. |
|
noexcept |
Set position reached threshold.
| threshold | Latch threshold. |
|
noexcept |
Set position scaling factor.
| factor | Scale factor. |
|
noexcept |
Select position feedback sensor.
| sel | Sensor selection. |
|
noexcept |
Enable/disable reference switch stops.
| enable | Bitmask of switch stops. |
|
noexcept |
Configure switch latch settings.
| setting | Latch behavior. |
|
noexcept |
Configure switch polarity and swap.
| config | Polarity/swap config. |
|
noexcept |
Set reference search mode.
| mode | Search sequence. |
|
noexcept |
Set reference search speed.
| speed | Search velocity. |
|
noexcept |
Set reference positioning speed.
| speed | Approach speed. |
|
noexcept |
Configure stop-on-position-deviation.
| max_error | Max allowed deviation. |
| soft_stop | true for ramp down, false for hard stop. |
|
noexcept |
Set target position.
| position | Desired position (internal units). |
|
noexcept |
Stop position control (SYSTEM_OFF).
|
private |