PLC Servo Synchronization via Profinet: A Practical Guide
In many industrial automation projects, achieving synchronized motion between multiple servo drives is a common requirement. While high-end motion controllers offer built-in synchronization features, sometimes a simpler PLC-based solution is needed. This article explores a practical approach to synchronizing two servo drives using a standard PLC over Profinet communication, based on real-world testing and iterative improvements.
The Basic Principle: Speed Following
The fundamental idea behind servo synchronization is straightforward: when the master axis moves, the slave axis should follow. The simplest method is to read the actual speed of the master drive and send it as the speed setpoint to the slave drive. In theory, this should keep both axes running at the same speed. However, in practice, this approach often introduces speed disturbances. Even when the master runs at a constant speed, the slave may exhibit significant speed fluctuations due to communication delays and noise.
To mitigate this, a filtering technique can be applied. For example, a median filter over three consecutive speed samples can smooth out the variations. After implementing such a filter, the speed tracking improved noticeably, but a new problem emerged: over time, the position error accumulated. The slave axis would gradually drift, leading to an unacceptable position offset during long runs.
Adding Position Correction: The Integral Term
The accumulation of position error suggests that speed control alone is insufficient. To correct this, a position feedback loop is necessary. By integrating the speed error over time, we can derive a position compensation value. The idea is to calculate the difference between the master and slave positions, multiply it by an integral gain (Ki), and add this compensation to the speed setpoint of the slave. This forms a proportional-integral (PI) controller for position synchronization.
For accurate integration, a fixed sampling time is crucial. Standard PLC cyclic scan times can vary, so a timed interrupt routine is often used to ensure consistent execution. In the test setup, a 5 ms interrupt was implemented. After tuning the Ki parameter, the position error during steady-state operation was reduced to within 10% of the target, which met the project requirements. However, during high-speed positioning moves, a new issue surfaced: when the master stopped at a target position (e.g., 20,000 encoder counts), the slave would overshoot by half a turn or more before reversing back to the correct position. This overshoot was attributed to communication latency and the scan cycle delay.
Attempting Derivative Action and Its Challenges
To counteract the overshoot, a derivative term (velocity change) was introduced. Theoretically, when the master decelerates rapidly, the derivative of the speed error can provide a predictive braking effect for the slave. In practice, however, the improvement was marginal. The servo drives themselves have very fast acceleration capabilities (typically 20 ms from 0 to 1000 rpm), which is faster than the filtering and control loop periods. Adjusting the drive’s acceleration time and reducing the filter period helped slightly, but the PLC’s scan cycle became a bottleneck. At a 5 ms cycle, the PLC struggled to keep up with rapid changes, causing issues like missed direction reversals.
Direct manipulation of communication buffers was considered to reduce overhead, but due to time constraints and the lack of diagnostic tools to measure communication timing precisely, this path was not pursued. The inherent latency of Profinet and the PLC’s processing time made it difficult to achieve high-precision synchronization with speed-mode control alone.
Alternative Approach: Position Mode with Interpolation
For applications requiring tighter synchronization, a more advanced method is to control the slave drive in position mode rather than speed mode. By using an interpolation technique, the PLC can predict the master’s future position and speed based on recent samples and send these as position commands to the slave. The slave’s own PID position loop then handles the fine control. This approach offloads the synchronization task to the drive’s fast internal control loop, potentially achieving much higher accuracy. Although this method was not tested in the original project, it represents a promising direction for future implementations.
Key Takeaways from Practical Testing
- Simple speed following works for low-precision applications but requires filtering to reduce noise.
- Adding an integral position term significantly reduces steady-state error, but tuning is critical.
- Derivative action may not be effective if the drive’s own acceleration is faster than the control loop.
- Communication latency and PLC scan time are the main limiting factors for synchronization accuracy.
- For high-precision sync, consider position mode control with trajectory prediction.
Implementation Considerations
When designing a servo synchronization system over Profinet, several factors must be considered:
| Factor | Impact | Mitigation |
|---|---|---|
| Communication cycle time | Determines update rate; longer cycles increase error | Use shortest feasible Profinet cycle (e.g., 1-2 ms) |
| PLC scan time | Affects control loop responsiveness | Use timed interrupts with high priority |
| Drive acceleration/deceleration | Fast dynamics can outpace control loop | Adjust drive ramp times to match control capability |
| Filtering method | Reduces noise but adds phase lag | Use median or low-pass filters with appropriate window |
| Control mode | Speed mode vs. position mode affects accuracy | Position mode with interpolation for high precision |
The choice of PLC and drives also plays a crucial role. Modern PLCs with dedicated motion control functions and drives supporting isochronous real-time communication can achieve synchronization errors in the microsecond range. However, for many applications, a well-tuned software-based solution on a standard PLC can provide adequate performance at a lower cost.
Conclusion
Synchronizing servo drives over Profinet using a PLC is feasible with careful design. Starting from a basic speed following method and progressively adding position integral correction can yield satisfactory results for many industrial tasks. While derivative action may not always provide significant benefits due to hardware limitations, exploring position mode control with predictive algorithms opens the door to higher precision. The key is to understand the trade-offs between communication speed, control loop frequency, and drive dynamics, and to select the approach that best fits the application requirements.