edcon_axis
edcon_axis
Modbus TCP axis backend — direct per-drive edcon/CMMT connection.
EdconAxis is the original Festo gantry axis implementation. It
connects directly to an individual CMMT servo/stepper drive via
Modbus TCP using the festo-edcon library, and exposes a millimetre-based
public API that satisfies
Axis.
This backend is appropriate when each drive is individually addressable on the
network and Gantry manages concurrency in
Python.
For coordinated multi-axis motion managed by a CECC-X PLC using the Festo Easy
Positioning API, use FPosBAxis
with the FPosBAPI backend instead.
EdconAxis
EdconAxis(
name: str,
ip: str,
run_referencing: bool = False,
max_position: float = inf,
min_position: float = -inf,
)
Bases: MotionHandler
Modbus TCP axis: direct festo-edcon MotionHandler connection to one drive.
Wraps low-level Modbus communication and position/velocity unit conversion behind a millimetre-based public API. All position values accepted and returned by the public methods use millimetres (mm) as their unit.
Attributes:
| Name | Type | Description |
|---|---|---|
name |
Human-readable label for this axis (e.g. |
|
ip |
IPv4 address of the drive's Modbus TCP endpoint. |
|
com |
Active |
|
max_speed |
float
|
Maximum achievable speed in drive velocity units. |
max_position |
float
|
Maximum achievable position in mm. |
min_position |
float
|
Minimum achievable position in mm. |
Initialise the axis and establish a Modbus connection.
Creates the ComModbus connection,
initialises the parent MotionHandler,
reads the software-limit PNUs, and optionally triggers homing.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Human-readable axis label used in log messages and equality checks. Axis labels are unique within a gantry. |
required |
ip
|
str
|
IPv4 address of the Festo drive's Modbus TCP interface. |
required |
run_referencing
|
bool
|
When |
False
|
max_position
|
float
|
Optional max position limitation, if the drive is restricted more than the internal SW limit position check. This avoids an issue where traversing toward the actual endstop is interrupted because the interia of the motion causes the drive to overshoot the limit position, throwing an error and interrupting the power stage on state. |
inf
|
min_position
|
float
|
Optional min position limitation, if the drive is restricted more than the internal SW limit position check. This avoids an issue where traversing toward the actual endstop is interrupted because the interia of the motion causes the drive to overshoot the limit position, throwing an error and interrupting the power stage on state. |
-inf
|
Source code in src/applied_motion/backends/edcon_axis.py
71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 | |
max_speed
property
Return largest allowed speed magnitude for this axis in mm/s.
This derives from configured signed velocity bounds and returns absolute maximum magnitude, independent of direction.
Returns:
| Type | Description |
|---|---|
float
|
Maximum absolute velocity limit in mm/s. |
home
Home the axis by running a referencing task.
Acknowledges any faults, enables the power stage, and then executes a blocking referencing task to establish the axis zero point.
Source code in src/applied_motion/backends/edcon_axis.py
is_homed
Checks whether drive has been homed and has a valid frame of reference.
Thin wrapper for interface consistency around MotionHandler.referenced().
current_position
Transparent wrapper around MotionHandler.current_position.
TODO: is this necessary?
Returns the raw position value in the drive's internal unit system
(drive units, whose scale is determined by PNU 11724 and varies by
firmware/configuration — typically 0.001 mm per unit). Use
get_current_axis_position when you need the position in a
consistent, human-readable unit (mm).
Source code in src/applied_motion/backends/edcon_axis.py
get_current_axis_position
Return the current axis position in the library's canonical output unit (mm).
Reads the raw drive-unit position from MotionHandler.current_position,
then converts it to mm via _valid_position with invert=True.
The drive's own PNU-reported position-unit scale is used for the
conversion, so the result is always consistent regardless of how the
drive was configured.
Internal methods (_check_overshoot, unit converters) continue to
use super().current_position() directly so their drive-unit arithmetic
is unaffected.
Source code in src/applied_motion/backends/edcon_axis.py
move
Move the axis to a specified position with a given velocity.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
position
|
int | float
|
Target position in millimetres (mm). Converted internally to drive units before the motion command is issued. |
required |
velocity
|
int | float
|
Move velocity in mm/s. Converted internally to drive units. |
required |
timeout
|
int | None
|
Optional time limit in seconds for the move. When provided,
the motion is launched in a background thread and a stop command
is issued if the thread has not finished by the deadline. When
|
None
|
**kwargs
|
Optional keyword overrides. Recognised keys:
|
{}
|
Returns:
| Type | Description |
|---|---|
bool
|
|
Source code in src/applied_motion/backends/edcon_axis.py
290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 | |