0% found this document useful (0 votes)
57 views

Design and Verification of PID Controller For Unstable System With Hardware-in-Loop Simulation

Uploaded by

fundacvlk7
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)
57 views

Design and Verification of PID Controller For Unstable System With Hardware-in-Loop Simulation

Uploaded by

fundacvlk7
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/ 5

2021 6th International Conference for Convergence in Technology (I2CT)

Pune, India. Apr 02-04, 2021

Design and Verification of PID Controller for


Unstable System with Hardware-in-Loop Simulation
Anusha Bangera, Bhagyashree Kinkar, Gayatri Thombare, Balu Bhusari and Prasiddh Trivedi
Department of Electronics Engineering
Ramrao Adik Institute of Technolgy, Navi Mumbai
Email: [email protected], [email protected], [email protected],
[email protected], [email protected]

Abstract—PID controllers have been a well-known device in between integer order and fractional-order PID controller has
2021 6th International Conference for Convergence in Technology (I2CT) | 978-1-7281-8876-8/21/$31.00 ©2021 IEEE | DOI: 10.1109/I2CT51068.2021.9418187

domestic as well as industrial processes. However, tuning its be made in [6]. An application of IMC-PID methods to process
parameters i.e. Proportional, Integral and Derivative can be a controller design for refinery and petrochemical plants has
tedious task. In spite of acquiring the precise values theoretically,
the odds of getting a similar outcome in practice is slim. Hence been explored in [7]. A real-time DSP based PID controller is
in this paper, we have taken an unstable system as our plant, tested in [8] and compared with state-feedback control.
modulated the signal using PID controller and obtained the Despite of accomplishing the optimal values of all three
parameters by implementing the Internal Model Control (IMC) parameters, the real-time implementation needs to be ensured.
technique. Furthermore, we tested this controller without making Instead of building a physical prototype of the controller, we
any physical prototype by using a dSPACE MicroLabBox which
is an all-in-one development system designed for laboratories, chose to test it using a kit which is capable of simulating
capable of creating a virtual simulation of the control unit’s the working of the PID controller in a virtual real time
working environment. At the end we built the controller and the operation known as dSPACE MicroLabBox. This device was
plant on DSP and MicroLabBox respectively to create a hardware developed in 2015 by the company dSPACE (digital signal
in loop (HiL) simulation and compared the theoretical and real processing and control engineering) founded in 1988 by Dr.
time simulation results.
Index Terms—PID, IMC, DSP, HiL, dSPACE, MicroLabBox Herbert Hanselmann and three other associate researchers
at the Institute of Mechatronics in University of Paderborn,
Germany. They are one of the world’s leading contributors of
I. I NTRODUCTION
tools used for developing, calibrating and testing electronic
For several years, control systems have been an essen- control units.
tial part in many instruments ranging from simple domestic In this paper, we will be discussing in details about the
appliances to elaborate industrial machines. Among various tuning method we used i.e. IMC based PID Design and show
controllers, PID has been a popular choice in industrial con- how we obtained the values of all the three parameters. After
trol systems as they sustain the desired value by ceaseless this, we will compare the simulation results produced by both
modulated control. Although there are only three parameters MATLAB Simulink and the dSPACE MicroLabBox.
involved which include Proportional, Integral and Derivative,
tuning can be challenging since it must be operated within the II. IMC BASED PID DESIGN
limitations of this controller. In addition to this, modulating The IMC Structure was first introduced by Morari and
an unstable system which follows a deviant path and fails to Zafiriou [1]. It is a two-step process which designed the
attain a steady state in respect to the time response curve has controller for optimal set point tracking and de-tuned for
proven to be a daunting task. robust performance by using a single tuning parameter(λ)
Various solutions have been proposed over the years, from known as the IMC filter. It can be illustrated in a simple block
the traditional mathematical methods such as Ziegler-Nichols, diagram shown in Fig-1.
Cohen-Coon to software tools involving computer automated
designs. These techniques however, are inadequate to tune
the PID controller for unstable systems. Internal Model Con-
trol (IMC) based PID controller design have proven to be
successful for the unstable systems. [1], [2]. A IMC-PID
design method has been implementation in [3] and real-time
performance is examined.
A Firefly algorithm has been explored for controller design
for unstable systems in [4]. The authors in [5] have performed
evolutionary algorithm based optimization of PID controller
gains. However, for unstable systems PID controller gains
remains to be touched upon. Also, a performance comparison Fig. 1. Block diagram of IMC structure

978-1-7281-8876-8/21/$31.00 ©2021 IEEE 1


Authorized licensed use limited to: ULAKBIM UASL - YILDIZ TEKNIK UNIVERSITESI. Downloaded on October 11,2024 at 09:16:46 UTC from IEEE Xplore. Restrictions apply.
This IMC structure can be rearranged to the feedback where a second order polynomial is selected to make q(s)
control structure shown in Fig-2. semi proper. Now solving for γ so that f (s = pu ) = 1
 
1 γ(1/τu ) + 1
f s= = =1
τu λ(1/τu ) + 1
   2
1 λ
γ +1= +1
5 5
   2  
1 λ λ
γ +1= +2 +1
5 5 5
      
Fig. 2. Rearranged block diagram of IMC structure 1 λ λ
γ = +2
5 5 5
Hence, IMC can be considered equivalent to the standard
Further algebraic manipulations can be done to compute the
feedback controller in the form:
value of γ in terms of λ.
q(s)   
gc (s) = (1) λ
1 − g̃p (s)q(s) γ=λ +2 (4)
5
Where gc (s) = Feedback Control, g̃p (s) = Internal Model Step 2. The IMC controller function is then computed as
and q(s) = Internal Model Controller.   
−1 −10s + 1 γs + 1
Also, the filter structure is suggested in [1] to obtain the PID q(s) = gp (s)f (s) = (5)
controller gains from the IMC controller. However, in case of 5 (λs + 1)2
unstable system, this method had to be altered. Rotstein and Substituting the value of q(s) and gp (s) in the equation
Lewin [9] modified this procedure using a more complex filter.
The steps involved for designing an IMC based PID controller q(s)
gc (s) = (6)
for unstable processes is as follows: 1 − g̃p (s)q(s)
Step 1. Choose the recommended filter f(s) which is in the γ γ(s) + 1
= (7)
form: 10(2λ − γ) γ(s)
γs + 1 Step 3. Comparing the final value of gc (s) with the standard
f (s) = (2)
(λs + 1)n PI controller,
Here, n is determined to make the controller function q(s) γ −(λ + 10)
kc = = (8)
semi proper. Also a value is found which satisfies the require- 10(2λ − γ) 10λ
ment of the filter f (s = pu ) = 1 where pu is an unstable
  
pole. λ
Step 2. Find the standard feedback controller using the τi = γ = λ +2 (9)
5
formula
After experimenting on MATLAB Simulink we found that
q(s) substituting λ = 0.004 gives a stable output hence we get the
gc (s) = (3)
1 − g̃p (s)q(s) final theoretical values as kc = −250.1 and τi = 0.008
Where q(s) = q̃(s)f (s) = g̃p−1 (s)f (s) and condense gc (s) III. M AIN R ESULTS
into ratio of two polynomials.
Although the procedure outlined in previous section pro-
Step 3. Rearrange it in the standard PID form and find
vides adequate PI/PID controller for with real unstable pole,
kc , τi and τd
it fails when the system has complex conjugate poles which
are unstable. This is demonstrated as follows.
A. An Example
Consider an unstable second order plant with complex
The first order transfer function for unstable system is given conjugate pair of unstable poles.
as
10 Kn (τn s + 1)
gp (s) = gp = (10)
−5s + 1 s2 + τ1 s + τ2

Where τu = 5 Here, the denominator polynomial s2 + τ1 s + τ2 has complex


kp = 10 Also the pole pu = (1/τu ) conjugate roots with positive real parts. The IMC controller
Step 1. The filter function is given by as described in literature would be
s2 + τ1 s + τ2 γs + 1
γs + 1 q(s) = (11)
f (s) = Kn (τn s + 1) (λs + 1)2
(λs + 1)2

2
Authorized licensed use limited to: ULAKBIM UASL - YILDIZ TEKNIK UNIVERSITESI. Downloaded on October 11,2024 at 09:16:46 UTC from IEEE Xplore. Restrictions apply.
where the filter transfer function must have the property that IV. S IMULATION AND H ARDWARE - IN -L OOP
V ERIFICATION
f (s)|s=unstable pole = 1 (12)
After calculating the gains from IMC procedure, the block
Assume that two complex conjugate unstable poles are s = diagram shown in Fig. 3 was implemented on Simulink
a ± jb, where a, b > 0. Now according to (12) and the result acquired from the simulation is shown
in Fig. 4 which indicated that the plant was stabilized
γs1 + 1
=1 (13) theoretically. For real time simulation, the controller was
λ2 s21 + 2λs1 + 1 later built on DSP C28335 board and the plant was built on
γs2 + 1 MicroLabBox. In order to display the waveform precisely
2 2 =1 (14)
λ s2 + 2λs2 + 1 on the CRO, a square wave generator was given as input.
Simplifying further to obtain relationship between γ and λ

s1 (λ2 s1 + 2λ − γ) = 0 (15)
2
s2 (λ s2 + 2λ − γ) = 0 (16)

From (15) and (16) it is clear that the root can either be zero
or it can be a real number. The chosen filter does not allow
the unstable root to be complex conjugate. Hence, the filter Fig. 3. Block diagram of Unstable system with PID Controller on MATLAB
function used in literature for unstable systems fails when the Simulink
unstable poles are not real.

A. Proposed Design of IMC-PID Controller for Unstable 1


Plants
Reference and Output
We propose a new filter function for IMC-PID controller
0.5
design for unstable plants when the unstable poles are complex
conjugate. Consider the new filter function to be used as
0
(γs + 1)2
f (s) = 2
(17)
s + λ1 s + λ2
−0.5
This filter function is proposed for the first time and it does not
fail for unstable plants with complex conjugate poles unlike
previous methods. Let us now carry out IMC-PID controller −1
design with this filter function. According the requirement in
0 5 · 10−2 0.1 0.15 0.2
(12) the value of filter function at the unstable poles must be
one. Thus, Time (sec)

(γs1 + 1)2 Fig. 4. Output view on MATLAB Simulink, red line represents the output of
=1
s21 + λ1 s 1 + λ2 the signal generator and blue line represents the output of stablized plant

(γs2 + 1)2
2 =1
s 2 + λ1 s 2 + λ2
A. dSpace Microlablbox
Further algebraic manipulation and comparing real and imag-
inary parts of the complex roots, Although the MATLAB Simulink provides output at a
given instantaneous time, it fails to present the real time
λ1 − 2γ output of the plant. Therefore, we have used a MicroLabBox
a= (18)
 2 which displays the real time operation of the controller
b = (2γ − λ1 )2 − 4(γ 2 − 1)(1 − λ2 ) (19) through a CRO. The dSPACE MicroLabBox (shown in Fig.
5) is a compact prototyping unit designed for laboratory
Further, processes. It has a 2 GHz Dual core real time processor with
λ1 − 2a a user programmable FPGA which gives the user flexibility
γ= (20) and runs the control loops at an exceptionally high speed.
2
λ21 (λ2 − 1) − 4a(λ2 − 1)λ1 + 4a2 λ2 − b2 = 0 (21) The MicroLabBox contains over 100 channels with three
connector panel variants providing versatility for different
Thus, this new proposed filter can provide the appropriate types of I/O connectors. It also has a Kensington lock without
values for γ, λ1 and λ2 which can then be used to derive the which the user cannot access the kit, thus providing theft
PID controller gains. protection. This MicroLabBox is supported with an extensive

3
Authorized licensed use limited to: ULAKBIM UASL - YILDIZ TEKNIK UNIVERSITESI. Downloaded on October 11,2024 at 09:16:46 UTC from IEEE Xplore. Restrictions apply.
range of dSPACE software packages including a Real Time environment in which the plant will function by executing the
Interface (RTI) for Simulink and a ControlDesk that gives real time model of the plant’s working environment. Hence
access to configure during run time with the means of the final output is generated as a waveform on the CRO as
graphical instruments. Hence, it possesses a high computation shown in Fig. 7 and the hardware implementation is shown
power integrated with very low I/O latencies, making this kit in Fig. 6. Comparing the results from MATLAB Simulink in
an ideal candidate for an extraordinary real time performance. Fig. 4 the with the real time simulation results, they did not
match as there was a steady state error present in real time
simulation.

Fig. 5. dSPACE MicroLabBox

B. Scaling
In order to establish a successful interfacing between the
DSP and dSPACE MicroLabBox, it is necessary to scale their
outputs as both these devices including the plant and controller
built in them have varied voltage range which is given below Fig. 6. Hardware interfacing of DSP board with dSPACE MicroLabBox
in the table.
Entities Voltage Range
DSP 0 to 3.3V
dSPACE -10V to +10V
Controller -500V to +500V
Plant -1V to +1V
From observing the above table, it is evident that these
entities are all are out of the range and communication is
not possible unless they are scaled. Hence while building
the controller and plant on DSP and dSPACE respectively, a
template was made for each device which scales all the output
signals. For DSP, a block was created which converts the
output signal of the controller using PWM RC filter circuit into
0 to 3.3V range and then sends this scaled signal to the plant Fig. 7. Final Output of the System displayed on the CRO where the yellow
in dSPACE. Another template is created for dSPACE where it line represents the signal generator and cyan line represents the plant
converts the signal coming from DSP into its numerical value
by taking the maximum and minimum value of the signal and
then later is sent to the plant. After receiving the final output V. C ONCLUSION
from the plant, dSPACE sends this signal to DSP for feedback. The design and implementation of PID controller for un-
Another block is used to convert the signal into 0 to 3.3V stable system using HiL on dSPACE has been presented. The
range so that the DSP can take this value as an ADC signal. IMC based PID procedure was used as the tuning method
When DSP receives this signal from dSPACE a block converts to find the three parameters and a real time simulation of
the signal into its numerical value which is suitable for the the system was shown on the CRO by using dSPACE Mi-
controller. This entire procedure is performed in seconds in a croLabBox. The cause of the steady state error in real time
continuous loop. Thus achieving a successful communication simulation will be further researched and the new proposed
between these devices. filter will be tested to rectify the error. After utilizing this
kit, we can attest that this device can be used in numerous
C. HiL Simulation Results areas including mechatronic research, robotics, biomedical
As seen in the earlier section after interfacing, both devices instruments, automobiles, aerospace etc. As the simulator is
performed in a continuous loop, providing a hardware in loop capable of creating a virtual working environment of the
simulation. The simulator in the MicroLabBox mimics the control unit without the hassle of creating a physical prototype

4
Authorized licensed use limited to: ULAKBIM UASL - YILDIZ TEKNIK UNIVERSITESI. Downloaded on October 11,2024 at 09:16:46 UTC from IEEE Xplore. Restrictions apply.
which can be sluggish and tedious to troubleshoot. The tests
can be carried out during the development process itself.
Consequently, the errors can be detected and eliminated at
the earliest stage, saving time and cost of industries.
VI. ACKNOWLEDGEMENT
We appreciate the guidance and support given to us by our
HOD Dr. Vishwesh Vyawahare and Principal Dr. Mukesh D.
Patil.
R EFERENCES
[1] M. Morari and E. Zafiriou, Robust Process Control, 1st ed. Prentice
Hall, Englewood Cliffs, NJ, 1989.
[2] D. Rivera, M. M., and S. Skogestad, “Internal Model Control for PID
Controller Design,” Industrial and Engineering Chemistry Process Design
and Development, vol. 25, no. 1, pp. 252 – 265, 1986.
[3] A. V. N. L. Anusha and A. Seshagiri Rao, “Design and Analysis of IMC
based PID Controller for Unstable Systems for Enhanced Closed Loop
Performance,” IFAC Proceedings, vol. 45, no. 1, pp. 41 – 46, 2012.
[4] S. Meena and A. Suresh, “Controller Design for Stable and Unstable
Systems Using Improved Firefly Algorithm,” Second International Con-
ference on Intelligen Computing and Control Systems (ICICCS), pp. 72
– 75, 2018.
[5] D. Maddi, A. Sheta, D. Davineni, and H. Al-Hiary, “Optimization of PID
Controller Gain Using Evolutionary Algorithm and Swarm Intelligence,”
2019 10th International Conference on Information and Communication
Systems (ICICS), pp. 199–204, 2019.
[6] M. H. Marzaki, M. H. F. Rahiman, R. Adnan, and M. Tajjudin, “Real time
performance comparison between PID and Fractional order PID controller
in SMISD plant,” 2015 IEEE 6th Control and System Graduate Research
Colloquium (ICSGRC), pp. 141–145, 2015.
[7] Z. Xinping, L. Quanshan, W. Huan, W. Wenxin, J. Qibing, and P. Lideng,
“The Application of Model PID or IMC-PID Advanced Process Control
to Refinery and Petrochemical Plants,” 2007 Chinese Control Conference,
pp. 699–703, 2007.
[8] E. Yolacan, S. Aydin, and H. M. Ertunc, “Real time DSP based PID and
state feedback control of a brushed DC motor,” 2011 XXIII International
Symposium on Information, Communication and Automation Technolo-
gies, pp. 1–6, 2011.
[9] D. E. Rotstein and D. R. Lewin, “Simple PI and PID Tuning for Open-
Loop Unstable Systems,” Industrial and Engineering Chemistry Research,
vol. 30, pp. 1864–1869, 1991.

5
Authorized licensed use limited to: ULAKBIM UASL - YILDIZ TEKNIK UNIVERSITESI. Downloaded on October 11,2024 at 09:16:46 UTC from IEEE Xplore. Restrictions apply.

You might also like