Skip to content

axis_protocol

axis_protocol

Structural protocol that all axis backend implementations must satisfy.

Axis

Bases: Protocol

Structural interface for a single controllable axis.

Both EdconAxis (Modbus/festo-edcon backend) and FPosBAxis (FPosBAPI backend) satisfy this protocol structurally — no explicit inheritance required.

All position values are in millimetres (mm). All velocity values are in mm/s.

move

move(position: float, velocity: float, **kwargs) -> bool

Move the axis to position at velocity.

Parameters:

Name Type Description Default
position float

Target position in mm (absolute or relative depending on position_type kwarg).

required
velocity float

Move speed in mm/s.

required
**kwargs

Backend-specific options (e.g. position_type, timeout).

{}

Returns:

Type Description
bool

True if the move completed successfully.

Source code in src/applied_motion/backends/axis_protocol.py
def move(self, position: float, velocity: float, **kwargs) -> bool:
    """Move the axis to *position* at *velocity*.

    Args:
        position: Target position in mm (absolute or relative depending on
            ``position_type`` kwarg).
        velocity: Move speed in mm/s.
        **kwargs: Backend-specific options (e.g. ``position_type``,
            ``timeout``).

    Returns:
        ``True`` if the move completed successfully.
    """
    ...

home

home() -> bool

Run the axis homing/referencing sequence.

Source code in src/applied_motion/backends/axis_protocol.py
def home(self) -> bool:
    """Run the axis homing/referencing sequence."""
    ...

get_current_axis_position

get_current_axis_position() -> float

Return the current axis position in mm.

Returns:

Type Description
float

Current position in mm.

Source code in src/applied_motion/backends/axis_protocol.py
def get_current_axis_position(self) -> float:
    """Return the current axis position in mm.

    Returns:
        Current position in mm.
    """
    ...

is_homed

is_homed() -> bool

Return whether this axis reports a valid homed/reference state.

Returns:

Type Description
bool

True if this axis is homed/referenced; False otherwise.

Source code in src/applied_motion/backends/axis_protocol.py
def is_homed(self) -> bool:
    """Return whether this axis reports a valid homed/reference state.

    Returns:
        ``True`` if this axis is homed/referenced; ``False`` otherwise.
    """
    ...

stopped

stopped() -> bool

Return True when the axis is not currently in motion.

Returns:

Type Description
bool

True if the axis has stopped; False if motion is ongoing.

Source code in src/applied_motion/backends/axis_protocol.py
def stopped(self) -> bool:
    """Return ``True`` when the axis is not currently in motion.

    Returns:
        ``True`` if the axis has stopped; ``False`` if motion is ongoing.
    """
    ...

acknowledge_faults

acknowledge_faults()

Clear errors.

Source code in src/applied_motion/backends/axis_protocol.py
def acknowledge_faults(self):
    """Clear errors."""
    # TODO: This shouldn't be exposed to end-users. This is done automatically for almost every motion task to proceed and is part of an internal interface.
    ...

enable_powerstage

enable_powerstage()

Turn on torque to motor controlling this axis.

Source code in src/applied_motion/backends/axis_protocol.py
def enable_powerstage(self):
    """Turn on torque to motor controlling this axis."""
    # TODO: This shouldn't be exposed to end-users. This is done automatically for almost every motion task to proceed and is part of an internal interface.
    ...

disable_powerstage

disable_powerstage()

Turn off torque to motor controlling this axis.

Source code in src/applied_motion/backends/axis_protocol.py
def disable_powerstage(self):
    """Turn off torque to motor controlling this axis."""
    ...

current_position

current_position()

Return current position.

Source code in src/applied_motion/backends/axis_protocol.py
def current_position(self):
    """Return current position."""
    ...

current_velocity

current_velocity()

Return current velocity.

Source code in src/applied_motion/backends/axis_protocol.py
def current_velocity(self):
    """Return current velocity."""
    ...

jog_task

jog_task(
    jog_positive: bool = True,
    jog_negative: bool = False,
    incremental: bool = False,
    duration: float = 0.0,
) -> bool

Jog the axis according to backend-specific jog semantics.

Parameters:

Name Type Description Default
jog_positive bool

When True, request jog in the positive direction.

True
jog_negative bool

When True, request jog in the negative direction.

False
incremental bool

Backend-specific incremental jog mode flag.

False
duration float

Optional jog duration in seconds. A value of 0 starts the jog and returns immediately.

0.0

Returns:

Type Description
bool

True if the jog command succeeds; False otherwise.

Source code in src/applied_motion/backends/axis_protocol.py
def jog_task(
    self,
    jog_positive: bool = True,
    jog_negative: bool = False,
    incremental: bool = False,
    duration: float = 0.0,
) -> bool:
    """Jog the axis according to backend-specific jog semantics.

    Args:
        jog_positive: When ``True``, request jog in the positive direction.
        jog_negative: When ``True``, request jog in the negative direction.
        incremental: Backend-specific incremental jog mode flag.
        duration: Optional jog duration in seconds. A value of ``0``
            starts the jog and returns immediately.

    Returns:
        ``True`` if the jog command succeeds; ``False`` otherwise.
    """
    # TODO: Implement this functionality using corresponding FPosBAPI command

    ...

ready_for_motion

ready_for_motion() -> bool

Return True when the axis is ready to accept a move command.

Returns:

Type Description
bool

True if the axis is enabled, homed, and fault-free.

Source code in src/applied_motion/backends/axis_protocol.py
def ready_for_motion(self) -> bool:
    """Return ``True`` when the axis is ready to accept a move command.

    Returns:
        ``True`` if the axis is enabled, homed, and fault-free.
    """
    ...