3.9 Evaluation and optimization of the control parameters
3.9.1 Servos
This chapter provides information on using the position controller with ACOPOS servo motors
(McAcpAx library).
- Trace for controller cascade assessment
- Optimizing the control loop
- Further options for ACOPOS servo motors
3.9.1.1 Trace for controller cascade assessment
A typical trace configuration for diagnosing the controller cascade is listed below. The ACOPOS
sample time was set so that we can record ~1.2 seconds on the ACOPOS. If the test movement is
shorter, the sample time should be set smaller again. For certain analyses, individual ParIDs can
also be removed in order to achieve a lower sample time.
Figure 44: mappCockpit - Trace configuration - ACOPOS controller cascade
3.9.1.2 Optimizing the control loop
The main criterion for good position control is the stability of the control loop and the smallest
possible tracking error (LAG_ERROR). Since the following error will never disappear, it is important to set a clear goal for the maximum permitted following error before optimization. To do this, the requirements of the process must be evaluated in order to derive the accuracy requirement for the axis.
To evaluate the position control, a trace recording is started and a test movement is carried out.
The test movement is gradually increased towards the maximum values of the axis. First slowly
over the entire distance to set up and check the software end positions. Then with an appropriate safety distance to the end positions to the maximum dynamic. It is important to ensure that the axis can move beyond the target position by the following error value.
Danger!
During these tests, high speeds and forces are deliberately applied to the
mechanics. Loose or incorrectly assembled parts can become detached from the
system or even fly around. Therefore, special attention must be paid to safety!The software end positions are always related to the currently set referencing. If the
referencing is incorrect, mechanical damage can occur.
Evaluation of the trace diagrams:
The examples shown below were created on an ETAL410 system. The traces are intended to show
the fundamentally relevant information for setting the control loop. Since every mechanical system behaves slightly differently, they are only examples and cannot represent all possible cases.
Figure 45: ETAL410.1033-1
Example 1 - Effect of position resolution on the position controller
The selected position resolution of the axis has no influence on the set control parameters. Only
the resolution of the target position and thus the final position reached is changed.
The ParIDs (position, speed) recorded in the trace are in ACOPOS units and are therefore scaled by the value set in the resolution.
Figure 46: Position controller following error for identical movement, control with different resolution
Example 2 – Cogging torques (cogging)
The LVA13.R0030D000-0 has a number of pole pairs of 4. If you compare the oscillations of the
following error with the position, you can clearly see that they are always related to the position of the rotor. At slow speeds you can see a period every 45° and at fast speeds you can see a period every 90°. It can be assumed that this oscillation is caused by the characteristics of the rotor’s magnetic field. The deviation of 2.88° to 362.88° in the measurement is due to the resolution of the trace.
Figure 47: Evaluation of the superimposed vibration
Example 3 – Speed Control - Proportional Gain (Kv)
The proportional gain factor of the speed controller should be chosen as large as possible without the controller becoming unstable. The autotuning values are usually quite good here; if necessary, you can optimize them manually.
Figure 48: Automation Studio configuration - Acopos Micro control parameters – SCtrl Kv
In the left case with SCtrl Kv 0.2 you can see that the speed tracking error runs very evenly, while in the right case with SCtrl Kv 0.5 the course has a better relationship to the driven contour. On the position tracking error you can also see a difference in the remaining control deviation; with a stronger speed controller, the end position is reached better.
Figure 49: PCtrl Kv 350 ;SCtrl Kv 0.2
Figure 50: PCtrl Kv 350 ;SCtrl Kv 0.5
Example 4 – Position Control - Proportional Gain (Kp)
The proportional gain factor of the position controller should be chosen as large as possible without the controller becoming unstable. The autotuning values are usually quite good here, but if necessary you can optimize them manually.
Figure 51: Automation Studio configuration - Acopos Micro control parameters – PCtrl Kv
In the left case with PCtrl Kv 200 you can see that the position tracking error is significantly larger (worse), here we reach ~1000 units, while in the PCtrl 350 case only a maximum of ~550 units is achieved.
Figure 52:PCtrl Kp 200;SCtrl Kv 0.5
Figure 53:PCtrl Kp 350;SCtrl Kv 0.5
Example 5 – Speed Control – Integration Time (Tn)
If there is a permanent control deviation (position tracking error) at the end of a movement, an
integration component on the controller can lead to the deviation being corrected. Reasons for a
permanent deviation could be friction, gravity, process forces, etc. The smaller the time unit for the integration component, the stronger it is, 0.5 “weak” → 0.005 “strong” applies.
Figure 54: Automation Studio configuration - Acopos Micro control parameters – SCtrl Tn
In the left case with Tn 0.1 you can clearly see that it takes much longer to settle. In the right case with Tn 0.01, the integration component is significantly more effective and the target position is adjusted more quickly.
Figure 55: PCtrl Kp 350 ; SCtrl Kv 0.5 Tn 0.1
Figure 56: PCtrl Kp 350 ; SCtrl Kv 0.5 Tn 0.01
Example 6 – Integration Time (Tn) Speed controller vs. position controller
An integration component should only ever be used on one controller. If the I component is used in the speed controller, both the speed tracking error and the position tracking error are influenced. If the I component is used on the position controller, only the position controller is influenced.
Figure 57: PCtrl Kp 350 ; SCtrl Kv 0.5 Tn 0.01
Figure 58: PCtrl Kp 350 Tn 0.01;SCtrl Kv 0.5
Example 7 – FeedForward (Simple model-based feedforward)
The FeedForward function makes it possible to store a single-mass model of the load in the drive
controller. Based on the movement profile and the set parameters, an additive current
(FFCTRL_ISQ) is then calculated and applied directly to the motor. This relieves the load on the
position control, especially in the area of the acceleration phase.
Figure 59: Automation Studio configuration - Acopos Micro control parameter FeedForward
In the left case you can see the progression without FeedForward, here large position tracking
errors ~ 500 units can be seen, especially at the points where the acceleration changes. In the right case, the FeedForward function has been activated, which generates a current that matches the acceleration. We see that the position tracking error is now only ~ 200 units in size.
Figure 60: PCtrl Kv 350 ; SCtrl Kv 0.5 Tn 0.01 without FF
Figure 61: PCtrl Kv 350; SCtrl Kv 0.5 Tn 0.01 with FF
AS Help Guid: 24bedca2-0f94-4a43-a85a-ea47f386b4ea
Figure 62: Automation Studio help – FeedForward setting aid
“Standard” mode:
The tuning movement takes place on both sides of the starting position. For
short distances it may be that no valid result can be determined.
Passive mode:
In this mode, only the “Command” and “Direction” parameters are relevant. Only the
values “Positive” and “Negative” are permitted for the “Direction” parameter.
So that you can see the result values in the cockpit, you should first change the
controller mode.
Figure 63: mappCockpit - axis operation - configuration
The tuning is then started using “Mode: Passive” and “Command: Start”. The
active tuning is displayed in the Watch window.
Figure 64: mappCockpit - axis operation - watch
The movement is then carried out in the selected direction. Now the
tuning can be done using “Mode: Passive” and “Command: Finish”. The parameters are activated on the controller and displayed in the configuration window under Feed Forward.
It makes sense to carry out several runs of the tuning and to view the results from different directions “positive” and Summarize “negatives” and choose an average value for the parameters.
AS Help Guid: a3ac93e2-83c8-4828-9e94-4cffef4e0ca2
Figure 65: Automation Studio help - Manual setting of the FeedForward parameters
Figure 66: Automation Studio help – FeedForward setting aid excerpt
The setting values should be increased from small to large. Values that are
too large can cause heavy strain on the mechanics due to rapidly jumping and
excessive current values. During tests, it should also be checked beforehand
for a reasonable following error termination limit.
Example 8 – Servo Loop Optimizer (Frequency Response Analysis)
The procedure for using the Servo Loop Optimizer in connection with mappMotion is described in the guide mappCockpit.
A normal course can be seen for our test axis. There are no filters to set.
Figure 67: Servo Loop Optimizer - Speed Controller view
Figure 68: Servo Loop Optimizer - Position Controller view
Servo loop optimizer
The help contains several case studies in the subchapter “Using the Servo
Loop Optimizer”. Therefore, no further case studies are discussed in this
guide.AS Help Guid: 3dcfff9e-341e-48cc-b7a3-0fcc56da82f5
Figure 69: Automation Studio Help – Servo Loop Optimizer
in this Post there are also hints about the usage of SLO
Guide: Work with mapp Cockpit
3.9.1.3 Further options for ACOPOS servo motors
The ACOPOS is a very comprehensive system that is continually being improved and expanded.
The following list is intended to provide assistance in selecting additional features. Detailed
information about how it works can then be found in the Automation Studio help.
- ServoLoopOptimizer (frequency response analysis, filter parameterization)
- Model-based control (extended model-based control)
- Suppression of periodic disturbances
- Controller cascade cycle times
- Setting current controller mode
- PWM switching frequency
- Field weakening
- Sensorless operation
- Speed controller speed dead zone(ParID 1706 since 5.18.1)
3.9.2 Steppers
Stepper motors are usually operated in pure control value operation. In some applications,
however, the use of a position controller is necessary to improve positioning. This chapter provides information on using the position controller with stepper motors (McStpAx library).
- Background to position control in stepper motors
- Trace for controller cascade assessment
- Standstill current when control is activated
- Optimizing the control loop
- Notes on control behavior due to externally applied load
3.9.2.1 Background on position control for stepper motors
When the stepper motor is controlled, a magnetic field is impressed into the motor. This causes
the rotor to align itself based on this magnetic field, which fixes the position. However, the
magnetic forces have a certain spring effect, and external forces result in a deviation between the impressed microstep position and the actual rotor position.
This means that a stepper motor without control behaves in a slightly springy manner within a full step. Only when there is a deviation greater than one full step is it considered a step loss.
By activating the position control, the controller has the opportunity to shift the impressed
magnetic field in such a way that the spring effects due to different loads are compensated for and the rotor is tracked to the target position. The impressed magnetic field position then no longer corresponds to the target position, but is shifted so that the rotor is guided to the correct position.
3.9.2.2 Trace for controller cascade assessment
A typical trace configuration for diagnosing the controller cascade is listed below. Since all data is recorded on the PLC, the PLC sample time is the relevant setting and should be adapted to the
cycle time of TK#1 (0s → automatic definition). Since there is a sufficiently large memory available on the PLC, you can set sufficiently large values for the recording time.
Figure 70: mappCockpit - Trace configuration - controller cascade stepper
3.9.2.3 Standstill current with activated control
It should be noted that the position controller is active even in the PLCopen standstill state and that there are therefore compensating movements on the motor shaft. These movements must be able to be carried out by the motor with the standstill current, so it must be set to a correspondingly high level.
Example:
The motor is at a standstill and something is then pressing against the axle.
3.9.2.4 Optimizing the control loop
The main criterion for good position control is the stability of the control loop and the smallest
possible tracking error (LAG_ERROR). Since the following error will never disappear, it is important to set a clear goal for the maximum permitted following error before optimization. To do this, the requirements of the process must be evaluated in order to derive the accuracy requirement for the axis.
To evaluate the position control, a trace recording is started and a test movement is carried out.
The test movement is gradually increased towards the maximum values of the axis. First slowly
over the entire distance to set up and check the software end positions. Then with an appropriate safety distance to the end positions to the maximum dynamic. It is important to ensure that the axis can move beyond the target position by the following error value.
Setting of “Prediction time” to correctly display the lag error
Depending on the hardware structure, the data requires different runtimes via the fieldbus. Therefore, the time comparison between the target and actual position is carried out using the “Prediction time” value so that the following error is calculated correctly.
If the following error curve is identical to the orange line, the “Prediction time” is too small. If
the following error curve is identical to the blue line, the “prediction time” is too large.
If the following error curve is identical to the green line, the “prediction time” is correct.
The greater the acceleration, the better you can see the effect.
Figure 71: Effect of “Prediction time” on the following error (no-load case)
If there is a load, the curve may deviate from the figure above. In this case, the setting is correct if the lag error has the smallest course in terms of magnitude.
Stepper motors with active position control via the McStpAx library should
always be operated as directly as possible on the CPU to minimize dead times.
For X20 CPUs this would be the X2X link on the CPU itself. For APCs on an X2X
fieldbus interface which is provided by an interface card in a slot.
Compared to other SM modules, the X20SM1446-1 has an additional
module-specific component and therefore the delay is slightly larger.
AS Help Guid: 8936ca04-3e15-4ff7-934e-8d9cb18cfb1d
Figure 72: Automation Studio Help - McStpAx position control
“Minimal Latency” setting on the fieldbus
With this mode, the overall running time of the data can be reduced, which
has a positive effect on the “prediction time”. However, it should be noted
that the input delay setting reduces the usable computing time for task
class #1 to half. This means with a 2ms cycle time you only have 1ms
processing time in TK#1.Figure 73: Automation Studio configuration - CPU properties
Figure 74: Automation Studio configuration - Powerlink properties
Figure 75: Automation Studio configuration - bus coupler properties
AS Help Guid: 50b99665-c6a2-4d37-95f2-e18af0c9e462
Figure 76: Automation Studio Help – Best possible response time
Control parameter optimization
Example 1 - Proportional Gain
The system is stable but very sluggish, the load always lags - the selected Kp value should be increased between 15-25%.
Figure 77: Stepper – Trace Example 1.1
System is stable - the selected Kp value shows rapid control behavior.
Figure 78: Stepper – Trace Example 1.2
System is unstable – the selected Kp value should be reduced between 15-50%.
Figure 79: Stepper – Trace Example 1.3
The system is very unstable, the smallest excitations lead to an oscillation - the selected Kp value
should be significantly reduced between 50-90%.
Figure 80: Stepper – Trace Example 1.4
Example 2 – Directional Dependent Error or Friction
Here you can see that a different actual position is reached, depending on which direction the
target position is approached from. An I component can help here in order to regulate the
remaining control deviation.
Figure 81: Stepper – Trace Example 2
3.9.2.5 Notes on control behavior due to externally applied load
For example, if an external force is applied to the motor shaft through manual intervention, the
control loop begins with a corresponding counter reaction and shifts the magnetic field by
applying a corresponding manipulated variable (orange phase in the picture). As soon as the
external force is removed, the shaft jumps uncontrollably and with high dynamics to the position
of the magnetic field and is then returned to the target position by the controller. (Red phase in
the picture)
Figure 82: Response of the position controller of a stepper motor controlled using McStpAx
If the positional deviation is maintained for a long time by a large force, the magnetic field exceeds one full step and a step loss occurs. This can then be interpreted as a rattling noise. The motor then jumps by up to two full steps. Such behavior is a concrete sign of a current setting that is too low or that the motor is generally overloaded.
3.9.2.6 Notes on the resonance behavior of stepper motors
Depending on the mechanics, stepper motors can tend to excite resonances in a certain speed
range. These speeds should then be avoided for the process.
What influences behavior
- Motor current
- Microstep / full step operation
- Mechanics (e.g. belt tension)
Position control cannot improve this behavior; operation in the resonance range should also be
avoided for position-controlled axes.
Figure 83: Behavior of a stepper motor at different speeds (Near the resonance area)
3.10 Compensation for dead times on axis couplings
If we use the coupling functions (MC_GearIn, MC_CamIn,…) there may be dead times and therefore a speed-dependent position error due to the transfer time of the data from one axis to another.
3.10.1 Diagnosis of dead times in mappCockpit
In order for the motors to perform an identical movement, it is important that the position controllers get the same positions at the same time. It is therefore important to compare the data from PCTRL_S_SET, the axes involved, with each other.
Figure 84: Trace of a 1:1 coupling at 1440° with a speed of 5000°/s Delay 0.002s
From the trace you can determine the time offset of 0.002s. You can also clearly see that there is
no offset when standing still. If there is an offset when stationary, this must be taken into account when calculating the difference!
Figure 85: Trace of a 1:1 coupling at 1440° at a speed of 5000°/s without delay
3.10.2 Delay of the leading axis in Automation Studio
The leading axis (master) must be delayed using the “Total Delay time” parameter.
Figure 86: Automation Studio configuration – ACOPOS position controller
Figure 87: Relationship between position generator and position controller Position-ParID
Further information on the subject of signal delays in couplings can be found in
the TM417 training module and the Automation Studio help.
Guid: 4e7c1002-8e5c-4759-a61b-8162a52c1d4c
Figure 88: Automation Studio Help – Signal delays in couplings
3.10.3 Delay-free coupling within an ACOPOS multi-channel device
In order to be able to create an instantaneous coupling with, for example, a Gear_In on a multichannel device, you must use the axis cross connection. If you don’t do this, data will also be transmitted within a device via the Powerlink stack and there will be delays.
Cross-communication on the slave axis can be activated via a ParID table.
Then an “Alternative Value” feature is required so that the ParID of the cross connection can be
referenced when coupling.
During GearIn, the slave axis’ own axis reference is then specified as the master and the
“Alternative Value” is selected as the source.
Figure 89: Delay-free coupling on a multi-channel device
Further information on the topic of axes cross-connection can be found in the
Automation Studio help.
Guid: 0287a9ee-ff61-4405-b3f5-7925e34ca829
Figure 90: Automation Studio help – Axis cross connection