Extract DualLoop Control EPOS4 ApplicationNotes 2021 03
Extract DualLoop Control EPOS4 ApplicationNotes 2021 03
In Brief
10.1 In Brief
In applications where gearheads (subsequently called gears), spindles, or belt systems are used to trans-
mit the motor rotation to the load, imperfections of these transmission elements do have an influence on the
performance of the load position control. If very accurate load positioning is required, it is common practice
to add an additional encoder at the load side to measure the exact load position. Such drive systems con-
tain two encoders; one on the motor shaft (so-called auxiliary encoder) and one on the load side (so-called
main encoder).
SCOPE
Table 10-88 Dual loop control | Covered hardware and required documents
TOOLS
Tools Description
Software «EPOS Studio» Version 3.5 or higher
10.2 Overview
With two encoders present in the system both position measurements can be used for feedback control in
order to improve performance of the load position control. This control method, the use of the two feedbacks
of both motor and load side, is called dual loop control. The structure of the EPOS4 dual loop control is
shown in Figure 10-143.
The EPOS4 dual loop control consists of two distinct control loops:
Auxiliary control loop controls the velocity of the motor and gives the motor current reference
as its output
Main control loop controls the position of the load and gives the motor velocity and acceleration
references as its outputs
A more detailed structure of EPOS4 dual loop control is shown in Figure 10-144.
The two loops are implemented with the following sampling periods:
T Auxiliary = 0.4ms
T Main = 1.2ms
KP mA s
_Auxiliary --------------- Auxiliary loop P gain 0x30AE 0x20
rad
KI mA
_Auxiliary --------- Auxiliary loop I gain 0x30AE 0x21
rad
FF mA s
_Auxiliary --------------- Auxiliary loop FF velocity gain 0x30AE 0x22
rad
2
FF mA s
_Auxiliary ----------------- Auxiliary loop FF acceleration gain 0x30AE 0x23
rad
Auxiliary loop observer position correction
l _Auxiliary 1 0x30AE 0x30
gain
Auxiliary loop observer velocity correction
l _Auxiliary Hz 0x30AE 0x31
gain
Nm
r Auxiliary ------------ Auxiliary loop observer friction 0x30AE 0x33
rpm
J Auxiliary 2 Auxiliary loop observer inertia 0x30AE 0x34
g cm
Table 10-90 Dual loop control | Auxiliary control loop parameters Object dictionary entries
K LowMain 1
--- Main loop P gain low bandwidth 0x30AE 0x01
s
K HighMain 1
--- Main loop P gain high bandwidth 0x30AE 0x02
s
H 1 Main loop gain scheduling weight 0x30AE 0x03
Table 10-91 Dual loop control | Main control loop parameters object dictionary entries
The parameters K Main , K HighMain , and H are the tuning parameters that can either be manually set
or they can be automatically calculated in an auto tuning procedure. The shape of the gain scheduling func-
tion for different values of the gain scheduling weight H is shown in Figure 10-145.
Figure 10-145 Dual loop control | Gain scheduling function for different values of main loop gain scheduling
weight
The following examples demonstrate the advantages of using dual loop control in eliminating the negative
effects of backlash and elastic motor load coupling. They also illustrate how the auto tuning procedure in the
dual loop control structure works.
Systems used for these illustrations are rotative systems comprising a motor with attached encoder and a
load with a respectively attached encoder. Motor and load are coupled with a gear and a shaft that can be
rigid or elastic.
SYSTEM COMPONENTS
In order to illustrate the advantage of using dual loop control for this configuration, regular PID position con-
trol is considered first. Thereby, the sensor on the load side is configured as the main sensor. After running
the auto tuning procedure, the parameters of the PID position controller are automatically calculated and
have the values listed in Table 10-93.
mA
0x30A1 0x01 Position controller P gain 95159.615 ---------
rad
mA
0x30A1 0x02 Position controller I gain 170609.607 ---------------
rad s
mA s
0x30A1 0x03 Position controller D gain 4247.317 ---------------
rad
mA s
0x30A1 0x04 Position controller FF velocity gain 175.721 ---------------
rad
2
mA s
0x30A1 0x05 Position controller FF acceleration gain 68.528 -----------------
rad
Table 10-93 Dual loop control | Use case 1: PID position controller parameters
Using the path planner and executing the trajectory with the maximal velocity of 1 rpm, an acceleration of
rpm
1000 ---------- , and a position change of 25 increments, the result obtained is as in Figure 10-147.
s
Figure 10-147 Dual loop control | Use case 1: Load position control with PID position controller
As seen, the reference tracking is generally good. However, after 700 ms (when the system should stop
moving and keep the load position fixed), several short changes in the actual load position may be
observed. These changes are caused by the backlash effects of the gear. Namely, the teeth of the gear are
imperfect to their theoretical shape and they have some play between them. Whenever the system reverses
the direction of motion or changes from movement to standstill, the use of a single loop controller may result
in oscillations of the load position due to nonlinear effects introduced by the backlash.
Now, the use of dual loop control in the application will be considered to illustrate how the negative effects
caused by the backlash can be eliminated.
The dual loop controller can also be tuned automatically by using the «Regulation Tuning Wizard». Before
starting dual loop tuning, the current controller must be properly tuned. Auto tuning of the dual loop control-
ler itself is done in two steps:
First, the auxiliary loop will be tuned using the respective dialog box given in Figure 10-148.
Upon pressing the ¤Auto tune¤ button, an identification experiment is conducted in which all the mechanical
parameters of the system relevant for the auxiliary loop are identified. In the tuning dialog box, stiffness and
damping of the feedforward PI controller and the bandwidth of the observer used to calculate motor velocity
can be adjusted. Moving the sliders to the right results in faster and more aggressive control in the auxiliary
loop. By applying the test signal, a visual representation of the auxiliary loop performance is being pro-
duced. The auxiliary loop should be fast and aggressive without a lot of overshoot in the signal and it should
be adjusted with the sliders until the desired performance is observed in the resulting test signal.
Figure 10-148 Dual loop control | Use case 1: Auxiliary loop tuning dialog box
Then the main loop can be tuned by using the main loop tuning dialog box. Upon pressing the ¤Auto tune¤
button, an identification experiment is executed in which the transfer function of the system drivetrain
together with the auxiliary loop control is identified.
CONSIDERATIONS
Running the experiment for tuning of the main loop makes sense only if the auxiliary loop has been
tuned before. The auxiliary loop controller is used as a part of the main loop identification experi-
ment and its parameters influence the calculation of the parameters in the main control loop.
The Bode plot of the experimentally determined transfer function and its fit are displayed in the
¤Identification¤ tab. Based on this Bode plot, an impression on the characteristics of the system to
be controlled can be gained. For example, if the Bode plot is relatively straight, it means that the
motor/load coupling is rigid. On the other hand if a resonant peak (a lob in the Bode plot) can be
observed, it means that the coupling is elastic and that the controller will try to handle this elasticity
by the use of the main loop filter.
The ¤Verification¤ tab in the dialog box contains the test signal of the resulting controller. The
«Bandwidth» of the controller can be adjusted using a slider. Higher bandwidth means faster and
more aggressive control behavior. However, it should be noted that for each system there are lim-
itations on the achievable closed loop bandwidth and that the auto tuning algorithm will consider
these limitations when calculating the main loop parameters. The other two sliders may be used to
set the «Bandwidth ratio» and the «Gain scheduling weight». These parameters influence the elim-
ination of the backlash effects and should be adjusted such that no backlash effects (as shown in
Figure 10-147) are visible in the verification signal. Increasing the «Gain scheduling weight»
(moving the slider to the right) and decreasing the «Bandwidth ratio» (moving the slider to the left)
has a positive effect on eliminating the negative effects caused by the backlash. The main loop tun-
ing dialog box is shown in Figure 10-149 and Figure 10-150.
Figure 10-149 Dual loop control | Use case 1: Main loop tuning dialog box with the «Identification» tab ac-
tive
Figure 10-150 Dual loop control | Use case 1: Main loop tuning dialog box with the «Verification» tab active
Dual loop controller parameters obtained after the auto tuning procedure for the considered application
example are given in Table 10-94.
1
0x30AE 0x01 Main loop P gain low bandwidth 221.34 ---
s
1
0x30AE 0x02 Main loop P gain high bandwidth 44.268 ---
s
0x30AE 0x03 Main loop gain scheduling weight 10.00 1
0x30AE 0x10 Main loop filter coefficient a 0 1
0x30AE 0x11 Main loop filter coefficient b 0 1
0x30AE 0x12 Main loop filter coefficient c 35530.0 1
0x30AE 0x13 Main loop filter coefficient d 376.0 1
0x30AE 0x14 Main loop filter coefficient e 35530.0 1
mA s
0x30AE 0x20 Auxiliary loop P gain 138.825 ---------------
rad
mA
0x30AE 0x21 Auxiliary loop I gain 2470.774 ---------
rad
mA s
0x30AE 0x22 Auxiliary loop FF velocity gain 0.151 ---------------
rad
2
mA s
0x30AE 0x23 Auxiliary loop FF acceleration gain 0.173 -----------------
rad
Auxiliary loop observer position correction
0x30AE 0x30
gain
0.950 1
Auxiliary loop observer velocity correction
0x30AE 0x31
gain
751.283 Hz
Auxiliary loop observer load correction mNm
0x30AE 0x32
gain
0.030 -------------
rad
Nm
0x30AE 0x33 Auxiliary loop observer friction 0 ------------
rad
0x30AE 0x34 Auxiliary loop observer inertia 20.48 2
g cm
0x30AE 0x40 Dual loop configuration miscellaneous 2 1
Table 10-94 Dual loop control | Use case 1: Dual loop load position controller parameters
The use of dual loop control results in load position control shown in Figure 10-151. As can be seen, neg-
ative effects caused by backlash are fully eliminated.
Figure 10-151 Dual loop control | Use case 1: Position control with dual loop controller
SYSTEM COMPONENTS
The first steps in properly configuring the dual loop controller for this application example is to run the cur-
rent controller auto tuning followed by the auxiliary loop auto tuning. Then, the main loop may be tuned. The
identification experiment that is run as part of the main loop tuning identifies the transfer function of the sys-
tem as seen by the main loop. The Bode plot of the identified transfer function is given in Figure 10-152.
The Bode plot indicates that the drivetrain has a resonant frequency at 48 Hz. At this frequency, the Bode
plot has a significant magnitude increase. The resonance is a direct consequence of the elastic coupling
between the gear and the load.
In order to achieve good control with the dual loop controller, the resonance must be taken into account
when designing the controller. In EPOS4 dual loop architecture this is done with the main loop filter, which is
automatically designed to neutralize the negative effects of the resonance. The transfer function obtained
by multiplying the automatically calculated main loop filter with the identified transfer function is shown in
Figure 10-152.
Figure 10-152 Dual loop control | Use case 2: Comparison of Bode plots
For cases with complex shapes of the identified Bode plot and if the automatic calculation of the main loop
filter does not give satisfactory performance, the main identification parameters may be saved. To do so
click right in the system identification area of the Regulation Tuning Wizards main loop tuning dialog
( Figure 10-153). Thereby, three files with the extension .csv are created. They contain the raw recorded
experimental data, fitted zeros and poles, and the experimental transfer function estimate respectively. The
saved values may be imported by an advanced calculation software and as such may be used to manually
configure the filter parameters. Note that such manual parameter configuration requires expert knowledge.
After running main loop tuning, the dual loop controller parameters as to Table 10-96 are obtained.
Figure 10-153 Dual loop control | Use case 2: Saving of the identification data
1
0x30AE 0x01 Main loop P gain low bandwidth 4.321 ---
s
1
0x30AE 0x02 Main loop P gain high bandwidth 120.12 ---
s
0x30AE 0x03 Main loop gain scheduling weight 10 1
0x30AE 0x10 Main loop filter coefficient a 1 1
0x30AE 0x11 Main loop filter coefficient b 42.846 1
0x30AE 0x12 Main loop filter coefficient c 93660.611 1
0x30AE 0x13 Main loop filter coefficient d 612.080 1
0x30AE 0x14 Main loop filter coefficient e 93660.611 1
mA s
0x30AE 0x20 Auxiliary loop P gain 112.32 ---------------
rad
mA
0x30AE 0x21 Auxiliary loop I gain 1109.41 ---------
rad
mA s
0x30AE 0x22 Auxiliary loop FF velocity gain 0 ---------------
rad
2
mA s
0x30AE 0x23 Auxiliary loop FF acceleration gain 0.18 -----------------
rad
Continued on next page.
The main loop filter is now used to eliminate the resonant effects. Therefore, turning the filter off may signifi-
cantly reduce the controller performance, or even lead to controller instability as illustrated in
Figure 10-154.
Figure 10-154 Dual loop control | Use case 2: Control performance with/without main loop filter
The reason for the controller to become instable when the filter is turned off lies in the fact that the system
has a resonant peak. In order for the controller to remain stable even in the case when the main loop filter is
not used, the controller bandwidth must be significantly reduced. However, in this case the oscillation at res-
onant frequency of the system remains.
Due to strong backlash, the performance of the dual loop controller obtained by the default settings in the
main loop auto tuning is not ideal. This is particularly the case in the phase where the load position is close
to reaching the target. This can be improved by adjusting the sliders for «Bandwidth ratio» and «Gain
scheduling weight». Thereby, moving the «Bandwidth ratio» slider to the left and the «Gain scheduling»
slider to the right in order that the «Main loop P gain low bandwidth» and the «Main loop gain scheduling
weight» are set to 15.32 1s and 20 respectively will result in improved tracking performance
( Figure 10-155).
Figure 10-155 Dual loop control | Use case 2: Control performance with default/fine-tuned main loop pa-
rameters
10.7 Conclusion
If a gear with backlash is involved and/or if the coupling between the motor and the load is elastic, the
described application examples show that using dual loop control results in better control performance than
using a PID position controller. In addition, using the main loop filter in the dual loop controller structure is
suggested when the drivetrain has a clearly prominent resonant frequency. If not the case, the main loop fil-
ter can be turned off especially with a high resolution main encoder.