YARP CiA-402 EtherCAT Device 0.6.0
YARP device plugin for EtherCAT CiA-402 drives
Loading...
Searching...
No Matches
CiA402 Namespace Reference

Classes

class  CheckEncoderCalibration
 Encoder calibration checker: compare live encoder readings against a reference TOML file. More...
 
class  EthercatManager
 Minimal EtherCAT master built on SOEM for CiA-402 devices. More...
 
struct  FieldInfo
 Metadata describing a field inside the raw TxPDO image. More...
 
struct  RxPDO
 Process Data Object written from master to slave (RxPDO). More...
 
class  StateMachine
 
class  StoreHome37
 Calibration utility: home all CiA-402 drives on the bus and persist the result to flash. More...
 
class  TxView
 Lightweight view over a slave's TxPDO image. More...
 

Enumerations

enum class  State : uint8_t {
  NotReadyToSwitchOn = 0 , SwitchOnDisabled = 1 , ReadyToSwitchOn = 2 , SwitchedOn = 3 ,
  OperationEnabled = 4 , QuickStopActive = 5 , FaultReaction = 6 , Fault = 7 ,
  Unknown = 8
}
 
enum class  TxField : uint8_t {
  Statusword , OpModeDisplay , Position6064 , Velocity606C ,
  Torque6077 , PositionError6065 , Timestamp20F0 , STO_6621_01 ,
  SBC_6621_02 , Enc1Pos2111_02 , Enc1Vel2111_03 , Enc2Pos2113_02 ,
  Enc2Vel2113_03 , TemperatureDrive
}
 Identifiers for fields read from a slave (TxPDO → master). More...
 

Functions

static constexpr State sw_to_state (uint16_t sw)
 
static constexpr std::string_view state_to_string (State s)
 
std::tm getLocalTime (const std::time_t &t)
 

Variables

Encoder SDO indices
static constexpr uint16_t IDX_ENC1_CONFIG = 0x2110
 :03 = resolution (counts/rev)
 
static constexpr uint16_t IDX_ENC1_DATA = 0x2111
 :01 = raw position, :02 = adjusted position
 
static constexpr uint16_t IDX_ENC2_CONFIG = 0x2112
 :03 = resolution (counts/rev)
 
static constexpr uint16_t IDX_ENC2_DATA = 0x2113
 :01 = raw position, :02 = adjusted position
 

Enumeration Type Documentation

◆ State

enum class CiA402::State : uint8_t
strong
Enumerator
NotReadyToSwitchOn 
SwitchOnDisabled 
ReadyToSwitchOn 
SwitchedOn 
OperationEnabled 
QuickStopActive 
FaultReaction 
Fault 
Unknown 

Definition at line 35 of file CiA402StateMachine.h.

◆ TxField

enum class CiA402::TxField : uint8_t
strong

Identifiers for fields read from a slave (TxPDO → master).

Each value corresponds to a standard or vendor-specific object/subindex that can be mapped into the TxPDO image and accessed via TxView.

Enumerator
Statusword 

0x6041: Statusword

OpModeDisplay 

0x6061: Modes of operation display

Position6064 

0x6064: Position actual value

Velocity606C 

0x606C: Velocity actual value

Torque6077 

0x6077: Torque actual value

PositionError6065 

0x6065: Position demand value / error

Timestamp20F0 

0x20F0: Timestamp (if supported)

STO_6621_01 

0x6621:01 Safe Torque Off status (exposed via PDO)

SBC_6621_02 

0x6621:02 Safe Brake Control status (exposed via PDO)

Enc1Pos2111_02 

0x2111:02 Vendor enc1 position

Enc1Vel2111_03 

0x2111:03 Vendor enc1 velocity

Enc2Pos2113_02 

0x2113:02 Vendor enc2 position

Enc2Vel2113_03 

0x2113:03 Vendor enc2 velocity

TemperatureDrive 

0x2031:01 Temperature (if supported)

Definition at line 53 of file EthercatManager.h.

Function Documentation

◆ getLocalTime()

std::tm CiA402::getLocalTime ( const std::time_t & t)
inline

Definition at line 12 of file TimeUtils.h.

◆ state_to_string()

static constexpr std::string_view CiA402::state_to_string ( State s)
inlinestaticconstexpr

Definition at line 78 of file CiA402StateMachine.h.

◆ sw_to_state()

static constexpr State CiA402::sw_to_state ( uint16_t sw)
inlinestaticconstexpr

Convert a raw status-word to the canonical CiA-402 state.

Only the relevant bits (0,1,2,3,4,5,6) are masked, exactly as the spec does. Patterns are taken from IEC 61800-7-204, table 13.

Definition at line 53 of file CiA402StateMachine.h.

Variable Documentation

◆ IDX_ENC1_CONFIG

uint16_t CiA402::IDX_ENC1_CONFIG = 0x2110
staticconstexpr

:03 = resolution (counts/rev)

Definition at line 14 of file EncoderSdoIndices.h.

◆ IDX_ENC1_DATA

uint16_t CiA402::IDX_ENC1_DATA = 0x2111
staticconstexpr

:01 = raw position, :02 = adjusted position

Definition at line 15 of file EncoderSdoIndices.h.

◆ IDX_ENC2_CONFIG

uint16_t CiA402::IDX_ENC2_CONFIG = 0x2112
staticconstexpr

:03 = resolution (counts/rev)

Definition at line 16 of file EncoderSdoIndices.h.

◆ IDX_ENC2_DATA

uint16_t CiA402::IDX_ENC2_DATA = 0x2113
staticconstexpr

:01 = raw position, :02 = adjusted position

Definition at line 17 of file EncoderSdoIndices.h.