Controlling a servo from a PLC
The servo amplifier does the fast control work; the PLC decides where the axis should go and when. There are two main ways to connect them, and one standard set of commands that most PLCs use.
1. Pulse train (pulse + direction)
The PLC's high-speed outputs send pulses to the amplifier: every pulse is one small step of movement, and a second output gives the direction. The pulse frequency sets the speed. With an electronic gear of, say, 10,000 pulses per motor revolution and a 10 mm ball screw, each pulse moves the axis 0.001 mm.
- Simple, cheap, works with many PLCs (Mitsubishi FX5, Siemens S7-1200 pulse outputs, Omron CP...).
- Limited by the maximum pulse frequency (often 100 kHz - 1 MHz) and the number of outputs.
- The PLC does not see the actual position unless the encoder signal is fed back.
2. Motion network (fieldbus)
Most new machines use a real-time network: EtherCAT, PROFINET IRT, CC-Link IE TSN, SSCNET or EtherNet/IP CIP Motion. Every cycle (often 1 ms or faster) the PLC sends the target position and receives the actual position, torque, status and alarms. One cable, many axes, full diagnostics.
PLCopen motion function blocks
Most PLC software uses the same standard PLCopen blocks, so the program looks similar on Siemens, Omron, Beckhoff, CODESYS and others:
| Block | Purpose |
|---|---|
| MC_Power | enable the amplifier (servo on) |
| MC_Home | find the reference position |
| MC_MoveAbsolute | move to a position (e.g. 250 mm) at a speed |
| MC_MoveRelative | move a distance from where it is |
| MC_MoveVelocity | run continuously at a speed |
| MC_Stop / MC_Halt | stop with a deceleration ramp |
| MC_Reset | clear an axis fault |
| MC_ReadActualPosition | read where the axis is |
Each block has an Execute input (start on a rising edge) and Done, Busy, Error outputs. See PLC programming languages.
A typical sequence
- Machine ready, no E-stop:
MC_Powerenables the axis. - If not homed:
MC_Home, wait forDone. - Step 1:
MC_MoveAbsoluteto the pick position, wait forDone(in position). - Close the gripper, wait for its sensor.
- Step 2: move to the place position, and so on. An SFC or step-bit ladder keeps the sequence readable.
- On any
Error: stop, show the alarm on the HMI, wait for reset.
Safety
Like VFDs, servo amplifiers have STO (Safe Torque Off) and often SS1 / SLS safety functions. Emergency stops and guard doors act on these through a safety relay or safety PLC, never only through the PLC program.
Try it yourself. Wire sensors, contactors and a PLC, write ladder logic and press RUN in the free PLC Sim Lab Playground. Nothing to install.
Open the Playground →Guided lessons →