Download as pdf or txt
Download as pdf or txt
You are on page 1of 45

Rotary Motion Servo Plant: SRV02

Rotary Experiment #02:


Position Control
SRV02 Position Control using QuaRC
Student Manual
SRV02 Position Control Laboratory Student Manual
Table of Contents
1. INTRODUCTION..........................................................................................................................................1
2. PREREQUISITES.........................................................................................................................................1
3. OVERVIEW OF FILES..................................................................................................................................2
4. PRE-LAB ASSIGNMENTS.............................................................................................................................3
4.1. Desired Position Control Response..................................................................................................3
4.1.1. Peak Time and Overshoot......................................................................................................................4
4.1.2. Steady-state Error...................................................................................................................................
4.1.3. SR!"2 Position Control Spe#i$i#ations.................................................................................................%
4.2. P! Control Desi&n............................................................................................................................'
4.2.1. Closed-loop Trans$er ()n#tion...............................................................................................................'
4.2.2. (indin& *ains to Satis$y Spe#i$i#ations...............................................................................................1"
4.2.3. Control *ain +imits.............................................................................................................................13
4.3. Steady-state Error d)e to a Ramp Re$eren#e..................................................................................14
4.3.1. Ramp Steady-State Error )sin& P!......................................................................................................14
4.3.2. P,! Control..........................................................................................................................................1
4.3.3. Ramp Steady-State Error )sin& P,!.....................................................................................................1-
4.3.4. ,nte&ral *ain Desi&n............................................................................................................................1%
5. IN-LAB PROCEDURES...............................................................................................................................19
..1. Position Control Sim)lation...........................................................................................................1'
..1.1. Set)p $or Position Control Sim)lation.................................................................................................2"
..1.2. Sim)latin& Step Response )sin& P!....................................................................................................21
..1.3. Sim)latin& Ramp Response )sin& P! and P,!....................................................................................2
..2. Position Control ,mplementation....................................................................................................31
..2.1. Set)p $or Position Control ,mplementation..........................................................................................32
Document Number 706 Revision !0 Pa"e i
SRV02 Position Control Laboratory Student Manual
..2.2. ,mplementin& Step Response )sin& P!................................................................................................33
..2.3. ,mplementin& Ramp Response )sin& P! and P,!...............................................................................3.
6. RESULTS SUMMARY.................................................................................................................................41
. REFERENCES...........................................................................................................................................42
Document Number 706 Revision !0 Pa"e ii
SRV02 Position Control Laboratory Student Manual
1. ntrodu!tion
The o/0e#tive o$ this e1periment is to develop a $eed/a#k system that #ontrols the position o$ the rotary
servo load sha$t. 2sin& the proportional-inte&ral-derivative 3P,D4 $amily5 a #ompensator is desi&ned to
meet a set o$ spe#i$i#ations.
The $ollo6in& topi#s are #overed in this la/oratory7
Desi&n a proportional-velo#ity 3P!4 #ompensator that #ontrols the position o$ the servo load
sha$t a##ordin& to #ertain time-domain re8)irements.
9#t)ator sat)ration.
Desi&n a proportional-velo#ity-inte&ral 3P,!4 #ontrol to tra#k a ramp re$eren#e si&nal.
Sim)late the P! and P,! #ontrollers )sin& the developed model o$ the plant and ens)re the
spe#i$i#ations are met 6itho)t any a#t)ator sat)ration.
,mplement the #ontrollers on the :)anser SR!"2 devi#e and eval)ate its per$orman#e.
2. Prere"uisites
,n order to s)##ess$)lly #arry o)t this la/oratory5 the )ser sho)ld /e $amiliar 6ith the $ollo6in&7
Data a#8)isition #ard 3e.&. :%45 the po6er ampli$ier 3e.&. 2P;45 and the main #omponents o$
the SR!"2 3e.&. a#t)ator5 sensors45 as des#ri/ed in Re$eren#es <1=5 <4=5 and <.=5 respe#tively.
>irin& and operatin& pro#ed)re o$ the SR!"2 plant 6ith the 2P; and D9C devi#e5 as
dis#)ssed in Re$eren#e <.=.
Trans$er $)n#tion $)ndamentals5 e.&. o/tainin& a trans$er $)n#tion $rom a di$$erential e8)ation.
+a/oratory des#ri/ed in Re$eren#e <= in order to /e $amiliar )sin& :)aRC 6ith the SR!"2.
Document Number 706 Revision !0 Pa"e
SRV02 Position Control Laboratory Student Manual
#. $%er%ie& of 'iles
Ta/le 1 /elo6 lists and des#ri/es the vario)s $iles s)pplied 6ith the SR!"2 Position Control
la/oratory.
File Name Description
"2 ? SR!"2 Position Control?
St)dent ;an)al.pd$
This la/oratory &)ide #ontains pre-la/ and in-la/ e1er#ises
demonstratin& ho6 to desi&n and implement a position #ontroller
on the :)anser SR!"2 rotary plant )sin& :)aRC.
set)p@srv"2@e1p"2@pos.m The main ;atla/ s#ript that sets the SR!"2 motor and sensor
parameters as 6ell as its #on$i&)ration-dependent model
parameters. R!" #$%& '%() *"(+ #* &)#!, #$) (-.*/-#*/+.
#on$i&@srv"2.m Ret)rns the #on$i&)ration-/ased SR!"2 model spe#i$i#ations Rm5
kt5 km5 Kg5 eta_g5 Beq5 Jeq5 and eta_m5 the sensor #ali/ration
#onstants A@POT5 A@EBC5 and A@T9CC5 and the 2P; limits
!;9D@2P; and ,;9D@2P;.
d@model@param.m Cal#)lates the SR!"2 model parameters K and tau /ased on the
devi#e spe#i$i#ations Rm5 kt5 km5 Kg5 eta_g5 Beq5 Jeq5 and eta_m.
#al#@#onversion@#onstants.m Ret)rns vario)s #onversions $a#tors.
s@srv"2@pos.mdl Sim)link $ile that sim)lates a #losed-loop P,! #ontroller $or the
SR!"2 system.
8@srv"2@pos.mdl Sim)link $ile that implements a #losed-loop P,! position #ontroller
on the SR!"2 system )sin& :)aRC.
Document Number 706 Revision !0 Pa"e 2
SRV02 Position Control Laboratory Student Manual
File Name Description
Table 1: Files supplied with the SRV02 Psiti! "!t#l e$pe#ime!t%
(. Pre)*ab +ssi,nments
4.1. Desired Position Control Response
The /lo#k dia&ram sho6n in (i&)re 1 is a &eneral )nity $eed/a#k system 6ith a #ompensator C3s4 and a
trans$er $)n#tion representin& the plant5 P3s4. The meas)red o)tp)t5 E3s45 is s)pposed to tra#k the
re$eren#e si&nal R3s4 and the tra#kin& has to yield to #ertain spe#i$i#ations.
Document Number 706 Revision !0 Pa"e #
SRV02 Position Control Laboratory Student Manual
Figu#e 1: &!it' (eedba)k s'stem%
The o)tp)t o$ the system sho6n in (i&)re 1 is
3 4 E s 3 4 C s 3 4 P s 3 4 3 4 R s 3 4 E s <1=
and /y solvin& $or E3s4 the res)ltin& #losed-loop trans$er $)n#tion
3 4 E s
3 4 C s 3 4 P s 3 4 R s
+ 1 3 4 C s 3 4 P s
<2=
is o/tained. Re#all in Re$eren#e <-=5 the SR!"2 volta&e-to-speed trans$er $)n#tion 6as derived. Pla#in&
that model in series 6ith an inte&rator &ives the open-loop volta&e-to-load &ear position trans$er
$)n#tion
3 4 P s
K
3 4 + s 1 s
.
<3=
2sin& a proportional #ompensator 6ith a se#ond-order plant5 s)#h as in <3=5 the #losed-loop trans$er
$)n#tion in <2= has the $orm

3 4 E s
3 4 R s

!
2
+ + s
2
2
!
s
!
2
<4=
6here
n
is the nat)ral )ndamped $re8)en#y and is the dampin& ratio. This is #alled the sta!da#d
se)!d*#de# trans$er $)n#tion and the properties o$ its response depend on the val)es o$
n
and
parameters.
(.1.1. Pea- Time and $%ers.oot
Consider 6hen a se#ond-order system as sho6n in E8)ation <4= is s)/0e#ted to a re$eren#e step
3 4 R s
R
"
s
<.=
6ith an step amplit)de o$ R
"
F 1... The o/tained response is sho6n in (i&)re 25 /elo65 6here the red
tra#e is the o)tp)t response5 y3t45 and the /l)e tra#e is the re$eren#e step5 r3t4.
Document Number 706 Revision !0 Pa"e $
SRV02 Position Control Laboratory Student Manual
Figu#e 2: Sta!da#d se)!d*#de# step #esp!se%
The ma1im)m val)e o$ the response is denoted /y the varia/le y
ma1
and it o##)rs at a time t
ma1
. (or a
response similar to (i&)re 25 the pe#)e!tage +e#sht is $o)nd )sin& the e8)ation
P,
1"" 3 4 '
ma$
R
"
R
"
.
<=
(rom the initial step time5 t
"
5 the time it takes $or the response to rea#h its ma1im)m val)e is
t
p
t
ma$
t
"
.
<-=
This is #alled the peak time o$ the system.
,n a se#ond-order system5 the amo)nt o$ overshoot depends solely on the dampin& ratio parameter and
it #an /e #al#)lated )sin& the e8)ation
P, 1"" )

_
,


1
2
.
<%=
The peak time depends on /oth the dampin& ratio and nat)ral $re8)en#y o$ the system and it #an /e
Document Number 706 Revision !0 Pa"e %
SRV02 Position Control Laboratory Student Manual
derived that the relationship /et6een them is
t
p

!
1
2
.
<'=
*enerally speakin& then5 the dampin& ratio a$$e#ts the shape o$ the response 6hile the nat)ral $re8)en#y
a$$e#ts the speed o$ the response.
(.1.2. Steady)state Error
Steady-state error is ill)strated in the ramp response &iven in (i&)re 3 and is denoted /y the varia/le e
ss
.
,t is the di$$eren#e /et6een the re$eren#e and o)tp)t si&nals a$ter the system response has settled. Th)s
$or a time t 6hen the system is in steady-state5 the steady-state error e8)als
e
ss
3 4 #
ss
t 3 4 '
ss
t
<1"=
6here r
ss
3t4 is the val)e o$ the steady-state re$eren#e and y
ss
is the steady-state val)e o$ the pro#ess
o)tp)t.
Figu#e -: Stead'*state e### i! #amp #esp!se%
1. (ind the error trans$er $)n#tion E3s4 in (i&)re 1 in terms o$ the re$eren#e R3s45 the plant P3s45
Document Number 706 Revision !0 Pa"e 6
SRV02 Position Control Laboratory Student Manual
and the #ompensator C3s4.
Sol
2. Re#all the $inal-val)e theorem
e
ss
lim
s "
s 3 4 E s
.
<11=
*iven that the #ompensator e8)als
3 4 C s 1
5
<12=
the re$eren#e is the step de$ined in <.=5 and the pro#ess model is the trans$er $)n#tion in <3=5 $ind
the steady-state error o$ the system.
Solution:
Document Number 706 Revision !0 Pa"e 7
0 1 2
0 1 2
SRV02 Position Control Laboratory Student Manual
3. Gased on the steady-state error res)lt $rom a step response 6ith a )nity proportional &ain5 6hat
T'pe o$ system is the SR!"2 6hen per$ormin& position #ontrol 3"5 15 25 or 34H *iven the T'pe
o$ system5 6hat 6o)ld /e the steady-state an&le i$ a ramp inp)t 6as &iven insteadH
(.1.#. SR/02 Position Control Spe!ifi!ations
The time-domain spe#i$i#ations $or #ontrollin& the position o$ the SR!"2 load sha$t are7
e
ss
"
5
<13=
t
p
".2" < = s
5 and
<14=
P, .." < = IJI
.
<1.=
Th)s 6hen tra#kin& the load sha$t re$eren#e5 the transient response sho)ld have a peak time less than or
e8)al to ".2" se#onds5 an overshoot less than or e8)al to . J5 and the steady-state response sho)ld have
no error.
Cal#)late the ma1im)m overshoot o$ the response 3in radians4 &iven a step setpoint o$ 4. de&rees5 or
3 4
d
t

4
.
<1=
Document Number 706 Revision !0 Pa"e &
0 1 2
SRV02 Position Control Laboratory Student Manual
Solution:
4.2. PV Control Design
(.2.1. Closed)loop Transfer 'un!tion
The proportional-velo#ity 3P!4 #ompensator )sed to #ontrol the position o$ the SR!"2 has the str)#t)re
3 4 V
m
t k
p
3 4 3 4
d
t 3 4
l
t k
+

_
,

d
d
t
3 4
l
t
.
<1-=
6here k
p
is the proportional #ontrol &ain5 k
v
is the velo#ity #ontrol &ain5
d
3t4 is the setpoint or re$eren#e
load an&le5 and
l
3t4 is the meas)red load sha$t an&le5 and !
m
3t4 is the SR!"2 inp)t volta&e. The /lo#k
dia&ram o$ the P! #ontrol is ill)strated in (i&)re 4.
Figu#e .: Bl)k diag#am ( SRV02 PV psiti! )!t#l%
Document Number 706 Revision !0 Pa"e '
0 1 2
SRV02 Position Control Laboratory Student Manual
1. (ind the #losed-loop SR!"2 position #ontrol trans$er $)n#tion5
l
3s4K
d
3s45 )sin& the time-
domain P! #ontrol in E8)ation <1-=5 the /lo#k dia&ram in (i&)re 45 and the pro#ess model in
<3=. 9ss)me the Lero initial #onditions5 th)s
l
3"
-
4 F ".
(.2.2. 'indin, 0ains to Satisfy Spe!ifi!ations
1. The res)ltin& SR!"2 #losed-loop trans$er $)n#tion has the same str)#t)re as the sta!da#d
se)!d*#de# s'stem &iven in <4=. The denominator o$ <4= is #alled the sta!da#d )ha#a)te#isti)
equati!/
+ + s
2
2
!
s
!
2
.
<1-=
(ind the #ontrol &ains k
p
and k
v
that map the #hara#teristi# e8)ation o$ the SR!"2 #losed-loop
system to the standard #hara#teristi# e8)ation &iven a/ove. >ith these t6o e8)ations5 the
#ontrol &ains #an /e desi&ned /ased on a spe#i$ied nat)ral $re8)en#y5
n
5 and dampin& ratio5 .
Document Number 706 Revision !0 Pa"e 0
0 1 2
SRV02 Position Control Laboratory Student Manual
Solution:
2. 2sin& the e8)ations des#ri/ed in Se#tion 4.1.15 e1press the nat)ral $re8)en#y and the dampin&
ratio in terms o$ per#enta&e overshoot and peak time spe#i$i#ations.
Document Number 706 Revision !0 Pa"e
0 1 2
SRV02 Position Control Laboratory Student Manual
Solution:
3. Cal#)late the minim)m dampin& ratio and nat)ral $re8)en#y re8)ired to meet the spe#i$i#ations
&iven in Se#tion 4.1.3.
4. Gased on the nominal SR!"2 model parameters5 A and 5 $o)nd in E1periment M17 SR!"2
;odelin& 3Re$eren#e <-=45 #al#)late the #ontrol &ains needed to satis$y the time-domain
response re8)irements.
Document Number 706 Revision !0 Pa"e 2
0 1 2
0 1 2
SRV02 Position Control Laboratory Student Manual
Solution:
2sin& the model parameters
(.2.#. Control 0ain *imits
,n #ontrol desi&n5 another $a#tor to /e #onsidered is a#t)ator sat)ration. This is a nonlinear element and
is represented /y a sat)ration /lo#k5 as sho6n in (i&)re .. Consider an SR!"2 type set)p 6here the PC
#omp)tes a #ontrol volta&e. The #ontrol volta&e is o)tp)tted /y a di&ital-to-analo& #hannel o$ the data-
a#8)isition devi#e5 !
da#
3t45 and then ampli$ied /y a po6er ampli$ier /y a $a#tor o$ A
a
. The ampli$ied
volta&e5 !
amp
3t45 is sat)rated /y either the ma1im)m o)tp)t volta&e o$ the ampli$ier or the limits o$ the
motor 36hi#hever is smaller4. The inp)t SR!"2 volta&e5 !
m
3t45 is the e$$e#tive volta&e /ein& applied to
the motor.
Figu#e 0: 1)tuat# satu#ati!%
1. The limitations o$ the a#t)ator m)st /e taken into a##o)nt 6hen desi&nin& a #ontroller. (or
instan#e5 the volta&e enterin& the SR!"2 motor sho)ld never e1#eed
Document Number 706 Revision !0 Pa"e #
0 1 2
SRV02 Position Control Laboratory Student Manual
V
ma$
1"." < = V
.
<1%=
(or the re$eren#e step &iven in <1= 3i.e. 4. de&ree step45 #al#)late the ma1im)m proportional
&ain. ,&nore the velo#ity #ontrol. ,s the k
p
desi&ned a/ove5 6hi#h satis$ies the spe#i$i#ations5
/elo6 the ma1im)m proportional &ainH
4.3. Steadystate !rror due to a Ra"p
Re#eren$e
(rom the previo)s steady-state analysis5 it 6as $o)nd that the #losed-loop SR!"2 system 6as a #ertain
type o$ system. This se#tion investi&ates the steady-state error d)e to a ramp position setpoint 6hen
)sin& P! and P,! #ontrollers.
(.#.1. Ramp Steady)State Error usin, P/
The steady-state error 6hen the SR!"2 tra#ks a ramp setpoint )sin& the P! #ontroller is eval)ated in
this se#tion.
1. *iven the ramp setpoint
3 4 R s
R
"
s
2
<1'=
$ind the error trans$er $)n#tion o$ the #losed-loop SR!"2 position P! #ontrol.
Document Number 706 Revision !0 Pa"e $
0 1 2
SRV02 Position Control Laboratory Student Manual
2. (ind the steady-state error and eval)ate it n)meri#ally &iven a ramp 6ith a slope o$
R
"
3.3

1
]
1
1
#ad
s
5
<2"=
the #ontrol &ains $o)nd in Se#tion 4.2.25 and the nominal model parameters derived in
+a/oratory M17 SR!"2 ;odelin& 3see Re$eren#e <-=4.
Solution:
Document Number 706 Revision !0 Pa"e %
0 1 2
0 1 2
SRV02 Position Control Laboratory Student Manual
(.#.2. P/ Control
9ddin& an inte&ral #ontrol #an help to eliminate any steady-state error. The proportional-inte&ral-
velo#ity 3P,!4 al&orithm that 6ill /e )sed to #ontrol the position o$ the SR!"2 3in addition to P!4 is o$
the $orm
3 4 V
m
t + k
p
3 4 3 4
d
t 3 4
l
t k
i
d

(
(
3 4
d
t 3 4
l
t t k
+

_
,

d
d
t
3 4
l
t
5
<21=
6here k
i
is the inte&ral &ain. The P,! position #ontrol /lo#k dia&ram is sho6n in (i&)re .
Figu#e 2: Bl)k diag#am ( P3V SRV02 psiti! )!t#l%
.. (ind the #losed-loop SR!"2 position #ontrol trans$er $)n#tion5
l
3s4K
d
3s45 )sin& the time-
domain P,! #ontrol in E8)ation <21=5 the /lo#k dia&ram in (i&)re .5 and the pro#ess model in
<3=. 9ss)me the Lero initial #onditions5 th)s
l
3"
-
4 F ".
Document Number 706 Revision !0 Pa"e 6
SRV02 Position Control Laboratory Student Manual
(.#.#. Ramp Steady)State Error usin, P/
,n this se#tion5 the steady-state error 6hen )sin& the P,! #ontrol is eval)ated.
1. (ind the error trans$er $)n#tion o$ the #losed-loop SR!"2 position P,! #ontrol.
2. Eval)ate the steady-state error.
Document Number 706 Revision !0 Pa"e 7
0 1 2
0 1 2
SRV02 Position Control Laboratory Student Manual
(.#.(. nte,ral 0ain 1esi,n
,t takes a #ertain amo)nt o$ time $or the o)tp)t response to tra#k the ramp re$eren#e 6ith Lero steady-
state error. This is #alled the settlin& time and it is determined /y the val)e )sed $or the inte&ral &ain. ,B
this se#tion5 the inte&ral &ain is #al#)lated /ased on the steady-state error that is o/tained 6ith the P!
#ontrol and the amo)nt o$ volta&e there is to spare.
1. ,n steady-state5 the ramp response error is #onstant and does not vary. There$ore5 to desi&n an
inte&ral &ain the velo#ity #ompensation #an /e ne&le#ted. Th)s the P, #ontrol
3 4 V
m
t + k
p
3 4 3 4
d
t 3 4
l
t k
i
d

(
(
3 4
d
t 3 4
l
t t
<22=
is /ein& #onsidered. >hen in steady-state5 the e1pression #an /e simpli$ied to
3 4 V
m
t + k
p
e
ss
k
i
d

(
(
"
t
i
e
ss
t
.
<23=
The varia/le t
i
is the inte&ration time. (ind the inte&ral &ain 6hen takin& the error over t6o
se#onds
t
i
1." < = s
<24=
and /ased on the proportional &ain $o)nd in Se#tion 4.2.25 the ma1im)m SR!"2 volta&e <1%=5
the steady-state error yielded 6ith the P! #ontrol #al#)lated in Se#tion 4.3.1.
Document Number 706 Revision !0 Pa"e &
0 1 2
SRV02 Position Control Laboratory Student Manual
2. n)*ab Pro!edures
St)dents are asked to sim)late the #losed-loop P! and P,! responses. Then5 the P! and P,! #ontrollers
are implemented on the a#t)al SR!"2.
%.1. Position Control Si"ulation
The s_s#+02_ps Sim)link dia&ram sho6n in (i&)re - is )sed to sim)late the #losed-loop position
response o$ the SR!"2 6hen )sin& either the P! or P,! #ontrols. The SRV02 4del )ses a Trans$er
(#n /lo#k $rom the Sim)link li/rary to sim)late the SR!"2 system. The P3V "!t#l s)/system
#ontains the P,! #ontrol detailed in Se#tion 4.3.2. >hen the inte&ral &ain is set to Lero5 this is
essentially a P! #ontroller. Ge$ore &oin& thro)&h the step response e1er#ises in Se#tion ..1.2 and the
ramp response 8)estions in Se#tion ..1.35 &o thro)&h Se#tion ..1.1 to #on$i&)re the la/ $iles properly.
Document Number 706 Revision !0 Pa"e '
0 1 2
SRV02 Position Control Laboratory Student Manual
Figu#e 5: Simuli!k mdel used t simulate the SRV02 )lsed*lp psiti! #esp!se%
2.1.1. Setup for Position Control Simulation
(ollo6 these steps to #on$i&)re the la/ properly7
1. +oad the ;atla/ so$t6are.
2. Gro6se thro)&h the "u##e!t 6i#e)t#' 6indo6 in ;atla/ and $ind the $older that #ontains the
SR!"2 position #ontroller $iles5 e.&. q_s#+02_ps%mdl.
3. Do)/le-#li#k on the s_s#+02_ps%mdl $ile to open the Sim)link dia&ram sho6n in (i&)re -.
4. Do)/le-#li#k on the setup_s#+02_e$p02_spd%m $ile to open the set)p s#ript $or the position
#ontrol Sim)link models.
.. C*"'%1!/) &)#!, &2/%,#7 The #ontrollers 6ill /e ran on an SR!"2 in the hi&h-&ear #on$i&)ration
6ith the dis# load5 as in Re$eren#e <-=. ,n order to sim)late the SR!"2 properly5 make s)re the
s#ript is set)p to mat#h this #on$i&)ration5 i.e. the EDT@*E9R@COB(,* sho)ld /e set to
NC,*CN and the +O9D@TEPE sho)ld /e set to ND,SCN. 9lso5 ens)re the EBCODER@TEPE5
T9CC@OPT,OB5 A@C9G+E5 2P;@TEPE5 and !;9D@D9C parameters are set a##ordin& to
the SR!"2 system that is to /e )sed in the la/oratory. Be1t5 set COBTRO+@TEPE to
N;9B29+N.
. R)n the s#ript /y sele#tin& the De/)& O R)n item $rom the men) /ar or #li#kin& on the Ru!
/)tton in the tool /ar. The messa&es sho6n in Te1t 15 /elo65 sho)ld /e &enerated in the ;atla/
Document Number 706 Revision !0 Pa"e 20
SRV02 Position Control Laboratory Student Manual
Command >indo6. The model parameters and spe#i$i#ations are loaded /)t the P,! &ains are
all set to Lero ? they need to /e #han&ed.
SRV02 model parameters:
K = 1.53 rad/s/V
tau = 0.0254 s
Specifications:
tp = 0.2 s
P = 5 !
"alculated PV control #ains:
$p = 0 V/rad
$% = 0 V.s/rad
&nte#ral control #ain for trian#le trac$in#:
$i = 0 V/rad/s
Te$t 1: 6ispla' message shw! i! 4atlab "mma!d 7i!dw a(te# #u!!i!g setup_s#+02_e$p02_ps%m%
2.1.2. Simulatin, Step Response usin, P/
The #losed-loop step position response o$ the SR!"2 6ill /e sim)lated )sin& the P! #ontrol to #on$irm
that the spe#i$i#ations in an ideal sit)ation are satis$ied and veri$y that the motor is not sat)rated. ,n
addition5 the a$$e#t o$ )sin& a hi&h-pass $ilter instead o$ a dire#t derivative is e1amined.
(ollo6 these steps to sim)late the SR!"2 P! position response7
1. Enter the proportional and velo#ity #ontrol &ains $o)nd in Se#tion 4.2.2 in ;atla/.
2. Sele#t squa#e in the Sig!al T'pe $ield o$ the SR!"2 Si&nal *enerator in order to &enerate a step
re$eren#e.
3. Set the 1mplitude 8#ad9 &ain /lo#k to K% to &enerate a step 6ith an amplit)de o$ 4. de&rees.
4. ,nside the P3V "!t#l s)/system5 set the 4a!ual Swit)h is to the )p6ard position so the
6e#i+ati+e /lo#k is )sed.
.. Open the load sha$t position s#ope5 theta_l 8#ad95 and the motor inp)t volta&e s#ope5 Vm 8V9.
. Start the sim)lation. Gy de$a)lt5 the sim)lation r)ns $or . se#onds. The s#opes sho)ld /e
displayin& responses similar to $i&)res % and '. Bote that in the theta_l 8#ad9 s#ope5 the yello6
tra#e is the setpoint position 6hile the p)rple tra#e is the sim)lated position 3&enerated /y the
SRV02 4del /lo#k4. This sim)lation is the #alled the 3deal PV response as it )ses the P!
#ompensator 6ith the derivative /lo#k.
Document Number 706 Revision !0 Pa"e 2
SRV02 Position Control Laboratory Student Manual
Figu#e :: 3deal PV psiti! #esp!se% Figu#e ;: 3deal PV mt# i!put +ltage%
-. *enerate a ;atla/ $i&)re sho6in& the 3deal PV position response and the ideal inp)t volta&e
and atta#h it to yo)r report. 9$ter ea#h sim)lation r)n5 ea#h s#ope a)tomati#ally saves their
response to a varia/le in the ;atla/ 6orkspa#e. That is5 the theta_l 8#ad9 s#ope saves its
response to the varia/le #alled data_ps and the Vm 8V9 s#ope saves its data to the data_+m
varia/le. The data_ps varia/le has the $ollo6in& str)#t)re7 data_ps8:/19 is the time ve#tor5
data_ps8:/29 is the setpoint5 and data_ps8:/-9 is the sim)lated an&le. (or the data_+m varia/le5
data_+m8:/19 is the time and data_+m8:/29 is the sim)lated inp)t volta&e.
Document Number 706 Revision !0 Pa"e 22
SRV02 Position Control Laboratory Student Manual
%. ;eas)re the steady-state error5 the per#enta&e overshoot5 and the peak time o$ the sim)lated
response. Does the response satis$y the spe#i$i#ations &iven in Se#tion 4.1.3H
Document Number 706 Revision !0 Pa"e 2#
0 1 2
SRV02 Position Control Laboratory Student Manual
'. >hen implementin& a #ontroller on a#t)al hard6are it is &enerally not advised to take the dire#t
derivative o$ a meas)red si&nal. (or instan#e5 6hen takin& the derivative o$ the SR!"2 en#oder
or potentiometer si&nal any noise or spikes in the si&nal /e#ome ampli$ied. This then &ets
m)ltiplied /y a &ain and $ed into the motor 6hi#h may lead to dama&e. To remove any hi&h-
$re8)en#y #omponents in the velo#ity si&nal5 a lo6-pass $ilter is pla#ed in series 6ith the
derivative5 i.e. takin& the hi&h-pass $ilter o$ the meas)red si&nal. Co6ever5 as 6ith a #ontroller
the $ilter m)st /e t)ned properly and does have some adverse a$$e#ts. *o in the P3V "!t#l
/lo#k and set the ;an)al S6it#h /lo#k to the do6n6ard position in order to ena/le the hi&h-
pass $ilter.
1". Start the sim)lation. The response in the s#opes sho)ld still /e similar to $i&)res % and '. This
sim)lation is the #alled the Filte#ed PV response as it )ses the P! #ompensator 6ith the hi&h-
pass $ilter /lo#k.
11. *enerate a ;atla/ $i&)re sho6in& the Filte#ed PV position and inp)t volta&e responses and
atta#h it to yo)r report.
Document Number 706 Revision !0 Pa"e 2$
0 1 2
SRV02 Position Control Laboratory Student Manual
12. ;eas)re the steady-state error5 peak time5 and per#enta&e overshoot. 9re the spe#i$i#ations still
satis$ied 6itho)t sat)ratin& the a#t)atorH Re#all that the peak time and per#enta&e overshoot
sho)ld not e1#eed the val)es &iven in Se#tion 4.1.3. Dis#)ss the #han&es that 6ere noti#ed $rom
the ideal response.
Document Number 706 Revision !0 Pa"e 2%
0 1 2
SRV02 Position Control Laboratory Student Manual
13. ,$ the spe#i$i#ations in the ideal #ase are satis$ied 6itho)t overloadin& the servo motor5 pro#eed
to the ne1t se#tion to sim)late the ramp response.
2.1.#. Simulatin, Ramp Response usin, P/ and P/
The #losed-loop ramp position response o$ the SR!"2 6ill /e sim)lated )sin& the P! and P,! #ontrol
systems. ,t 6ill /e veri$ied that the Lero steady-state error spe#i$i#ations in Se#tion 4.1.3 is met 6itho)t
the motor /e#omin& sat)rated.
(ollo6 these steps to sim)lated the SR!"2 P! position response7
1. Enter the proportional and velo#ity #ontrol &ains $o)nd in Se#tion 4.2.2.
2. Sele#t t#ia!gle in the Sig!al T'pe $ield o$ the SR!"2 Si&nal *enerator in order to &enerate a
ramp or trian&)lar re$eren#e.
3. Set the 1mplitude 8#ad9 &ain /lo#k to K3.
4. Ens)re the F#eque!)' 8<=9 $ield in the T#ia!gle 7a+e(#m /lo#k is set to ".% CL. This 6ill
&enerate a alternative in#reasin& and de#reasin& ramp si&nal 6ith the same slope )sed in the
pre-la/ e1er#ises5 &iven in E8)ation <2"=. The slope is #al#)lated $rom the T#ia!gula#
7a+e(#m amplit)de5 1mp5 and $re8)en#y5 (5 )sin& the e1pression
R
"
4 1mp (
.
<2.=
.. ,nside the P3V "!t#l s)/system5 set the 4a!ual Swit)h is to the do6n6ard position so the
<igh*Pass Filte# /lo#k is )sed.
Document Number 706 Revision !0 Pa"e 26
0 1 2
SRV02 Position Control Laboratory Student Manual
. Open the load sha$t position s#ope5 theta_l 8#ad95 and the motor inp)t volta&e s#ope5 Vm 8V9.
-. Start the sim)lation. The s#opes sho)ld /e displayin& responses similar to $i&)res 1" and 11.
Figu#e 10: Ramp #esp!se usi!g PV% Figu#e 11: 3!put +ltage ( #amp t#a)ki!g usi!g PV%
%. *enerate a ;atla/ $i&)re sho6in& the Ramp PV position response and its #orrespondin& inp)t
volta&e tra#e. 9tta#h it to yo)r report.
Document Number 706 Revision !0 Pa"e 27
SRV02 Position Control Laboratory Student Manual
'. ;eas)re the steady-state error. Compare the sim)lation meas)rement 6ith the steady-state error
#al#)lated in Pre-+a/ Se#tion 4.3.1.
Document Number 706 Revision !0 Pa"e 2&
0 1 2
SRV02 Position Control Laboratory Student Manual
1". Enter the inte&ral &ain desi&ned in Se#tion 4.3.4 in ;atla/. The P,! #ontroller 6ill no6 /e
sim)lated.
11. Start the sim)lation. The Ramp P3V response in the s#opes sho)ld /e similar to $i&)res 12 and
13.
Figu#e 12: P3V #amp #esp!se%

Figu#e 1-: 3!put +ltage usi!g P3V )!t#l%
12. *enerate a ;atla/ $i&)re sho6in& the Ramp P3V position response and its #orrespondin& inp)t
volta&e. 9tta#h it to yo)r report.
Document Number 706 Revision !0 Pa"e 2'
0 1 2
SRV02 Position Control Laboratory Student Manual

13. ;eas)re the steady-state error. ,s the steady-state spe#i$i#ation &iven in Se#tion 4.1.3 satis$ied
6itho)t sat)ratin& the a#t)atorH
Document Number 706 Revision !0 Pa"e #0
0 1 2
SRV02 Position Control Laboratory Student Manual
14. ,$ the spe#i$i#ations are satis$ied 6itho)t sat)ratin& the a#t)ator5 pro#eed to the ne1t se#tion to
/e&in implementin& the #ontrollers on the SR!"2.
%.2. Position Control &"ple"entation
The q_s#+02_ps Sim)link dia&ram sho6n in (i&)re 14 is )sed to per$orm the position #ontrol
e1er#ises in this la/oratory. The SRV02*>T s)/system #ontains :)aRC /lo#ks that inter$a#e 6ith the
DC motor and sensors o$ the SR!"2 system5 as dis#)ssed in Re$eren#e <=. The P3V "!t#l s)/system
implements the P,! #ontrol detailed in Se#tion 4.3.25 e1#ept a hi&h-pass $ilter is )sed to o/tain the
velo#ity si&nal 3as opposed to takin& the dire#t derivative4.
Document Number 706 Revision !0 Pa"e #
0 1 2
SRV02 Position Control Laboratory Student Manual
Figu#e 1.: Simuli!k mdel used with ?uaR" t #u! the PV a!d P3V psiti! )!t#lle#s ! the SRV02%
2.2.1. Setup for Position Control mplementation
Ge$ore /e&innin& the in-la/ e1er#ises on the SR!"2 devi#e5 the 8@srv"2@pos Sim)link dia&ram and the
set)p@srv"2@e1p"2@pos.m s#ript m)st /e #on$i&)red.
(ollo6 these steps to &et the system ready $or this la/7
1. Set)p the SR!"2 in the hi&h-&ear #on$i&)ration and 6ith the dis# load as des#ri/ed in
Re$eren#e <.=.
2. +oad the ;atla/ so$t6are.
3. Gro6se thro)&h the "u##e!t 6i#e)t#' 6indo6 in ;atla/ and $ind the $older that #ontains the
SR!"2 position #ontrol $iles5 e.&. q_s#+02_ps%mdl.
4. Do)/le-#li#k on the q_s#+02_ps%mdl $ile to open the Position Control Sim)link dia&ram sho6n
in (i&)re 14.
.. C*"'%1!/) DAQ7 Do)/le-#li#k on the C,+ ,nitialiLe /lo#k in the SRV02*>T s)/system 36hi#h
is lo#ated inside the SRV02*>T Psiti! s)/system4 and ens)re it is #on$i&)red $or the D9:
devi#e that is installed in yo)r system. (or instan#e5 the /lo#k sho6n in (i&)re 14 is set)p $or
the :)anser :% hard6are-in-the-loop /oard. See Re$eren#e <= $or more in$ormation on
#on$i&)rin& the C,+ ,nitialiLe /lo#k.
. C*"'%1!/) S)"&*/7 The position o$ the load sha$t #an /e meas)red )sin& vario)s sensors. Set
the Ps S#) So)r#e /lo#k in 8@srv"2@pos5 as sho6n in (i&)re 145 as $ollo6s7
1 to )se the potentiometer
Document Number 706 Revision !0 Pa"e #2
SRV02 Position Control Laboratory Student Manual
2 to )se to the en#oder
Bote that 6hen )sin& the potentiometer5 there 6ill /e a dis#ontin)ity.
-. C*"'%1!/) &)#!, &2/%,#7 Set the parameters in the set)p@srv"2@e1p"2@pos.m s#ript a##ordin&
to yo)r system set)p. See Se#tion ..1.1 $or more details.
2.2.2. mplementin, Step Response usin, P/
,n this la/5 the an&)lar position o$ the SR!"2 load sha$t5 i.e. the dis# load5 6ill /e #ontrolled )sin& the
developed P! #ontrol. ;eas)rements 6ill then /e taken to ens)re that the spe#i$i#ations are satis$ied.
(ollo6 the steps /elo67
1. R)n the set)p@srv"2@e1p"2@pos.m s#ript.
2. Enter the proportional and velo#ity #ontrol &ains $o)nd in Se#tion 4.2.2.
3. Set Sig!al T'pe in the SR!"2 Si&nal *enerator to squa#e to &enerate a step re$eren#e.
4. Set the 1mplitude 8#ad9 &ain /lo#k to K% to &enerate a step 6ith an amplit)de o$ 4. de&rees.
.. Open the load sha$t position s#ope5 theta_l 8#ad95 and the motor inp)t volta&e s#ope5 Vm 8V9.
. Cli#k on :)aRC O G)ild to #ompile the Sim)link dia&ram.
-. Sele#t :)aRC O Start to /e&in r)nnin& the #ontroller. The s#opes sho)ld /e displayin& responses
similar to $i&)res 1. and 1. Bote that in the theta_l 8#ad9 s#ope5 the yello6 tra#e is the setpoint
position 6hile the p)rple tra#e is the meas)red position.
Figu#e 10: 4easu#ed PV step #esp!se%

Figu#e 12: PV )!t#l i!put +ltage%
%. >hen a s)ita/le response is o/tained5 #li#k on the Stp /)tton in the Sim)link dia&ram tool /ar
3or sele#t :)aRC O Stop $rom the men)4 to stop r)nnin& the #ode. *enerate a ;atla/ $i&)re
sho6in& the P! position response and its inp)t volta&e. 9tta#h it to yo)r report. 9s in the
s@srv"2@pos Sim)link dia&ram5 6hen the #ontroller is stopped ea#h s#ope a)tomati#ally saves
their response to a varia/le in the ;atla/ 6orkspa#e. Th)s the theta_l 8#ad9 s#ope saves its
response to the data_ps +a#iable and the Vm 8V9 s#ope saves its data to the data_+m varia/le.
Document Number 706 Revision !0 Pa"e ##
SRV02 Position Control Laboratory Student Manual
'. ;eas)re the steady-state error5 the per#enta&e overshoot5 and the peak time o$ the SR!"2 load
&ear. Does the response satis$y the spe#i$i#ations &iven in Se#tion 4.1.3H
Document Number 706 Revision !0 Pa"e #$
0 1 2
SRV02 Position Control Laboratory Student Manual
1". ;ake s)re :)aRC is stopped.
11. Sh)t o$$ the po6er o$ the 2P; i$ no more e1periments 6ill /e per$ormed on the SR!"2 in this
session.
2.2.#. mplementin, Ramp Response usin, P/ and P/
(ollo6 these steps to make the SR!"2 tra#k a trian&)lar response )sin& the P! and P,! #ontrols7
1. R)n the set)p@srv"2@e1p"2@pos.m s#ript.
2. Enter the proportional and velo#ity #ontrol &ains $o)nd in Se#tion 4.2.2.
3. Set Sig!al T'pe in the SR!"2 Si&nal *enerator to t#ia!gle in order to &enerate a ramp or
trian&)lar re$eren#e.
4. Set the 1mplitude 8#ad9 &ain /lo#k to K3.
.. Ens)re the F#eque!)' 8<=9 $ield in the T#ia!gle 7a+e(#m /lo#k is set to ".% CL.
. Open the load sha$t position s#ope5 theta_l 8#ad95 and the motor inp)t volta&e s#ope5 Vm 8V9.
-. Cli#k on :)aRC O G)ild to #ompile the Sim)link dia&ram.
%. Sele#t :)aRC O Start to /e&in r)nnin& the #ontroller. The s#opes sho)ld /e displayin& responses
similar to $i&)res 1% and 1-.
Document Number 706 Revision !0 Pa"e #%
0 1 2
SRV02 Position Control Laboratory Student Manual
Figu#e 15: 4easu#ed SRV02 PV #amp #esp!se%

Figu#e 1:: 3!put +ltage ( PV #amp #esp!se%
'. *enerate a ;atla/ $i&)re sho6in& the Ramp PV position response and its #orrespondin& inp)t
volta&e tra#e. 9tta#h it to yo)r report.
Document Number 706 Revision !0 Pa"e #6
SRV02 Position Control Laboratory Student Manual
1". ;eas)re the steady-state error and #ompare it 6ith the steady-state error #al#)lated in Pre-+a/
Se#tion 4.3.1.
Document Number 706 Revision !0 Pa"e #7
0 1 2
SRV02 Position Control Laboratory Student Manual
11. Enter the inte&ral &ain desi&ned in Se#tion 4.3.4 in ;atla/ in order to r)n the P,! #ontroller on
the SR!"2.
12. Start the :)aRC #ontroller. The Ramp P3V response in the s#opes sho)ld /e similar to $i&)res
1' and 2".
Figu#e 1;: 4easu#ed SRV02 P3V #amp #esp!se%

Figu#e 20: 3!put +ltage (#m P3V #amp )!t#l%
13. *enerate a ;atla/ $i&)re sho6in& the meas)red SR!"2 Ramp P3V position response and its
#orrespondin& inp)t volta&e. 9tta#h it to yo)r report.
Document Number 706 Revision !0 Pa"e #&
0 1 2
SRV02 Position Control Laboratory Student Manual

14. ;eas)re the steady-state error. ,s the steady-state spe#i$i#ation &iven in Se#tion 4.1.3 satis$ied
6itho)t sat)ratin& the a#t)atorH
Document Number 706 Revision !0 Pa"e #'
0 1 2
SRV02 Position Control Laboratory Student Manual
1.. ;ake s)re :)aRC is stopped.
1. Sh)t o$$ the po6er o$ the 2P; i$ no more e1periments 6ill /e per$ormed on the SR!"2 in this
session.
Document Number 706 Revision !0 Pa"e $0
0 1 2
SRV02 Position Control Laboratory Student Manual
3. Results Summary
(ill o)t Ta/le 25 /elo65 6ith the pre-la/oratory and in-la/oratory res)lts o/tained s)#h as the desi&ned
P,! &ains alon& 6ith the meas)red peak time5 per#enta&e overshoot5 and steady-state error o/tained
$rom the sim)lated and implemented step and ramp responses.
Section Description Symbol Value Unit
4.2.2 Pre-Lab: Model Parameters
4. Open-+oop Steady-State *ain A radK3!.s4
4. Open-+oop Time Constant

s
4.2.2 Pre-Lab: PV ain Desi!n
4. Proportional &ain k
p
!Krad
4. !elo#ity &ain k
v
!.sKrad
4.2." Pre-Lab: #ontrol ain Limits
1. ;a1im)m proportional &ain k
p5ma1
!Krad
4.".$ Pre-Lab: %amp Steady-State &rror
2. Steady-state error )sin& P! e
ss
rad
4."." Pre-Lab: %amp Steady-State &rror
2. Steady-state error )sin& P,! e
ss
rad
4.".4 Pre-Lab: 'nte!ral ain Desi!n
1. ,nte&ral &ain k
i
!K3rad.s4
(.$.2 'n-Lab Simulation: 'deal PV Step %esponse
%. Peak time t
p
s
%. Per#enta&e overshoot PO J
%. Steady-state error e
ss
rad
(.$.2 'n-Lab Simulation: Filtered PV Step %esponse
12. Peak time t
p
s
12. Per#enta&e overshoot PO J
12. Steady-state error e
ss
rad
(.$." 'n-Lab Simulation: %amp %esponse
Document Number 706 Revision !0 Pa"e $
SRV02 Position Control Laboratory Student Manual
'. P! Steady-state error e
ss
rad
13. P,! Steady-state error e
ss
rad
(.2.2 'n-Lab 'mplementation: PV Step %esponse
'. Peak time t
p
s
'. Per#enta&e overshoot PO J
'. Steady-state error e
ss
rad
(.2." 'n-Lab 'mplementation: %amp %esponse
'. P! Steady-state error e
ss
rad
13. P,! Steady-state error e
ss
rad
Table 2: SRV02 >$pe#ime!t @2: Psiti! )!t#l #esults summa#'%
4. Referen!es
<1= :)anser. 61? &se# 4a!ual.
<2= :)anser. ?uaR" &se# 4a!ual 3type doc 'uarc in ;atla/ to a##ess4.
<3= :)anser. ?uaR" 3!stallati! 4a!ual.
<4= :)anser. &P4 &se# 4a!ual.
<.= :)anser. SRV02 &se# 4a!ual.
<= :)anser. SRV02 ?uaR" 3!teg#ati! A 3!st#u)t# 4a!ual.
<-= :)anser. Rta#' >$pe#ime!t @1: SRV02 4deli!g.
Document Number 706 Revision !0 Pa"e $2

You might also like