HF-TMC9660 Driver
Hardware Agnostic C++ Driver for the TMC9660
Loading...
Searching...
No Matches
TMC9660::FOCControl Struct Reference

Subsystem for FOC control: torque/flux, velocity, position loops, open‐loop support, and reference switch / stop-event parameters. More...

#include <TMC9660.hpp>

Collaboration diagram for TMC9660::FOCControl:

Public Member Functions

bool stop () noexcept
 Stop torque/flux control (SYSTEM_OFF).
 
bool setTargetTorque (int16_t milliamps) noexcept
 Set desired torque.
 
bool getActualTorque (int16_t &milliamps) noexcept
 Read actual torque.
 
bool setTargetFlux (int16_t milliamps) noexcept
 Set desired flux current.
 
bool getActualFlux (int32_t &milliamps) noexcept
 Read actual flux current.
 
bool setTorqueOffset (int16_t milliamps) noexcept
 Set torque offset (feed-forward).
 
bool getTorqueOffset (int16_t &milliamps) noexcept
 Read torque offset.
 
bool setFluxOffset (int16_t milliamps) noexcept
 Set flux offset (feed-forward).
 
bool getFluxOffset (int16_t &milliamps) noexcept
 Read flux offset.
 
bool setCurrentLoopGains (uint16_t p, uint16_t i, bool separate=false, uint16_t fluxP=0, uint16_t fluxI=0) noexcept
 Configure current-loop PI gains.
 
bool setTorqueFluxPiSeparation (tmc9660::tmcl::TorqueFluxPiSeparation sep) noexcept
 Select combined or separate torque/flux PI parameters.
 
bool setCurrentNormalization (tmc9660::tmcl::CurrentPiNormalization pNorm, tmc9660::tmcl::CurrentPiNormalization iNorm) noexcept
 Set normalization for current-PI outputs.
 
bool getTorquePiError (int32_t &error) noexcept
 Read torque PI error.
 
bool getFluxPiError (int32_t &error) noexcept
 Read flux PI error.
 
bool getTorquePiIntegrator (int32_t &integrator) noexcept
 Read torque-PI integrator state.
 
bool getFluxPiIntegrator (int32_t &integrator) noexcept
 Read flux-PI integrator state.
 
bool setVelocitySensor (tmc9660::tmcl::VelocitySensorSelection sel) noexcept
 Select velocity feedback sensor.
 
bool getVelocitySensor (tmc9660::tmcl::VelocitySensorSelection &sel) noexcept
 Read velocity feedback sensor.
 
bool setTargetVelocity (int32_t velocity) noexcept
 Set target velocity.
 
bool getActualVelocity (int32_t &velocity) noexcept
 Read actual velocity.
 
bool setVelocityOffset (int32_t offset) noexcept
 Set velocity offset.
 
bool getVelocityOffset (int32_t &offset) noexcept
 Read velocity offset.
 
bool setVelocityLoopGains (uint16_t p, uint16_t i) noexcept
 Configure velocity PI gains.
 
bool setVelocityNormalization (tmc9660::tmcl::VelocityPiNorm pNorm, tmc9660::tmcl::VelocityPiNorm iNorm) noexcept
 Set velocity PI normalization.
 
bool getVelocityPiIntegrator (int32_t &integrator) noexcept
 Read velocity-PI integrator.
 
bool getVelocityPiError (int32_t &error) noexcept
 Read velocity-PI error.
 
bool setVelocityScalingFactor (uint16_t factor) noexcept
 Set velocity scaling factor.
 
bool getVelocityScalingFactor (uint16_t &factor) noexcept
 Read velocity scaling factor.
 
bool setStopOnVelocityDeviation (uint32_t maxError, bool softStop=true) noexcept
 Configure stop-on-velocity-deviation.
 
bool getStopOnVelocityDeviation (uint32_t &maxError, bool &softStop) noexcept
 Read stop-on-velocity-deviation settings.
 
bool setVelocityLoopDownsampling (uint8_t divider) noexcept
 Set velocity loop downsampling.
 
bool getVelocityLoopDownsampling (uint8_t &divider) noexcept
 Read velocity loop downsampling.
 
bool setVelocityReachedThreshold (uint32_t threshold) noexcept
 Set velocity reached threshold.
 
bool getVelocityReachedThreshold (uint32_t &threshold) noexcept
 Read velocity reached threshold.
 
bool setVelocityMeterSwitchThreshold (uint32_t threshold) noexcept
 Set velocity meter switch threshold.
 
bool getVelocityMeterSwitchThreshold (uint32_t &threshold) noexcept
 Read velocity meter switch threshold.
 
bool setVelocityMeterSwitchHysteresis (uint16_t hysteresis) noexcept
 Set velocity meter hysteresis.
 
bool getVelocityMeterSwitchHysteresis (uint16_t &hysteresis) noexcept
 Read velocity meter hysteresis.
 
bool getVelocityMeterMode (tmc9660::tmcl::VelocityMeterMode &mode) noexcept
 Read current velocity meter mode.
 
bool setPositionSensor (tmc9660::tmcl::PositionSensorSelection sel) noexcept
 Select position feedback sensor.
 
bool getPositionSensor (tmc9660::tmcl::PositionSensorSelection &sel) noexcept
 Read position feedback sensor.
 
bool setTargetPosition (int32_t position) noexcept
 Set target position.
 
bool getActualPosition (int32_t &position) noexcept
 Read actual position.
 
bool setPositionScalingFactor (uint16_t factor) noexcept
 Set position scaling factor.
 
bool getPositionScalingFactor (uint16_t &factor) noexcept
 Read position scaling factor.
 
bool setPositionLoopGains (uint16_t p, uint16_t i) noexcept
 Configure position PI gains.
 
bool setPositionNormalization (tmc9660::tmcl::VelocityPiNorm pNorm, tmc9660::tmcl::VelocityPiNorm iNorm) noexcept
 Set position PI normalization.
 
bool getPositionPiIntegrator (int32_t &integrator) noexcept
 Read position-PI integrator.
 
bool getPositionPiError (int32_t &error) noexcept
 Read position-PI error.
 
bool setStopOnPositionDeviation (uint32_t maxError, bool softStop=true) noexcept
 Configure stop-on-position-deviation.
 
bool getStopOnPositionDeviation (uint32_t &maxError, bool &softStop) noexcept
 Read stop-on-position-deviation settings.
 
bool setPositionLoopDownsampling (uint8_t divider) noexcept
 Set position loop downsampling.
 
bool getPositionLoopDownsampling (uint8_t &divider) noexcept
 Read position loop downsampling.
 
bool setPositionLimitLow (int32_t limit) noexcept
 Set low position limit.
 
bool getPositionLimitLow (int32_t &limit) noexcept
 Read low position limit.
 
bool setPositionLimitHigh (int32_t limit) noexcept
 Set high position limit.
 
bool getPositionLimitHigh (int32_t &limit) noexcept
 Read high position limit.
 
bool setPositionReachedThreshold (uint32_t threshold) noexcept
 Set position reached threshold.
 
bool getPositionReachedThreshold (uint32_t &threshold) noexcept
 Read position reached threshold.
 
bool getOpenloopAngle (int16_t &angle) noexcept
 Read open-loop angle.
 
bool setOpenloopCurrent (uint16_t milliamps) noexcept
 Set open-loop current.
 
bool getOpenloopCurrent (uint16_t &milliamps) noexcept
 Read open-loop current.
 
bool setOpenloopVoltage (uint16_t voltage) noexcept
 Set open-loop voltage.
 
bool getOpenloopVoltage (uint16_t &voltage) noexcept
 Read open-loop voltage.
 
bool setReferenceSwitchEnable (tmc9660::tmcl::ReferenceSwitchEnable enable) noexcept
 Enable/disable reference switch stops.
 
bool getReferenceSwitchEnable (tmc9660::tmcl::ReferenceSwitchEnable &enable) noexcept
 Read reference switch enable mask.
 
bool setReferenceSwitchPolaritySwap (tmc9660::tmcl::ReferenceSwitchPolaritySwap config) noexcept
 Configure switch polarity and swap.
 
bool getReferenceSwitchPolaritySwap (tmc9660::tmcl::ReferenceSwitchPolaritySwap &config) noexcept
 Read switch polarity/swap config.
 
bool setReferenceSwitchLatchSettings (tmc9660::tmcl::ReferenceSwitchLatchSettings setting) noexcept
 Configure switch latch settings.
 
bool getReferenceSwitchLatchSettings (tmc9660::tmcl::ReferenceSwitchLatchSettings &setting) noexcept
 Read switch latch settings.
 
bool setEventStopSettings (tmc9660::tmcl::EventStopSettings settings) noexcept
 Configure event-stop settings.
 
bool getEventStopSettings (tmc9660::tmcl::EventStopSettings &settings) noexcept
 Read event-stop settings.
 
bool setReferenceSwitchSearchMode (tmc9660::tmcl::ReferenceSwitchSearchMode mode) noexcept
 Set reference search mode.
 
bool getReferenceSwitchSearchMode (tmc9660::tmcl::ReferenceSwitchSearchMode &mode) noexcept
 Read reference search mode.
 
bool setReferenceSwitchSearchSpeed (int32_t speed) noexcept
 Set reference search speed.
 
bool getReferenceSwitchSearchSpeed (int32_t &speed) noexcept
 Read reference search speed.
 
bool setReferenceSwitchSpeed (int32_t speed) noexcept
 Set reference positioning speed.
 
bool getReferenceSwitchSpeed (int32_t &speed) noexcept
 Read reference positioning speed.
 
bool getRightLimitSwitchPosition (int32_t &position) noexcept
 Read right-limit-switch position.
 
bool getHomeSwitchPosition (int32_t &position) noexcept
 Read home-switch position.
 
bool getLastReferencePosition (int32_t &position) noexcept
 Read last reference position.
 
Raw Inputs (read-only)
bool getMccInputsRaw (uint16_t &inputs) noexcept
 
Intermediate FOC Voltages (read-only)
bool getFocVoltageUx (int16_t &voltage) noexcept
 
bool getFocVoltageWy (int16_t &voltage) noexcept
 
bool getFocVoltageV (int16_t &voltage) noexcept
 
bool getFocVoltageUq (int16_t &voltage) noexcept
 
Field-weakening (read/write)
bool setFieldWeakeningI (uint16_t milliamps) noexcept
 
bool getFieldWeakeningI (uint16_t &milliamps) noexcept
 
bool setFieldWeakeningVoltageThreshold (uint16_t voltage) noexcept
 
bool getFieldWeakeningVoltageThreshold (uint16_t &voltage) noexcept
 
Intermediate FOC Currents (read-only)
bool getFocCurrentUx (int16_t &milliamps) noexcept
 
bool getFocCurrentV (int16_t &milliamps) noexcept
 
bool getFocCurrentWy (int16_t &milliamps) noexcept
 
bool getFocCurrentIq (int16_t &milliamps) noexcept
 
Target Torque Biquad Filter (read/write)
bool setTargetTorqueBiquadFilterEnable (bool enable) noexcept
 
bool getTargetTorqueBiquadFilterEnable (bool &enable) noexcept
 
bool setTargetTorqueBiquadFilterACoeff1 (int32_t coeff) noexcept
 
bool getTargetTorqueBiquadFilterACoeff1 (int32_t &coeff) noexcept
 
bool setTargetTorqueBiquadFilterACoeff2 (int32_t coeff) noexcept
 
bool getTargetTorqueBiquadFilterACoeff2 (int32_t &coeff) noexcept
 
bool setTargetTorqueBiquadFilterBCoeff0 (int32_t coeff) noexcept
 
bool getTargetTorqueBiquadFilterBCoeff0 (int32_t &coeff) noexcept
 
bool setTargetTorqueBiquadFilterBCoeff1 (int32_t coeff) noexcept
 
bool getTargetTorqueBiquadFilterBCoeff1 (int32_t &coeff) noexcept
 
bool setTargetTorqueBiquadFilterBCoeff2 (int32_t coeff) noexcept
 
bool getTargetTorqueBiquadFilterBCoeff2 (int32_t &coeff) noexcept
 
Actual Velocity Biquad Filter (read/write)
bool setActualVelocityBiquadFilterEnable (bool enable) noexcept
 
bool getActualVelocityBiquadFilterEnable (bool &enable) noexcept
 
bool setActualVelocityBiquadFilterACoeff1 (int32_t coeff) noexcept
 
bool getActualVelocityBiquadFilterACoeff1 (int32_t &coeff) noexcept
 
bool setActualVelocityBiquadFilterACoeff2 (int32_t coeff) noexcept
 
bool getActualVelocityBiquadFilterACoeff2 (int32_t &coeff) noexcept
 
bool setActualVelocityBiquadFilterBCoeff0 (int32_t coeff) noexcept
 
bool getActualVelocityBiquadFilterBCoeff0 (int32_t &coeff) noexcept
 
bool setActualVelocityBiquadFilterBCoeff1 (int32_t coeff) noexcept
 
bool getActualVelocityBiquadFilterBCoeff1 (int32_t &coeff) noexcept
 
bool setActualVelocityBiquadFilterBCoeff2 (int32_t coeff) noexcept
 
bool getActualVelocityBiquadFilterBCoeff2 (int32_t &coeff) noexcept
 
Combined & integrated raw measurements (read-only)
bool getTorqueFluxCombinedTargetValues (uint32_t &value) noexcept
 
bool getTorqueFluxCombinedActualValues (uint32_t &value) noexcept
 
bool getVoltageDqCombinedActualValues (uint32_t &value) noexcept
 
bool getIntegratedActualTorqueValue (uint32_t &value) noexcept
 
bool getIntegratedActualVelocityValue (uint32_t &value) noexcept
 

Private Member Functions

 FOCControl (TMC9660 &parent) noexcept
 

Private Attributes

TMC9660driver
 

Friends

class TMC9660
 

Detailed Description

Subsystem for FOC control: torque/flux, velocity, position loops, open‐loop support, and reference switch / stop-event parameters.

Covers TMCL parameters:

  • Torque/Flux PI (104–120)
  • Velocity PI (123–139)
  • Position PI (142–157)
  • Open‐loop (45–47)
  • Ref switch & stop (161–170)

Constructor & Destructor Documentation

◆ FOCControl()

TMC9660::FOCControl::FOCControl ( TMC9660 parent)
inlineexplicitprivatenoexcept

Member Function Documentation

◆ getActualFlux()

bool TMC9660::FOCControl::getActualFlux ( int32_t &  milliamps)
noexcept

Read actual flux current.

Parameters
[out]milliampsActual flux in mA.
Returns
true if read.

◆ getActualPosition()

bool TMC9660::FOCControl::getActualPosition ( int32_t &  position)
noexcept

Read actual position.

Parameters
[out]positionMeasured position.
Returns
true if read.

◆ getActualTorque()

bool TMC9660::FOCControl::getActualTorque ( int16_t &  milliamps)
noexcept

Read actual torque.

Parameters
[out]milliampsActual torque in mA.
Returns
true if read.

◆ getActualVelocity()

bool TMC9660::FOCControl::getActualVelocity ( int32_t &  velocity)
noexcept

Read actual velocity.

Parameters
[out]velocityMeasured velocity.
Returns
true if read.

◆ getActualVelocityBiquadFilterACoeff1()

bool TMC9660::FOCControl::getActualVelocityBiquadFilterACoeff1 ( int32_t &  coeff)
noexcept

◆ getActualVelocityBiquadFilterACoeff2()

bool TMC9660::FOCControl::getActualVelocityBiquadFilterACoeff2 ( int32_t &  coeff)
noexcept

◆ getActualVelocityBiquadFilterBCoeff0()

bool TMC9660::FOCControl::getActualVelocityBiquadFilterBCoeff0 ( int32_t &  coeff)
noexcept

◆ getActualVelocityBiquadFilterBCoeff1()

bool TMC9660::FOCControl::getActualVelocityBiquadFilterBCoeff1 ( int32_t &  coeff)
noexcept

◆ getActualVelocityBiquadFilterBCoeff2()

bool TMC9660::FOCControl::getActualVelocityBiquadFilterBCoeff2 ( int32_t &  coeff)
noexcept

◆ getActualVelocityBiquadFilterEnable()

bool TMC9660::FOCControl::getActualVelocityBiquadFilterEnable ( bool &  enable)
noexcept

◆ getEventStopSettings()

bool TMC9660::FOCControl::getEventStopSettings ( tmc9660::tmcl::EventStopSettings settings)
noexcept

Read event-stop settings.

Parameters
[out]settingsStop conditions.
Returns
true if read.

◆ getFieldWeakeningI()

bool TMC9660::FOCControl::getFieldWeakeningI ( uint16_t &  milliamps)
noexcept

◆ getFieldWeakeningVoltageThreshold()

bool TMC9660::FOCControl::getFieldWeakeningVoltageThreshold ( uint16_t &  voltage)
noexcept

◆ getFluxOffset()

bool TMC9660::FOCControl::getFluxOffset ( int16_t &  milliamps)
noexcept

Read flux offset.

Parameters
[out]milliampsOffset in mA.
Returns
true if read.

◆ getFluxPiError()

bool TMC9660::FOCControl::getFluxPiError ( int32_t &  error)
noexcept

Read flux PI error.

Parameters
[out]errorCurrent flux-PI error.
Returns
true if read.

◆ getFluxPiIntegrator()

bool TMC9660::FOCControl::getFluxPiIntegrator ( int32_t &  integrator)
noexcept

Read flux-PI integrator state.

Parameters
[out]integratorIntegrator value.
Returns
true if read.

◆ getFocCurrentIq()

bool TMC9660::FOCControl::getFocCurrentIq ( int16_t &  milliamps)
noexcept

◆ getFocCurrentUx()

bool TMC9660::FOCControl::getFocCurrentUx ( int16_t &  milliamps)
noexcept

◆ getFocCurrentV()

bool TMC9660::FOCControl::getFocCurrentV ( int16_t &  milliamps)
noexcept

◆ getFocCurrentWy()

bool TMC9660::FOCControl::getFocCurrentWy ( int16_t &  milliamps)
noexcept

◆ getFocVoltageUq()

bool TMC9660::FOCControl::getFocVoltageUq ( int16_t &  voltage)
noexcept

◆ getFocVoltageUx()

bool TMC9660::FOCControl::getFocVoltageUx ( int16_t &  voltage)
noexcept

◆ getFocVoltageV()

bool TMC9660::FOCControl::getFocVoltageV ( int16_t &  voltage)
noexcept

◆ getFocVoltageWy()

bool TMC9660::FOCControl::getFocVoltageWy ( int16_t &  voltage)
noexcept

◆ getHomeSwitchPosition()

bool TMC9660::FOCControl::getHomeSwitchPosition ( int32_t &  position)
noexcept

Read home-switch position.

Parameters
[out]positionPosition value.
Returns
true if read.

◆ getIntegratedActualTorqueValue()

bool TMC9660::FOCControl::getIntegratedActualTorqueValue ( uint32_t &  value)
noexcept

◆ getIntegratedActualVelocityValue()

bool TMC9660::FOCControl::getIntegratedActualVelocityValue ( uint32_t &  value)
noexcept

◆ getLastReferencePosition()

bool TMC9660::FOCControl::getLastReferencePosition ( int32_t &  position)
noexcept

Read last reference position.

Parameters
[out]positionPosition value.
Returns
true if read.

◆ getMccInputsRaw()

bool TMC9660::FOCControl::getMccInputsRaw ( uint16_t &  inputs)
noexcept

◆ getOpenloopAngle()

bool TMC9660::FOCControl::getOpenloopAngle ( int16_t &  angle)
noexcept

Read open-loop angle.

Parameters
[out]angleElectrical angle.
Returns
true if read.

◆ getOpenloopCurrent()

bool TMC9660::FOCControl::getOpenloopCurrent ( uint16_t &  milliamps)
noexcept

Read open-loop current.

Parameters
[out]milliampsCurrent in mA.
Returns
true if read.

◆ getOpenloopVoltage()

bool TMC9660::FOCControl::getOpenloopVoltage ( uint16_t &  voltage)
noexcept

Read open-loop voltage.

Parameters
[out]voltageVoltage unit.
Returns
true if read.

◆ getPositionLimitHigh()

bool TMC9660::FOCControl::getPositionLimitHigh ( int32_t &  limit)
noexcept

Read high position limit.

Parameters
[out]limitMaximum allowed position.
Returns
true if read.

◆ getPositionLimitLow()

bool TMC9660::FOCControl::getPositionLimitLow ( int32_t &  limit)
noexcept

Read low position limit.

Parameters
[out]limitMinimum allowed position.
Returns
true if read.

◆ getPositionLoopDownsampling()

bool TMC9660::FOCControl::getPositionLoopDownsampling ( uint8_t &  divider)
noexcept

Read position loop downsampling.

Parameters
[out]dividerFactor.
Returns
true if read.

◆ getPositionPiError()

bool TMC9660::FOCControl::getPositionPiError ( int32_t &  error)
noexcept

Read position-PI error.

Parameters
[out]errorPI error.
Returns
true if read.

◆ getPositionPiIntegrator()

bool TMC9660::FOCControl::getPositionPiIntegrator ( int32_t &  integrator)
noexcept

Read position-PI integrator.

Parameters
[out]integratorIntegrator value.
Returns
true if read.

◆ getPositionReachedThreshold()

bool TMC9660::FOCControl::getPositionReachedThreshold ( uint32_t &  threshold)
noexcept

Read position reached threshold.

Parameters
[out]thresholdLatch threshold.
Returns
true if read.

◆ getPositionScalingFactor()

bool TMC9660::FOCControl::getPositionScalingFactor ( uint16_t &  factor)
noexcept

Read position scaling factor.

Parameters
[out]factorScale factor.
Returns
true if read.

◆ getPositionSensor()

bool TMC9660::FOCControl::getPositionSensor ( tmc9660::tmcl::PositionSensorSelection sel)
noexcept

Read position feedback sensor.

Parameters
[out]selSensor selection.
Returns
true if read.

◆ getReferenceSwitchEnable()

bool TMC9660::FOCControl::getReferenceSwitchEnable ( tmc9660::tmcl::ReferenceSwitchEnable enable)
noexcept

Read reference switch enable mask.

Parameters
[out]enableMask.
Returns
true if read.

◆ getReferenceSwitchLatchSettings()

bool TMC9660::FOCControl::getReferenceSwitchLatchSettings ( tmc9660::tmcl::ReferenceSwitchLatchSettings setting)
noexcept

Read switch latch settings.

Parameters
[out]settingLatch behavior.
Returns
true if read.

◆ getReferenceSwitchPolaritySwap()

bool TMC9660::FOCControl::getReferenceSwitchPolaritySwap ( tmc9660::tmcl::ReferenceSwitchPolaritySwap config)
noexcept

Read switch polarity/swap config.

Parameters
[out]configConfig.
Returns
true if read.

◆ getReferenceSwitchSearchMode()

bool TMC9660::FOCControl::getReferenceSwitchSearchMode ( tmc9660::tmcl::ReferenceSwitchSearchMode mode)
noexcept

Read reference search mode.

Parameters
[out]modeSearch sequence.
Returns
true if read.

◆ getReferenceSwitchSearchSpeed()

bool TMC9660::FOCControl::getReferenceSwitchSearchSpeed ( int32_t &  speed)
noexcept

Read reference search speed.

Parameters
[out]speedSearch velocity.
Returns
true if read.

◆ getReferenceSwitchSpeed()

bool TMC9660::FOCControl::getReferenceSwitchSpeed ( int32_t &  speed)
noexcept

Read reference positioning speed.

Parameters
[out]speedApproach speed.
Returns
true if read.

◆ getRightLimitSwitchPosition()

bool TMC9660::FOCControl::getRightLimitSwitchPosition ( int32_t &  position)
noexcept

Read right-limit-switch position.

Parameters
[out]positionPosition value.
Returns
true if read.

◆ getStopOnPositionDeviation()

bool TMC9660::FOCControl::getStopOnPositionDeviation ( uint32_t &  maxError,
bool &  softStop 
)
noexcept

Read stop-on-position-deviation settings.

Parameters
[out]maxErrorConfigured max deviation.
[out]softStopSoft/hard stop flag.
Returns
true if read.

◆ getStopOnVelocityDeviation()

bool TMC9660::FOCControl::getStopOnVelocityDeviation ( uint32_t &  maxError,
bool &  softStop 
)
noexcept

Read stop-on-velocity-deviation settings.

Parameters
[out]maxErrorConfigured max deviation.
[out]softStopSoft/hard stop flag.
Returns
true if read.

◆ getTargetTorqueBiquadFilterACoeff1()

bool TMC9660::FOCControl::getTargetTorqueBiquadFilterACoeff1 ( int32_t &  coeff)
noexcept

◆ getTargetTorqueBiquadFilterACoeff2()

bool TMC9660::FOCControl::getTargetTorqueBiquadFilterACoeff2 ( int32_t &  coeff)
noexcept

◆ getTargetTorqueBiquadFilterBCoeff0()

bool TMC9660::FOCControl::getTargetTorqueBiquadFilterBCoeff0 ( int32_t &  coeff)
noexcept

◆ getTargetTorqueBiquadFilterBCoeff1()

bool TMC9660::FOCControl::getTargetTorqueBiquadFilterBCoeff1 ( int32_t &  coeff)
noexcept

◆ getTargetTorqueBiquadFilterBCoeff2()

bool TMC9660::FOCControl::getTargetTorqueBiquadFilterBCoeff2 ( int32_t &  coeff)
noexcept

◆ getTargetTorqueBiquadFilterEnable()

bool TMC9660::FOCControl::getTargetTorqueBiquadFilterEnable ( bool &  enable)
noexcept

◆ getTorqueFluxCombinedActualValues()

bool TMC9660::FOCControl::getTorqueFluxCombinedActualValues ( uint32_t &  value)
noexcept

◆ getTorqueFluxCombinedTargetValues()

bool TMC9660::FOCControl::getTorqueFluxCombinedTargetValues ( uint32_t &  value)
noexcept

◆ getTorqueOffset()

bool TMC9660::FOCControl::getTorqueOffset ( int16_t &  milliamps)
noexcept

Read torque offset.

Parameters
[out]milliampsOffset in mA.
Returns
true if read.

◆ getTorquePiError()

bool TMC9660::FOCControl::getTorquePiError ( int32_t &  error)
noexcept

Read torque PI error.

Parameters
[out]errorCurrent torque-PI error.
Returns
true if read.

◆ getTorquePiIntegrator()

bool TMC9660::FOCControl::getTorquePiIntegrator ( int32_t &  integrator)
noexcept

Read torque-PI integrator state.

Parameters
[out]integratorIntegrator value.
Returns
true if read.

◆ getVelocityLoopDownsampling()

bool TMC9660::FOCControl::getVelocityLoopDownsampling ( uint8_t &  divider)
noexcept

Read velocity loop downsampling.

Parameters
[out]dividerFactor.
Returns
true if read.

◆ getVelocityMeterMode()

bool TMC9660::FOCControl::getVelocityMeterMode ( tmc9660::tmcl::VelocityMeterMode mode)
noexcept

Read current velocity meter mode.

Parameters
[out]modeCurrent mode.
Returns
true if read.

◆ getVelocityMeterSwitchHysteresis()

bool TMC9660::FOCControl::getVelocityMeterSwitchHysteresis ( uint16_t &  hysteresis)
noexcept

Read velocity meter hysteresis.

Parameters
[out]hysteresisHysteresis.
Returns
true if read.

◆ getVelocityMeterSwitchThreshold()

bool TMC9660::FOCControl::getVelocityMeterSwitchThreshold ( uint32_t &  threshold)
noexcept

Read velocity meter switch threshold.

Parameters
[out]thresholdThreshold.
Returns
true if read.

◆ getVelocityOffset()

bool TMC9660::FOCControl::getVelocityOffset ( int32_t &  offset)
noexcept

Read velocity offset.

Parameters
[out]offsetOffset in RPM.
Returns
true if read.

◆ getVelocityPiError()

bool TMC9660::FOCControl::getVelocityPiError ( int32_t &  error)
noexcept

Read velocity-PI error.

Parameters
[out]errorPI error.
Returns
true if read.

◆ getVelocityPiIntegrator()

bool TMC9660::FOCControl::getVelocityPiIntegrator ( int32_t &  integrator)
noexcept

Read velocity-PI integrator.

Parameters
[out]integratorIntegrator value.
Returns
true if read.

◆ getVelocityReachedThreshold()

bool TMC9660::FOCControl::getVelocityReachedThreshold ( uint32_t &  threshold)
noexcept

Read velocity reached threshold.

Parameters
[out]thresholdThreshold.
Returns
true if read.

◆ getVelocityScalingFactor()

bool TMC9660::FOCControl::getVelocityScalingFactor ( uint16_t &  factor)
noexcept

Read velocity scaling factor.

Parameters
[out]factorScale factor.
Returns
true if read.

◆ getVelocitySensor()

bool TMC9660::FOCControl::getVelocitySensor ( tmc9660::tmcl::VelocitySensorSelection sel)
noexcept

Read velocity feedback sensor.

Parameters
[out]selSensor selection.
Returns
true if read.

◆ getVoltageDqCombinedActualValues()

bool TMC9660::FOCControl::getVoltageDqCombinedActualValues ( uint32_t &  value)
noexcept

◆ setActualVelocityBiquadFilterACoeff1()

bool TMC9660::FOCControl::setActualVelocityBiquadFilterACoeff1 ( int32_t  coeff)
noexcept

◆ setActualVelocityBiquadFilterACoeff2()

bool TMC9660::FOCControl::setActualVelocityBiquadFilterACoeff2 ( int32_t  coeff)
noexcept

◆ setActualVelocityBiquadFilterBCoeff0()

bool TMC9660::FOCControl::setActualVelocityBiquadFilterBCoeff0 ( int32_t  coeff)
noexcept

◆ setActualVelocityBiquadFilterBCoeff1()

bool TMC9660::FOCControl::setActualVelocityBiquadFilterBCoeff1 ( int32_t  coeff)
noexcept

◆ setActualVelocityBiquadFilterBCoeff2()

bool TMC9660::FOCControl::setActualVelocityBiquadFilterBCoeff2 ( int32_t  coeff)
noexcept

◆ setActualVelocityBiquadFilterEnable()

bool TMC9660::FOCControl::setActualVelocityBiquadFilterEnable ( bool  enable)
noexcept

◆ setCurrentLoopGains()

bool TMC9660::FOCControl::setCurrentLoopGains ( uint16_t  p,
uint16_t  i,
bool  separate = false,
uint16_t  fluxP = 0,
uint16_t  fluxI = 0 
)
noexcept

Configure current-loop PI gains.

Parameters
pProportional gain for torque (and flux if not separate).
iIntegral gain for torque (and flux if not separate).
separatetrue to use separate flux gains.
fluxPProportional gain for flux loop.
fluxIIntegral gain for flux loop.
Returns
true if written.

◆ setCurrentNormalization()

bool TMC9660::FOCControl::setCurrentNormalization ( tmc9660::tmcl::CurrentPiNormalization  pNorm,
tmc9660::tmcl::CurrentPiNormalization  iNorm 
)
noexcept

Set normalization for current-PI outputs.

Parameters
pNormNormalization for P-term.
iNormNormalization for I-term.
Returns
true if written.

◆ setEventStopSettings()

bool TMC9660::FOCControl::setEventStopSettings ( tmc9660::tmcl::EventStopSettings  settings)
noexcept

Configure event-stop settings.

Parameters
settingsStop conditions.
Returns
true if written.

◆ setFieldWeakeningI()

bool TMC9660::FOCControl::setFieldWeakeningI ( uint16_t  milliamps)
noexcept

◆ setFieldWeakeningVoltageThreshold()

bool TMC9660::FOCControl::setFieldWeakeningVoltageThreshold ( uint16_t  voltage)
noexcept

◆ setFluxOffset()

bool TMC9660::FOCControl::setFluxOffset ( int16_t  milliamps)
noexcept

Set flux offset (feed-forward).

Parameters
milliampsOffset in mA.
Returns
true if written.

◆ setOpenloopCurrent()

bool TMC9660::FOCControl::setOpenloopCurrent ( uint16_t  milliamps)
noexcept

Set open-loop current.

Parameters
milliampsCurrent in mA.
Returns
true if written.

◆ setOpenloopVoltage()

bool TMC9660::FOCControl::setOpenloopVoltage ( uint16_t  voltage)
noexcept

Set open-loop voltage.

Parameters
voltageVoltage unit (0…32767).
Returns
true if written.

◆ setPositionLimitHigh()

bool TMC9660::FOCControl::setPositionLimitHigh ( int32_t  limit)
noexcept

Set high position limit.

Parameters
limitMaximum allowed position.
Returns
true if written.

◆ setPositionLimitLow()

bool TMC9660::FOCControl::setPositionLimitLow ( int32_t  limit)
noexcept

Set low position limit.

Parameters
limitMinimum allowed position.
Returns
true if written.

◆ setPositionLoopDownsampling()

bool TMC9660::FOCControl::setPositionLoopDownsampling ( uint8_t  divider)
noexcept

Set position loop downsampling.

Parameters
dividerDownsample factor.
Returns
true if written.

◆ setPositionLoopGains()

bool TMC9660::FOCControl::setPositionLoopGains ( uint16_t  p,
uint16_t  i 
)
noexcept

Configure position PI gains.

Parameters
pP gain.
iI gain.
Returns
true if written.

◆ setPositionNormalization()

bool TMC9660::FOCControl::setPositionNormalization ( tmc9660::tmcl::VelocityPiNorm  pNorm,
tmc9660::tmcl::VelocityPiNorm  iNorm 
)
noexcept

Set position PI normalization.

Parameters
pNormP-term norm.
iNormI-term norm.
Returns
true if written.

◆ setPositionReachedThreshold()

bool TMC9660::FOCControl::setPositionReachedThreshold ( uint32_t  threshold)
noexcept

Set position reached threshold.

Parameters
thresholdLatch threshold.
Returns
true if written.

◆ setPositionScalingFactor()

bool TMC9660::FOCControl::setPositionScalingFactor ( uint16_t  factor)
noexcept

Set position scaling factor.

Parameters
factorScale factor.
Returns
true if written.

◆ setPositionSensor()

bool TMC9660::FOCControl::setPositionSensor ( tmc9660::tmcl::PositionSensorSelection  sel)
noexcept

Select position feedback sensor.

Parameters
selSensor selection.
Returns
true if written.

◆ setReferenceSwitchEnable()

bool TMC9660::FOCControl::setReferenceSwitchEnable ( tmc9660::tmcl::ReferenceSwitchEnable  enable)
noexcept

Enable/disable reference switch stops.

Parameters
enableBitmask of switch stops.
Returns
true if written.

◆ setReferenceSwitchLatchSettings()

bool TMC9660::FOCControl::setReferenceSwitchLatchSettings ( tmc9660::tmcl::ReferenceSwitchLatchSettings  setting)
noexcept

Configure switch latch settings.

Parameters
settingLatch behavior.
Returns
true if written.

◆ setReferenceSwitchPolaritySwap()

bool TMC9660::FOCControl::setReferenceSwitchPolaritySwap ( tmc9660::tmcl::ReferenceSwitchPolaritySwap  config)
noexcept

Configure switch polarity and swap.

Parameters
configPolarity/swap config.
Returns
true if written.

◆ setReferenceSwitchSearchMode()

bool TMC9660::FOCControl::setReferenceSwitchSearchMode ( tmc9660::tmcl::ReferenceSwitchSearchMode  mode)
noexcept

Set reference search mode.

Parameters
modeSearch sequence.
Returns
true if written.

◆ setReferenceSwitchSearchSpeed()

bool TMC9660::FOCControl::setReferenceSwitchSearchSpeed ( int32_t  speed)
noexcept

Set reference search speed.

Parameters
speedSearch velocity.
Returns
true if written.

◆ setReferenceSwitchSpeed()

bool TMC9660::FOCControl::setReferenceSwitchSpeed ( int32_t  speed)
noexcept

Set reference positioning speed.

Parameters
speedApproach speed.
Returns
true if written.

◆ setStopOnPositionDeviation()

bool TMC9660::FOCControl::setStopOnPositionDeviation ( uint32_t  maxError,
bool  softStop = true 
)
noexcept

Configure stop-on-position-deviation.

Parameters
maxErrorMax allowed deviation.
softStoptrue for ramp down, false for hard stop.
Returns
true if written.

◆ setStopOnVelocityDeviation()

bool TMC9660::FOCControl::setStopOnVelocityDeviation ( uint32_t  maxError,
bool  softStop = true 
)
noexcept

Configure stop-on-velocity-deviation.

Parameters
maxErrorMax allowed deviation.
softStoptrue for ramp down, false for hard stop.
Returns
true if written.

◆ setTargetFlux()

bool TMC9660::FOCControl::setTargetFlux ( int16_t  milliamps)
noexcept

Set desired flux current.

Parameters
milliampsTarget flux in mA.
Returns
true if written.

◆ setTargetPosition()

bool TMC9660::FOCControl::setTargetPosition ( int32_t  position)
noexcept

Set target position.

Parameters
positionDesired position (internal units).
Returns
true if written.

◆ setTargetTorque()

bool TMC9660::FOCControl::setTargetTorque ( int16_t  milliamps)
noexcept

Set desired torque.

Parameters
milliampsTarget torque in mA.
Returns
true if written.

◆ setTargetTorqueBiquadFilterACoeff1()

bool TMC9660::FOCControl::setTargetTorqueBiquadFilterACoeff1 ( int32_t  coeff)
noexcept

◆ setTargetTorqueBiquadFilterACoeff2()

bool TMC9660::FOCControl::setTargetTorqueBiquadFilterACoeff2 ( int32_t  coeff)
noexcept

◆ setTargetTorqueBiquadFilterBCoeff0()

bool TMC9660::FOCControl::setTargetTorqueBiquadFilterBCoeff0 ( int32_t  coeff)
noexcept

◆ setTargetTorqueBiquadFilterBCoeff1()

bool TMC9660::FOCControl::setTargetTorqueBiquadFilterBCoeff1 ( int32_t  coeff)
noexcept

◆ setTargetTorqueBiquadFilterBCoeff2()

bool TMC9660::FOCControl::setTargetTorqueBiquadFilterBCoeff2 ( int32_t  coeff)
noexcept

◆ setTargetTorqueBiquadFilterEnable()

bool TMC9660::FOCControl::setTargetTorqueBiquadFilterEnable ( bool  enable)
noexcept

◆ setTargetVelocity()

bool TMC9660::FOCControl::setTargetVelocity ( int32_t  velocity)
noexcept

Set target velocity.

Parameters
velocityTarget velocity (internal units).
Returns
true if written.

◆ setTorqueFluxPiSeparation()

bool TMC9660::FOCControl::setTorqueFluxPiSeparation ( tmc9660::tmcl::TorqueFluxPiSeparation  sep)
noexcept

Select combined or separate torque/flux PI parameters.

Parameters
sepSeparation mode.
Returns
true if written.

◆ setTorqueOffset()

bool TMC9660::FOCControl::setTorqueOffset ( int16_t  milliamps)
noexcept

Set torque offset (feed-forward).

Parameters
milliampsOffset in mA.
Returns
true if written.

◆ setVelocityLoopDownsampling()

bool TMC9660::FOCControl::setVelocityLoopDownsampling ( uint8_t  divider)
noexcept

Set velocity loop downsampling.

Parameters
dividerDownsample factor.
Returns
true if written.

◆ setVelocityLoopGains()

bool TMC9660::FOCControl::setVelocityLoopGains ( uint16_t  p,
uint16_t  i 
)
noexcept

Configure velocity PI gains.

Parameters
pP gain.
iI gain.
Returns
true if written.

◆ setVelocityMeterSwitchHysteresis()

bool TMC9660::FOCControl::setVelocityMeterSwitchHysteresis ( uint16_t  hysteresis)
noexcept

Set velocity meter hysteresis.

Parameters
hysteresisHysteresis value.
Returns
true if written.

◆ setVelocityMeterSwitchThreshold()

bool TMC9660::FOCControl::setVelocityMeterSwitchThreshold ( uint32_t  threshold)
noexcept

Set velocity meter switch threshold.

Parameters
thresholdThreshold value.
Returns
true if written.

◆ setVelocityNormalization()

bool TMC9660::FOCControl::setVelocityNormalization ( tmc9660::tmcl::VelocityPiNorm  pNorm,
tmc9660::tmcl::VelocityPiNorm  iNorm 
)
noexcept

Set velocity PI normalization.

Parameters
pNormP-term norm.
iNormI-term norm.
Returns
true if written.

◆ setVelocityOffset()

bool TMC9660::FOCControl::setVelocityOffset ( int32_t  offset)
noexcept

Set velocity offset.

Parameters
offsetOffset in RPM.
Returns
true if written.

◆ setVelocityReachedThreshold()

bool TMC9660::FOCControl::setVelocityReachedThreshold ( uint32_t  threshold)
noexcept

Set velocity reached threshold.

Parameters
thresholdThreshold value.
Returns
true if written.

◆ setVelocityScalingFactor()

bool TMC9660::FOCControl::setVelocityScalingFactor ( uint16_t  factor)
noexcept

Set velocity scaling factor.

Parameters
factorScale factor.
Returns
true if written.

◆ setVelocitySensor()

bool TMC9660::FOCControl::setVelocitySensor ( tmc9660::tmcl::VelocitySensorSelection  sel)
noexcept

Select velocity feedback sensor.

Parameters
selSensor selection.
Returns
true if written.

◆ stop()

bool TMC9660::FOCControl::stop ( )
noexcept

Stop torque/flux control (SYSTEM_OFF).

Returns
true on success.

Friends And Related Symbol Documentation

◆ TMC9660

friend class TMC9660
friend

Member Data Documentation

◆ driver

TMC9660& TMC9660::FOCControl::driver
private

The documentation for this struct was generated from the following files: