Professional Documents
Culture Documents
CS EE380 Lec04 Expt3
CS EE380 Lec04 Expt3
Lecture 4: Experiment 3
EE380 (Control Systems)
Contents
1 Announcements 4
I Procedure of Exp.3 5
2 Outline of the experiment 6
6 Discretization 10
JJ
II
J
I
Back
Forward
Close
4/18
Announcements
• Before doing an experiment, download latest versions of sup-
porting documents from Brihaspati.
• Turn off power supply to board when not programming dsPIC or
taking readings.
• After completion of experiment
– Shut down PC, FG, PS.
– Remove PICkit 2 from dsPIC board.
JJ
II
J
I
Back
Forward
Close
Part I 5/18
Procedure of Exp.3
JJ
II
J
I
Back
Forward
Close
6/18
H (s) Saturation
û 29 u
u u 1 Vreq
≤ 0.8 actual δ
PWM H-bridge Motor
ω
2
s + 10s + 29 Vs Vs
Here, û is controller’s output, uactual is numerical value of voltage applied to motor’s arma-
ture. Vreq is actual voltage applied to motor’s armature, δ is duty ratio of PWM signal.
Realization on hardware
• Utilize the various components of an integrated development environment (IDE):
editor, compiler, linker, debugger, and programmer to program a µC.
• Program controller using C language into µC.
• Monitoring: read data into PC from µC using UART modules.
JJ
Analysis II
J
• Compare actual performance with predicted performance.
I
Back
Forward
Close
8/18
29
Prefix s2 +10s +29
to math model from Exp.1 Program H (s) into dsPIC
Discretization
a1 s + a0
s2 + b1 s + b0
Simulation
diagram
ẋ1 = x2
ẋ2 = −b0 x1 − b1 x2 + u
y = a0 x1 + a1 x2
Euler’s
approximation
JJ
x1(k+1) = x1(k) + ∆t x2(k) II
x2(k+1) = −b0 ∆t x1(k) + (1 − b1 ∆t) x2(k) + ∆t uk J
y k = a 0 x 1( k ) + a 1 x 2( k ) I
Back
Forward
Close
11/18
JJ
II
J
I
Back
Forward
Close
13/18
1
a n sf o r m Z −
Lap
la c e T ra n sf o r m
Z -tr a n sfor m Z
l a c e T r a n sf or m
e Z -tr
ap
rs
eL
ve
Bilinear Transform
s
In
er
v
In = Tustin’s method
G (s) G (z)
2 z −1 1+ sT2s
s= or z =
Ts z+1 1− sT2s JJ
• Both s-domain & z-domain are fictitious domains. II
• s-domain simplifies working with differential equations; z-domain simplifies working with J
difference equations. I
• Bilinear transform is not the only way to go G (s) ↔ G (z). Back
• Ts determined by Nqyquist sampling rate. Forward
Close
14/18
G (s) ←→ G (z)
• Consider definitions of L and Z
Z ∞
Y (s) = L {y(t)} , y(t)e−st dt
t =0
∞
Y (z) = Z {y(k )} , ∑ y ( k ) z−k
k =0
• Let σ = [b1 b2 b3 − a1 − a2 − a3 ]| .
• Suppose we have data of u(k) and y(k) for k = 0, 1, . . . , N.
• Problem: Find σ such that (1) holds for this data.
I.E., find parameters of a TF that fits to input-output data.
• Let error in the fit be
ε(k, σ ) = b1 u(k − 1) + b2 u(k − 2) + b3 u(k − 3) − y(k) JJ
− a1 y ( k − 1) − a2 y ( k − 2) − a3 y ( k − 3). II
J
• Modified problem: Find σ to minimize J (σ ) , ∑kN=0 ε2 (k, σ). I
Back
• If J (σ = σ0 ) = 0, then find best estimate σ̂ of σ0. Forward
Close
Part III 18/18
other.
JJ
II
J
I
Back
Forward
Close