Digital Control System Design Project
Digital Control System Design Project
DIGITAL CONTROL
FINAL PROJECT
INTRODUCTION
OBJECTIVES
Calculate the error constant Kp, the steady-state error in the presence of
a unit step input and the settling time for the
transfer function of a discretized plant in closed loop.
DEVELOPMENT
Exercise 1: Assume that the transfer function of the plant is:
(a) Calculate the position error constant Kp, the steady-state error
stationary in response to a unit step input and the settling time
for the transfer function of the discretized plant without controller in
closed loop.
( )=Controlador
=Retenedor de orden cero
Plant
Entry
Exit
( )= ( ) ( ) ∗( ) ( )
( )= ( )− ( ) ( )
Now replacing (1) in (2)
E(s) = R(s) - Gp(s)Zoh(s)E*(s)
[E(s)=R(s)−Gp(s)Zoh(s)E∗(s)]∗
E*(s)=R*(s)−[Gp(s)Zoh(s)]*E*(s)
E*(s) + [Gp(s)Zoh(s)]*E*(s) = R*(s)
E*(s)[1+[Gp(s)Zoh(s)]*]=R*(s)
SCHOOL OF BASIC SCIENCES TECHNOLOGIES AND ENGINEERING
DIGITAL CONTROL
SCHOOL OF BASIC SCIENCES TECHNOLOGIES AND ENGINEERING
DIGITAL CONTROL
SCHOOL OF BASIC SCIENCES TECHNOLOGIES AND ENGINEERING
DIGITAL CONTROL
SCHOOL OF BASIC SCIENCES TECHNOLOGIES AND ENGINEERING
DIGITAL CONTROL
ESCUELA DE CIENCIAS BÁSICAS TECNOLOGÍAS E INGENIERÍAS
DIGITAL CONTROL
OVERBOOST
SCHOOL OF BASIC SCIENCES TECHNOLOGIES AND ENGINEERING
DIGITAL CONTROL
SCHOOL OF BASIC SCIENCES, TECHNOLOGIES, AND ENGINEERING
DIGITAL CONTROL
SCHOOL OF BASIC SCIENCES, TECHNOLOGIES, AND ENGINEERING
DIGITAL CONTROL
EXERCISE 2
SCHOOL OF BASIC SCIENCES TECHNOLOGIES AND ENGINEERING
DIGITAL CONTROL
[ ]
( )
1
s ( s +1 )
(
HG ( z=) 1−z
−1
z)
s
¿ ( 1−z−1 ) z
[ 1
+
1
s s +1s
2
−
1
]
−1 0.2z z z
HG ( z
) =(1−z )( ( 2
+
z−1 ) z−e−0.2
−
z−1
)
0.0187308 ( z +0.935525 )
¿
( z−1)(z−0.818731)
( )
1 0.0187308 ( z +0.935525 )
k v = limz−1( )
T z→1 ( z−1 ) ( z−0.818731 )
k v =0.04
Now the procedure is carried out to find the transfer function.
in closed loop and the position error in order to find the error in state
stationary in front of a step input.
( )
0.0187308 ( z +0.935525 )
( z−1 ) ( z−0.818731 )
k p =lim =1
(
0.0187308z+( 0.935525 )
)
z→1
1+
( z−1z−0.818731
)( )
1
e p= =0.5
1+ k p
Now the phase margin is given:
0.0187308 ( z +0.935525 )
HG ( z )=
( z−1 ) ( z−0.818731 )
SCHOOL OF BASIC SCIENCES TECHNOLOGIES AND ENGINEERING
DIGITAL CONTROL
1+0.5Tw
z=
1−0.5Tw
1+0.5 ( 0.2 ) w
z=
1−0.5 ( 0.2 ) w
( 1+ 0.1w )
z=
1−0.1w
HG (w=)
0.0187308
( ( 1+ 0.1w )
1−0.1w
+ 0.935525 )
( (1−0.1w
1+ 0.1w )
−1 1−0.1w −0.818731 )
)( (1+0.1w )
0.0187308 ( 1+0.1w+0.935525−0.0935525w )
HG ( w )=
(1+ 0.1w−1+0.1w ) ( 1+0.1w−0.818731+0.818731w )
0.1813+0.1818w
0.2w(¿)
¿
0.0187308 ( 1,935525+0.065525w )
HG ( w )=
¿
0.00121w+0.03625
HG ( w )=
0.0363w2 +0.0362w
G ( z )= ( 1−z−1 ) z
[ 2
k
s (s+1 ) ]
G ( z )= ( 1−z ) k (
−1
(
0.018273+0.01752z
( 1−z 1−0.81871−z
( −1 2
z ) −1−1
)
) −1
)
k ( 0.01873z+0.01752 )
G ( z )=
(z−1)(z−0.81871)
We perform a bilinear transformation.
1+0.5Tw1+ 0.1w
z= =
1−0.5Tw1−0.1w
SCHOOL OF BASIC SCIENCES TECHNOLOGIES AND ENGINEERING
DIGITAL CONTROL
1+0.1w
0.01873 +0.01752
1−0.1w
G ( w)=k
(
1+ 0.1w
1−0.1w
−1
1+0.1w
1−0.1w )(
−0.81871 )
k(−0.000332653w2−0.096332w+0.996585)
G ( w )=
w2 +0.996805w
With Kv=2 we assume a transfer function for the digital controller.
1+tw
G d ( w )=
1−αw
1+tw k(−0.000332653w2−0.096332w+0.996585)
k v =lim
w→0 ( 1−αw
( ) w2 +0.996805w
)=2
2
k= =2
0.999779
Now we proceed to design a controller that has an angle of 50° without
affect the constant k.
Thus 50-31.6=18.4, a margin between 8 and 12 degrees is recommended considering
the shift of the gain at the crossover frequency will be assumed to be 28°
maximum phase advance angle. To calculate the attenuation factor.
1−α
sinϕm=
1+α
We replace it with the angle
1−α
sen28=
1+α
( 1+α ) sen28=1−α
a=0.361
We find the point where the magnitude is not balanced.
we replace by w=jv in G(w).
1
−20 log =−4.425
√ 0.361
(√ ( ) √ ( ) )
2 2
2 v v
1+ 1+
300 10
vertG ( jv )=
v ❑√ 1+ v 2
The frequency is equal to 1.7
The crossing frequency is given by:
SCHOOL OF BASIC SCIENCES TECHNOLOGIES AND ENGINEERING
DIGITAL CONTROL
1
v c= =1.7
√ ατ
τ =0.9790ατ=0.3534
1+τw1+0.9790w
G d ( w )= =
1−αw1+0.3534w
( ( −0.000332653w−0.096332w+0.996585
)(
2
1+0.9790w
)
)
G D ( w ) G ( w )= 2
w + 0.996805w 1+0.3534w
We convert the transfer function of the compensator to z terms by
bilinear transformation medium where T=0.2:
z−1
w=10
z +1
G ( w )=
d
( z+1 )
z −1
1+0.9790 10
1+0.3534 (10
z+ 1 )
z−1
2.3798z−1.93869
G D ( z )=
z−0.558888
In MatLab we have:
SCHOOL OF BASIC SCIENCES, TECHNOLOGIES, AND ENGINEERING
DIGITAL CONTROL
2. PRACTICAL ACTIVITY
ACTIVITY 1
First, we must find the response of the plant in open loop:
Open loop plant response
p1=-1
p2=-2
k=10
Gps=zpk([],[p1 p2],k)
step(Gps);
SCHOOL OF BASIC SCIENCES, TECHNOLOGIES, AND ENGINEERING
DIGITAL CONTROL
CLOSED LOOP
Glcsc=tf(feedback(Gps,1))
[numsc, densc] = tfdata(Glcsc, 'v');
Wn=sqrt(densc(3))
zeta=(densc(2))/(2*Wn)
step(Glcsc,5);
DESIGN CONDITIONS
ts=1.9;
SI=19;
zita=-(log(SI/100))/(sqrt(pi^2+(log(SI/100))^2))
wn=4/(zita*ts)
name
0.4673
wn =
4.5047
Gcs=zpk([p1 p2],[0 -2*zita*wn],wn^2/k)
Gcs =
s (s+4.211)
Glccc =
20.293
----------------------
(s^2 + 4.211s + 20.29)
Test
T=0.1;
Gz = zpk(c2d(Gps, T, 'zoh'))
Gz =
0.04528 (z+0.9048)
---------------------
SCHOOL OF BASIC SCIENCES TECHNOLOGIES AND ENGINEERING
DIGITAL CONTROL
(z-0.9048) (z-0.8187)
Glcz =
Point 2
numDz = [0.01873 0.01752];
denDz = [(1-1) (1-0.81871)];
Kv = 2
sys = Kv*tf(numDz, denDz, 0.2)
margin(sys)
sisotool(sys)
Error constants such as the position error constant (Kp) and velocity error constant (Kv) serve as key indicators of a digital control system's performance in tracking reference inputs. The position error constant relates to the accuracy with which the system can maintain its output in the presence of a step input, affecting the steady-state error. The velocity error constant reflects the system's ability to follow a ramp input, indicating the capability to maintain accuracy over dynamic changes. Together, these constants help in assessing and optimizing the system for desired performance criteria, ensuring minimal error under different operating scenarios .
Using a lead-lag compensator in digital control systems offers the advantage of precise adjustment of both transient and steady-state performance. A lead component in such a compensator can provide phase lead, improving transient performance by increasing phase margin, thereby enhancing stability. Meanwhile, the lag component can improve steady-state performance by adjusting the gain to achieve the desired error constant. Together, they allow fine-tuning to meet specific design requirements such as a targeted phase margin, ensuring robust system behavior under different operating conditions .
The steady-state error for a closed-loop system with a unit step input is calculated using the position error constant Kp, which can be determined from the system's transfer function. The steady-state error (e_ss) is given by e_ss = 1/(1+Kp) when the system type permits. This calculation is significant because it quantifies the system's ability to track a reference input in the long-term, indicating the accuracy and performance of the control system in eliminating persistent deviations from the desired output .
Understanding transient response in digital control systems is vital for assessing how a system reacts to changes from one state to another before reaching steady-state. It is analyzed by examining characteristics such as rise time, peak time, overshoot, and settling time, which provide insights into the system's speed and stability. Evaluating these characteristics helps in designing controllers like PID or compensators that can modify transient behavior to meet performance objectives, such as minimizing overshoot and achieving faster settling times .
Simulating control systems using software like Labview and Matlab is crucial for verifying and visualizing theoretical models of digital control systems. These tools allow engineers and researchers to perform simulations that provide insights into system behavior under various conditions, enabling the analysis of transient and steady-state responses. Additionally, they facilitate the tuning and optimization of controllers by allowing for easy adjustments and real-time visual feedback, thus ensuring that the designed system meets the specified performance criteria before actual implementation .
The Z Transform is essential in the analysis and design of digital control systems as it allows for the modeling and transformation of discrete-time signals from the time domain to the frequency domain, facilitating the analysis of system dynamics and stability. This transformation enables the simulation and evaluation of control systems using tools like MATLAB, which allows for graphical verification of mathematical calculations and the design of controllers to improve system performance .
A lead compensator can enhance a digital control system by increasing the stability or the speed of response. Specifically, it helps to improve the transient response characteristics by adding phase lead, which can result in reduced overshoot and improved settling time. By modifying the frequency response of the system, a lead compensator can also improve the system's phase margin and gain margin, thus enhancing overall stability .
The phase margin of a discretized plant without a controller in open-loop is calculated by first determining the system's frequency response characteristics, often using a Nyquist or Bode plot. Specifically, the phase margin is the additional phase lag required at the gain crossover frequency (where the gain is 1) to bring the system to the verge of instability. The phase margin is important as it indicates the relative stability of the system; higher phase margins suggest that the system can withstand a greater degree of system changes or model inaccuracies before becoming unstable .
Fourier Sampling relates to stability in digital control design as it involves analyzing the frequency content of signals to ensure that the system behaves appropriately in different frequency ranges. It helps in understanding how various frequency components affect stability and response characteristics of the system. Proper sampling ensures that aliasing is avoided, which can introduce instability. By analyzing the Fourier spectrum, designers can ensure the system's stability by understanding and mitigating the effects of high-frequency components that might destabilize the system .
Designing a digital PID controller with specific requirements involves several steps. First, obtain the mathematical model of the plant and determine its response characteristics. Use this model to establish the controller parameters that achieve the desired performance, such as maximum thrust and settling time. These parameters are tuned iteratively using simulations, for instance in MATLAB, to meet the criteria. The PID controller can be adjusted by modifying the proportional, integral, and derivative gains to balance the trade-offs between speed, stability, and accuracy. Testing in simulation ensures that the designed controller meets all specified requirements before real-world implementation .