82 if ((statusword & 0x4F) == 0x40) {
85 if ((statusword & 0x6F) == 0x21) {
88 if ((statusword & 0x6F) == 0x23) {
91 if ((statusword & 0x6F) == 0x27) {
94 if ((statusword & 0x6F) == 0x07) {
97 if ((statusword & 0x4F) == 0x0F) {
100 if ((statusword & 0x4F) == 0x08) {
116 return "NotReadyToSwitchOn";
118 return "SwitchOnDisabled";
120 return "ReadyToSwitchOn";
124 return "OperationEnabled";
126 return "QuickStopActive";
128 return "FaultReactionActive";
141 return "ProfilePosition";
143 return "ProfileVelocity";
145 return "ProfileTorque";
149 return "CyclicSyncPosition";
151 return "CyclicSyncVelocity";
153 return "CyclicSyncTorque";
OperationMode
CiA402 operation modes (object 0x6060 / 0x6061 values).
Definition cia402.h:35
@ kNoMode
No mode assigned.
@ kCyclicSyncVelocity
CSV — interpolated cyclic velocity.
@ kCyclicSyncTorque
CST — interpolated cyclic torque.
@ kCyclicSyncPosition
CSP — interpolated cyclic position (the common SOMANET mode).
@ kHoming
HM — reference/homing run.
@ kProfileTorque
PT — profiled torque.
@ kProfilePosition
PP — trapezoidal point-to-point positioning.
@ kProfileVelocity
PV — profiled velocity.
Command
Canonical controlword command-bit patterns (the value of the bits in kCommandMask).
Definition cia402.h:66
@ kCmdShutdown
→ ReadyToSwitchOn (enable voltage + no quick stop).
Definition cia402.h:67
@ kCmdDisableVoltage
→ SwitchOnDisabled.
Definition cia402.h:70
@ kCmdFaultReset
Rising edge of bit 7 clears a fault.
Definition cia402.h:72
@ kCmdQuickStop
→ QuickStopActive.
Definition cia402.h:71
@ kCmdSwitchOn
→ SwitchedOn (also "disable operation" from OperationEnabled).
Definition cia402.h:68
@ kCmdEnableOperation
→ OperationEnabled.
Definition cia402.h:69
State
States of the CiA402 device control state machine (decoded from the statusword).
Definition cia402.h:47
@ kNotReadyToSwitchOn
Drive initialising; no clear state yet.
@ kQuickStopActive
Quick stop in progress.
@ kSwitchedOn
Switch-on command accepted; power stage on, no motion.
@ kReadyToSwitchOn
Shutdown command accepted.
@ kFaultReactionActive
A fault is being reacted to (e.g. controlled stop).
@ kOperationEnabled
Fully enabled; setpoints are followed.
@ kFault
Faulted and stopped; needs a fault reset.
@ kSwitchOnDisabled
Powered, holding; the resting state after init.
constexpr std::string_view toString(State state)
Human-readable name of a state (for logging / JSON). Never returns nullptr.
Definition cia402.h:113
constexpr uint16_t kCommandMask
Controlword (0x6040) command-bit mask — the state-machine bits a transition touches.
Definition cia402.h:63
constexpr State decodeState(uint16_t statusword)
Decodes the CiA402 state machine state from a statusword (0x6041) value.
Definition cia402.h:79
constexpr bool isFaulted(uint16_t statusword)
Whether the statusword's fault bit (bit 3) is set, gated to the faulted states.
Definition cia402.h:107
Object
Standard CiA402 object dictionary indices used by the drive profile.
Definition cia402.h:21
@ kPositionActualValue
INTEGER32, TxPDO — actual position.
Definition cia402.h:29
@ kStatusword
UNSIGNED16, TxPDO — reports the state machine.
Definition cia402.h:23
@ kTargetVelocity
INTEGER32, RxPDO — CSV/PV setpoint.
Definition cia402.h:27
@ kTorqueActualValue
INTEGER16, TxPDO — actual torque.
Definition cia402.h:31
@ kControlword
UNSIGNED16, RxPDO — commands the state machine.
Definition cia402.h:22
@ kVelocityActualValue
INTEGER32, TxPDO — actual velocity.
Definition cia402.h:30
@ kTargetTorque
INTEGER16, RxPDO — CST/PT setpoint (per-mille of rated).
Definition cia402.h:28
@ kModeOfOperationDisplay
INTEGER8, TxPDO — active operation mode.
Definition cia402.h:25
@ kTargetPosition
INTEGER32, RxPDO — CSP/PP setpoint.
Definition cia402.h:26
@ kModeOfOperation
INTEGER8, RxPDO — requested operation mode.
Definition cia402.h:24