Hardware 8-segment acceleration/dec-acc profile controller.
More...
#include <TMC9660.hpp>
|
bool | enable (bool on) noexcept |
| Enable or disable the ramp generator block.
|
|
bool | setAcceleration (uint32_t a1, uint32_t a2, uint32_t aMax) noexcept |
| Set acceleration segments A1, A2, Amax (µ units/s²).
|
|
bool | setDeceleration (uint32_t d1, uint32_t d2, uint32_t dMax) noexcept |
| Set deceleration segments D1, D2, Dmax (µ units/s²).
|
|
bool | setVelocities (uint32_t vStart, uint32_t vStop, uint32_t v1, uint32_t v2, uint32_t vMax) noexcept |
| Configure velocity thresholds and limits.
|
|
bool | setTiming (uint16_t tVmaxCycles, uint16_t tZeroWaitCycles) noexcept |
| Timing constraints at Vmax and between moves.
|
|
bool | enableFeedForward (bool enableVelFF, bool enableAccelFF, uint16_t accelFFGain, tmc9660::tmcl::AccelerationFFShift accelFFShift) 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.
|
|
Hardware 8-segment acceleration/dec-acc profile controller.
Covers all ramp generator and feedforward parameters:
- ACCELERATION_FF_GAIN (50)
- ACCELERATION_FF_SHIFT (51)
- RAMP_ENABLE (52)
- DIRECT_VELOCITY_MODE (53)
- RAMP_AMAX/A1/A2 (54/55/56)
- RAMP_DMAX/D1/D2 (57/58/59)
- RAMP_VMAX/V1/V2/VSTART/VSTOP (60/61/62/63/64)
- RAMP_TVMAX/TZEROWAIT (65/66)
- ACCELERATION_FEEDFORWARD_ENABLE (67)
- VELOCITY_FEEDFORWARD_ENABLE (68)
- RAMP_VELOCITY (69)
- RAMP_POSITION (70)
◆ Ramp()
TMC9660::Ramp::Ramp |
( |
TMC9660 & |
parent | ) |
|
|
inlineexplicitprivatenoexcept |
◆ enable()
bool TMC9660::Ramp::enable |
( |
bool |
on | ) |
|
|
noexcept |
Enable or disable the ramp generator block.
- Parameters
-
on | True to enable, false to disable (RAMP_ENABLE). |
◆ enableFeedForward()
Enable hardware feed-forward terms and set gain/shift.
This allows the ramp generator to use feed-forward terms for velocity and acceleration.
- Parameters
-
enableVelFF | Enable the VELOCITY_FEEDFORWARD feature (VELOCITY_FEEDFORWARD_ENABLE) |
enableAccelFF | Enable the ACCELERATION_FEEDFORWARD feature (ACCELERATION_FEEDFORWARD_ENABLE) |
accelFFGain | ACCELERATION_FF_GAIN (0…65535) |
accelFFShift | ACCELERATION_FF_SHIFT enum (tmc9660::tmcl::AccelerationFFShift) |
◆ getRampPosition()
bool TMC9660::Ramp::getRampPosition |
( |
int32_t & |
position | ) |
|
|
noexcept |
Get the current target position calculated by the ramp controller.
- Parameters
-
[out] | position | The current ramp target position (RAMP_POSITION, param 70) |
- Returns
- true if the value was read successfully.
◆ getRampVelocity()
bool TMC9660::Ramp::getRampVelocity |
( |
int32_t & |
velocity | ) |
|
|
noexcept |
Get the current target velocity calculated by the ramp controller.
- Parameters
-
[out] | velocity | The current ramp target velocity (RAMP_VELOCITY, param 69) |
- Returns
- true if the value was read successfully.
◆ setAcceleration()
bool TMC9660::Ramp::setAcceleration |
( |
uint32_t |
a1, |
|
|
uint32_t |
a2, |
|
|
uint32_t |
aMax |
|
) |
| |
|
noexcept |
Set acceleration segments A1, A2, Amax (µ units/s²).
- Parameters
-
a1 | First acceleration (RAMP_A1) |
a2 | Second acceleration (RAMP_A2) |
aMax | Top acceleration (RAMP_AMAX) |
◆ setDeceleration()
bool TMC9660::Ramp::setDeceleration |
( |
uint32_t |
d1, |
|
|
uint32_t |
d2, |
|
|
uint32_t |
dMax |
|
) |
| |
|
noexcept |
Set deceleration segments D1, D2, Dmax (µ units/s²).
- Parameters
-
d1 | Second deceleration (RAMP_D1) |
d2 | First deceleration (RAMP_D2) |
dMax | Top deceleration (RAMP_DMAX) |
◆ setDirectVelocityMode()
bool TMC9660::Ramp::setDirectVelocityMode |
( |
bool |
enable | ) |
|
|
noexcept |
Direct-velocity mode instead of classic PI velocity loop.
- Parameters
-
enable | True to enable direct velocity mode (DIRECT_VELOCITY_MODE) |
◆ setTiming()
bool TMC9660::Ramp::setTiming |
( |
uint16_t |
tVmaxCycles, |
|
|
uint16_t |
tZeroWaitCycles |
|
) |
| |
|
noexcept |
Timing constraints at Vmax and between moves.
- Parameters
-
tVmaxCycles | Minimum time at VMAX (RAMP_TVMAX) |
tZeroWaitCycles | Wait time at end of ramp (RAMP_TZEROWAIT) |
◆ setVelocities()
bool TMC9660::Ramp::setVelocities |
( |
uint32_t |
vStart, |
|
|
uint32_t |
vStop, |
|
|
uint32_t |
v1, |
|
|
uint32_t |
v2, |
|
|
uint32_t |
vMax |
|
) |
| |
|
noexcept |
Configure velocity thresholds and limits.
- Parameters
-
vStart | Start velocity (RAMP_VSTART) |
vStop | Stop velocity (RAMP_VSTOP) |
v1 | Velocity threshold 1 (RAMP_V1) |
v2 | Velocity threshold 2 (RAMP_V2) |
vMax | Maximum velocity (RAMP_VMAX) |
◆ TMC9660
◆ driver
The documentation for this struct was generated from the following files: