0% found this document useful (0 votes)
74 views11 pages

PID Controller Using Rapid Control Prototyping Techniques

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
74 views11 pages

PID Controller Using Rapid Control Prototyping Techniques

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

International Journal of Electrical and Computer Engineering (IJECE)

Vol. 9, No. 3, June 2019, pp. 1645~1655


ISSN: 2088-8708, DOI: 10.11591/ijece.v9i3.pp1645-1655  1645

PID controller using rapid control prototyping techniques

Odair A. Trujillo1, Nicolás Toro-García2, Fredy E. Hoyos3


1,2Departmentof Electrical and Electronics Engineering & Computer Sciences, Universidad Nacional de Colombia - Sede
Manizales, Colombia
3Universidad Nacional de Colombia - Sede Medellín - Facultad de Ciencias - Escuela de Física, Colombia

Article Info ABSTRACT


Article history: To analyze the performance of the PID controller in a buck type converter
implemented in real time. We begin by designing a continuous controller using
Received Jun 19, 2018 the analytical method for calculating PIDs. Pulse width modulation is then
Revised Dec 18, 2018 used and bifurcation diagrams analyzed to reveal some problems of switching
Accepted Dec 29, 2018 and sampling time. The model converter is then implemented with a PID
controller in dSPACE. The experimental results provide detailed requirements
of sampling frequency and switching speed, and show the performance of the
Keywords: PID controller. Converters are used in power generation solar systems and
conmuted power sources for feed telecommunication devices, smart grids, and
DC-DC converters other applications.
Dynamic power converters
analysis
Numerical bifurcation
PID hardware
PID software Copyright © 2019 Institute of Advanced Engineering and Science.
Rapid control prototyping All rights reserved.

Corresponding Author:
Fredy E. Hoyos,
Facultad de Ciencias - Escuela de Física,
Universidad Nacional de Colombia - Sede Medellín,
Carrera 65 Nro. 59A-110, Medellín, Colombia.
Email: [email protected]

1. INTRODUCTION
The buck converter is a switching power supply with two semiconductor devices [1], a transistor (𝑄)
and diode (𝐷), an inductor (𝐿), an output capacitor (𝐶), and its respective load as shown in Figure 1.
This system converts an unregulated DC voltage to another regulated lower voltage. The transistor switches
the input power 𝐸 by pulse width modulation (PWM) to feed the filter 𝐿𝐶. The diode conducts when the
transistor is off if there is positive current in the coil. The inductor does not allow rapid changes in current and
the capacitor does not support abrupt changes of voltage, creating between them a low pass filter.
A MOSFET is used for switching, thus, the control technique must determine the OFF and ON switch times.
This control form is known as pulse width modulation (PWM) [2]-[6].
Figure 2 shows a block diagram of the system under study. This system is divided into two major
subgroups: the hardware that includes the physical and electronic components and the software implemented
on a dSPACE, which performs the signal acquisition and implementation of PID control technique. The
hardware consists of a sensors (high-impedance resistors connected in parallel) to measure the 𝑉𝐶 state variable
(capacitor voltage). The converter’s switch is handled from the control and development card through the PWM
and the pulse is opto-isolated through fast optocouplers. The digital part is developed in the control and
development card dSPACE DS1104 [7], where the PID control technique is implemented. PID was used due
to its easy availability and compatibility with some series of PLCs, DCS software, Advantech 6022, and
popular software such as LabView and MATLAB [8], [9]. The card is programmed using the
MATLAB/Simulink® platform and has a display interface called “ControlDesk.” The controller is
implemented in Simulink® and downloaded to the DSP to operate at a given frequency [10]. The state variable

Journal homepage: http://iaescore.com/journals/index.php/IJECE


1646  ISSN: 2088-8708

comes to the controller through the 12-bit ADC input with a sampling rate set for the experiment at 10 kHz
and then 30 kHz. The controller parameters are set through variable gain blocks because they were tuned in
real time. At each sampling period, the controller calculates the duty cycle in real time and its equivalent in the
PWM control switch.

Figure 1. Schematic of buck converter model Figure 2. Block diagram of the proposed system

This article is intended for the digital PWM approach, which presents rich nonlinear dynamics and
has the following advantages: immunity to analog component variations; faster process design; low sensitivity
to changes in parameters; programmability; allows reduction or elimination of passive external components;
allows calibration of protection algorithms; and supports digital system interfaces for implementing nonlinear
control techniques [11]–[16]. However, the DPWM also has disadvantages as it is affected by two limitations:
quantization effects [12], [13] and delays in the control loop [17], [18].

2. BUCK CONVERTER MODEL

Where 𝑟𝑖𝑛𝑡 is the internal resistance of the MOSFET (𝑟𝑀 ) plus the resistance source (𝑟𝑠 ) and the resistance coil
(𝑟𝐿 ) plus the shunt resistor’s resistance used for the current measure (𝑟𝑀𝑒𝑑 ) as shown in Figure 1.
By summation of currents in the capacitor’s node we obtain

Solving and simplifying gives

Converting to matrix form gives

Int J Elec & Comp Eng, Vol. 9, No. 3, June 2019 : 1645 - 1655
Int J Elec & Comp Eng ISSN: 2088-8708  1647

𝑟𝑖𝑛𝑡 +𝑟𝐿 1 1 1
Converting to state variables and making 𝑎 = ,𝑏= ,𝑐= ,𝑑= , and maintaining signs gives
𝐿 𝐿 𝐶 𝑅𝐶

(1)

If the switch stays OFF (u=0), then the equation becomes X = ̇ AX because it does not take into account
the diode’s voltage.
In the case where the switch is closed, we find the transfer function using

which yields

(2)

In (2), the following values will be replaced to find the system’s response:
𝐸 = 40 𝑉, 𝐶 = 46.27 µ𝐹
𝑅 = 39.3 Ω, 𝑟𝑖𝑛𝑡 = 0.688 Ω
𝐿 = 2.47 𝑚𝐻, 𝑟𝐿 = 1.345 Ω

(3)

The poles for (3) are

The root locus is shown Figure 3. Therefore, the system is stable with the values used for constants
and it is underdamped. The response to stepped E volts can be seen in Figure 4, which shows an overshoot that
must be reduced and a steady-state error of about 2 volts, indicating the system is underdamped. In low-power
buck converters, such as computer sources, it is usual to find a zener diode and transistor-based regulation of
the converter output. This technique has the advantage of avoiding the use of control; however, it has the
disadvantage of increasing the probability of failure on points where it handles the power output. To obtain the
desired voltage with proper MOSFET handling and without adding elements that may fail in the converter
output is the goal of implementing a controller.

Figure 3. Root locus Figure 4. Step response

PID controller using rapid control prototyping techniques (Odair A. Trujillo)


1648  ISSN: 2088-8708

3. CONTINUOUS PID CONTROLLER


The method used is known as the “analytical method.” We start from the desired behavior as
determined by the second-order canonical equation, which should match the characteristic equation of the
closed-loop system with PID, to find the constants Kp, Kd, and Ki.

3.1. Desired response


𝑡𝑠 = 2.5 𝑚𝑠, 𝑀𝑝 = 10% = 0.1

Second-order canonical equation (desired behavior):

Poles on:

3.2. Closed loop with unknown PID constants


Replacing the parameters in the transfer function and making a change of variables 𝑚 = 8739229,
𝑛 = 1372, and 𝑝 = 9191377, we must close the loop with unknown PID. Block diagram as shown in
Figure 5.

Figure 5. Block diagram

This gives the transfer function with the unknown constants of PID:

However, before matching the characteristic equations, we must first increase the degree of the second-order
characteristic equation. This is achieved by adding a remnant pole to the characteristic equation so as to not
affect the desired behavior; in this case, that is five times away from the dominant poles. This modification
usually affects the amplitude, but the behavior of the canonical system is preserved:

Thus, it is now possible to match the coefficients:

Int J Elec & Comp Eng, Vol. 9, No. 3, June 2019 : 1645 - 1655
Int J Elec & Comp Eng ISSN: 2088-8708  1649

Replacing these constants in the closed-loop transfer function, the simulation is then performed with a step
value of E volts.
Figure 6 shows that the controlled system does not reach the desired overshoot; however, it is normal
to do some tuning, preferably when the controller is already modulated by the PWM so as to avoid double
tuning. The settling time and the steady-state error are the desired outcomes.

Figure 6. Comparison of step response in open-and closed-loop systems with PID

4. DISCRETE TIME SYSTEM


For a continuous time, system, the general solution is given by

Therefore, the solution in discrete time form is given by

(4)

The solution of Equation (4) is obtained as

Making 𝐴𝑑 = 𝑒 𝐴𝑇 y 𝐵𝑑 = (𝑒 𝐴𝑇 − 𝐼)𝐴−1 𝐵, the solution can be presented as

(5)

Then, the solution of 𝑒 𝐴𝑇 is

(6)

From (6) and applying Laplace’s anti-transformation, we obtain the matrix 𝑒 𝐴𝑇 :

(7)

where
𝑒 −𝜁𝜔𝑛 𝑡 𝑠𝑒𝑛(𝜔𝑑 𝑡) 𝑒 −𝜁𝜔𝑛 𝑡 𝑠𝑒𝑛(𝜔𝑑 𝑡)−𝜙
𝑇𝑒𝑟𝑚1 = , 𝑇𝑒𝑟𝑚2 = − ,
𝜔𝑑 √1−𝜁 2
and
√1−𝜁 2
𝜔𝑑 = 𝜔𝑛 √1 − 𝜁 2 ; 𝜙 = 𝑡𝑎𝑛−1 .
𝜁

At this point, we probe that 𝑒 𝐴𝑇 evaluated at 𝑡 = 0 is equal to the identity matrix.


PID controller using rapid control prototyping techniques (Odair A. Trujillo)
1650  ISSN: 2088-8708

Knowing 𝑒 𝐴𝑇 , an algorithm was implemented in MATLAB® to produce the discrete equivalent


shown in Figure 7. The continuous time system has 𝑇𝑠 = 5.9 ms, so we can choose a sampling rate
𝑇 = 50 μseg. Initializing the necessary variables, we obtain the output shown in Figure 7. Thus, we can see
how the discrete equivalent is very close to the real equivalent.

Figure 7. Discrete time equivalent

5. PID MODULATED BY PWM


The found constants will be used in this controller. Initializing variables and respective vectors to zero
the output (𝑉𝐶 ) (load voltage) shown in Figure 8. We observe that the overshoot appears even higher than
previously estimated; to reduce the overshoot, we follow Table 1 taken from [13], showing an online tuning
form of PID, depending on the output characteristics required by the user. This table is valid as long as the
constants to tune are calculated with a known method. Therefore, from the values that we have calculated, we
reduce 𝐾𝑖 = 2400 to obtain an overshoot close to zero as shown in Figure 9, which is very convenient for
such converters.

Figure 8. PID with PWM Figure 9. Tuned output (𝑉𝐶 ) using Table 1

Table 1. Effects of Independent P, I, and D Tuning


PID Rise Time Overshoot Settling Time Steady Stage Error Stability
⇑Kp Decrease Increase Small increase Decrease Degrade
⇑Ki Small decrease Increase Increase Large decrease Degrade
⇑Kd Small decrease Decrease Decrease Minor change Improve

6. BIFURCATION DIAGRAMS
Bifurcation diagrams are defined as qualitative and quantitative variations of the system’s dynamics
in front of the variation of parameters that can influence the stability of the system and characteristics of the
output, among other issues.

Int J Elec & Comp Eng, Vol. 9, No. 3, June 2019 : 1645 - 1655
Int J Elec & Comp Eng ISSN: 2088-8708  1651

The bifurcation diagram is a tool to analyze the dynamic system and provides information on it limits
of stable operation. For this system, only the constant Kp has to be varied as this affects the others.
This requires the industrial form of PID:

6.1. Vcand D bifurcation diagrams with Kp variations


Figures 10 and 11 show that the operating range of Kp has an upper limit of 19 units apx before the
system becomes chaotic.

Figure 10. 𝑉𝐶 ’s bifurcations Figure 11. D’s bifurcations

6.2. 𝑽𝑪 and 𝑫 bifurcation diagrams with varying T


Figure 12 shows that for small values of T (sampling period), the system has a one periodic wave for
high frequencies; however, by increasing the sampling period equal to the switching period (around 110 μseg),
the systems begins to turn chaotic.

Figure 12. 𝑉𝐶 ’s bifurcation diagram with varying T Figure 13. D’s bifurcation diagram with varying T

7. MATLAB/SIMULINK® SIMULATION
The next simulation performed in simulink moves us closer to real-time implementation performed in
dSPACE. Figures 14 and 15, respectively, show the circuit diagrams and elements used. Figure 16 displays the
output in open- and closed–loop systems with PID. Reducing the sampling rate to half causes the signal to lose
symmetry because it receives fewer sampling points and, therefore, the integration process struggles as it adds
more than needed or rests more than needed, for the same reason. This explains the strong oscillations seen in
Figure 17. This effect is accentuated in the implementation.

PID controller using rapid control prototyping techniques (Odair A. Trujillo)


1652  ISSN: 2088-8708

Figure 14. PID and PWM schema Figure 15. Buck converter

Figure 16. 𝑉𝐶 output in open- and closed-loop Figure 17. 𝑉𝐶 output with a minor sample
frequency systems with PID

8. EXPERIMENTAL RESULTS
For real-time implementation, the control and development card dSPACE was used. The converter’s
PID controller was implemented in simulink as diagrammed in Figure 18, where it controls the controller
implemented on hardware through the PWM generation block.

Figure 18: Rapid control prototyping to control the buck converter

Int J Elec & Comp Eng, Vol. 9, No. 3, June 2019 : 1645 - 1655
Int J Elec & Comp Eng ISSN: 2088-8708  1653

The results presented in this section were obtained with the experimental prototype and the parameters
defined in Table 2. By changing the reference voltage to 10 V, 20 V, and 30 V, and varying the sampling and
switching frequency, we show that the real system is much more sensitive to a low sampling rate. Figure 19
corresponds to a sampling frequency of 10 kHz. Increasing the sampling frequency three times (30 kHz) in
Figure 20 results in a little improvement in the regulated signal 𝑉𝐶 and, especially, a reduction in the sound
produced by the inductor due to the switching frequency growth of the transistor.
By increasing significantly the value of the capacitor to 376 μF as shown in Figure 21, we improve
the converter’s filtering and find a better answer with a lower steady-state error, even for the design parameters
shown in Table 2. The reason is that more capacity filters higher frequencies and, therefore, the regulation is
better, thus reducing considerably the system’s chaos. It can be seen in Figures 22 and 23 that if we make
instant load changes going from 14.59 Ω to 39.3 Ω with a capacitor of 376 μF and switching to 10 kHz, then
the system regulates too well with errors less than 2%; hence, not only the good performance of the PID
controller must be considered.

Table 2. Experimental Prototype Data


Parameter Value
𝑅: Load resistance 39.3 Ω
𝐶: Capacitance 46.27 and 376 𝜇𝐹
𝐿: Inductance 2.473 𝑚𝐻
𝑟𝑖𝑛𝑡 : Internal resistance of the source 0.688 Ω
𝑟𝐿 : Internal resistance of the inductor 1.345 Ω
𝐸: Input voltage 40.086 𝑉
𝐹𝑐: Switching frequency 10 kHz and 30 kHz
𝐹𝑠: Sampling frequency 10 kHz and 30 kHz
Kp: Proportional gain 2.7162
Kd: Derivative gain 0.0011245
Ki: Integral gain 2400

Figure 19. 𝑉𝐶 output with 𝐶 = 46 µF, Vc at 10 kHz Figure 20. 𝑉𝐶 output with 𝐶 = 46 µF, Vc at 30 kHz

Figure 21. 𝑉𝐶 output with 𝐶 = 376 µF at 10 kHz Figure 22. 𝑉𝐶 output with load changes 𝑅 with 𝐶 = 376 µF

Figure 23. I load 𝑖𝑅 with load changes 𝑅 with 𝐶= 376 µF

PID controller using rapid control prototyping techniques (Odair A. Trujillo)


1654  ISSN: 2088-8708

9. CONCLUSIONS
Because the increased value of the capacitor produced a substantial improvement in the system, it is
necessary to propose a detailed study of the buck converters currently on the market in order to determine and
compare which and what values of their elements are most appropriate to apply with different control
techniques. It is likely that the implemented converter does not have the best features to adequately respond to
PID control. The PID controller in the continuous case shows good performance in terms of regulating output
voltage (𝑉𝐶 ). In some systems, a continuous PID control can react in a way and when is modulated by PWM
change substantially; therefore, we should not assume that what is found in continuous time can be applied
without restrictions in discrete time. The switching and sampling frequencies affect a major proportion of the
integral because it needs to add the highest possible amount of points to successfully complete the integration
process. Having hardware that supports high sampling and switching frequencies is a very important factor
when implementing a system. For the implemented converter, the PID controller did not respond in the best
way. It is necessary to filter or remove the derivative and select appropriate sampling and switching
frequencies.

ACKNOWLEDGMENTS
This work was supported by the Universidad Nacional de Colombia, Sede Medellín under the projects
HERMES-34671 and HERMES-36911. The authors thank the School of Physics for their valuable support to
conduct this research. This research paper corresponds to “programa reconstrucción del tejido social en zonas
de pos-conflicto en Colombia del proyecto Modelo ecosistémico de mejoramiento rural y construcción de paz:
instalación de capacidades locales,” financed by the “Fondo Nacional de Financiamiento para la Ciencia, la
Tecnología y la Innovación, Fondo Francisco José de Caldas con contrato No 213-2018 con Código 58960.”

REFERENCES
[1] Yousefzadeh V. Haitao Hu. and Maksimovic D., “Nonuniform A/D quantization for improved dynamic responses
of digitally controlled DC–DC converters,” Power Electronics, IEEE Transactions on, Vol. 23 , no. 4,
pp. 1998 - 2005, 2008.
[2] DeGusseme K. VandeSype D.M., VandenBossche A.P. DeBelie F.M.L.L., and Melkebeek J.A. “Small-signal z-
domain analysis of digitally controlled converters,” Power Electronics, IEEE Transactions on Vol. 21 , no. 2,
pp. 470 - 478, 2006.
[3] Maksimovic D. and Zane R., “Small-signal discrete-time modeling of digitally controlled DC-DC converters,”
Computers in Power Electronics, 2006. COMPEL ’06. IEEE Workshops on, pp. 231 - 235, 2006.
[4] Zane R. Maksimovic D. and Erickson R. “Impact of digital control in power electronics,” Power Semiconductor
Devices and ICs, 2004. Proceedings. ISPSD ’04. The 16th International Symposium on, pp. 13 - 22, 2004.
[5] Maksimovic D. Prodic A. and Erickson R.W., “Digital controller chip set for isolated dc power supplies,” Applied
Power Electronics Conference and Exposition, 2003. APEC ’03. Eighteenth Annual IEEE Vol. 2, pp. 866 - 872,
2003.
[6] Peterchev A.V. and Sanders S.R., “Quantization resolution and limit cycling in digitally controlled pwm converters,”
Power Electronics, IEEE Transactions on, Vol. 18 , no. 1 , Part: 2, pp. 301 - 308, 2003.
[7] M. Habbab, A. Hazzab, and P. Sicard., “Real Time Implementation of Fuzzy Adaptive PI-sliding Mode Controller
for Induction Machine Control,” International Journal of Electrical and Computer Engineering (IJECE), Vol. 8,
No. 5, pp. 2884-2894 , October 2018.
[8] E. Rakhman, Feriyonika., “Distributed Control System Applied in Temperatur Control by Coordinating Multi-loop
Controller,” Telecommunication Computing Electronics and Control (TELKOMNIKA), Vol. 16, No. 4,
pp. 1568-1576, August 2018.
[9] A. Prayitno, V. Indrawati, I. I. Trusulaw, “Fuzzy Gain Scheduling PID Control for Position of the AR.Drone,”
International Journal of Electrical and Computer Engineering (IJECE). Vol. 8, No. 4, pp. 1939-1946, August 2018.
[10] F. E. Hoyos, J. E. Candelo, and J. A. Taborda, “Selection and Validation of Mathematical Models of Power
Converters using Rapid Modeling and Control Prototyping Methods,” International Journal of Electrical and
Computer Engineering (IJECE), Vol. 8, No. 3, pp. 1551-1568, June 2018.
[11] Prodic A. Hao P, Maksimovic D. and Alarcon E., “Modeling of quantization effects in digitally controlled DC-DC
converters,” Power Electronics, IEEE Transactions on, Vol. 18 , No. 1 , Part. 2, pp. 301 - 308, 2003.
[12] Liu C.P. Fung C.W. and Pong M.H. “A diagrammatic approach to search for minimum sampling frequency and
quantization resolution for digital control of power converters,” Power Electronics Specialists Conference, 2007.
IEEE, pp. 826 - 832, 2007.
[13] Gregory Chong. Kiam Heong Ang. and Yun Li., “PID control system analysis, design, and technology,” IEEE
Transactions on control systems technology, Vol. 13, No. 4, July 2005.
[14] E. Fossas and G. Olivar, “Study of chaos in the buck converter,” IEEE transactions on Circuits and Systems-I:
Fundamental Theory and Applications, 43, 13–25, 1996.

Int J Elec & Comp Eng, Vol. 9, No. 3, June 2019 : 1645 - 1655
Int J Elec & Comp Eng ISSN: 2088-8708  1655

[15] D.C Hamill, J.H.B. Deane, and D.J Jefferies, “Modeling of chaotic dc-dc converters by iterated nonlinear mappings,”
IEEE transactions on Power Electronics, 7:25–36, 1992.
[16] D. Hart, “Electrónica de Potencia,” Prentice Hall, Madrid, España, 2001.
[17] N. Mohan, T. Undeland, and W. Robbins, “Power Electronics: Converters. Aplications and Design,” J. Wiley, 1995.
[18] G. Olivar, “Chaos in the Buck Converter,” PhD thesis. Universidad Politécnica de Cataluña. Spain, Available at:
http://www.tdx.cat/handle/10803/5841, 1997.

BIOGRAPHIES OF AUTHORS

Odair A. Trujillo: received a B.S. in electrical engineering and M.S. in automatics from Universidad
Nacional de Colombia, Manizales in 2008 and 2013, respectively. His research interests include
nonlinear control, nonlinear dynamics of nonsmooth systems, and power electronic converters. He is
a member of the reasearch group in power resources GIRE.

Nicolás Toro: received a B.S. in electrical engineering and Ph.D. in automatics from Universidad
Nacional de Colombia, Manizales in 1983 and 2012, respectively, as well as an M.S. in production
automatic systems from Universidad Tecnológica de Pereira, Colombia in 2000. He is currently an
Associate Professor in the Department of Electrical Engineering, Electronics, and Computer Science,
Universidad Nacional de Colombia, Sede de Manizales. His research interests include nonlinear
control, nonlinear dynamics of nonsmooth systems, and power electronic converters. He is a member
of the reasearch group in power resources GIRE (Código colombiano de registro: COL0144229), at
Universidad Nacional de Colombia. https://orcid.org/0000-0001-8317-4126

Fredy E. Hoyos: electrical engineer, MEng Industrial Automation, Ph.D in Automation; Assistant
Professor, Science Faculty, School of Physics, Universidad Nacional de Colombia Sede Medellín,
Colombia; E-mail: [email protected]. His research interests include nonlinear control, nonlinear
dynamics of nonsmooth systems, and power electronic applications. He is an Associate Researcher in
Colciencias and a member of the reasearch group in Digital Signal Processing for Real-Time Systems
at Universidad Nacional de Colombia. https://orcid.org/0000-0001-8766-5192

PID controller using rapid control prototyping techniques (Odair A. Trujillo)

You might also like