How to Write Code for S-Curve Motion Profiles with 7 Segments Using a PLC

Question:

Hello everyone, I am seeking assistance in writing a code for S-curve motion profiles consisting of 7 segments to regulate the speed of a motor through a PLC. I am struggling to find the equations needed for each segment. I require help to control the time, ensuring that I reach the setpoint within the same time frame whether I use linear ramping or S-curve ramping. While I am aware that my drive supports this function (Siemens G120), I need to implement S-ramping within the PLC for my specific application. Thank you for your help. Warm regards.

Top Replies

TurkSaleh is seeking assistance with programming S-curve motion profiles with 7 segments to regulate the speed of a motor through a PLC. While the Siemens G120 drive supports this feature, the specific equations for each segment are unavailable. This task may be challenging to execute within a PLC due to potential unexpected scenarios. For example, not all moves will contain 7 segments, and determining peak velocity or acceleration can be complex if the commanded values are not reached. It is crucial to consider factors such as short moves and scan times when implementing S-ramping in a PLC effectively. Only a few individuals have successfully addressed these challenges, highlighting the intricate nature of this task.

According to Peter Nachtwey, implementing complex calculations in a PLC may seem challenging at first. However, it is actually quite feasible if the calculation time aligns with the overall operational timing. It all comes down to meeting your specific requirements. For instance, I have witnessed turbine controls utilizing variable guide vanes with software-based floating point calculations and advanced mathematical methods like Heron's method for square roots and 3D map interpolation. Despite taking 20 seconds for calculations, it can still be achieved with the right knowledge and understanding of limitations, even on a budget-friendly controller.

Peter Nachtwey stated that performing certain calculations in a PLC may seem difficult, but it can actually be quite manageable. The key is to calculate points for time, position, velocity, and acceleration, ensuring that some points may overlap depending on the parameters. By simplifying the calculations with symmetric jerk and acceleration values, or considering asymmetric profiles, the task can be achieved effectively. Running the profile involves monitoring time and position, applying the relevant equations for instantaneous velocity, and comparing expected versus actual position. This process helps in fine-tuning the control loop by adjusting the proportional gain. It is essential to ensure that the PLC can update swiftly for the application's requirements, potentially offloading complex profiles to drive hardware for higher speeds. Profiles with lower update frequencies can comfortably be handled within the PLC, although certain terms like Jerk may be omitted if unnecessary.

Let's wait for the response from the original poster. It's important to note that a G120 is not suitable for servo drives, which means precise movements and high accuracy positioning may not be achievable.

JRW commented on the OP's question about the G120 not being a servo drive, indicating that fast moves and high accuracy positioning may not be achievable with it. However, the limiting factor in a PLC-based motion profile is typically not the drive itself, but rather potential communication limitations. JRW shared their experience with using open-loop drive control on an induction motor for PLC-based motion profiles, noting that application details are crucial. They highlighted an instance with a Parker VFD over EtherNet/IP where the drive lagged significantly despite the motion profile running smoothly in the PLC. Despite attempts to address the issue with Parker, adjustments to latency offsets and speed were the only viable solutions.

Hey there! S-curve motion profiles can indeed be quite tricky to implement. Generally, these profiles can be broken down into the acceleration, constant velocity, and deceleration phases, each designed to eliminate sudden changes in speed, thus reducing the jerk. Perhaps, you can calculate each segment individually, using kinematic equations. This would offer a smooth, continuous, and controlled motion across each segment. For tracking your time, you could set up a high-speed timer in your PLC, adjusting each motion ramp until you're synchronized. I would recommend contacting Siemens support too, they're pretty helpful with these issues. Persistence is key here, keep experimenting and you'll get there. Good luck!

Hey there, it seems like you've got quite a task on your hands. I have some experience with S-curve motion profiles. For each of the seven segments, a cubic or quintic equation will be utilized to achieve the desired curve profile. Regarding the timing issue, if your intention is to maintain the same time frame regardless of linear or S-curve ramping, then you'll have to adjust the acceleration and deceleration times accordingly. Keep in mind that for S-ramps, acceleration is not constant, hence you might need to put more attention into the exact timing. Regarding implementing S-ramping in a PLC, you would need to program your PLC to control the acceleration and deceleration of the motor to mimic the S-curve. Unfortunately, I don't have specific experience with Siemens G120, so I suggest referring to their instruction or user manual for precise details. Hope this leads you in the right direction!

More Replies →

Streamline Your Asset Management
See How Oxmaint Works!!

✅   Work Order Management

✅   Asset Tracking

✅   Preventive Maintenance

✅   Inspection Report

We have received your information. We will share Schedule Demo details on your Mail Id.

You must be a registered user to add a comment. If you've already registered,
sign in. Otherwise, register and sign in.

Frequently Asked Questions (FAQ)

FAQ: 1. What is an S-curve motion profile and why is it beneficial for regulating motor speed?

Answer: - An S-curve motion profile consists of smooth acceleration and deceleration phases, resulting in reduced stress on the motor and mechanical components. It provides a more controlled and precise motion compared to linear ramping.

FAQ: 2. How many segments are typically used in a 7-segment S-curve motion profile?

Answer: - A 7-segment S-curve motion profile typically consists of 6 segments for acceleration and deceleration, with a constant velocity segment in between.

FAQ: 3. How can I calculate the equations needed for each segment of the S-curve motion profile?

Answer: - The equations for each segment of the S-curve motion profile can be derived based on the desired acceleration, deceleration, and velocity profiles. Utilizing mathematical formulas and motion control principles can help in determining the equations for each segment.

FAQ: 4. Can a PLC effectively control the timing of reaching a setpoint using S-curve ramping?

Answer: - Yes, a PLC can be programmed to implement S-curve ramping for precise control over the timing of reaching a setpoint. By adjusting the parameters and equations within the PLC program, the desired time frame for reaching the setpoint can be achieved consistently.

FAQ: 5. How can I integrate S-curve ramping into a PLC program for a Siemens G120 drive?

Answer: - To implement S-curve ramping with a Siemens G120 drive using a PLC, you will

Ready to Simplify Maintenance?

Join hundreds of satisfied customers who have transformed their maintenance processes.
Sign up today and start optimizing your workflow.

Request Demo  →