CODESYS Applied Practice — Axes (Part 1)
Environment: CODESYS V3.5 SP22 | Target: CODESYS Control Win V3 x64 simulation Overview The previous lesson built a minimal host/controller loop: three axes that were hand-rolled — FB_SimAxis parsed commands and climbed position itself. The motion was real; the axes were fake. This lesson meets a real axis. What is an axis? Start from motion control. In short: an axis is the motion counterpart of…
In the CODESYS Applied Practice series, Part 1 explores the concept of axes in motion control within the CODESYS environment. The previous lesson built a minimal host/controller loop with three hand-rolled axes using FB_SimAxis, which parsed commands and climbed position. However, this lesson introduces a real axis.
To understand axes, one must first grasp the motion control aspect. An axis can be thought of as the motion counterpart of a control object, featuring setpoints and status on one side, and drive, motor, and encoder on the other. These components are bound together through mapping.
Motion control functions blocks (FBs) share a common timing structure: execute edge, busy, done, and error. The CiA 402 standard for drives follows a similar state machine, progressing from "Not ready to switch on" to "Switched on" and then "Operation enabled."
Three key boundaries exist in this context: the Motion API (MC_*), the axis object (state and setpoints), and the drive profile (CiA 402 or fieldbus). While the program code remains the same, the backend implementation can be either simulated or real, allowing for flexibility in development.
In summary, a logical axis and a physical axis may appear different, but they share a consistent mapping and timing structure. The CiA 402 standard serves as the drive language, enabling the same program to run seamlessly on both simulated and hardware targets.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.