Abstract: When designing and debugging positioning axes in production machines, the following questions are of particular interest: How long does positioning take? How long does it take to reach the target speed? What distance is traveled when the commanded speed is changed? What acceleration and jerk are required to complete positioning within a specific time? When must movement be stopped to avoid collisions (collision monitoring)? How can minimal wear be achieved on the machine? This paper starts with the positioning process where the initial acceleration and velocity are zero, introduces how to calculate and evaluate the details of the motion profile, and then introduces a method for calculating and programming motion profiles with non-zero initial velocity and acceleration based on the S7-1500(T).
1. Introduction
When using the motion control process object (TO) of SIMATICS 7-1500(T) to control a servo motor and its mechanism for positioning, preliminary calculations can be performed in advance using a computer program such as SIZER to obtain information on the motor's dynamic characteristics, such as acceleration torque, driver braking power, and positioning time. However, these calculations performed by a computer program cannot be reflected in the process program execution within the controller. During program execution, it is often necessary to accurately determine the distance required for acceleration and deceleration, and appropriate parameter values need to be given in the program to meet process requirements. Conventionally, commissioning engineers set process object parameters based on the on-site commissioning results. If the SIMATICS 7-1500(T) program could automatically calculate the positioning time and appropriate dynamic parameters before program execution, it would greatly assist in equipment commissioning and engineering implementation, making the commissioning work much easier and simpler, and achieving better results.
2. The impact of position control reference setpoint formation and related parameter calculations
By generating a reference setpoint for position control and transmitting it to the moving process axis, the controlled servo system can move according to the required acceleration and velocity change characteristic curves. Due to the nonlinearity and hysteresis of the controlled object in position adjustment, as well as the multi-order characteristics of the control loop itself, the signal transmission of the reference setpoint is distorted, resulting in dynamic trajectory deviations. By limiting the generation characteristics of the reference setpoint, these dynamic trajectory deviations can be effectively reduced. On the one hand, this avoids the current limit of the drive system not being reached, while ensuring the servo motor operates within its capability range. On the other hand, limiting the reference setpoint also reduces the requirements for the rigidity and inertia of the transmission system and mechanical transmission components.
If the values of influential reference setpoints such as jerk, acceleration, and velocity are limited, each motion step will be performed in a time-optimal manner when one of these three values is at its limit at any instant. While adjusting the parameters of the reference setpoints can improve trajectory accuracy and reduce the requirements on the transmission system, it will simultaneously increase motion time. If the mechanical rigidity of a shaft cannot be increased, overshoot characteristics can be improved by limiting acceleration and jerk at the cost of positioning time. The acceleration and deceleration limits during motion are easily determined by the output capacity and braking capacity of the motor and drive. However, jerk is influenced by the natural frequency, damping, desired overshoot, and positioning time of the motion mechanism, making it relatively difficult to correctly tune the jerk limit. Engineers can perform calculations directly using Excel or a SIMATIC 7-1500(T) controller. The calculation formula (using Excel as an example) is shown in the figure below. The calculation formula is based on the ramp characteristics of the second-order system's setpoint. The overshoot value can also be calculated using the formula shown in the figure below.
Figure 1 shows the calculation of the shock (Jerk) given the mechanism's damping, acceleration, and natural frequency, as well as the required overshoot.
3. Calculation process of motion profile with initial acceleration and zero velocity
Motion profiles with initial acceleration and zero velocity require less computation and are easier to implement. In SIMATICS 7-1500(T), positioning time is calculated in seven segments.
Figure 2 General Seven-Segment Acceleration Profile
The calculation is performed by combining the input velocity, acceleration, impact (Jerk) parameters and the given distance. If the limit value is found that the given parameters cannot be reached, the number of calculation segments is reduced. For example, there are no constant acceleration segments, constant deceleration segments, and constant velocity segments, forming a four-segment positioning acceleration and deceleration profile.
The SCL statement for determining the limits of acceleration/deceleration and the maximum speed within the profile is as follows:
IF(0.5*#setDistance*(#setJerk*#setJerk))**(1.0/3.0)>SQRT(#setVelocity*#setJerk)THEN
#AccDecMax:=SQRT(#setVelocity*#setJerk);
ELSE
#AccDecMax:=(0.5*#setDistance*(#setJerk*#setJerk))**(1.0/3.0);
END_IF;
#VelMax:=(0.25*#setJerk*(#setDistance*#setDistance))**(1.0/3.0);
//In SIMATICS 7-1500(T), the instruction **(1.0/3.0) equals the cube root calculation.
The above calculation instructions can yield the maximum limit value, thus identifying the actual segments within the seven acceleration profiles. Furthermore, obtaining the maximum limit value allows for the easy deduction of the running time for each subsequent segment and the overall running time. Implicit information such as motor torque utilization can also be obtained. To facilitate use by a wide range of engineers, Siemens has encapsulated the SIMATIC S7-1500(T) with a function library, LCalcMC, containing the above program. This library allows for direct forward calculation of time and distance, or reverse calculation of dynamic parameters based on distance.
4. Calculation process of motion profile with non-zero initial acceleration and velocity.
The LCalcMC library can calculate reference parameters from rest to rest, but many applications involve non-zero initial velocities and accelerations, such as when a new set of target positions and dynamic parameters are given during operation. Therefore, it is necessary to calculate the relevant profile segment number and limit values separately.
To obtain accurate calculation values, it is first necessary to compare the values of the motion vectors in operation with the newly given parameters, and define the sixteen intervals for calculation (abbreviations in Table 1: V = velocity, S = distance, a = acceleration, m = maximum value, at0 = the value when the acceleration decreases to zero, atm = the value when the acceleration changes to the maximum value, mt0 = from the maximum value to zero, vt0 = the value when the velocity decreases to zero, for example, the velocity value when the acceleration decreases to zero at Vat0).
Table 1 shows the interval discrimination based on the current acceleration and the given acceleration.
Each of the above intervals is divided into four different cases. Taking interval 1 as an example, as shown in Table 2:
Table 2 further divides the interval based on the given target distance.
Among them, sub-interval three of the four intervals needs to be calculated separately because there is a new target value to meet the requirement of a given distance. The calculation method can be to directly solve using Cardan's formula, or to use the bisection method to find the new velocity. Since the search direction and range can be determined, the numerical search can be completed in about twenty loops within SIMATICS 7-1500(T) with a calculation accuracy of 0.001. The formula consists of three cubic equations in one variable, which can be obtained from the standard seven-segment positioning vector calculation formula. When programming, a series of subroutines can be prepared first to calculate the position and velocity values of each segment. Taking the displacement of the fifth segment in the seven-segment acceleration and the third sub-interval of interval three as an example, as shown in the figure below:
Figure 3 Example of the standard seven-segment formula
The above subroutines can then be combined to calculate the new target velocity value for the third sub-interval of interval three:
Figure 4. Example of calculating the third subinterval using the bisection method.
After completing the calculations for the 16 sub-intervals, the complete time and motion profile calculations can be performed in SIMATICS 7-1500(T). The simulation results are shown in the figure below:
Figure 5 shows the simulation using PLCSIM (execution cycle is 4ms).
Conclusion
Single-axis positioning is the foundation of multi-axis synchronous control and path control of motion mechanisms. A deep understanding of the information and parameters of single-axis positioning is essential for achieving more accurate and rapid synchronization and path control. Using the SIMATICS 7-1500(T) LCalcMC library and a motion profile calculation scheme with non-zero initial velocity and acceleration, more information can be obtained during the debugging and running of positioning programs. Furthermore, accurate calculation of the impact (jerk) provides a clear range and direction for parameter settings during debugging. Further research shows that the calculated values of the above seven motion profiles can be interpolated within the IPO cycle of SIMATICS 7-1500(T), and then, by utilizing position deviation and velocity pre-control functions, excellent motion control functions can be achieved on DSC-supporting drives.