0% found this document useful (0 votes)
34 views6 pages

Design of Discrete Time PID Controller

The document discusses the design and implementation of a discrete-time PID controller, highlighting its advantages over continuous-time controllers, including faster response times. It details the conversion processes between analog and digital signals using ADCs and DACs, and emphasizes the importance of stability analysis in both the s-domain and z-domain. Additionally, it provides mathematical formulations and examples related to the design and performance evaluation of digital PID controllers.

Uploaded by

senshree250
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)
34 views6 pages

Design of Discrete Time PID Controller

The document discusses the design and implementation of a discrete-time PID controller, highlighting its advantages over continuous-time controllers, including faster response times. It details the conversion processes between analog and digital signals using ADCs and DACs, and emphasizes the importance of stability analysis in both the s-domain and z-domain. Additionally, it provides mathematical formulations and examples related to the design and performance evaluation of digital PID controllers.

Uploaded by

senshree250
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/ 6

Design of discrete-time PID controller

Ibrahim A . El- sharif Fathi O. Hareb Amer R. Zerek

Libyan academy of Gradute Libyan academy of Gradute Zawia University, Faculty


Studies , Electrical and Studies , Electrical and computer of Engineering/ EE
computer Eng.Department, Eng.Department, School of Department, Zawia, Libya,
School of Engineering [email protected]
[email protected]
[email protected],

Abstract: The discrete-time closed-loop PID controller is the controlled do not “speak the same language” and some
most popular controller. It is more faster time response and rise form of translation is required. The translation from
time than the continuous-time PID controller. Although, we controller language (digital) to physical process language
have to check the stability in a continuous-time of any digital (analog) is performed by a digital-to-analog converter, or
controller, but after using z-transform to convert the system to DAC. The translation from process language to digital
a digital control system we use the digital signals as an input to controller language is performed by an analog-to-digital
the computer. And treat those signals inside the microprocessor converter, or ADC. A sensor is needed to monitor the
by the A.T.U. after that convert them to analog to the final controlled variable for feedback control. The combination
element. of the elements discussed here in a control loop is shown
in 1-1 Variations on this control configuration are
Keywords: PID, ATU, RHS, LHS, ADC, DAC. possible. For example, the system could have several
reference inputs and controlled variables, each with a loop
1. Introduction: similar to that of Figure 1-1. The system could also
include an inner loop with digital or analog control. [ 1 ]
In the past few decades, analog controllers have often been
replaced by digital controllers whose inputs and outputs
are defined at discrete time instances. The digital
controllers are in the form of digital circuits, digital
computers, or microprocessors. The discrete-time PID
controller that means discussing the continuous signal
which it has been converted from continuous-time to
discrete-time , therefore always used analog to digital
converter [1] . Figure 2-1 The main structure of digital control system.
Digital signal which has been converted it must be
sampled therefore, Z-transformation and its inverse used to Z-transform used as a key for discrete-time systems to
solve the difference equations and convert the signal at solve the difference equations to show the output response of
continuous-time to a signal at discrete-time . analog to the control systems.
digital converter must be used after the signal treated by
the discrete-time PID controller to operate the plant for Suppose �(�) is a continuous function and we sample this
example : a level control plant , the analog subsystem function at time intervals of � , thus obtaining the data
includes the plant as well as the amplifiers and actuators
necessary to drive it. The output of the plant is periodically �(0), �(�), �(2�), … , �(��), …
measured and converted to a number that can be fed back 1
to the computer using an ADC. let � = � �� �� ������������ � = (�)

2. The main structure of a digital control system : Thus:



To control a physical system or process using a digital
controller, the controller must receive measurements from �(�) = � �(��)� −� (2 − 1)
the system, process them, and then send control signals to �=0
the actuator that effects the control action. In almost all
applications, both the plant and the actuator are analog 1 − � −��
���� (�) = (2 − 2)
systems. This is a situation where the controller and the �
To convert the equation (2-2) to a z-transform :

1 J Z=0
���� (�) = (1 − � −1 ) � � � (2 − 3)

3. Stability and mapping between s-domain and z- Re


domain:

Z1=1

Z2=0.3678

Figure 4-2 Root locus of discrete-time closed-loop system


on the z-plane

By draw the root locus in z-plane we must follow steps below :


1. Leave one of the roots on R.H.S.
2. Before the next root we look back ( if the number of
roots were odd there are a pole in that region,
otherwise -the number of poles were even- there no
more poles).
Figure 3-1 Stability between s-plane and z-plane 3. If there is a pole –in that region- it have to move
away from that place of positive real axis Breakaway
Clearly we could see the matching between s-domain and z- Point to meet its zero in–negative axis- the opposite
domain the circle on the R.H.S. represent the limit of stability axis that point called Break-in point.
because if the pole of z was inside the circle (the yellow stars),
• Take the derivative of the characteristic equation (4-2)
To find out the Break-away point and the Break-in point by :
the system is stable. But when the pole outside the circle (the
red stars) the system is unstable. If the pole is on the unit circle of the system :
(the blue stars), system is critical stable. In the same way on 1 + �(�) = 0 (4 − 2)
L.H.S. the poles at left of the s-plane (the yellow stars) the 0.6321 � �
system will be stable. But when the pole on the right side of the = −1
� 2 − 1.3678 � + 0.3678
s-plane (the red stars) the system is unstable. If the pole is on −(� 2 − 1.3678� + 0.3678)
the image axis of the s-plane (the blue stars), system is critical � =
0.6321�
stable. −� 2 + 1.3678� − 0.3678
=
• Equalize the = 0 :
4. Root locus : 0.6321�
��
��
Figure 4-1 Shows the discrete-time closed-loop control
system. ��
=
��
(0.6321�)(−2�+1.3678)−��−� 2 +1.3678�−0.3678�(0.6321)�
�� =0
��� �� � = 1 ��� ��� �� (�) = (0.6321)2 � 2
(� − 1) 2 2
−2� + 1.3678�+� − 1.3678� + 0.3678
= =0
�(�) 0.6321 �� 0.6321 � 2
2
�(�) = = (4 − 1) �� −� + 0.3678
�(�) (� − 1)(� − 0.3678) = =0 (4 − 3)
�� 0.6321 � 2
2
From equation (4-1) which represents the transfer function of � = 0.3678 → � = ± √0.3678
the discrete-time closed-loop control system shown in figure 4- �1 = 0.606 �2 = − 0.606
1, and we could see the both poles of the system � = 1 , � = As shown in figure 4-3 below the two open-loop poles
0.3678 ��� �ℎ� ���� ��� ���� � = � move from their location ( �1 = 1 , �2 = 0.3678 )
to the Breakaway point . After that they move away
from Breakaway point shaped a curve up and down
until they meet each other in the Break-in point going
to zero .
In the same manner, digital compensators designed in the z-
domain for discrete-time control system.

��

Figure 5-2 General form of a digital controller

Figure 5-2 shows the general form of digital control system.


The pulse transfer function of the digital
controller/compensator is written :
�(�)
= �(�) (5 − 3)
�(�)
Figure 4-3 Root locus move from Breakaway point to The closed-loop transfer function of the system becomes :
Break-in point . �(�) �(�) �(�)
= (5 − 4)
�(�) 1 + �(�) ��(�)
The characteristic equation is :
5. Design discrete-time PID controller:
1 + �(�) ��(�) = 0 (5 − 5)
In a continuous system, a differentiation of the error signal
�(�) can be represented as :
��
�(�) = (5 − 6)
��
By taking the Laplace transform with zero initial
conditions :
�(�)
= � (5 − 7)
�(�)
In discrete-time control system, a differentiation can be
approximated to :
�(��) − �(� − 1)�
�(��) = (5 − 8)

The z-transform will be :
�(�) 1 − � −1
Figure 5-1 Structure of continuous PID controller . = (5 − 9)
�(�) �
Hence, the Laplace operator can be approximated to :
As show in the figure 5-1 above the main component of the 1 − � −1 �− 1
�= = (5 − 10)
continuous PID controller are Proportional plus Integral plus � ��
Derivative . Digital PID controller from the equation (5-4) , inserting
equation (5-10):
Most commercial controllers provide full PID (also �− 1 2 �− 1
�� ��� �� ( ) + �� ( ) + 1 �
called three-term) control action. Including a term that is a �(�) = �� �� �(�) (5 − 11)
�− 1
function of the derivative of the error can ,with high-order �� ( )
��
plants, provide a stable control solution.[ 2 ] By simplified to give :
PID controller is represented as : �(�) �� (�2 � 2 + �� �1 � + �0 )
�� � = (5 − 12)
�(�) = �� �(�) + � � �� �(�) �(� − 1)
�� 0 Where
+ �� �� �̇� (�) (5 − 1) ��
By taking Laplace transform : �0 = (5 − 13)

�� (�� �� � 2 + �� � + 1 ) 2��
�(�) = �(�) (5 − 2) �1 = �1 − � (5 − 14)
�� � �
�� �� �� �
Where �� = ��� �� = �1 = � + + 1� (5 − 15)
�� �� � ��
Tustin’s Rule : also called the bilinear transformation, gives a
better approximation to integration since it is based on a
trapezoidal rather than a rectangular area.
2(� − 1)
� = (5 − 16)
�(� + 1)

Substituted the value of � into the denominator of equation


(5-4), still yield a digital PID controller of the form shown in
equation (5-12) where :
��
�0 = (5 − 17)

� 2��
�1 = � − − 1� (5 − 18)
2�� �
� ��
�1 = � + + 1� (5 − 19) Figure 5-4 Closed-loop frequency response for both lead
2�� � compensator designs.
To understand the output response of the PID controller we
have to see the procedures in the following Example : Table 5-1 System frequency domain performance :
Example (5-1):
The laser guided missile shown in figure 5-3 has an open-loop Closed-loop Gain Phase
transfer function (combining the fin dynamics and missile peak �� Bandwidth
margin margin
dynamics) of [ 2 ] 5.5 dB 13.75 dB 5.09 rad/s 30.6o
20
�2 (�) �3 (�) = 2 (5 − 20)
� (� + 5) (a) From figure 5-4 lead compensator two, the bandwidth
A lead compensator, has a transfer function of : is 5.09 rad/s or 0.81 Hz . Ten times this is 8.1 Hz, so
0.8 (1 + � ) select a sampling frequency of 10Hz, i.e. =0.1
�1 (�) = (5 − 21)
(1 + 0.0625 � ) seconds. For a sample and hold device cascaded with
(a) Find the z-transform of the missile by selecting a the missile dynamics.[ 2 ]
sampling frequency of at least 10 times higher than 1 − � −�� 20
�(�) = � �� 2 � (5 − 22)
the system bandwidth . � � (� + 5)
(b) Convert the lead compensator in equation (5-21) into �(�)
a digital compensator to find the step response of the 20
system, thus use Tustin’s rule, to find the step = (1 − � −�� ) � 3 � (5
� (� + 5)
response of the system.
− 23)
(c) Compare the response found with the continuous step
For � = 0.1 � , �������� (4 − 26) ���� �� �� ����� ∶
response, and convert the compensator that is closest
0.00296 � 2 + 0.01048 � + 0.0023
to its difference equation. �(�) = (5
� 3 − 2.6065 � 2 − 0.6065
− 24)

(b) Substituting the value of s which is in equation (5-10)


into the lead compensator given in equation (5-21) :
�� + (� − 1)
�(�) = 0.8 � �� �
�� + 0.0625 (� − 1)
��
5.4152 � − 4.923
�(�) = (5 − 25)
� − 0.3846
Figure 5-3 Laser guided missile
Solution : (c) Using Tustin’s rule by substituting the value of s of
equation (5-16) into lead compensator equation (9-23)
:
�(� + 1) + 2(� − 1)
�(� + 1)
�(�) = 0.8 � �
�(� + 1) + 0.0625 [2(� − 1)]
�(� + 1)
�(�)
�(�) =
�(�)
7.467 � − 6.756 The digital design for = 0.7 has a much slower time
= (5 − 26) response than its analog counterpart .
� − 0.111
It is possible to improve the design by trial and error, including
(d) From Figure (5-4) below, we could see clearly that redesign of the analog controller, but the design with = 0.5
the digital compensator using Tustin’s rule is closest may be acceptable. One must weigh the cost of redesign
to the continuous response. against that of relaxing the design specifications for the
From equation (5-26) particular application at hand. The final design must be a
�(�) compromise between speed of response and relative stability.[
�(�) = 1]
�(�)
7.467 − 6.756� −1
= (5 − 27) 7. Laboratory Experiments
1 − 0.111� −1 >> num=[20];
The difference equation for the digital compensator is :
�(��) = 0.111 �(� − 1)� + 7.467 �(��) >> den=conv([1 0 0],[1 5]);
>> Ts=0.1;
− 6.756 �(� − 1)� (5 − 28)
>> ncomp=0.8*[1 1];
>> dcomp=[0.0625 1];
6. Result discussion of the comparison between an
>> [nol,dol]=series(ncomp,dcomp,num,den);
analog and digital PID controller :
>> [ncl,dcl]=cloop(nol,dol);
For a special comparison of The time response between an
>> [numd,dend]=c2dm(num,den,Ts,'zoh');
analog PID controller and digital PID controller shown in
figure 6-1 after finding the Laplace transformation , tune the >> [ncomd,dcomd]=c2dm(ncomp,dcomp,Ts,'tustin');
parameters of the PID controller and convert the transfer >> printsys(num,den,'s')
function to the z-transformation , and plot the analog PID num/den =
20
controller with gain � = 100 and both digital PID controller
-----------
gains but with K= 9.62,13.2, the system has = 0.7 , 0.5, and
s^3 + 5 s^2
�� = 43.2, 46.2 ���/�, respectively. Both designs have a
>> printsys(num,den,'z')
sufficiently fast time constant, but the second damping ratio is
num/den =
less than the specified value of 0.7. Lower gains give an
20
unacceptably slow analog design. The time
-----------
response for the high- gain digital design is very fast.
z^3 + 5 z^2
However, it has an overshoot of over 4% but has a
>> printsys(ncomp,dcomp,'s')
settling time of 5.63 s.
num/den =
0.8 s + 0.8
------------
0.0625 s + 1
>> printsys(ncomp,dcomp,'z')
num/den =
0.8 z + 0.8
------------
0.0625 z + 1
>> [nold,dold]=series(ncomd,dcomd,numd,dend);
>> [nold,dold]=cloop(nold,dold);
>> [nold,dold]=series(ncomd,dcomd,numd,dend);
>> [ncld,dcld]=cloop(nold,dold);
>> subplot(211),step(ncl,dcl);
>> subplot(212),dstep(ncld,dcld);
Figure 6-1 Time step response for the digital PID design
with K = 9.62 (light gray), K = 13.2 (dark gray) and for
analog design (black) K =100.
References

1. M. Sam Fadali , ‘ Digital Control Engineering


Analysis and design ’ , Elsevier , 2009 .
2. Roland S. Burns, ‘ Advanced Control Engineering ’ ,
Butterworth-Heinemann,2001 .

Figure 6-2 Laboratory experiment : Comparison between


analog and digital PID controller

Conclusion

Due to both figures (4-5 and 4-6) we can clearly see the
difference between the continuous closed-loop PID controller
and digital closed-loop PID controller in the output responses
even if they are have the same parameters like = 0.7 .
There all a lot of benefits when we use digital PID controllers
instead of using continuous PID controller they could
summarized in following points :
1. Accuracy. Digital signals are represented in terms of
zeros and ones to represent a single number. This
involves a very small error as compared to analog signals
where noise and power supply drift are always present.
2. Implementation errors. The errors that result from
digital representation and arithmetic are negligible. By
contrast, the processing of analog signals is performed
using components such as resistors and capacitors with
actual values that vary significantly from the nominal
design values.
3. Flexibility. An analog controller is difficult to modify
or redesign once implemented in hardware. A digital
controller is implemented in firmware or software, and
its modification is possible without a complete
replacement of the original controller.
4. Speed. The speed of computer hardware has increased
exponentially. This increase in processing speed has
made it possible to sample and process control signals
at very high speeds.
5. Cost. Although the prices of most goods and services
have steadily increased, the cost of digital circuitry
continues to decrease.

You might also like