diff --git a/poulpe_ethercat_controller/src/register.rs b/poulpe_ethercat_controller/src/register.rs index 48dde98..ad6fa09 100644 --- a/poulpe_ethercat_controller/src/register.rs +++ b/poulpe_ethercat_controller/src/register.rs @@ -138,6 +138,7 @@ impl BoardStatus { } else if flags.motor_error_flags.iter().any(|x| { x.contains(&MotorErrorFlag::LowBusVoltage) || x.contains(&MotorErrorFlag::DriverFault) + || x.contains(&MotorErrorFlag::DriverCommunicationFail) }) { Ok(BoardStatus::BusVoltageError) } else if flags @@ -153,6 +154,10 @@ impl BoardStatus { } else if flags .homing_error_flags .contains(&HomingErrorFlag::AxisSensorReadFail) + || flags + .motor_error_flags + .iter() + .any(|x| x.contains(&MotorErrorFlag::AxisSensorCommunicationFail)) { Ok(BoardStatus::SensorError) } else { diff --git a/poulpe_ethercat_controller/src/state_machine.rs b/poulpe_ethercat_controller/src/state_machine.rs index b57f0c8..52649d1 100644 --- a/poulpe_ethercat_controller/src/state_machine.rs +++ b/poulpe_ethercat_controller/src/state_machine.rs @@ -91,6 +91,8 @@ pub enum MotorErrorFlag { LowBusVoltage = 6, DriverFault = 7, TemperatureSensorMalfunctionWarning = 8, + AxisSensorCommunicationFail = 9, + DriverCommunicationFail = 10, } // Error codes for the homing procedure