ecdev::IMotionProfile
Facade-facing contract for a motion (drive) device. More...
#include <motion_profile.hpp>
Inherited by ecdev::CiA402DriveProfile
Public Functions
| Name | |
|---|---|
| virtual | ~IMotionProfile() =default |
| virtual std::int32_t | targetPosition() const =0 |
| virtual std::uint16_t | statusword() const =0 |
| virtual void | setTargetVelocity(std::int32_t counts_per_sec) =0 Command CSV target velocity in counts/s; only honoured by a profile running in CSV. |
| virtual void | setTargetTorque(std::int32_t per_mille_rated) =0 Command CST target torque in per-mille of rated torque; only honoured by a profile in CST. |
| virtual void | setTargetPosition(std::int32_t counts) =0 Command CSP target position in encoder counts; implicitly leaves "hold actual" mode. |
| virtual void | setOperatingMode(DriveOpMode mode) Select the cyclic operating mode (CSP / CSV / CST). |
| virtual void | setAutoFaultRecover(bool enable) Set the CiA402 auto fault-reset/recover behaviour. |
| virtual void | requestFaultReset() =0 One-shot fault-reset edge (acted on only while the drive reports Fault). |
| virtual void | requestEnable() =0 Request the drive walk to Operation Enabled (cancels a prior disable request). |
| virtual void | requestDisable() =0 Request the drive walk back to a de-energised resting state. |
| virtual std::int32_t | modeDisplay() const Drive's modes-of-operation display (CiA402 0x6061; 8=CSP, 9=CSV, 10=CST). |
| virtual bool | isOperationEnabled() const =0 |
| virtual bool | isFault() const =0 |
| virtual std::int32_t | actualVelocity() const =0 |
| virtual std::int32_t | actualTorque() const Drive's reported actual torque (CiA402 0x6077, per-mille of rated). |
| virtual std::int32_t | actualPosition() const =0 |
Detailed Description
class ecdev::IMotionProfile;
Facade-facing contract for a motion (drive) device.
This is the ONLY surface the Axis facade depends on – it knows nothing about CiA402 controlwords, the backend, or the ENI. Any drive profile (CiA402 today, others later) implements it so the same Axis works across drive families.
All methods are safe to call from an application thread concurrently with the RT cycle: the implementation backs them with lock-free state.
Pre-start configuration (call between prepare() and start()): setOperatingMode() / setAutoFaultRecover() are not thread-safe with the RT cycle; call them only after prepare() and before start(). Default no-ops make non-CiA402 profiles unaffected.
Public Functions Documentation
function ~IMotionProfile
virtual ~IMotionProfile() =default
function targetPosition
virtual std::int32_t targetPosition() const =0
Reimplemented by: ecdev::CiA402DriveProfile::targetPosition
function statusword
virtual std::uint16_t statusword() const =0
Reimplemented by: ecdev::CiA402DriveProfile::statusword
function setTargetVelocity
virtual void setTargetVelocity(
std::int32_t counts_per_sec
) =0
Command CSV target velocity in counts/s; only honoured by a profile running in CSV.
Reimplemented by: ecdev::CiA402DriveProfile::setTargetVelocity
function setTargetTorque
virtual void setTargetTorque(
std::int32_t per_mille_rated
) =0
Command CST target torque in per-mille of rated torque; only honoured by a profile in CST.
Reimplemented by: ecdev::CiA402DriveProfile::setTargetTorque
function setTargetPosition
virtual void setTargetPosition(
std::int32_t counts
) =0
Command CSP target position in encoder counts; implicitly leaves "hold actual" mode.
Reimplemented by: ecdev::CiA402DriveProfile::setTargetPosition
function setOperatingMode
inline virtual void setOperatingMode(
DriveOpMode mode
)
Select the cyclic operating mode (CSP / CSV / CST).
Reimplemented by: ecdev::CiA402DriveProfile::setOperatingMode
Call before start() to choose the initial mode, or while running to switch live. A live switch takes effect only when the ENI maps modes-of-operation (0x6060) into the RxPDO (eni_gen does this for CiA402 drives); otherwise the drive runs the mode set via SDO at PRE_OP and a later call has no cyclic effect. RT-safe. Default no-op so non-CiA402 profiles are unaffected.
function setAutoFaultRecover
inline virtual void setAutoFaultRecover(
bool enable
)
Set the CiA402 auto fault-reset/recover behaviour.
Reimplemented by: ecdev::CiA402DriveProfile::setAutoFaultRecover
Call between prepare() and start(); not RT-safe.
function requestFaultReset
virtual void requestFaultReset() =0
One-shot fault-reset edge (acted on only while the drive reports Fault).
Reimplemented by: ecdev::CiA402DriveProfile::requestFaultReset
function requestEnable
virtual void requestEnable() =0
Request the drive walk to Operation Enabled (cancels a prior disable request).
Reimplemented by: ecdev::CiA402DriveProfile::requestEnable
function requestDisable
virtual void requestDisable() =0
Request the drive walk back to a de-energised resting state.
Reimplemented by: ecdev::CiA402DriveProfile::requestDisable
function modeDisplay
inline virtual std::int32_t modeDisplay() const
Drive's modes-of-operation display (CiA402 0x6061; 8=CSP, 9=CSV, 10=CST).
Reimplemented by: ecdev::CiA402DriveProfile::modeDisplay
0 if unmapped.
function isOperationEnabled
virtual bool isOperationEnabled() const =0
Reimplemented by: ecdev::CiA402DriveProfile::isOperationEnabled
function isFault
virtual bool isFault() const =0
Reimplemented by: ecdev::CiA402DriveProfile::isFault
function actualVelocity
virtual std::int32_t actualVelocity() const =0
Reimplemented by: ecdev::CiA402DriveProfile::actualVelocity
function actualTorque
inline virtual std::int32_t actualTorque() const
Drive's reported actual torque (CiA402 0x6077, per-mille of rated).
Reimplemented by: ecdev::CiA402DriveProfile::actualTorque
0 if the profile does not map it. Diagnostic only.
function actualPosition
virtual std::int32_t actualPosition() const =0
Reimplemented by: ecdev::CiA402DriveProfile::actualPosition
Updated on 2026-07-04 at 22:59:44 +0000