Motion Master 6.0.0-alpha.86
Next-generation motion control software
Loading...
Searching...
No Matches
mm::node::Cia402Drive Class Reference

Borrowed view of a CiA402 drive — the device control state machine, operation modes, and the standard cyclic setpoints, expressed over a Device's parameter access. More...

#include <cia402_drive.h>

Inheritance diagram for mm::node::Cia402Drive:
[legend]
Collaboration diagram for mm::node::Cia402Drive:
[legend]

Public Member Functions

 Cia402Drive (Device &device)
 Binds an (unchecked) CiA402 view to device. Prefer createCia402Drive.
 
std::expected< cia402::State, std::string > state () const
 Reads and decodes the current state machine state (statusword 0x6041).
 
std::expected< uint16_t, std::string > statusword () const
 Reads the raw statusword (0x6041).
 
std::expected< uint16_t, std::string > controlword () const
 Reads the last-commanded controlword (0x6040).
 
std::expected< void, std::string > setControlword (uint16_t value)
 Writes the controlword (0x6040) verbatim.
 
std::expected< cia402::OperationMode, std::string > operationMode () const
 Reads the active operation mode (display object 0x6061).
 
std::expected< void, std::string > setOperationMode (cia402::OperationMode mode)
 Requests an operation mode (0x6060). The drive reflects it in 0x6061 once accepted.
 
std::expected< int8_t, std::string > operationModeValue () const
 Reads the requested operation mode (0x6060) as its raw value.
 
std::expected< int8_t, std::string > operationModeValueDisplay () const
 Reads the active operation mode (0x6061) as its raw value — the display counterpart of operationModeValue, and the one that says what the drive actually took.
 
std::expected< void, std::string > setOperationModeValue (int8_t mode)
 Writes a raw operation-mode value to 0x6060 — the counterpart of operationModeValue.
 
std::expected< void, std::string > applyOperationMode (int8_t mode, std::chrono::milliseconds timeout=std::chrono::milliseconds(200))
 Writes mode to 0x6060 and waits until the drive reports it active in 0x6061.
 
std::expected< Cia402Status, std::string > readStatus () const
 Reads state, statusword, controlword, and the active mode in one shot.
 
std::expected< void, std::string > shutdown ()
 Shutdown: → ReadyToSwitchOn.
 
std::expected< void, std::string > switchOn ()
 Switch on: ReadyToSwitchOn → SwitchedOn (also disables operation from enabled).
 
std::expected< void, std::string > enableOperation ()
 Enable operation: SwitchedOn → OperationEnabled.
 
std::expected< void, std::string > disableVoltage ()
 Disable voltage: → SwitchOnDisabled.
 
std::expected< void, std::string > quickStop ()
 Quick stop: → QuickStopActive.
 
std::expected< void, std::string > faultReset ()
 Fault reset: asserts the rising edge of controlword bit 7 to clear a latched fault.
 
std::expected< void, std::string > transitionToState (cia402::State target, std::chrono::milliseconds timeout=std::chrono::milliseconds(2000), bool allowQuickStopOverride=false)
 Drives the state machine to target, walking every intermediate transition.
 
std::expected< void, std::string > enable (std::chrono::milliseconds timeout=std::chrono::milliseconds(2000))
 Drives the state machine to OperationEnabled.
 
std::expected< void, std::string > disable ()
 Brings the drive to SwitchOnDisabled (disable voltage). Single transition.
 
std::expected< int32_t, std::string > targetPosition () const
 Reads the last-commanded target position (0x607A, INTEGER32).
 
std::expected< void, std::string > setTargetPosition (int32_t counts)
 Writes target position (0x607A, INTEGER32) — CSP / PP.
 
std::expected< int32_t, std::string > targetVelocity () const
 Reads the last-commanded target velocity (0x60FF, INTEGER32).
 
std::expected< void, std::string > setTargetVelocity (int32_t value)
 Writes target velocity (0x60FF, INTEGER32) — CSV / PV.
 
std::expected< int16_t, std::string > targetTorque () const
 Reads the last-commanded target torque (0x6071, INTEGER16, per-mille of rated).
 
std::expected< void, std::string > setTargetTorque (int16_t perMille)
 Writes target torque (0x6071, INTEGER16, per-mille of rated) — CST / PT.
 
std::expected< int32_t, std::string > positionActualValue () const
 Reads actual position (0x6064, INTEGER32).
 
std::expected< int32_t, std::string > velocityActualValue () const
 Reads actual velocity (0x606C, INTEGER32).
 
std::expected< int16_t, std::string > torqueActualValue () const
 Reads actual torque (0x6077, INTEGER16, per-mille of rated).
 
std::expected< uint16_t, std::string > errorCode () const
 Reads the error code (0x603F, UNSIGNED16) — the code of the last drive fault.
 
std::expected< int16_t, std::string > quickStopOptionCode () const
 Reads the quick stop option code (0x605A, INTEGER16).
 
std::expected< void, std::string > setQuickStopOptionCode (int16_t value)
 Writes the quick stop option code (0x605A, INTEGER16) — the quick-stop reaction.
 
std::expected< int32_t, std::string > positionDemandValue () const
 Reads the position demand value (0x6062, INTEGER32) — trajectory generator output.
 
std::expected< uint32_t, std::string > followingErrorWindow () const
 Reads the following error window (0x6065, UNSIGNED32).
 
std::expected< void, std::string > setFollowingErrorWindow (uint32_t value)
 Writes the following error window (0x6065, UNSIGNED32).
 
std::expected< uint16_t, std::string > followingErrorTimeout () const
 Reads the following error time out (0x6066, UNSIGNED16, ms).
 
std::expected< void, std::string > setFollowingErrorTimeout (uint16_t value)
 Writes the following error time out (0x6066, UNSIGNED16, ms).
 
std::expected< uint32_t, std::string > positionWindow () const
 Reads the position window (0x6067, UNSIGNED32) — the target-reached tolerance.
 
std::expected< void, std::string > setPositionWindow (uint32_t value)
 Writes the position window (0x6067, UNSIGNED32).
 
std::expected< uint16_t, std::string > positionWindowTime () const
 Reads the position window time (0x6068, UNSIGNED16, ms).
 
std::expected< void, std::string > setPositionWindowTime (uint16_t value)
 Writes the position window time (0x6068, UNSIGNED16, ms).
 
std::expected< int32_t, std::string > velocityDemandValue () const
 Reads the velocity demand value (0x606B, INTEGER32) — ramp generator output.
 
std::expected< uint16_t, std::string > velocityWindow () const
 Reads the velocity window (0x606D, UNSIGNED16) — the target-reached tolerance.
 
std::expected< void, std::string > setVelocityWindow (uint16_t value)
 Writes the velocity window (0x606D, UNSIGNED16).
 
std::expected< uint16_t, std::string > velocityWindowTime () const
 Reads the velocity window time (0x606E, UNSIGNED16, ms).
 
std::expected< void, std::string > setVelocityWindowTime (uint16_t value)
 Writes the velocity window time (0x606E, UNSIGNED16, ms).
 
std::expected< uint16_t, std::string > velocityThreshold () const
 Reads the velocity threshold (0x606F, UNSIGNED16) — the standstill threshold.
 
std::expected< void, std::string > setVelocityThreshold (uint16_t value)
 Writes the velocity threshold (0x606F, UNSIGNED16).
 
std::expected< uint16_t, std::string > velocityThresholdTime () const
 Reads the velocity threshold time (0x6070, UNSIGNED16, ms).
 
std::expected< void, std::string > setVelocityThresholdTime (uint16_t value)
 Writes the velocity threshold time (0x6070, UNSIGNED16, ms).
 
std::expected< uint16_t, std::string > maxTorque () const
 Reads max torque (0x6072, UNSIGNED16, per-mille of rated).
 
std::expected< void, std::string > setMaxTorque (uint16_t perMille)
 Writes max torque (0x6072, UNSIGNED16, per-mille of rated).
 
std::expected< uint16_t, std::string > maxCurrent () const
 Reads max current (0x6073, UNSIGNED16, per-mille of rated).
 
std::expected< void, std::string > setMaxCurrent (uint16_t perMille)
 Writes max current (0x6073, UNSIGNED16, per-mille of rated).
 
std::expected< int16_t, std::string > torqueDemand () const
 Reads the torque demand (0x6074, INTEGER16) — control loop output.
 
std::expected< uint32_t, std::string > motorRatedCurrent () const
 Reads the motor rated current (0x6075, UNSIGNED32, mA).
 
std::expected< void, std::string > setMotorRatedCurrent (uint32_t milliamps)
 Writes the motor rated current (0x6075, UNSIGNED32, mA).
 
std::expected< uint32_t, std::string > motorRatedTorque () const
 Reads the motor rated torque (0x6076, UNSIGNED32, mNm).
 
std::expected< void, std::string > setMotorRatedTorque (uint32_t millinewtonMetres)
 Writes the motor rated torque (0x6076, UNSIGNED32, mNm).
 
std::expected< uint32_t, std::string > dcLinkCircuitVoltage () const
 Reads the DC link circuit voltage (0x6079, UNSIGNED32, mV).
 
std::expected< PositionRangeLimit, std::string > positionRangeLimit () const
 Reads the position range limit (0x607B) — both sub-entries.
 
std::expected< void, std::string > setPositionRangeLimit (const PositionRangeLimit &limit)
 Writes the position range limit (0x607B) — min then max; aborts on first failure.
 
std::expected< int32_t, std::string > homeOffset () const
 Reads the home offset (0x607C, INTEGER32).
 
std::expected< void, std::string > setHomeOffset (int32_t value)
 Writes the home offset (0x607C, INTEGER32).
 
std::expected< SoftwarePositionLimit, std::string > softwarePositionLimit () const
 Reads the software position limit (0x607D) — both sub-entries.
 
std::expected< void, std::string > setSoftwarePositionLimit (const SoftwarePositionLimit &limit)
 Writes the software position limit (0x607D) — min then max; aborts on first failure.
 
std::expected< uint8_t, std::string > polarity () const
 Reads the polarity (0x607E, UNSIGNED8) — position/velocity inversion bits.
 
std::expected< void, std::string > setPolarity (uint8_t value)
 Writes the polarity (0x607E, UNSIGNED8).
 
std::expected< uint32_t, std::string > maxMotorSpeed () const
 Reads the max motor speed (0x6080, UNSIGNED32).
 
std::expected< void, std::string > setMaxMotorSpeed (uint32_t value)
 Writes the max motor speed (0x6080, UNSIGNED32).
 
std::expected< uint32_t, std::string > profileVelocity () const
 Reads the profile velocity (0x6081, UNSIGNED32) — PP cruise velocity.
 
std::expected< void, std::string > setProfileVelocity (uint32_t value)
 Writes the profile velocity (0x6081, UNSIGNED32).
 
std::expected< uint32_t, std::string > profileAcceleration () const
 Reads the profile acceleration (0x6083, UNSIGNED32).
 
std::expected< void, std::string > setProfileAcceleration (uint32_t value)
 Writes the profile acceleration (0x6083, UNSIGNED32).
 
std::expected< uint32_t, std::string > profileDeceleration () const
 Reads the profile deceleration (0x6084, UNSIGNED32).
 
std::expected< void, std::string > setProfileDeceleration (uint32_t value)
 Writes the profile deceleration (0x6084, UNSIGNED32).
 
std::expected< uint32_t, std::string > quickStopDeceleration () const
 Reads the quick stop deceleration (0x6085, UNSIGNED32).
 
std::expected< void, std::string > setQuickStopDeceleration (uint32_t value)
 Writes the quick stop deceleration (0x6085, UNSIGNED32).
 
std::expected< int16_t, std::string > motionProfileType () const
 Reads the motion profile type (0x6086, INTEGER16).
 
std::expected< void, std::string > setMotionProfileType (int16_t value)
 Writes the motion profile type (0x6086, INTEGER16).
 
std::expected< uint32_t, std::string > torqueSlope () const
 Reads the torque slope (0x6087, UNSIGNED32) — PT torque ramp rate.
 
std::expected< void, std::string > setTorqueSlope (uint32_t value)
 Writes the torque slope (0x6087, UNSIGNED32).
 
std::expected< int16_t, std::string > torqueProfileType () const
 Reads the torque profile type (0x6088, INTEGER16).
 
std::expected< void, std::string > setTorqueProfileType (int16_t value)
 Writes the torque profile type (0x6088, INTEGER16).
 
std::expected< GearRatio, std::string > gearRatio () const
 Reads the gear ratio (0x6091) — both sub-entries.
 
std::expected< void, std::string > setGearRatio (const GearRatio &ratio)
 Writes the gear ratio (0x6091) — motor then shaft revolutions; aborts on first failure.
 
std::expected< FeedConstant, std::string > feedConstant () const
 Reads the feed constant (0x6092) — both sub-entries.
 
std::expected< void, std::string > setFeedConstant (const FeedConstant &constant)
 Writes the feed constant (0x6092) — feed then shaft revolutions; aborts on first failure.
 
std::expected< int8_t, std::string > homingMethod () const
 Reads the homing method (0x6098, INTEGER8).
 
std::expected< void, std::string > setHomingMethod (int8_t method)
 Writes the homing method (0x6098, INTEGER8).
 
std::expected< HomingSpeeds, std::string > homingSpeeds () const
 Reads the homing speeds (0x6099) — both sub-entries.
 
std::expected< void, std::string > setHomingSpeeds (const HomingSpeeds &speeds)
 Writes the homing speeds (0x6099) — switch then zero search; aborts on first failure.
 
std::expected< uint32_t, std::string > homingAcceleration () const
 Reads the homing acceleration (0x609A, UNSIGNED32).
 
std::expected< void, std::string > setHomingAcceleration (uint32_t value)
 Writes the homing acceleration (0x609A, UNSIGNED32).
 
std::expected< uint32_t, std::string > siUnitVelocity () const
 Reads the SI unit velocity (0x60A9, UNSIGNED32) — the unit code of velocity objects.
 
std::expected< void, std::string > setSiUnitVelocity (uint32_t value)
 Writes the SI unit velocity (0x60A9, UNSIGNED32).
 
std::expected< int32_t, std::string > velocityOffset () const
 Reads the velocity offset (0x60B1, INTEGER32) — CSP/CSV velocity feed-forward.
 
std::expected< void, std::string > setVelocityOffset (int32_t value)
 Writes the velocity offset (0x60B1, INTEGER32).
 
std::expected< int16_t, std::string > torqueOffset () const
 Reads the torque offset (0x60B2, INTEGER16) — torque feed-forward.
 
std::expected< void, std::string > setTorqueOffset (int16_t value)
 Writes the torque offset (0x60B2, INTEGER16).
 
std::expected< uint16_t, std::string > touchProbeFunction () const
 Reads the touch probe function (0x60B8, UNSIGNED16) — arm/config bits.
 
std::expected< void, std::string > setTouchProbeFunction (uint16_t value)
 Writes the touch probe function (0x60B8, UNSIGNED16).
 
std::expected< uint16_t, std::string > touchProbeStatus () const
 Reads the touch probe status (0x60B9, UNSIGNED16) — latch status bits.
 
std::expected< int32_t, std::string > touchProbe1PositiveEdge () const
 Reads the position latched at touch probe 1's rising edge (0x60BA, INTEGER32).
 
std::expected< int32_t, std::string > touchProbe1NegativeEdge () const
 Reads the position latched at touch probe 1's falling edge (0x60BB, INTEGER32).
 
std::expected< uint32_t, std::string > touchProbeTimeStamp1PositiveValue () const
 Reads the time stamp of touch probe 1's rising edge (0x60D1, UNSIGNED32).
 
std::expected< uint32_t, std::string > touchProbeTimeStamp1NegativeValue () const
 Reads the time stamp of touch probe 1's falling edge (0x60D2, UNSIGNED32).
 
std::expected< uint16_t, std::string > positioningOptionCode () const
 Reads the positioning option code (0x60F2, UNSIGNED16) — PP behaviour options.
 
std::expected< void, std::string > setPositioningOptionCode (uint16_t value)
 Writes the positioning option code (0x60F2, UNSIGNED16).
 
std::expected< int32_t, std::string > followingErrorActualValue () const
 Reads the following error actual value (0x60F4, INTEGER32).
 
std::expected< int32_t, std::string > controlEffort () const
 Reads the control effort (0x60FA, INTEGER32) — position loop output.
 
std::expected< int32_t, std::string > positionDemandInternalValue () const
 Reads the position demand internal value (0x60FC, INTEGER32).
 
std::expected< uint32_t, std::string > digitalInputs () const
 Reads the digital inputs (0x60FD, UNSIGNED32) — input bit field.
 
std::expected< DigitalOutputs, std::string > digitalOutputs () const
 Reads the digital outputs (0x60FE) — both sub-entries.
 
std::expected< void, std::string > setDigitalOutputs (const DigitalOutputs &outputs)
 Writes the digital outputs (0x60FE) — levels first (inert while masked off), then the enable mask, so a newly enabled output comes up with its commanded level; aborts on first failure.
 
std::expected< uint32_t, std::string > supportedDriveModes () const
 Reads the supported drive modes (0x6502, UNSIGNED32) — the capability bit field. Constant, so it is cached after the first read.
 
- Public Member Functions inherited from mm::node::ProfileDevice
 ProfileDevice (Device &device)
 Binds an (unchecked) view to device. Prefer createProfileDevice.
 
Devicedevice ()
 The underlying generic device this view operates on.
 
const Devicedevice () const
 
std::expected< uint32_t, std::string > deviceType () const
 Reads the device type (0x1000, UNSIGNED32) — the device profile the object dictionary implements (low word = profile number, e.g. 402; high word = profile-specific info).
 
std::expected< uint8_t, std::string > errorRegister () const
 Reads the error register (0x1001, UNSIGNED8) — the active error class bit field (bit 0 = generic error). Read-only but volatile, so every call re-reads the device.
 
std::expected< int32_t, std::string > cobIdSync () const
 Reads the COB-ID of the SYNC message (0x1005, INTEGER32). Writable, so every call re-reads the device.
 
std::expected< void, std::string > setCobIdSync (int32_t value)
 Writes the COB-ID of the SYNC message (0x1005, INTEGER32).
 
std::expected< int32_t, std::string > communicationCyclePeriod () const
 Reads the communication cycle period (0x1006, INTEGER32, µs). Writable, so every call re-reads the device.
 
std::expected< void, std::string > setCommunicationCyclePeriod (int32_t value)
 Writes the communication cycle period (0x1006, INTEGER32, µs).
 
std::expected< std::string, std::string > manufacturerDeviceName () const
 Reads the manufacturer device name (0x1008, VISIBLE_STRING).
 
std::expected< std::string, std::string > manufacturerSoftwareVersion () const
 Reads the manufacturer software version (0x100A, VISIBLE_STRING) — the firmware version.
 
std::expected< uint16_t, std::string > guardTime () const
 Reads the node guarding guard time (0x100C, UNSIGNED16, ms). Writable, so every call re-reads the device.
 
std::expected< void, std::string > setGuardTime (uint16_t value)
 Writes the node guarding guard time (0x100C, UNSIGNED16, ms).
 
std::expected< uint8_t, std::string > lifeTimeFactor () const
 Reads the node guarding life time factor (0x100D, UNSIGNED8). Writable, so every call re-reads the device.
 
std::expected< void, std::string > setLifeTimeFactor (uint8_t value)
 Writes the node guarding life time factor (0x100D, UNSIGNED8).
 
std::expected< uint32_t, std::string > storeParameters () const
 Reads "save all parameters" (0x1010:01, UNSIGNED32) — the save capability (bit 0 = device saves on command); writing the "save" signature to it triggers the store. Writable, so every call re-reads the device.
 
std::expected< void, std::string > setStoreParameters (uint32_t signature)
 Writes "save all parameters" (0x1010:01, UNSIGNED32). Writing the ASCII "save" signature (0x65766173) commands the device to store its parameters to non-volatile memory; the device aborts any other value.
 
std::expected< void, std::string > runStoreParameters (const StoreParametersConfig &config={})
 Commands a parameter store (0x1010) and waits for the device to confirm it completed.
 
std::expected< RestoreDefaultParameters, std::string > restoreDefaultParameters () const
 Reads the restore-default-parameters object (0x1011) — the restore capability of all four groups. Writable (the "load" signature triggers a restore), so every call re-reads the device. Fails if any sub-entry read fails.
 
std::expected< void, std::string > setRestoreAllDefaultParameters (uint32_t signature)
 Writes "restore all default parameters" (0x1011:01, UNSIGNED32). Writing the ASCII "load" signature (0x64616F6C) commands the restore; the device aborts any other value.
 
std::expected< void, std::string > setRestoreCommunicationDefaultParameters (uint32_t signature)
 Writes "restore communication default parameters" (0x1011:02, UNSIGNED32) — the ASCII "load" signature (0x64616F6C) commands the restore.
 
std::expected< void, std::string > setRestoreApplicationDefaultParameters (uint32_t signature)
 Writes "restore application default parameters" (0x1011:03, UNSIGNED32) — the ASCII "load" signature (0x64616F6C) commands the restore.
 
std::expected< void, std::string > setRestoreManufacturerDefaultParameters (uint32_t signature)
 Writes "restore manufacturer-defined default parameters" (0x1011:04, UNSIGNED32) — the ASCII "load" signature (0x64616F6C) commands the restore.
 
std::expected< void, std::string > runRestoreDefaultParameters (RestoreGroup group, const RestoreDefaultParametersConfig &config={})
 Commands a restore of default parameters (0x1011) and waits for the device to confirm.
 
std::expected< uint32_t, std::string > consumerHeartbeatTime () const
 Reads the consumer heartbeat time (0x1016:01, UNSIGNED32, ms — node ID in bits 16-23). Writable, so every call re-reads the device.
 
std::expected< void, std::string > setConsumerHeartbeatTime (uint32_t value)
 Writes the consumer heartbeat time (0x1016:01, UNSIGNED32, ms — node ID in bits 16-23).
 
std::expected< uint16_t, std::string > producerHeartbeatTime () const
 Reads the producer heartbeat time (0x1017, UNSIGNED16, ms). Writable, so every call re-reads the device.
 
std::expected< void, std::string > setProducerHeartbeatTime (uint16_t value)
 Writes the producer heartbeat time (0x1017, UNSIGNED16, ms).
 
std::expected< Identity, std::string > identity () const
 Reads the identity object (0x1018) — vendor ID, product code, revision, serial.
 
std::expected< uint8_t, std::string > synchronousCounterOverflowValue () const
 Reads the synchronous counter overflow value (0x1019, UNSIGNED8). Writable, so every call re-reads the device.
 
std::expected< void, std::string > setSynchronousCounterOverflowValue (uint8_t value)
 Writes the synchronous counter overflow value (0x1019, UNSIGNED8).
 
std::expected< std::vector< uint8_t >, std::string > osCommand () const
 Reads back the OS command bytes (0x1023:01, 8 bytes). Writable (this is the command the caller last issued), so every call re-reads the device.
 
std::expected< void, std::string > setOsCommand (const std::vector< uint8_t > &command)
 Writes the OS command bytes (0x1023:01, 8 bytes) — issues an OS command; poll osCommandStatus / osCommandResponse for the result.
 
std::expected< uint8_t, std::string > osCommandStatus () const
 Reads the OS command status (0x1023:02, UNSIGNED8). Read-only but volatile (it tracks the last issued command), so every call re-reads the device.
 
std::expected< std::vector< uint8_t >, std::string > osCommandResponse () const
 Reads the OS command response bytes (0x1023:03, 8 bytes). Read-only but volatile (it tracks the last issued command), so every call re-reads the device.
 
std::expected< void, std::string > setOsCommandMode (uint8_t mode)
 Writes the OS command mode (0x1024, UNSIGNED8). Write-only on the device — there is no matching getter.
 

Additional Inherited Members

- Protected Attributes inherited from mm::node::ProfileDevice
Devicedevice_
 The borrowed device — the only data member permitted in the whole view chain.
 

Detailed Description

Borrowed view of a CiA402 drive — the device control state machine, operation modes, and the standard cyclic setpoints, expressed over a Device's parameter access.

Every method routes through Device::readValue / writeValue, so it transparently uses the live PDO image while the device is exchanging (SAFE-OP/OP) and falls back to SDO otherwise — the caller never chooses the transport. The view is stateless (see ProfileDevice): the drive's actual state is its statusword, re-read on every query.

Construct via createCia402Drive, which validates that the device actually implements the profile before binding the view. The bare constructor is unchecked — for tests or already-validated paths.

Note
Single-shot, here-and-now operations only. A long-running procedure must re-resolve its Device per step rather than cache this view across a bus rescan: command-and-wait procedures (homing runs, calibration, auto-tuning) run off-RT on a background thread, while cycle-locked setpoint generation runs in an RT CyclicTask. Either way the view is rebound per step/cycle, never held in a long-lived instance.

Constructor & Destructor Documentation

◆ Cia402Drive()

mm::node::Cia402Drive::Cia402Drive ( Device device)
inlineexplicit

Binds an (unchecked) CiA402 view to device. Prefer createCia402Drive.

Member Function Documentation

◆ applyOperationMode()

std::expected< void, std::string > mm::node::Cia402Drive::applyOperationMode ( int8_t  mode,
std::chrono::milliseconds  timeout = std::chrono::milliseconds(200) 
)

Writes mode to 0x6060 and waits until the drive reports it active in 0x6061.

A drive is free to ignore a mode request, and refusing is a successful write followed by nothing happening — which is indistinguishable from success unless someone looks. SOMANET firmware refuses a change to a non-"dynamic" mode while in Operation Enabled, and refuses outright any mode its opmode_update does not list (deprecated system identification, -4). Both raise a warning the drive keeps to itself and answer the SDO with success.

Mode 0 is exempt: it requests no mode, so there is nothing to arrive at, and a display object still showing the previous mode is not a refusal.

Parameters
modeThe 0x6060 value to request.
timeoutHow long to give 0x6061 to catch up.
Returns
Void once the drive reports mode active, otherwise why not — naming the mode it is in instead, with its 0x603F error code when that can be read.

◆ controlEffort()

std::expected< int32_t, std::string > mm::node::Cia402Drive::controlEffort ( ) const

Reads the control effort (0x60FA, INTEGER32) — position loop output.

◆ controlword()

std::expected< uint16_t, std::string > mm::node::Cia402Drive::controlword ( ) const

Reads the last-commanded controlword (0x6040).

◆ dcLinkCircuitVoltage()

std::expected< uint32_t, std::string > mm::node::Cia402Drive::dcLinkCircuitVoltage ( ) const

Reads the DC link circuit voltage (0x6079, UNSIGNED32, mV).

◆ digitalInputs()

std::expected< uint32_t, std::string > mm::node::Cia402Drive::digitalInputs ( ) const

Reads the digital inputs (0x60FD, UNSIGNED32) — input bit field.

◆ digitalOutputs()

std::expected< DigitalOutputs, std::string > mm::node::Cia402Drive::digitalOutputs ( ) const

Reads the digital outputs (0x60FE) — both sub-entries.

◆ disable()

std::expected< void, std::string > mm::node::Cia402Drive::disable ( )

Brings the drive to SwitchOnDisabled (disable voltage). Single transition.

◆ disableVoltage()

std::expected< void, std::string > mm::node::Cia402Drive::disableVoltage ( )

Disable voltage: → SwitchOnDisabled.

◆ enable()

std::expected< void, std::string > mm::node::Cia402Drive::enable ( std::chrono::milliseconds  timeout = std::chrono::milliseconds(2000))

Drives the state machine to OperationEnabled.

transitionToState with that target, and deliberately without the quick-stop override: this is what procedures call to prepare a drive, and one that overrode a quick stop on the way to a measurement would be undoing a stop somebody asked for.

Parameters
timeoutMaximum time to wait for OperationEnabled.
Returns
Void once OperationEnabled is reached, or an error string on a bus failure, a fault that will not clear, or timeout.

◆ enableOperation()

std::expected< void, std::string > mm::node::Cia402Drive::enableOperation ( )

Enable operation: SwitchedOn → OperationEnabled.

◆ errorCode()

std::expected< uint16_t, std::string > mm::node::Cia402Drive::errorCode ( ) const

Reads the error code (0x603F, UNSIGNED16) — the code of the last drive fault.

◆ faultReset()

std::expected< void, std::string > mm::node::Cia402Drive::faultReset ( )

Fault reset: asserts the rising edge of controlword bit 7 to clear a latched fault.

Sets bit 7 (preserving the other bits); the drive latches the reset on the 0→1 transition. It does not clear bit 7 — the next state-machine command does that via kCommandMask, re-arming the reset. (Clearing it here would be lost on the PDO path, where a set+clear issued in one call collapses to the last staged value and the drive never sees the edge.)

◆ feedConstant()

std::expected< FeedConstant, std::string > mm::node::Cia402Drive::feedConstant ( ) const

Reads the feed constant (0x6092) — both sub-entries.

◆ followingErrorActualValue()

std::expected< int32_t, std::string > mm::node::Cia402Drive::followingErrorActualValue ( ) const

Reads the following error actual value (0x60F4, INTEGER32).

◆ followingErrorTimeout()

std::expected< uint16_t, std::string > mm::node::Cia402Drive::followingErrorTimeout ( ) const

Reads the following error time out (0x6066, UNSIGNED16, ms).

◆ followingErrorWindow()

std::expected< uint32_t, std::string > mm::node::Cia402Drive::followingErrorWindow ( ) const

Reads the following error window (0x6065, UNSIGNED32).

◆ gearRatio()

std::expected< GearRatio, std::string > mm::node::Cia402Drive::gearRatio ( ) const

Reads the gear ratio (0x6091) — both sub-entries.

◆ homeOffset()

std::expected< int32_t, std::string > mm::node::Cia402Drive::homeOffset ( ) const

Reads the home offset (0x607C, INTEGER32).

◆ homingAcceleration()

std::expected< uint32_t, std::string > mm::node::Cia402Drive::homingAcceleration ( ) const

Reads the homing acceleration (0x609A, UNSIGNED32).

◆ homingMethod()

std::expected< int8_t, std::string > mm::node::Cia402Drive::homingMethod ( ) const

Reads the homing method (0x6098, INTEGER8).

◆ homingSpeeds()

std::expected< HomingSpeeds, std::string > mm::node::Cia402Drive::homingSpeeds ( ) const

Reads the homing speeds (0x6099) — both sub-entries.

◆ maxCurrent()

std::expected< uint16_t, std::string > mm::node::Cia402Drive::maxCurrent ( ) const

Reads max current (0x6073, UNSIGNED16, per-mille of rated).

◆ maxMotorSpeed()

std::expected< uint32_t, std::string > mm::node::Cia402Drive::maxMotorSpeed ( ) const

Reads the max motor speed (0x6080, UNSIGNED32).

◆ maxTorque()

std::expected< uint16_t, std::string > mm::node::Cia402Drive::maxTorque ( ) const

Reads max torque (0x6072, UNSIGNED16, per-mille of rated).

◆ motionProfileType()

std::expected< int16_t, std::string > mm::node::Cia402Drive::motionProfileType ( ) const

Reads the motion profile type (0x6086, INTEGER16).

◆ motorRatedCurrent()

std::expected< uint32_t, std::string > mm::node::Cia402Drive::motorRatedCurrent ( ) const

Reads the motor rated current (0x6075, UNSIGNED32, mA).

◆ motorRatedTorque()

std::expected< uint32_t, std::string > mm::node::Cia402Drive::motorRatedTorque ( ) const

Reads the motor rated torque (0x6076, UNSIGNED32, mNm).

◆ operationMode()

std::expected< cia402::OperationMode, std::string > mm::node::Cia402Drive::operationMode ( ) const

Reads the active operation mode (display object 0x6061).

◆ operationModeValue()

std::expected< int8_t, std::string > mm::node::Cia402Drive::operationModeValue ( ) const

Reads the requested operation mode (0x6060) as its raw value.

The raw pair exists because the enum cannot hold every mode a drive has. 0x6060 is an INTEGER8 whose negative half the profile leaves entirely to the vendor, so a drive sitting in one of those — a SOMANET in diagnostics (-2) — has a mode that cia402::OperationMode has no name for and never will. Use these when the value is being carried (saved to put back, taken from a client, written straight through) and the typed pair when it is being reasoned about.

◆ operationModeValueDisplay()

std::expected< int8_t, std::string > mm::node::Cia402Drive::operationModeValueDisplay ( ) const

Reads the active operation mode (0x6061) as its raw value — the display counterpart of operationModeValue, and the one that says what the drive actually took.

◆ polarity()

std::expected< uint8_t, std::string > mm::node::Cia402Drive::polarity ( ) const

Reads the polarity (0x607E, UNSIGNED8) — position/velocity inversion bits.

◆ positionActualValue()

std::expected< int32_t, std::string > mm::node::Cia402Drive::positionActualValue ( ) const

Reads actual position (0x6064, INTEGER32).

◆ positionDemandInternalValue()

std::expected< int32_t, std::string > mm::node::Cia402Drive::positionDemandInternalValue ( ) const

Reads the position demand internal value (0x60FC, INTEGER32).

◆ positionDemandValue()

std::expected< int32_t, std::string > mm::node::Cia402Drive::positionDemandValue ( ) const

Reads the position demand value (0x6062, INTEGER32) — trajectory generator output.

◆ positioningOptionCode()

std::expected< uint16_t, std::string > mm::node::Cia402Drive::positioningOptionCode ( ) const

Reads the positioning option code (0x60F2, UNSIGNED16) — PP behaviour options.

◆ positionRangeLimit()

std::expected< PositionRangeLimit, std::string > mm::node::Cia402Drive::positionRangeLimit ( ) const

Reads the position range limit (0x607B) — both sub-entries.

◆ positionWindow()

std::expected< uint32_t, std::string > mm::node::Cia402Drive::positionWindow ( ) const

Reads the position window (0x6067, UNSIGNED32) — the target-reached tolerance.

◆ positionWindowTime()

std::expected< uint16_t, std::string > mm::node::Cia402Drive::positionWindowTime ( ) const

Reads the position window time (0x6068, UNSIGNED16, ms).

◆ profileAcceleration()

std::expected< uint32_t, std::string > mm::node::Cia402Drive::profileAcceleration ( ) const

Reads the profile acceleration (0x6083, UNSIGNED32).

◆ profileDeceleration()

std::expected< uint32_t, std::string > mm::node::Cia402Drive::profileDeceleration ( ) const

Reads the profile deceleration (0x6084, UNSIGNED32).

◆ profileVelocity()

std::expected< uint32_t, std::string > mm::node::Cia402Drive::profileVelocity ( ) const

Reads the profile velocity (0x6081, UNSIGNED32) — PP cruise velocity.

◆ quickStop()

std::expected< void, std::string > mm::node::Cia402Drive::quickStop ( )

Quick stop: → QuickStopActive.

◆ quickStopDeceleration()

std::expected< uint32_t, std::string > mm::node::Cia402Drive::quickStopDeceleration ( ) const

Reads the quick stop deceleration (0x6085, UNSIGNED32).

◆ quickStopOptionCode()

std::expected< int16_t, std::string > mm::node::Cia402Drive::quickStopOptionCode ( ) const

Reads the quick stop option code (0x605A, INTEGER16).

◆ readStatus()

std::expected< Cia402Status, std::string > mm::node::Cia402Drive::readStatus ( ) const

Reads state, statusword, controlword, and the active mode in one shot.

◆ setControlword()

std::expected< void, std::string > mm::node::Cia402Drive::setControlword ( uint16_t  value)

Writes the controlword (0x6040) verbatim.

Sets every bit as given — use when composing a mode-specific controlword (e.g. the homing-start or new-setpoint bits). For pure state-machine transitions prefer the named transition methods, which preserve the mode-specific and halt bits.

◆ setDigitalOutputs()

std::expected< void, std::string > mm::node::Cia402Drive::setDigitalOutputs ( const DigitalOutputs outputs)

Writes the digital outputs (0x60FE) — levels first (inert while masked off), then the enable mask, so a newly enabled output comes up with its commanded level; aborts on first failure.

◆ setFeedConstant()

std::expected< void, std::string > mm::node::Cia402Drive::setFeedConstant ( const FeedConstant constant)

Writes the feed constant (0x6092) — feed then shaft revolutions; aborts on first failure.

◆ setFollowingErrorTimeout()

std::expected< void, std::string > mm::node::Cia402Drive::setFollowingErrorTimeout ( uint16_t  value)

Writes the following error time out (0x6066, UNSIGNED16, ms).

◆ setFollowingErrorWindow()

std::expected< void, std::string > mm::node::Cia402Drive::setFollowingErrorWindow ( uint32_t  value)

Writes the following error window (0x6065, UNSIGNED32).

◆ setGearRatio()

std::expected< void, std::string > mm::node::Cia402Drive::setGearRatio ( const GearRatio ratio)

Writes the gear ratio (0x6091) — motor then shaft revolutions; aborts on first failure.

◆ setHomeOffset()

std::expected< void, std::string > mm::node::Cia402Drive::setHomeOffset ( int32_t  value)

Writes the home offset (0x607C, INTEGER32).

◆ setHomingAcceleration()

std::expected< void, std::string > mm::node::Cia402Drive::setHomingAcceleration ( uint32_t  value)

Writes the homing acceleration (0x609A, UNSIGNED32).

◆ setHomingMethod()

std::expected< void, std::string > mm::node::Cia402Drive::setHomingMethod ( int8_t  method)

Writes the homing method (0x6098, INTEGER8).

◆ setHomingSpeeds()

std::expected< void, std::string > mm::node::Cia402Drive::setHomingSpeeds ( const HomingSpeeds speeds)

Writes the homing speeds (0x6099) — switch then zero search; aborts on first failure.

◆ setMaxCurrent()

std::expected< void, std::string > mm::node::Cia402Drive::setMaxCurrent ( uint16_t  perMille)

Writes max current (0x6073, UNSIGNED16, per-mille of rated).

◆ setMaxMotorSpeed()

std::expected< void, std::string > mm::node::Cia402Drive::setMaxMotorSpeed ( uint32_t  value)

Writes the max motor speed (0x6080, UNSIGNED32).

◆ setMaxTorque()

std::expected< void, std::string > mm::node::Cia402Drive::setMaxTorque ( uint16_t  perMille)

Writes max torque (0x6072, UNSIGNED16, per-mille of rated).

◆ setMotionProfileType()

std::expected< void, std::string > mm::node::Cia402Drive::setMotionProfileType ( int16_t  value)

Writes the motion profile type (0x6086, INTEGER16).

◆ setMotorRatedCurrent()

std::expected< void, std::string > mm::node::Cia402Drive::setMotorRatedCurrent ( uint32_t  milliamps)

Writes the motor rated current (0x6075, UNSIGNED32, mA).

◆ setMotorRatedTorque()

std::expected< void, std::string > mm::node::Cia402Drive::setMotorRatedTorque ( uint32_t  millinewtonMetres)

Writes the motor rated torque (0x6076, UNSIGNED32, mNm).

◆ setOperationMode()

std::expected< void, std::string > mm::node::Cia402Drive::setOperationMode ( cia402::OperationMode  mode)

Requests an operation mode (0x6060). The drive reflects it in 0x6061 once accepted.

◆ setOperationModeValue()

std::expected< void, std::string > mm::node::Cia402Drive::setOperationModeValue ( int8_t  mode)

Writes a raw operation-mode value to 0x6060 — the counterpart of operationModeValue.

Nothing is checked: whether the drive has this mode is the drive's answer, given by whether 0x6061 comes to reflect it. Use applyOperationMode to wait for that answer.

◆ setPolarity()

std::expected< void, std::string > mm::node::Cia402Drive::setPolarity ( uint8_t  value)

Writes the polarity (0x607E, UNSIGNED8).

◆ setPositioningOptionCode()

std::expected< void, std::string > mm::node::Cia402Drive::setPositioningOptionCode ( uint16_t  value)

Writes the positioning option code (0x60F2, UNSIGNED16).

◆ setPositionRangeLimit()

std::expected< void, std::string > mm::node::Cia402Drive::setPositionRangeLimit ( const PositionRangeLimit limit)

Writes the position range limit (0x607B) — min then max; aborts on first failure.

◆ setPositionWindow()

std::expected< void, std::string > mm::node::Cia402Drive::setPositionWindow ( uint32_t  value)

Writes the position window (0x6067, UNSIGNED32).

◆ setPositionWindowTime()

std::expected< void, std::string > mm::node::Cia402Drive::setPositionWindowTime ( uint16_t  value)

Writes the position window time (0x6068, UNSIGNED16, ms).

◆ setProfileAcceleration()

std::expected< void, std::string > mm::node::Cia402Drive::setProfileAcceleration ( uint32_t  value)

Writes the profile acceleration (0x6083, UNSIGNED32).

◆ setProfileDeceleration()

std::expected< void, std::string > mm::node::Cia402Drive::setProfileDeceleration ( uint32_t  value)

Writes the profile deceleration (0x6084, UNSIGNED32).

◆ setProfileVelocity()

std::expected< void, std::string > mm::node::Cia402Drive::setProfileVelocity ( uint32_t  value)

Writes the profile velocity (0x6081, UNSIGNED32).

◆ setQuickStopDeceleration()

std::expected< void, std::string > mm::node::Cia402Drive::setQuickStopDeceleration ( uint32_t  value)

Writes the quick stop deceleration (0x6085, UNSIGNED32).

◆ setQuickStopOptionCode()

std::expected< void, std::string > mm::node::Cia402Drive::setQuickStopOptionCode ( int16_t  value)

Writes the quick stop option code (0x605A, INTEGER16) — the quick-stop reaction.

◆ setSiUnitVelocity()

std::expected< void, std::string > mm::node::Cia402Drive::setSiUnitVelocity ( uint32_t  value)

Writes the SI unit velocity (0x60A9, UNSIGNED32).

◆ setSoftwarePositionLimit()

std::expected< void, std::string > mm::node::Cia402Drive::setSoftwarePositionLimit ( const SoftwarePositionLimit limit)

Writes the software position limit (0x607D) — min then max; aborts on first failure.

◆ setTargetPosition()

std::expected< void, std::string > mm::node::Cia402Drive::setTargetPosition ( int32_t  counts)

Writes target position (0x607A, INTEGER32) — CSP / PP.

◆ setTargetTorque()

std::expected< void, std::string > mm::node::Cia402Drive::setTargetTorque ( int16_t  perMille)

Writes target torque (0x6071, INTEGER16, per-mille of rated) — CST / PT.

◆ setTargetVelocity()

std::expected< void, std::string > mm::node::Cia402Drive::setTargetVelocity ( int32_t  value)

Writes target velocity (0x60FF, INTEGER32) — CSV / PV.

◆ setTorqueOffset()

std::expected< void, std::string > mm::node::Cia402Drive::setTorqueOffset ( int16_t  value)

Writes the torque offset (0x60B2, INTEGER16).

◆ setTorqueProfileType()

std::expected< void, std::string > mm::node::Cia402Drive::setTorqueProfileType ( int16_t  value)

Writes the torque profile type (0x6088, INTEGER16).

◆ setTorqueSlope()

std::expected< void, std::string > mm::node::Cia402Drive::setTorqueSlope ( uint32_t  value)

Writes the torque slope (0x6087, UNSIGNED32).

◆ setTouchProbeFunction()

std::expected< void, std::string > mm::node::Cia402Drive::setTouchProbeFunction ( uint16_t  value)

Writes the touch probe function (0x60B8, UNSIGNED16).

◆ setVelocityOffset()

std::expected< void, std::string > mm::node::Cia402Drive::setVelocityOffset ( int32_t  value)

Writes the velocity offset (0x60B1, INTEGER32).

◆ setVelocityThreshold()

std::expected< void, std::string > mm::node::Cia402Drive::setVelocityThreshold ( uint16_t  value)

Writes the velocity threshold (0x606F, UNSIGNED16).

◆ setVelocityThresholdTime()

std::expected< void, std::string > mm::node::Cia402Drive::setVelocityThresholdTime ( uint16_t  value)

Writes the velocity threshold time (0x6070, UNSIGNED16, ms).

◆ setVelocityWindow()

std::expected< void, std::string > mm::node::Cia402Drive::setVelocityWindow ( uint16_t  value)

Writes the velocity window (0x606D, UNSIGNED16).

◆ setVelocityWindowTime()

std::expected< void, std::string > mm::node::Cia402Drive::setVelocityWindowTime ( uint16_t  value)

Writes the velocity window time (0x606E, UNSIGNED16, ms).

◆ shutdown()

std::expected< void, std::string > mm::node::Cia402Drive::shutdown ( )

Shutdown: → ReadyToSwitchOn.

◆ siUnitVelocity()

std::expected< uint32_t, std::string > mm::node::Cia402Drive::siUnitVelocity ( ) const

Reads the SI unit velocity (0x60A9, UNSIGNED32) — the unit code of velocity objects.

◆ softwarePositionLimit()

std::expected< SoftwarePositionLimit, std::string > mm::node::Cia402Drive::softwarePositionLimit ( ) const

Reads the software position limit (0x607D) — both sub-entries.

◆ state()

std::expected< State, std::string > mm::node::Cia402Drive::state ( ) const

Reads and decodes the current state machine state (statusword 0x6041).

◆ statusword()

std::expected< uint16_t, std::string > mm::node::Cia402Drive::statusword ( ) const

Reads the raw statusword (0x6041).

◆ supportedDriveModes()

std::expected< uint32_t, std::string > mm::node::Cia402Drive::supportedDriveModes ( ) const

Reads the supported drive modes (0x6502, UNSIGNED32) — the capability bit field. Constant, so it is cached after the first read.

◆ switchOn()

std::expected< void, std::string > mm::node::Cia402Drive::switchOn ( )

Switch on: ReadyToSwitchOn → SwitchedOn (also disables operation from enabled).

◆ targetPosition()

std::expected< int32_t, std::string > mm::node::Cia402Drive::targetPosition ( ) const

Reads the last-commanded target position (0x607A, INTEGER32).

◆ targetTorque()

std::expected< int16_t, std::string > mm::node::Cia402Drive::targetTorque ( ) const

Reads the last-commanded target torque (0x6071, INTEGER16, per-mille of rated).

◆ targetVelocity()

std::expected< int32_t, std::string > mm::node::Cia402Drive::targetVelocity ( ) const

Reads the last-commanded target velocity (0x60FF, INTEGER32).

◆ torqueActualValue()

std::expected< int16_t, std::string > mm::node::Cia402Drive::torqueActualValue ( ) const

Reads actual torque (0x6077, INTEGER16, per-mille of rated).

◆ torqueDemand()

std::expected< int16_t, std::string > mm::node::Cia402Drive::torqueDemand ( ) const

Reads the torque demand (0x6074, INTEGER16) — control loop output.

◆ torqueOffset()

std::expected< int16_t, std::string > mm::node::Cia402Drive::torqueOffset ( ) const

Reads the torque offset (0x60B2, INTEGER16) — torque feed-forward.

◆ torqueProfileType()

std::expected< int16_t, std::string > mm::node::Cia402Drive::torqueProfileType ( ) const

Reads the torque profile type (0x6088, INTEGER16).

◆ torqueSlope()

std::expected< uint32_t, std::string > mm::node::Cia402Drive::torqueSlope ( ) const

Reads the torque slope (0x6087, UNSIGNED32) — PT torque ramp rate.

◆ touchProbe1NegativeEdge()

std::expected< int32_t, std::string > mm::node::Cia402Drive::touchProbe1NegativeEdge ( ) const

Reads the position latched at touch probe 1's falling edge (0x60BB, INTEGER32).

◆ touchProbe1PositiveEdge()

std::expected< int32_t, std::string > mm::node::Cia402Drive::touchProbe1PositiveEdge ( ) const

Reads the position latched at touch probe 1's rising edge (0x60BA, INTEGER32).

◆ touchProbeFunction()

std::expected< uint16_t, std::string > mm::node::Cia402Drive::touchProbeFunction ( ) const

Reads the touch probe function (0x60B8, UNSIGNED16) — arm/config bits.

◆ touchProbeStatus()

std::expected< uint16_t, std::string > mm::node::Cia402Drive::touchProbeStatus ( ) const

Reads the touch probe status (0x60B9, UNSIGNED16) — latch status bits.

◆ touchProbeTimeStamp1NegativeValue()

std::expected< uint32_t, std::string > mm::node::Cia402Drive::touchProbeTimeStamp1NegativeValue ( ) const

Reads the time stamp of touch probe 1's falling edge (0x60D2, UNSIGNED32).

◆ touchProbeTimeStamp1PositiveValue()

std::expected< uint32_t, std::string > mm::node::Cia402Drive::touchProbeTimeStamp1PositiveValue ( ) const

Reads the time stamp of touch probe 1's rising edge (0x60D1, UNSIGNED32).

◆ transitionToState()

std::expected< void, std::string > mm::node::Cia402Drive::transitionToState ( cia402::State  target,
std::chrono::milliseconds  timeout = std::chrono::milliseconds(2000),
bool  allowQuickStopOverride = false 
)

Drives the state machine to target, walking every intermediate transition.

Reads the state, issues the one transition that advances toward target (cia402::nextFsaTransition), and repeats until the drive arrives or timeout elapses. The state is re-read every iteration rather than assumed, so a drive that needs an extra cycle, or that moves on its own — out of kFaultReactionActive, or out of kQuickStopActive once its quick-stop ramp finishes — is simply followed.

Intended for the control-plane (HTTP) thread: it sleeps between polls and must never be called from the RT loop. Process data must be exchanging for the drive to advance at all — the statusword has to update between polls, and the firmware additionally refuses kOperationEnabled unless master communication is live.

Three outcomes are worth telling apart in the error, and this does:

  • a fault that will not clear — the reset was issued and the drive stayed in kFault, which the firmware does when the cause is still present. The drive's own error report is attached.
  • an unreachable target — asking for a state no command enters, or for kOperationEnabled out of a quick stop without allowQuickStopOverride.
  • a plain timeout, naming the state it was stuck in.

**Targeting kQuickStopActive may legitimately end in kSwitchOnDisabled.** Quick stop option code 0x605A decides whether the drive stays in that state or passes through it, and with codes 0-4 it passes through — so this reads the code and, when it says the drive does not hold, accepts Switch On Disabled as arrival. Without that the walk would see the drive already past its target, climb back up, quick-stop again, and loop until the timeout.

Parameters
targetWhere to bring the drive. Must be cia402::isCommandableState.
timeoutMaximum time to spend walking.
allowQuickStopOverrideWhether transition 16 may be used to leave kQuickStopActive upward. False for anything that did not explicitly ask for it: a quick stop is a deliberate act, and a procedure that merely wants an enabled drive must not undo one.
Returns
Void once target is reached, otherwise why not.

◆ velocityActualValue()

std::expected< int32_t, std::string > mm::node::Cia402Drive::velocityActualValue ( ) const

Reads actual velocity (0x606C, INTEGER32).

◆ velocityDemandValue()

std::expected< int32_t, std::string > mm::node::Cia402Drive::velocityDemandValue ( ) const

Reads the velocity demand value (0x606B, INTEGER32) — ramp generator output.

◆ velocityOffset()

std::expected< int32_t, std::string > mm::node::Cia402Drive::velocityOffset ( ) const

Reads the velocity offset (0x60B1, INTEGER32) — CSP/CSV velocity feed-forward.

◆ velocityThreshold()

std::expected< uint16_t, std::string > mm::node::Cia402Drive::velocityThreshold ( ) const

Reads the velocity threshold (0x606F, UNSIGNED16) — the standstill threshold.

◆ velocityThresholdTime()

std::expected< uint16_t, std::string > mm::node::Cia402Drive::velocityThresholdTime ( ) const

Reads the velocity threshold time (0x6070, UNSIGNED16, ms).

◆ velocityWindow()

std::expected< uint16_t, std::string > mm::node::Cia402Drive::velocityWindow ( ) const

Reads the velocity window (0x606D, UNSIGNED16) — the target-reached tolerance.

◆ velocityWindowTime()

std::expected< uint16_t, std::string > mm::node::Cia402Drive::velocityWindowTime ( ) const

Reads the velocity window time (0x606E, UNSIGNED16, ms).


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