ball and beam pid

52
I SS N0280-5316 I SR N LU TF D 2/TF R T- - 573 6--S E M od eli n ga ndC on t r ol of t h e Ball an d B e am Process M art aV i r seda D epart ment of A u t omat i c C on t rol L u n dI n st i t u teof  Tech n olo g y M ar c h2004

Upload: jorge-daniel-badillo

Post on 06-Jul-2018

225 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Ball and Beam pid

8/17/2019 Ball and Beam pid

http://slidepdf.com/reader/full/ball-and-beam-pid 1/52

ISSN0280-5316

ISRNLUTFD2/TFRT--5736--SE

Modeling and Control of the

Ball and Beam Process

Marta Virseda

Department of AutomaticControl

Lund Institute of Technology

March2004

Page 2: Ball and Beam pid

8/17/2019 Ball and Beam pid

http://slidepdf.com/reader/full/ball-and-beam-pid 2/52

Page 3: Ball and Beam pid

8/17/2019 Ball and Beam pid

http://slidepdf.com/reader/full/ball-and-beam-pid 3/52

Department of Automatic Control

Lund Institute of Technology

Box 118

SE!!1 "" Lund S#eden

 Document name

MASTER THESIS

 Date of issue

March 2004

 Document Number 

ISRNLUTFD2/TFRT--5736--SE

 Author(s)

Marta Virs!aSupervisor 

R"#$ %"ha&ss"& a&! A&!rs R"'rtss"& at LTH i&L(&!) E&ri*( +a,&s at U&i) ! Va##a!"#i! i& S.ai&

Sponsoring organization

Title and subtitle

M"!#i& a&! "&tr"# "$ th +a## a&! +a1 r"css M"!##ri& si1(#ri& "ch r#ri& a (#a . '"1 .r"css&)

 Abstract 

One of the most difficult problems that an engineer who works with modeling

deals with, is the question about how to translate a physical phenomenon into a

set of equations. It is usually difficult to capture all dynamics and phenomena,

so one usually strives for a set of equations that describes the physical system

approximately and adequately with the accuracy for the purpose. In our case, we

model the dynamics relevant for control design.

The topic of this thesis was to do an in-depth study of the all and eam

process. Two different experimental implementation of the all and eamprocess have been considered, both available at the course lab at the

!epartment of "utomatic #ontrol, $und. The first step consisted of deriving

the equations of motion, that is, to do the mathematical modeling of the

process.

In order to implement this model %odelica has been used. %odelica, which is a

powerful language for modeling of physical systems, uses the tool !ymola.

"nother model was designed also with %odelica but with the help of the extension

of the multi body library, which uses a methodology based on ob&ect orientation

and symbolic manipulation of equations. 'ith this last model it was possible to

visuali(e an animation in real time )!.

The following step of the pro&ect was to do control design for the

different models. The obtained simulations were shown in !ymola and

*imulink.

+inally experiments on the real process were developed, based on vision feedback.

 Keywords

M"!#i& c"&tr"# "'8ct-"ri&t! 1"!#i&

lassification system and!or inde" terms (if any)

Supplementary bibliographical information

 #SSN and $ey title

0290-53:6 #S%N 

 &anguage

E&#ish Number of pages

47 'ecipients notes

Security classification

The report may be ordered from the Department of Automatic ontrol or borrowed through*niversity &ibrary+ %o" ,+ S-.//0 11 &und+ Sweden 2a" 345 45 

/// 4/ 4,

Page 4: Ball and Beam pid

8/17/2019 Ball and Beam pid

http://slidepdf.com/reader/full/ball-and-beam-pid 4/52

Ac$no#ledgments

This ;"r has '& acc"1.#ish! at th D.art1&t "$ A(t"1atic "&tr"# at L(&!

I&stit(t "$ Tch&"#", i& S;!& 't;& <ct"'r 2003 a&! March 2004)

I&itia##, I ;"(#! #i t" =.rss 1, ratit(! t" Dr) R"#$ %"ha&ss"& $"r ii& th

 ."ssi'i#it, t" ;"r i& this !.art1&t (&!r his s(.risi"&)I ;ish t" =.rss 1, si&cr ratit(! t" A&!rs R"'rtss"& ;h" (i!! this thsis a&!

h#.! ;h&r I ;as i& &!) H h#.! 1 ;ith 1, !"('ts a&! *(sti"&s)

I ;ish t" tha& a## 1, S.a&ish $ri&!s $"r thir i&s.irati"&a# a&! 1"ra# s(.."rt a&!s.cia##, t" 1, $ri&!s Ra(# a&! Ta&ia ;h" h#.! 1 i& 1, ar#ir !a,s ;h& I arri! t"

S;!&)

Last '(t crtai&#, &"t #ast I ;"(#! #i t" sh"; 1, ratit(! t" 1, .ar&ts 1, sistr a&!

1, ra&!.ar&ts ;h" ha '& &r"(s ;ith thir &c"(ra1&t)

This thsis is !!icat! t" th1)

Page 5: Ball and Beam pid

8/17/2019 Ball and Beam pid

http://slidepdf.com/reader/full/ball-and-beam-pid 5/52

TABLE %& C%'TE'TS

Introduction((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((( 1

Dymola and )odelica ((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((( !

!(1 Dymola ((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((( !2):): D,1"#a $at(rs )))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) 3

2):)2 Th 1"!#i& &ir"&1&t ))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) 4

!(! )odelica((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((( *2)2): M"!#ica $at(rs)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) 5

!(+ ,o# to learn Dymola and )odelica((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((( 8

Ball and Beam ((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((( -

+(1 .rocess Description ((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((( -

)athematical modeling (((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((( 1!

*(1 Ball and Beam )odel(((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((( 1!4):): N;t"&>s sc"&! #a; )))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) :24):)2 Lara&ia& 1th"!s)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) :4

)odeling in )odelica ((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((( 1-

/(1 )odels #ith )odelica language (((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((( 1-5):): M"!#ica 1"!#? N;t"&>s sc"&! #a; )))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) 205):)2 M"!#ica 1"!#? Lara&ia& 1th"! ))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) 2:

/(! )odel #ith )odelica0s liraries (((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((( !+

Control Design and Simulations (((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((( !2

2(1 Control design ((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((( !26):): "&tr"# !si&? #i&ar "'srr-'as! c"&tr"# )))))))))))))))))))))))))))))))))))))))))))))))))))))) 26

6):)2 "&tr"# Dsi&? &"&#i&ar s,st1))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) 29

2(! Simulations (((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((( +16)2): Si1(#ati"&s i& Si1(#i&)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) 3:

Experiments((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((( ++

3(1 Experimental Setup (((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((( ++

3(! ,o# to do the experiments((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((( +*

Conclusions (((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((( *!

8(1 Conclusions (((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((( *!

Page 6: Ball and Beam pid

8/17/2019 Ball and Beam pid

http://slidepdf.com/reader/full/ball-and-beam-pid 6/52

:

Chapter 1

Introduction

This thsis c"&c&trats "& th st(!, "$ th +a## a&! +a1 .r"css) Th 1"!#i& has '&!"& ;ith M"!#ica a&! D,1"#a)

D,1"#a is a& i&trat! &ir"&1&t $"r !#".i& 1"!#s i& th M"!#ica #a&(a a&!

a si1(#ati"& &ir"&1&t $"r .r$"r1i& =.ri1&ts)T" !" th c"&tr"# !si& thr ar 1a&, ."ssi'i#itis@ this .r"8ct .rs&ts a& "'srr-

 'as! c"&tr"# !si& !#".1&t i& Mat#a' 'as! "& ."#-.#ac1&t) Th si1(#ati"&s ar 1a!

i& Si1(#i& a&! D,1"#a) Th =.ri1&ts ;ith th ra# +a## a&! +a1 .r"css ar !"& ;ith th

c"&tr"##r i1.#1&t! i& a ra#-ti1 =t&si"& t" Si1(#i& a&! ias(a# $!'ac $r"1 a ca1ras,st1)

A sh"rt !scri.ti"& "$ th thsis cha.tr is "(t#i&! '#";?

Chapter ! .rs&ts a& =.#a&ati"& "$ !i$$r&t t""#s (s! $"r th 1"!#i&)

Chapter + !scri's th st(!, "$ th +a## a&! +a1 .r"css)

Chapter * .rs&ts th 1ath1atica# 1"!#i& "$ th .h,sica# s,st1) Chapter

/ is th 1"!#i& i& M"!#ica "$ th 'a1 a&! 'a## .r"css( Chapter 2

c"&tai&s c"&tr"# !si& "$ th "'tai&! 1"!#s a&! th c"rrs."&!i&si1(#ati"&s)

Chapter 3 c"&tai&s th =.ri1&ts !"&)

Chapter 8 .rs&ts th s(11ari! c"&c#(si"&s "$ this thsis)

Page 7: Ball and Beam pid

8/17/2019 Ball and Beam pid

http://slidepdf.com/reader/full/ball-and-beam-pid 7/52

Chapter !

Dymola and )odelica

This cha.tr is a sh"rt i&tr"!(cti"& t" th !i$$r&t t""#s (s! $"r th 1"!#i& i& th

thsis)

!(1 Dymola

Th c"1.a&, D,&asi1Bs 1issi"& is t" !#". th s"$t;ar t""#s that i&!(str, &!s $"r 

s"#i& !1a&!i& 1"!#i& si1(#ati"& a&! !si& .r"'#1s) Th 1.hasis is "& ha&!#i&

#ar 1(#ti-&i&ri& s,st1s $$ici&t#,) D,1"#a .i"&r! th "'8ct-"ri&t! .h,sica#1"!#i& 1th"!"#", a&! th acc"1.a&,i& si1(#ati"& tch&"#",)

I& :CC6 D,&asi1 t"" th i&itiati t" !si& a &; (&i$i! "'8ct-"ri&t! #a&(a $"r 

 .h,sica# s,st1s 1"!#i& ca##! M"!#ica) F"(&!! i& :CC2 D,&asi1 is th #a!i& !#".r 

a&! i1.#1&t "$ "'8ct-"ri&t! 1(#ti-&i&ri& 1"!#i& tch&"#", a&! th M"!#ica#a&(a 2)

D,1"#a - D,&a1ic M"!#i& La'"rat"r, - is a t""# $"r 1(#ti-!"1ai& 1"!#i& a&!si1(#ati"&) D,&asi1 !#".! it) D,1"#a s(.."rts th 1"!#i& #a&(a M"!#ica $"r ;hich

thr ar a &(1'r "$ $r a&! c"11rcia# 1"!# #i'raris that i&c#(! 1"!#s "$ 1cha&ica#

thr1a# h,!ra(#ic a&! thr1"!,&a1ic a&! c"&tr"# s,st1s) 4

D,1"#a (ss a &; 1"!#i& 1th"!"#", 'as! "& "'8ct "ri&tati"& a&! s,1'"#ic

1a&i.(#ati"& "$ *(ati"&s) Th (s(a# &! $"r th 1a&(a# c"&rsi"& "$ *(ati"&s t" a '#"c !iara1 is r1"! ', th (s "$ a(t"1atic $"r1(#a 1a&i.(#ati"&)

Page 8: Ball and Beam pid

8/17/2019 Ball and Beam pid

http://slidepdf.com/reader/full/ball-and-beam-pid 8/52

ha.tr 2) D,1"#a a&! M"!#ica

3

!(1(1 Dymola features4

¾ M"!# Tra&s#at"r 

                                                                                                                                                           A(t"1atic ca(sa#it, a&a#,sis

                                                                                                                                                           S,1'"#ic s"#(ti"& "$ *(ati"&s a&! i&!= r!(cti"&                                                                                                                                                           S"#(ti"& "$ a#'raic #"".s                                                                                                                                                           A(t"1atic ha&!#i& "$ ti1 a&! stat &ts                                                                                                                                                           &rat -c"!

¾ Ha&!#s #ar c"1.#= 1(#ti-!"1ai& 1"!#s

¾ Fastr 1"!#i& ', ra.hica# 1"!# c"1."siti"&

                                                                                                                                                           ra.hica# 1"!# !it"r a&! 'r";sr                                                                                                                                                            Dra s('1"!#s $r"1 #i'raris                                                                                                                                                           ara1tr $"r1s

                                                                                                                                                           "&&ct ra.hica##,                                                                                                                                                           +(i#! ic"&s - ."#,"&s circ#s t=t c"#"r tcG                                                                                                                                                           T=t !it"r $"r !c#arati"&s a&! *(ati"&s                                                                                                                                                           A(t"1atic HTML 1"!# !"c(1&tati"&

¾  N" 1a&(a# *(ati"& 1a&i.(#ati"& &!!

¾ Fastr si1(#ati"& - s,1'"#ic .r-.r"cssi&

¾ <.& $"r (sr !$i&! 1"!# c"1."&&ts

¾ <.& i&tr$ac t" "thr .r"ra1s

¾ A&i1ati"&

                                                                                                                                                           Ra# ti1 3D a&i1ati"&                                                                                                                                                           +"=s s.hrs c,#i&!rs tc - .r!$i&! is(a# c#asss                                                                                                                                                           I1."rt "$ DF a&! STL $i#s                                                                                                                                                           Hi!!& s(r$ac r1"a# sha!i&                                                                                                                                                           #"tti&

¾ Si1(#at"r 

                                                                                                                                                           Ha&!#s <DE a&! DAE 1"!#s                                                                                                                                                           Stat "r th art &(1rica# i&trati"&                                                                                                                                                           F#=i'# i&itia#iati"&                                                                                                                                                           I&tr$ac t" =tr&a# -$(&cti"&s                                                                                                                                                           Mat#a'/Si1(#i& = a& ! SAE i&tr$acs                                                                                                                                                           DDE i&tr$ac                                                                                                                                                           Ra# ti1 si1(#ati"& :

Page 9: Ball and Beam pid

8/17/2019 Ball and Beam pid

http://slidepdf.com/reader/full/ball-and-beam-pid 9/52

!(1(! The modeling en5ironment

D,1"#a is a& i&trat! &ir"&1&t $"r !#".i& 1"!#s i& th M"!#ica #a&(a a&!

a si1(#ati"& &ir"&1&t $"r .r$"r1i& =.ri1&ts)

Th D,1"#a 1"!#i& &ir"&1&t is !ii!! i& t;" 1ai& .arts?

¾ At th 1"!#i& 1"! ca##! M"!# E!it"r ;hr th 1"!#s ar c"1."s! $r"1

#i'rar, c"1."&&ts $r"1 th M"!#ica sta&!ar! #i'rar, "thr #i'raris a&!

c"11rcia# a&! .r".ritar, #i'raris as ;## as 1"!#s !#".! ', th (sr) M"!#sar ithr c"1."s! "$ "thr 1"r .ri1iti c"1."&&ts "r !scri'! ', *(ati"&s at

th #";st ##)

This 1"! a##";s?

                                                                                                                                                           M"!# c"1."siti"&                                                                                                                                                           D$a(#t .ara1tr stti&s                                                                                                                                                           D$i&iti"& "$ *(ati"&s

¾ At th si1(#ati"& 1"! D,1"#a tra&s$"r1s a !c#arati *(ati"& 'as! 1"!#!scri.ti"& i&t" $$ici&t c"!) I& this ## it is ."ssi'# sh"; th rs(#ts as a&i1ati"&s

"r (si& .#"t ;i&!";s $"r is(a#iati"& "$ si1(#ati"& rs(#ts)

D,1"#a .r"i!s a c"1.#t si1(#ati"& &ir"&1&t '(t ca& a#s" =."rt c"! $"r 

si1(#ati"& i& Si1(#i&) I& a!!iti"& t" th (s(a# "$$#i& si1(#ati"& D,1"#a ca& &rat c"! $"r 

s.cia#i! har!;ar-i&-#"". s,st1s s(ch as !SAE = a&! "thrs 5)

D,1"#a (ss M"!#ica ;hich is a& "'8ct "ri&tat! 1"!#i& #a&(a ;hich s(.."rts

hirarchica# str(ct(ri& r(s a&! "#(ti"& "$ #ar a&! c"1.#= 1"!#s i&!.&!&t $r"1 th

a..#icati"&) It (ss aca(sa# 1"!#i& 'as! "& !i$$r&tia# a&! a#'raic *(ati"&s)

!(! )odelica

M"!#ica 3 is a .";r$(# #a&(a $"r 1"!#i& "$ .h,sica# s,st1s !si&! t" s(.."rt$$cti #i'rar, !#".1&t a&! 1"!# =cha&) It is a 1"!r& #a&(a '(i#t "& aca(sa#

1"!#i& ;ith 1ath1atica# *(ati"&s a&! "'8ct-"ri&t! c"&str(cts t" $aci#itat r(s "$ 

1"!#i& &";#!)

Th ;"r ;ith M"!#ica start! i& S.t1'r :CC6 ;ith a r"(. "$ a'"(t $i$t& .rs"&s

;ith &";#! a'"(t 1"!#i& #a&(as a&! 1"!#s ;ith !i$$r&tia# a#'raic *(ati"&s

DAE)Th $irst rsi"& "$ th M"!#ica #a&(a !$i&iti"& ;as $i&ish! i& S.t1'r :CC7) I&

%a&(ar, 2002 a &; rsi"& ;as r#as!)

Page 10: Ball and Beam pid

8/17/2019 Ball and Beam pid

http://slidepdf.com/reader/full/ball-and-beam-pid 10/52

!(!(1 )odelica features

Th $"(r 1"st i1."rta&t $at(rs "$ M"!#ica ar?

¾ Is 'as! "& *(ati"&s i&sta! "$ assi&1&t stat1&ts) This .r1its aca(sa#

1"!#i& that is 'ttr r(s "$ c#asss si&c *(ati"&s !" &"t s.ci$, a crtai&!ata $#"; !ircti"&) Th(s a M"!#ica c#ass ca& a!a.t t" 1"r tha& "& !ata $#";

c"&t=t)

¾ Has 1(#ti-!"1ai& ca.a'i#it, 1a&i& that 1"!# c"1."&&ts c"rrs."&!i& t"

 .h,sica# "'8cts $r"1 sra# !i$$r&t !"1ai&s s(ch as )) #ctrica# 1cha&ica#

thr1"!,&a1ic h,!ra(#ic 'i"#"ica# a&! c"&tr"# a..#icati"&s ca& ' !scri'! a&!c"&&ct!)

¾ Is a& "'8ct-"ri&t! #a&(a ;ith a &ra# c#ass c"&c.t that (&i$is c#asss

&rics a&! &ra# s('t,.i& i&t" a si&# #a&(a c"&str(ct) This $aci#itats r(s

"$ c"1."&&ts a&! "#(ti"& "$ 1"!#s)

¾ Has a str"& s"$t;ar c"1."&&t 1"!# ;ith c"&str(cts $"r crati& a&! c"&&cti&c"1."&&ts) Th(s th #a&(a is i!a##, s(it! as a& architct(ra# !scri.ti"&

#a&(a $"r c"1.#= .h,sica# s,st1s a&! t" s"1 =t&! $"r s"$t;ar s,st1s)

M"!#s a&! s('-1"!#s ar !c#ar! as c#asss ;ith c"&&cti"& i&tr$acs ca##!

connectors) This c"&&cti"& ca.a'i#it, a##";s th (s "$ 1"!# #i'raris t" c"1."s c"1.#=

1"!#s ;ith th !ra a&! !r". a&! c"&&cti"& !ra;i& $aci#itis "$ 1"!r& ra.hica# !it"rs)

Th "a# "$ th M"!#ica !si& $$"rt is t" !si& .h,sica# s,st1s 1"!#i& #a&(a

that 1as #i$ $"r th 1"!# '(i#!rs c"&si!ra'#, asir a&! 1"r .r"!(cti)

F"##";i& ar !scri'! th &ra# $at(rs "$ M"!#ica)

,ierarchical modeling

M"!#ica s(.."rts '"th hih ##s 1"!#i& ', c"1."siti"& a&! !tai#! #i'rar,

c"1."&&t 1"!#i& ', *(ati"&s) M"!#s "$ sta&!ar! c"1."&&ts ar t,.ica##, aai#a'# i&

1"!# #i'raris) Usi& a ra.hica# 1"!# !it"r a 1"!# ca& ' !$i&! ', !ra;i& ac"1."siti"& !iara1 ', ."siti"&i& ic"&s that r.rs&t th 1"!#s "$ th c"1."&&ts !ra;i&

c"&&cti"&s a&! ii& .ara1tr a#(s i& !ia#"( '"=s) "&str(cts $"r i&c#(!i& ra.hica#

a&&"tati"&s i& M"!#ica 1a ic"&s a&! c"1."siti"& !iara1s ."rta'# 't;& !i$$r&t t""#s2)

Page 11: Ball and Beam pid

8/17/2019 Ball and Beam pid

http://slidepdf.com/reader/full/ball-and-beam-pid 11/52

A& =a1.# "$ th t=t(a# r.rs&tati"& "$ a si1.# 1"t"r !ri s,st1 is?

1"!# M"t"rDri

ID c"&tr"##r?M"t"r 1"t"r@ar'"= ar &:00@

I&rtia i&rtia %:0@

*(ati"&c"&&ctc"&tr"##r)"(t"rt 1"t"r)i&"rt@

c"&&ctc"&tr"##r)i&"rt2 1"t"r)"(t"rt@

c"&&ctar)$#a&Ja 1"t"r)$#a&J'@

c"&&ctar)$#a&J' i&rtia)$#a&Ja@&! M"t"rDri@

Th c"1."siti"& !iara1 "$ th 1"!# c#ass M"t"r is sh";& '#";?

Fi(r 2):? M"t"r !ri ;ith M"!#ica #i'raris

Page 12: Ball and Beam pid

8/17/2019 Ball and Beam pid

http://slidepdf.com/reader/full/ball-and-beam-pid 12/52

Structure model liraries

A .";r$(# .aca c"&c.t is aai#a'# t" str(ct(r #ar 1"!# #i'raris a&! t" $i&! a

c"1."&&t i& a $i# s,st1 ii& its hirarchica# M"!#ica c#ass &a1)

,yrid modeling

A (&i*( $at(r "$ M"!#ica is th ha&!#i& "$ !isc"&ti&("(s a&! aria'# str(ct(rc"1."&&ts s(ch as r#a,s s;itchs 'ari& $ricti"& c#(tchs 'ras i1.act sa1.#! !ata

s,st1s a(t"1atic ar'"=s tc) M"!#ica has i&tr"!(c! s.cia# #a&(a c"&str(cts a##";i&

a si1(#at"r t" i&tr"!(c $$ici&t ha&!#i& "$ &ts &!! i& s(ch cass)

Array

M"!#ica s(.."rts arra,s (ti#ii& a Mat#a' #i s,&ta=) Th #1&ts "$ arra,s 1a, '

"$ th 'asic !ata t,.s Ra# I&tr +""#a& Stri& "r c"1."&&t 1"!#s) This a##";sc"&&i&t !iscrtiati"& "$ si1.# .artia# !i$$r&tia# *(ati"&s)

Class parameters

+si!s "r!i&ar, &(1ric .ara1trs M"!#ica a##";s 1"!# c#ass .ara1trs) As a&

=a1.# ass(1 that a& a(t"-t(&i& c"&tr"##r sh"(#! r.#ac a I c"&tr"##r) It is "$ c"(rs

 ."ssi'# t" 8(st r.#ac th c"&tr"##r i& a ra.hica# (sr &ir"&1&t i)) t" crat a &; 1"!#)Th .r"'#1 ;ith this s"#(ti"& is that t;" 1"!#s 1(st ' 1ai&tai&!) M"!#ica has th

ca.a'i#it, t" i&sta! s('stit(t a 1"!# c"1."&&t s" "&#, "& rsi"& "$ th rst "$ th 1"!# is

&!!)

E6uations

M"!#s i& M"!#ica ar 1ath1atica##, !scri'! ', !i$$r&tia# a#'raic a&! !iscrt

*(ati"&s) N" .artic(#ar aria'# &!s t" ' s"#! 1a&(a##,) A M"!#ica t""# ;i## ha &"(h

i&$"r1ati"& t" !ci! it a(t"1atica##,) M"!#ica is !si&! s(ch that aai#a'# s.cia#i!a#"rith1s ca& ' (ti#i! t" &a'# $$ici&t ha&!#i& "$ #ar 1"!#s hai& 1"r tha& h(&!r!

th"(sa&! *(ati"&s) M"!#ica is s(it! a&! (s! $"r har!;ar-i&-th-#"". si1(#ati"&s a&! $"r 1'!!! c"&tr"# s,st1s)

Page 13: Ball and Beam pid

8/17/2019 Ball and Beam pid

http://slidepdf.com/reader/full/ball-and-beam-pid 13/52

!(+ ,o# to learn Dymola and )odelica

Th $irst tas "$ this thsis ;as #ar&i& D,1"#a a&! th M"!#ica #a&(a) I& 1,

c"1.(tr rsi"& 5): "$ D,1"#a ;as i&sta##! aai#a'# as $r s"(rc c"!) M"st "$ th

=isti& t(t"ria#s ar 'as! "& =a1.#s 'si!s I (s! sra# t(t"ria#s a&! '""s s"1 "$ th1;r?

¾ Th (i! Ktti& Start! ;ith D,1"#a : i&c#(!! i& D,1"#a (sr>s 1a&(a# ;hich

 .r"i!s s"1 =a1.#s i& "r!r t" (i! ,"( thr"(h D,1"#a) F"r !tai#!i&$"r1ati"& a'"(t th .r"ra1 ,"( ca& c"&s(#t th "&-#i& !"c(1&tati"& aai#a'# i&

th H#. 1&( a$tr s#cti& D"c(1&tati"&)

¾ Th '"" KI&tr"!(cti"& t" h,sica# M"!#i& ;ith M"!#ica 6 ;hich i&tr"!(cs t"

th M"!#ica 1"!#i& #a&(a a&! sh";s th (s th .";r$(# $at(rs "$ thM"!#ica #a&(a)

¾ A t(t"ria# .aca ca##! K+i&&r t(t"ria# 7 ;hich c"&tai&s =rciss) Ths=rciss ar ""! t" #ar& t" ;rit si1.# 1"!#s th (s th M"!#ica sta&!ar!

#i'rar, tcG

¾  6odelica tutorial document a&!  6odelica specification document+  '"th !$i& th

M"!#ica #a&(a 9)

¾  Advanced Tutorial is a c"&ti&(ati"& "$ +i&&r t(t"ria# C)

Page 14: Ball and Beam pid

8/17/2019 Ball and Beam pid

http://slidepdf.com/reader/full/ball-and-beam-pid 14/52

C

Chapter +

Ball and Beam

This cha.tr is a& i&tr"!(cti"& t" th .r"css "$ th 'a## r"##i& "& th 'a1)

+(1 .rocess Description

Th 'a## a&! 'a1 s,st1 is "& "$ th 1"st &!(ri&#, .".(#ar a&! i1."rta&t #a'"rat"r,1"!#s $"r tachi& c"&tr"# s,st1s &i&ri&) Th 'a## a&! 'a1 is ;i!#, (s! 'ca(s it is

r, si1.# t" (&!rsta&! as a s,st1 a&! ,t th c"&tr"# tch&i*(s that ca& ' st(!i! it c"r 

1a&, i1."rta&t c#assica# a&! 1"!r& !si& 1th"!s) It has a r, i1."rta&t .r".rt,@ it is ".&

#"". (&sta'#)

Fi(r 3):? Diara1 "$ +a## a&! +a1

Page 15: Ball and Beam pid

8/17/2019 Ball and Beam pid

http://slidepdf.com/reader/full/ball-and-beam-pid 15/52

ha.tr 3) +a## a&! +a1

Th s,st1 is r, si1.# a st# 'a## r"##i& "& th t". "$ a #"& 'a1) Th 'a1 is

1"(&t! "& th "(t.(t sha$t "$ a& #ctrica# 1"t"r a&! s" th 'a1 ca& ' ti#t! a'"(t its c&tr 

a=is ', a..#,i& a& #ctrica# c"&tr"# si&a# t" th 1"t"r a1.#i$ir)

Th c"&tr"# 8"' is t" a(t"1atica##, r(#at th ."siti"& "$ th 'a## "& th 'a1 ',cha&i& th a&# "$ th 'a1) This is a !i$$ic(#t c"&tr"# tas 'ca(s th 'a## !"s &"t sta, i&

"& .#ac "& th 'a1 '(t 1"s ;ith acc#rati"& that is a..r"=i1at#, .r"."rti"&a# t" th ti#t"$ th 'a1) I& c"&tr"# tr1i&"#", th s,st1 is ".& #"". (&sta'# 'ca(s th s,st1 "(t.(t

th 'a## ."siti"& i&crass ;ith"(t #i1it $"r a $i=! i&.(t 'a1 a&#) F!'ac c"&tr"# 1(st

 ' (s! t" sta'i#i th s,st1 a&! t" . th 'a## i& a !sir! ."siti"& "& th 'a1)

T;" !i$$r&t i1.#1&tati"&s "$ th +a## a&! +a1 .r"css ha '& c"&si!r! '"th

aai#a'# at th c"(rs #a' "$ th D.art1&t "$ A(t"1atic "&tr"# s $i(r 3)2 a&! 3)3)

Fi(r 3)2? +a## a&! +a1 c"&&ct! ia ar'"=

Th 'a1 is c"&&ct! t" a #"cit, c"&tr"##! D-1"t"r ia a ar'"=) This 1as it

1(ch asir t" c"&tr"# th .r"css a&! thr is r, #itt# i&$#(&c "$ th cr"ss-c"(.#i&s $r"1th 'a## t" th 'a1)

Page 16: Ball and Beam pid

8/17/2019 Ball and Beam pid

http://slidepdf.com/reader/full/ball-and-beam-pid 16/52

Fi(r 3)3? +a## a&! +a1 !irct#, c"&&ct! t" th a=is "$ a D-1"t"r 

Dirct !ri& 'a1? Th 'a1 is !irct#, c"&&ct! t" th a=is "$ a D-1"t"r)

Th 'a1 a&# is 1as(r! '(t &"t th a&(#ar #"cit,) Th 'a## ."siti"& &!s a#s" t" '

1as(r! a&! i& th sta&!ar! c"&$i(rati"& "$ th .r"css at th D.art1&t "$ A(t"1atic"&tr"# th 1ta# 'a## c#"ss a& #ctrica# circ(it a#"& th rai# "$ th 'a1)

I& "(r =.ri1&ta# st(. s cha.tr 7 ; ha (s! a isi"& s,st1 $"r !tr1i&i& th

 'a## ."siti"&) Th s.! "$ th 'a## &!s t" ' sti1at!)

Page 17: Ball and Beam pid

8/17/2019 Ball and Beam pid

http://slidepdf.com/reader/full/ball-and-beam-pid 17/52

:2

Chapter *

)athematical modeling

This cha.tr !scri's h"; t" "'tai& th *(ati"&s "$ 1"ti"& $"r th +a## a&! +a1

 .r"css)

*(1 Ball and Beam )odel

Th *(ati"&s $"r "'tai&i& th 1"!# i& M"!#ica ha '& ra#i! ', 1a&s "$ t;"

!i$$r&t 1th"!s) <& "$ th1 is !ri! ;ith si1.# 1ath1atic *(ati"&s (si& N;t"&>s

sc"&! #a; a&! a&"thr thr"(h th (s "$ th Lara&ia& Mth"!)

*(1(1 'e#ton0s second la#

I& this 1"!# ; $irst c"&si!r "&#, th r#ati"& 't;& th 'a1 a&# a&! th ."siti"& "$ th 'a##)

α =

Page 18: Ball and Beam pid

8/17/2019 Ball and Beam pid

http://slidepdf.com/reader/full/ball-and-beam-pid 18/52

ha.tr 4? Math1atica# 1"!#i&

Th .ara1trs "$ th 'a## a&! 'a1 ar !$i&! as $"##";s?

α Î +a1 a&# c""r!i&atL Î +a1 L&th

1Î Mass "$ th 'a##RÎ Ra!i(s "$ th 'a##% Î +a##>s 1"1&t "$ i&rtiaÎ raitati"&a#acc#rati"& = Î "siti"&"$ th 'a##

 N#cti& $ricti"&a# $"rcs th t;" $"rcs i&$#(&ci& th 1"ti"& "$ th 'a## ar?

- Ft= F"rc !( t" tra&s#ati"&a# 1"ti"&

- Fr= F"rc !( t" 'a## r"tati"&

Tra&s#ati"&a#?

d2 "

M "M =dt

2

 2 t"

= m ⋅ 

M "M

(4):)

T"r*( !( t" th 'a## r"tati"& is?! ⎜

v '⎟ ! 2 ⎜

 "⎟

 ⎛  ⎞  ⎛   ⎞T F R %⋅ ⋅

dw ' % ⋅

  ⎝   ' % ⋅

   ' ⎠ 

 7=⋅

 2 r"

r"dt 

= 7

M "M '

2

 ⎠  ⎝dt dt

2 '

(4)2)

Page 19: Ball and Beam pid

8/17/2019 Ball and Beam pid

http://slidepdf.com/reader/full/ball-and-beam-pid 19/52

Th 1"1&t i&rtia "$ th 'a## is s.hr?

 7 =2

⋅ m ⋅  '2

5

(4)3)

S('stit(ti& th *(ati"& 4)3 i&t" th *(ati"& 4)2 ; t?

 2 r"

= 2⋅ m ⋅ M "M

5

 N;t"&>s sc"&! #a; a#"& th i&c#i&ati"&?

 2 r"

+ 2 t"

= m ⋅  g ⋅ si&α (4)4)

S('stit(ti& i& th *(ati"& 4)4?

2⋅ m ⋅ M "M + m ⋅ M "M = m ⋅  g ⋅ si&α

5

I& c"&c#(si"& ; ha?

M "M =5

⋅  g ⋅ si&α7

I& this !riati"& ; ha ta& i&t" c"&si!rati"& h"; th 'a## ."siti"& a$$cts th a&#)

*(1(! Lagrangian methods

Th c"&tr"# "'8cti is t" c"&tr"# th t"r*( τ a..#i! at th .i"t "$ th 'a1 s(chthat th 'a## ca& r"## "& th 'a1 a&! trac a !sir! tra8ct"r,) Th t"r*( ca(ss th(s acha& "$ th 'a1 a&# a&! a 1"1&t i& th ."siti"& "$ th 'a##)

τ O '

r  '

Page 20: Ball and Beam pid

8/17/2019 Ball and Beam pid

http://slidepdf.com/reader/full/ball-and-beam-pid 20/52

Th .ara1trs "$ th 'a## a&! 'a1 ar !$i&! as $"##";s?

I ' Î +a1>s 1"1&t "$ i&rtia

O 'Î +a1 a&#1s Î Mass "$ th 'a##Is Î +a##>s 1"1&t "$ i&rtiar s Î Ra!i(s "$ th s.hrr  ' Î "siti"& "$ th 'a##

Th i&tic &r, "$ th s,st1 is?

T = T beam + T 

 sphere

T beam

= T beam

 frame

+ T beam

beam

body

center 

T  sphere = T 

 sphere  frame + T  spherebeam body

center 

Each &r, is?

T beam

 frame = 0

¾ Th r"tati"&a# i&tic &r, "$ th 'a1 is?

: 2T beamcenter

= ⋅  #b

⋅θMb

2

¾ Th 'a## has i&tic &r, ;ith rs.ct t" th $ra1 i& '"th ra!ia# a&! circ(#ar 1"ti"&?

: ( 2 ) 2 : 2T  sphere frame

= ⋅  m s

⋅ r b

2⋅θM

b

+ ⋅ m s

⋅ r Mb

2

¾ Th r"tati"&a# i&tic &r, "$ th s.hr a'"(t its '"!, c&tr

: 2T  spherecenter

= ⋅  # s

⋅θM s

2

(4)5)

Th r"tati"&a# i&rtia "$ th r"##i& s.hr is

 # =2

⋅ m s5

 s⋅ r

2

(4))

(4)6) s

Page 21: Ball and Beam pid

8/17/2019 Ball and Beam pid

http://slidepdf.com/reader/full/ball-and-beam-pid 21/52

a&! a..#,i& a r"##i& ;ith"(t s#i..i&?4) (4)7)

r Mb = r 

 s  ⋅θM

 s

S('stit(ti& th *(ati"&s 4)6 a&! 4)7 i&t" th *(ati"& 4)5 ; t?

: ⎡ 2  ⎤  ⎡  :  ⎤  : ⎡ 2 ⎤

T  spherecenter  =

2⋅ ⎢ 

5⋅ (m   ⋅ r

2 ) ⋅

r2

⋅ r M 2

⎥  =

2⎢ 5

⋅ m s

 ⋅ r M 2

⎥ ⎣  ⎦  ⎣   s ⎦  

⎣  ⎦

Th i&tic &r, "$ th s,st1 is?(4))

T =:

⋅ ⎡ #    ⋅θM 2

(m⋅ r

2 )⋅θM 2+ 

m

⋅ r M 2

+

2⋅ m   ⋅ r M 

2

(4))

4)9

2 ⎣  b b  s b b  s b 5  s b ⎦

Si1.#i$,i& th *(ati"& 4)9 ; ha?

T =:

⋅ ⎡( #  + m ⋅ r

2 )⋅θM 2

+

7⋅ m   ⋅ r M 

2 ⎤

2 ⎣  

b s b b5

 s b

Th r"##i& 'a## a#"& =hi'its th ."t&tia# &r, "$ th s,st1?

8 = m s

⋅  g ⋅ r b

⋅ si&θb

T" s(1 (.?

¾ 7I'ETIC E'E9:

T =:

⋅ ⎡( #  + m ⋅ r

2 )⋅θM 2

+

7⋅ m   ⋅ r M 

2

(4))

(4)C)

2 ⎣  

b s b b5

 s b

¾ .%TE'TIAL E'E9:

8 = m s

⋅  g ⋅ r b

⋅ 

si&θb

(4))

(4):0)

 s ⎥  ⎢

b b b

⎢( )

⎢⎥

⎢  ⎥

Page 22: Ball and Beam pid

8/17/2019 Ball and Beam pid

http://slidepdf.com/reader/full/ball-and-beam-pid 22/52

T" ;rit th *(ati"&s "$ 1"ti"& ; !$i& th Lara&ia& L t" ' th !i$$r&c 't;&

th i&tic a&! ."t&tia# &r, "$ th s,st1)

 &(9 9M ) = T  (9 9M )− 8 

(9 )

(4)::)

;hr * !&"t th s"-ca##! &ra#i! c""r!i&ats "$ th s,st1 T is th i&tic &r,

"$ th s,st1 a&! V is th ."t&tia# &r, "$ th s,st1)

S('stit(ti& th *(ati"&s 4)C a&! 4):0 i&t" th *(ati"& 4):: ; t?

 & =:

⋅ ⎡ #    ⋅θM 2

(m⋅ r

2 )⋅θM 2+ 

m

⋅ r M 2

+2

⋅ 

m

⋅ r M 2 ⎤ 

− 

m

⋅  g ⋅ 

⋅ si&θ

2b b  s b b  s b

5 s b s b b

Lara&>s *(ati"&s "$ 1"ti"& ar $"r1! $r"1?

⎡ ∂ ⎤d & ∂ &

 ⎢   ⎥ − =dt ⎣∂9Mi ⎦ ∂9i

 2 9i

;hr F*i is th =tr&a# $"rc i& this cas F*i isτ)

*iÎ

 i& this cas arθ ' a&! r M

b

 ∂ &

∂θMb

=:

⋅  # + m ⋅ r2 ⋅ 2 ⋅θM

2b s b b

∂ &=

:⋅ 

7⋅ 2 ⋅ 

m

⋅ r

∂r Mb

2 5

I$ ; !ri '"th =.rssi"&s ;ith rs.ct t" ti1 t ; t?

 ⎡  ∂ ⎤  &d ⎢  ⎥  ⎣ ∂θ

Mb ⎦ 

=  # dt

b

+ m s   ⋅ r

2

⋅θM

+ 2 ⋅ 

m s

⋅ 

r b

⋅ 

r Mb

⋅θMb

⎡ ∂ ⎤  &d ⎢  ⎥

  ⎣ ∂r Mb ⎦ 

=7

m  ⋅ Mr M

dt 5 s b

 s b

b b

Page 23: Ball and Beam pid

8/17/2019 Ball and Beam pid

http://slidepdf.com/reader/full/ball-and-beam-pid 23/52

Th "thrs *(ati"&s ;hich ; &! ar?

∂ &

∂θb

= −m s

⋅  g ⋅ r b

⋅ c"sθb

∂ & = :⋅ [2 ⋅ 

m

⋅ 

r b

⋅θM 2 ]− m

⋅  g ⋅ si&θb

∂r b

2

E;<ATI%'S %& )%TI%'4

2 M M #b + m s

⋅ r b

⋅θb

+ 2 ⋅ m s⋅ r 

b⋅ r M

b⋅θ

b+ m s

⋅  g ⋅ r b

⋅ c"sθb

= τ

Mr 

+5

⋅  g

⋅ 

si&θ

− r

⋅θM 2

=

0b

7b b b

;hr τ is th t"r*( a..#i! t" th 'a1)

b s s

Page 24: Ball and Beam pid

8/17/2019 Ball and Beam pid

http://slidepdf.com/reader/full/ball-and-beam-pid 24/52

:C

Chapter /

)odeling in )odelica

I& this cha.tr th t;" 1"!#s ar ;ritt& i& th M"!#ica #a&(a thr"(h *(ati"&s a&!

a&"thr 1"!# is crat! ;ith th M"!#ica>s #i'raris) P a#s" .rs&t si1(#ati"& rs(#ts (si&D,1"#a $"r th !i$$r&t 1"!#s)

/(1 )odels #ith the )odelica language

M"!#ica is (&#i 1"st &ra#-.(r."s #a&(as &"t .ri1ari#, 'as! "& a#"rith1s '(t

(ss *(ati"&s i&sta! that is "& !"s &"t &! t" r$"r1(#at th !i$$r&tia# *(ati"& i&t" th

sta&!ar! $"r1 =.#icit

d"=

dt 

 f  " u t

 '(t ca& ha &ra# *(ati"&s ;hr th ti1 !riatis a..ar i1.#icit#,) F"r r, 1"!# th

 .r"ra11r ca& !$i& a &(1'r "$ *(ati"&s !scri'i& th .r".rtis "$ th 1"!#) Th

*(ati"&s !$i& th r#ati"& 't;& th !i$$r&t *(a&titis i& th si1(#ati"&)

Th 1ai& ras"& ;h, M"!#ica (ss *(ati"& is that r, si1(#ati"& .r"'#1 i& $act is a1ath1atica# .r"'#1) It a#s" i th #a&(a a hih a'stracti"& ## 'ca(s a& *(ati"& is

"$t& 1"r i&t(iti tha& a& a#"rith1)

D,1"#a .r"i!s a c"1.#t si1(#ati"& &ir"&1&t) D,1"#a tra&s$"r1s a !c#arati*(ati"& 'as! 1"!# !scri.ti"& i&t" $$ici&t c"!) A$tr a 1"!# has '& tra&s#at! i&t"

si1(#ati"& c"! th si1(#ati"& r(& is st (.) ara1trs a&! i&itia# c"&!iti"&s ar ' !$i&! as

;## as th !(rati"& "$ th si1(#ati"&)

Page 25: Ball and Beam pid

8/17/2019 Ball and Beam pid

http://slidepdf.com/reader/full/ball-and-beam-pid 25/52

ha.tr 5) M"!# i& M"!#ica

D,1"#a is (s! t" is(a#i !,&a1ic 'hai"r) #"ts "$ th ti1-rs."&s "$ aria'#s ar

"$t& har! t" i&tr.rt a&! a 1"r ra#istic ra.hica# i; is &!!) D,1"#a s(.."rts a 3-

!i1&si"&a# a&i1at! 1"!# i; i& a!!iti"& t" !,&a1ic 1"!#i& ;ith a #i'rar, "$ ra.hica#

"'8cts) Ph& a 1"!# is !scri'! i& D,1"#a ;ith *(ati"&s a&! s('1"!#s it is a#s" ."ssi'#

t" !$i& its is(a# a..ara&c) This is !"& i&c#(!i& .r!$i&! ra.hica# "'8cts "$ ari"(ssha.s)

Th t;" "'tai&! 1"!#s i& th .ri"(s cha.tr ca& ' ;ritt& i& M"!#ica thr"(h thir 

*(ati"&s "$ 1"ti"&) Ths t;" .r"ra1s ar sh";& '#"; ;ith th rs.cti si1(#ati"&s !"&

;ith D,1"#a)

/(1(1 )odelica model4 'e#ton0s second la#

1"!# 'a##J'a1J:i1."rt M"!#ica)SI(&its@

// "&sta&ts

c"&sta&t Ra# M"!#ica)"&sta&ts)J& Qraitati"&a# Acc#rati"&Q@

// ara1trs

 .ara1tr Ra# :)0 QM"t"r c"&sta&tQ@

// Varia'#s

Ra# a#.ha Q+a1 a&#Q@ Ra#

QV#"cit, "$ th 'a##Q@ Ra# aQAcc#rati"& "$ th 'a##Q@ Ra# =

Q"siti"& "$ th 'a##Q@

Ra# ( Q"&tr"# si&a#Q@*(ati"&

!r=@a !r@

// Math1atica# 1"!#i&a 5/7M"!#ica)Math)si&a#.ha@

!ra#.ha (@

// "&tr"# si&a#( 0@

&! 'a##J'a1J:@

Page 26: Ball and Beam pid

8/17/2019 Ball and Beam pid

http://slidepdf.com/reader/full/ball-and-beam-pid 26/52

Fi(r 5):? D,1"#a si1(#ati"&? Rs."&s "$ 'a1 a&# ."siti"& "$ th 'a## a&! #"cit, ".&-#"". rs."&s $"r 1"!# 'as "& N;t"&>s sc"&! #a;

This 1"!# $its ;## th 'a1 ;hich is !ri& ia a ar'"= that is th 'a## ."siti"& a&!

th t"r*( th 'a## ca(ss !"s &"t a$$ct th a&# "$ th 'a1)

/(1(! )odelica model4 Lagrangian method

1"!# 'a##J'a1J2

i1."rt M"!#ica)SI(&its@

// ara1trs

 .ara1tr SI(&its)Mass 10): QMass "$ 'a##Q@

 .ara1tr SI(&its)L&th L:)0 Q+a1 #&thQ@ .ara1tr SI(&its)Ra!i(s r0)0:5 QRa!i(s "$ th 'a##Q@ .ara1tr SI(&its)M"1&t<$I&rtia %2/51r2 QS.hrBs 1"1&t "$ I&rtiaQ@

 .ara1tr SI(&its)M"1&t<$I&rtia I:7 Q+a1 I&rtia a#(Q@

// "&sta&ts

c"&sta&t Ra# M"!#ica)"&sta&ts)J& Qraitati"&a# Acc#rati"&Q@

// Varia'#s

Ra# thta Q+a1 A&#Q@

Ra# ; QA&(#ar V#"cit,Q@Ra# a#.ha QA&(#ar Acc#rati"&Q@Ra# =start0)0 Q"siti"& th 'a## i& th 'a1Q@

Ra# QV#"cit, "$ th 'a##Q@

Ra# a QAcc#rati"& "$ th 'a##Q@Ra# ta(start0)0 QT"r*(Q@

*(ati"&

Page 27: Ball and Beam pid

8/17/2019 Ball and Beam pid

http://slidepdf.com/reader/full/ball-and-beam-pid 27/52

!r=@a !r@

; !rthta@

a#.ha !r;@

// Lara&ia& 1th"!

I 1=2a#.ha 21=; 1=M"!#ica)Math)c"sthta ta(@a 5/7M"!#ica)Math)si&thta - =;2 0@

// "&tr"# #a;ta( 0@

&! 'a##J'a1J2@

Fi(r 5)2? D,1"#a si1(#ati"&? Rs."&s "$ 'a1 a&# ."siti"& "$ th 'a## a&! #"cit, <.&-

#"". rs."&s $"r th Lara&ia& 1"!#

This 1"!# is a..r".riat $"r a 'a1 ;hich is !irct-!ri& $r"1 th 1"t"r &" ar'"=

a&! as, t" 1" ', ha&!) Thr$"r th 'a## ."siti"& a&! th c"rrs."&!i& t"r*( !( t"rait, ;i## a$$ct th 'a1 a&# 1(ch 1"r)

+"th 1"!#s ca& ' =."rt! t" Si1(#i& $"r ithr si1(#ati"& "r c"&tr"# !si& ;hich is

#atr t" ' (s! $"r th c"&tr"# "$ th 'a1 a&! 'a## .r"css thr"(h $!'ac $r"1 a isi"&s,st1) Pith this .r"ra1 r(&&i& "& a&"thr c"1.(tr ; ca& !tr1i& th 'a## ."siti"&

;hich ar th& s&t t" th c"&tr"##r ia a &t;"r c"&&cti"&)

Th =."rt "$ a #i&ari! 1"!# t" Si1(#i& ca& ' ra#i! $r"1 1"! Si1(#ati"& "$ 

D,1"#a) I& "r!r t" !" it ,"( ca& (s th c"11a&! Li&ari i&c#(!! i& th Si1(#ati"& M&()

This c"11a&! ca#c(#ats a #i&ari! 1"!# at s"1 !tr1i&! i&itia# a#(s) Th #i&ari!1"!# is st"r! i& Mat#a' $"r1at a&! ca& ' #"a!! i&t" Mat#a' ;ith th 1-$i# t#"a!#i&)

A&"thr ;a, t" !" th =."rtati"& $r"1 D,1"#a t" Si1(#i& ca& ' $"(&! i& th

Page 28: Ball and Beam pid

8/17/2019 Ball and Beam pid

http://slidepdf.com/reader/full/ball-and-beam-pid 28/52

Mastr Thsis r"8ct ', air a##ir C "r Fra&csc" a#(i :0)

/(! )odel #ith )odelica0s liraries

This scti"& =.#ai&s a&"thr a#tr&ati t" 1"!# r"##i& "& a s(r$ac)

Th $r M(#ti+"!, #i'rar, c"&tai&s 3-!i1&si"&a# 1cha&ica# c"1."&&ts t" 1"!# rii!

1(#ti-'"!, s,st1s s(ch as r"'"ts sat##its "r hic#s)

Th #i'rar, .r"i!s 'asic 1"!# c#asss $"r rii! '"!is 8"i&ts $"rcs 1as(r1&t a&!

a&i1ati"& #1&ts) R"#(t .ris1atic a&! "thr i!a# 8"i&ts c"&&ct '"!is) i&1atic #"".sca& ' ha&!#! ', (si& c(t-8"i&ts t" 'ra th #"".s)

F"r a (sr it is as, t" i&tr"!(c &; c"1."&&ts "r c"., a&! 1"!i$, =isti& "&s)

A (&i*( $at(r "$ th #i'rar, is th .r".rt, that 8"i&ts ca& ha a aria'# str(ct(r) That

is r, !r "$ $r!"1 "$ a 8"i&t ca& ' #"c! a&! (&#"c! !(ri& 1"1&t ;ith"(t

!&rati& $$ici&c,)

This #i'rar, "$$rs a& a#tr&ati t" th M"!#icaA!!iti"&s)M(#ti+"!, #i'rar,)

Th "'tai&! 1"!# ;ith M"!#ica #i'raris is sh";& '#";?

1"!# TstS.hr

 .ara1tr SI)Acc#rati"& C)9:@

i&&r .ara1tr SI)Acc#rati"&3 rait,0-0W@

// E##i.s"i! s1i-!ia1trsi&&r .ara1tr SI)L&th a::@

i&&r .ara1tr SI)L&th '::@i&&r .ara1tr SI)L&th c::@

i&&r .ara1tr SI)A&# !#taM"!#ica)"&sta&ts).i/:0@

+as +as: a&&"tati"& =t&t-60 0@ -40 20@

R"##i&+"!, R"##i&+"!,:*start:000Wrstart0:0WI: 0 0@ 0 : 0@ 0 0 :start0)0500W"1astart-:-:-0)05W a&&"tati"& =t&t20 0@ 40 20@E##i.s"i!J"&J#a& E##i.s"i!J"&J#a&: a&&"tati"& =t&t-20 0@ 0 20@

*(ati"&

c"&&ct+as:)I&"rtR"## E##i.s"i!J"&J#a&:)<(t"rtAa&&"tati"& ."i&ts-50 :C@ -50 30@ -:3 30@ -:3 :C@

c"&&ct+as:)<(t"rt E##i.s"i!J"&J#a&:)I&"rtA

Page 29: Ball and Beam pid

8/17/2019 Ball and Beam pid

http://slidepdf.com/reader/full/ball-and-beam-pid 29/52

a&&"tati"& ."i&ts-50 :@ -50 -:0@ -:3 -:0@ -:3 :@

c"&&ctE##i.s"i!J"&J#a&:)I&"rt+ R"##i&+"!,:)<(t"rt

a&&"tati"& ."i&ts-7 :@ -7 -:0@ 30 -:0@ 30 :@c"&&ctE##i.s"i!J"&J#a&:)<(t"rt+ R"##i&+"!,:)I&"rtR"##

a&&"tati"& ."i&ts-7 :C@ -7 30@ 30 30@ 30 :C@

&! TstS.hr@

F"r 1"r !tai#s .#as r$r t" th ;' .a?htt.?//;;;)1"!#ica)"r/"&$r&c2003/.a.rs)sht 1 # :2

Th architct(r "$ i&$"r1ati"& i&tracti"&s is sh";& '#";?

Fi(r 5)3? Architct(r "$ "'tai&! 1"!# ;ith M"!#ica #i'raris

<& sh"(#! c"&si!r a## c"&&ct"rs (s! a'" as 'i!irct! "&s) Arr";s i& Fi(r 5)3 ar

(s! t" sh"; th s1a&tics "$ i&tracti"&s) It>s c#ar that th ;h"# c"&str(cti"& c"&si!r!a'" is a irt(a# "&) "&str(cti& th 1"!# th c"1.i#r =tracts a## *(ati"&s $r"1 th

"'8cts a&! ass1'#s th1 c"1."si& th DAE s,st1 ".ti1i! $"r a &(1ric i&trat"r)

Page 30: Ball and Beam pid

8/17/2019 Ball and Beam pid

http://slidepdf.com/reader/full/ball-and-beam-pid 30/52

A 'asic $at(r is that a## c"1."&&ts ha a&i1ati"& i&$"r1ati"& ;ith a..r".riat !$a(#t

sis a&! c"#"rs) A t,.ica# scr&sh"t "$ th a&i1ati"& "$ 'a1 a&! 'a## is sh";& i& th Fi(r5)4 '#";)

Fi(r 5)4? A&i1ati"& "$ "'tai&! 1"!# ;ith M"!#ica #i'raris

Page 31: Ball and Beam pid

8/17/2019 Ball and Beam pid

http://slidepdf.com/reader/full/ball-and-beam-pid 31/52

26

Chapter 2

Control Design and Simulations

This cha.tr !tai#s th c"&tr"# !si& "$ th t;" "'tai&! 1"!#s ;ith th M"!#ica

#a&(a) Pith th N;t"&>s sc"&! #a; 1"!# ; !" th st(!, thr"(h a& "'srr !si& a&!;ith th Lara&ia& 1"!# ; ;"r ;ith a #i&ari! 1"!# a&! a& "'srr t" !" th st(!,) I&

this cha.tr ar a#s" sh";& th "'tai&! si1(#ati"&s i& Si1(#i&)

2(1 Control design

2(1(1 Control design through oser5er

A## stats ar &"t aai#a'# $"r $!'ac i& 1a&, cass a&! "& &!s t" sti1at

(&aai#a'# stat aria'#s) Esti1ati"& "$ (&1as(ra'# stat aria'#s is c"11"&#, ca##!"'srati"&) A !ic "r a c"1.(tr .r"ra1 that sti1ats "r "'srs th stat is ca##! a

stat-"'srr "r si1.#, a& "'srr) I$ th stat-"'srr "'srs a## stat aria'#s "$ th

s,st1 rar!#ss "$ ;hthr s"1 stat aria'#s ar aai#a'# $"r !irct 1as(r1&t it isca##! a $(##-"r!r stat "'srr)

A& "'srr that sti1ats #ss tha& th !i1&si"& "$ th stat-ct"r is ca##! a r!(c!-"r!r 

stat-"'srr "r si1.#, a r!(c!-"r!r "'srr)

Th ras"& $"r i&tr"!(ci& th "'srr is that ."# .#ac1&t ;ith $(## stat $!'ac is

&"t r, .ractica#) First $"r a& &-!i1&si"&a# s,st1 it r*(irs & 1as(r1&ts ;hich i& t(r&

1a&s & tra&s!(crs) S(ch a c"&tr"##r ;"(#! ' '"th =.&si a&! '(#,) F(rthr t" 'i1.#1&ta'# a## th stats ;"(#! ha t" ' 1as(ra'#) E& i$ s(ch a stat 1"!#

$"r1(#ati"& c"(#! ' "'tai&! it 1iht &"t ' a .r$rr! $"r1(#ati"&)

26

Page 32: Ball and Beam pid

8/17/2019 Ball and Beam pid

http://slidepdf.com/reader/full/ball-and-beam-pid 32/52

ha.tr 6? "&tr"# Dsi& a&! Si1(#ati"&s

+asica##, thr ar t;" $"r1s "$ th i1.#1&tati"& "$ a& sti1at"r as ".& #"". a&!

c#"s!-#"".) Th !i$$r&c 't;& ths t;" is a c"rrcti"& tr1 i&"#i& th sti1ati"&

rr"r (s! t" a!8(st th rs."&s "$ th sti1at"r) A c#"s!-#"". sti1at"r is r$rr! t" as a&

"'srr)

+ca(s "$ "(r +a## a&! +a1 1"!# is ".& #"". (&sta'# is &cssar, t" ha s"1 i&!

"$ 1as(r1&t "$ th 'a## #"cit,) Th c#assica# .r"."rti"&a# D-c"&tr"##r ts a #"cit,1as(r ', !i$$r&tiati& th 'a## ."siti"&) Th c#assica# .has #a! c"1.&sat"r !"s

s"1thi& r, si1i#ar) A&"thr ;a, "$ !"i& this is t" (s a& "'srr 'as! (."& a 1"!# "$ 

th 'a## a&! 'a1 t" sti1at th s,st1s stats a&! (s th stat sti1ats "$ 'a## ."siti"& a&!#"cit, i& a stat $!'ac c"&tr"##r)

P !si& a $(##-"r!r stat "'srr t" sti1at th"s stats that ar &"t 1as(ra'#) P

;a&t t" !" "(r "'srr as $ast as it is ."ssi'# ;ith"(t a1.#i$,i& t"" 1(ch hih $r*(&c,!ist(r'a&cs) Thr$"r ; .#ac th ."#s "$ th "'srr i& th ra& "$ t;" t" $i ti1s #arr 

i& 1a&it(! tha& th c"&tr"##r ."#s)Pith "(r c"&tr"##r ; ;a&t t" t that th s,st1 is sta'#) +#"; a sch1atic "$ "(r 

 .#a&t-"'srr a&! c"&tr"##r s,st1 is sh";&)

Fi(r 6):? Si1(#i&? N;t"&Bs sc"&! #a; 1"!#@ .#a&t-"'srr a&! c"&tr"##r 

Page 33: Ball and Beam pid

8/17/2019 Ball and Beam pid

http://slidepdf.com/reader/full/ball-and-beam-pid 33/52

2(1(! Control Design4 nonlinear system

"&si!ri& th "'tai&! *(ati"&s "$ 1"ti"& i& scti"& 4):)2 ; !" a st(!, "$ c"&tr"#

!si& thr"(h a #i&ari! stat 1"!# "$ th s,st1 ar"(&! a *(i#i'ri(1 ."siti"&) P a#s""'tai& a sta'i#ii& c"&tr"##r $"r th #i&ar 1"!# ;h& th a&(#ar ."siti"& is 1as(r!)

Th *(ati"&s "$ 1"ti"& ;r?

2 M M #b + m s

⋅ r b

⋅θb

+ 2 ⋅ m s⋅ r 

b⋅ r M

b⋅θ

b+ m s

⋅  g ⋅ r b

⋅ c"sθ b= τ

Mr M  +5

⋅  g ⋅ 

si&θ

− r ⋅θM 2 = 0

b7

b b b

Th &"&#i&ar stats ar?θ ' θMb r a&! r M

a&! th stat *(ati"&s 'c"1?

⎧ d θ⎪ dt ⎪⎪ d θM

= θM 

=

 f :

 ⎛   2 ⋅ ms

⋅ r  ' ⎞   ⎛ ms

⋅  g ⋅ r  '

⋅ c"sθ '

⎞ ⎛   : ⎞

⎪ dt 

= θM = −⎜   ⎟ ⋅θM 

⋅ r Mb

− ⎜  # + m   ⋅ r2

⎟ + ⎜   ⎟ ⋅τ =  f 

+ m⋅

 r2 2

⎨⎪ dr ⎪ dt ⎪

 ⎝   b

= r M =  f3

 s b ⎠  ⎝   b s b  ⎠   ⎝   b s b ⎠

⎪ dr M = Mr M =

5⋅

⋅θM 2−

5⋅  g ⋅ si&θ = f 

dt 7b b

7b 4

T" ha a !sir! *(i#i'ri(1 i&?

θe

= 0

r e

= :

θM

e

= 0

r Me

= 0

; th(s !$i& th stats a

 ":

= θ −θe

= θ

 "2

= θM −θM

e = θM

 "3

= r − r e

= r −:

 "4

= r M − r Me = r M

Page 34: Ball and Beam pid

8/17/2019 Ball and Beam pid

http://slidepdf.com/reader/full/ball-and-beam-pid 34/52

a&! th c"&tr"# i&.(t

u = τ −τ e

+, s('stit(ti& a#(s i& $ 2 ; "'tai&?

τ e

= m s

⋅  g ⋅ r e

;"ri& ;ith ths &; a#(s i& th stat *(ati"&s a&! c"&si!ri& th *(i#i'ri(1=:=2=3=4(0 ; th(s ha th #i&ari! stat 1"!#?

 "M =  A ⋅  " + % ⋅ u y =  ⋅  "

;hr = is a ct"r r.rs&ti& th stat ( is a sca#ar r.rs&ti& th i&.(t a&! , is a

sca#ar r.rs&ti& th "(t.(t) Th 1atrics A + a&! !tr1i& th r#ati"&shi.s 't;& th stat a&! i&.(t a&! "(t.(t aria'#s)I& "(r s,st1 th 1atrics A + a&! ha th $"##";i& r.rs&tati"&?

 ⎡  0 : 0 0⎤ ⎡  0 ⎤

 ⎢   −m s

⋅  g ⎥ ⎢  : ⎥ ⎢  

0 0 # + m

⎥ ⎢  ⎥   =

⎡: 0 0 0⎤ A = ⎢ b s ⎥  % = ⎢  #

 '+ ms

⎥  ⎢

0 0 : 0⎥

 ⎢  0 0 0 :⎥  ⎣  ⎦

 ⎢  0 ⎥⎢ − 5

⋅  g 0 0 0⎥⎢⎣ 7 ⎥⎦   ⎣⎢  0 ⎥⎦

Th &=t st. is t" chc th c"&tr"##a'i#it, a&! th "'sra'i#it, "$ th s,st1) F"r th

s,st1 t" ' c"1.#t#, stat c"&tr"##a'# th c"&tr"##a'i#it, 1atri=

: = [ % A% A

2 %

 A3 %]

1(st ha th ra& "$ 4) Th ra& "$ th 1atri= is th &(1'r "$ i&!.&!&t r";s "r c"#(1&s) I& th sa1 ;a, $"r th s,st1 t" ' c"1.#t#, stat "'sra'# th

"'sra'i#it, 1atri=

 ⎡   ⎤ ⎢  ⎥

: = ⎢ A ⎥o ⎢A

2 ⎥ ⎢   3 ⎥

⎣A ⎦

0

c

Page 35: Ball and Beam pid

8/17/2019 Ball and Beam pid

http://slidepdf.com/reader/full/ball-and-beam-pid 35/52

1(st a#s" ha ra& "$ 4)

T" "'tai& a sta'i#ii& c"&tr"##r $"r th #i&ari! 1"!# ; &! t" ha a sta'#

charactristic ."#,&"1ia# $"r th c#"s! #"". s,st1 r""ts strict#, i& th #$t ha#$-.#a&) I&

this =a1.# ; !tr1i& a stat-$!'ac ai& s(ch that th c#"s!-#"". ."#s ar ats-: "r!r 4) Th charactristic ."#,&"1ia# is?

αcss:4s

44s

36s

24s:

αcAA44A

36A

24AI

Th(s ', Acr1a&&Xs $"r1(#a

$ = [0 0 0 :]⋅ :−:

⋅α

 A

;hr Yc is th c"&tr"##a'i#it, 1atri= .ri"(s#, !$i&!)

P .#ac th ."#s "$ th "'srr i& s-5 that is $i ti1 'ir tha& "(r c"&tr"##r 

 ."#s ;ith it ; t that "(r s,st1 is $astr) Th(s ; ha?

α"ss54s

420s

3:50s

2500s625

α"AA420A

3:50A

25004A625I

Th(s ', Acr1a&&Xs $"r1(#a

⎡0⎤ ⎢  ⎥

 & = α  A ⋅ :−:

⋅ ⎢0⎥

o o ⎢0⎥ ⎢  ⎥

⎣:⎦

;hr Y" is th "'sra'i#it, 1atri= !$i&! '$"r)

Th(s ; ha th "'srr $!'ac c"&tr"##r

d"Z= 3 A − % ⋅ $ − & ⋅  ⋅  "Z + & ⋅ y dt 

u = −$ ⋅  "Z

c c

Page 36: Ball and Beam pid

8/17/2019 Ball and Beam pid

http://slidepdf.com/reader/full/ball-and-beam-pid 36/52

Th $"##";i& Si1(#i& 1"!# ca& ' (s! t" si1(#at th s,st1)

Fi(r 6)2? "&tr"##r "$ #i&ari! Lara&ia& 1"!# i& Si1(#i& 

2(! Simulations

2(!(1 Simulations in Simulin$ 

Si1(#i& is a& i&tracti &ir"&1&t i&trat! i& Mat#a' $"r 1"!#i& si1(#ati"& a&!

a&a#,i& !,&a1ic s,st1s) Si1(#i& .r"i!s a ra.hica# (sr i&tr$ac $"r c"&str(cti& '#"c !iara1 1"!#s ia !ra a&! !r". ".rati"&s) M"!#s ca& ' r"(.! i&t" hirarchis t" crat a

si1.#i$i! i; "$ c"1."&&ts "r s('s,st1s) Thr$"r a 1"!# '(i#t (. i& Si1(#i& c"&sists "$  '#"cs that c"rrs."&! t" s('s,st1s "$ th 1"!#) I& ach '#"c thr ar 1ath1atica#

r#ati"&shi.s that !scri' th .h,sica# 'hai"r "$ th s,st1) I$ th s('s,st1s a$$ct ach

"thr i&$"r1ati"& 't;& th '#"cs has t" ' =cha&! i& "r!r t" a#(at th r#ati"&shi.s)

Th '&$it ;ith Si1(#i& is th as, t" (s !si& a&! si&c th s"$t;ar is i&trat!

;ith Mat#a' it 1as it r, .";r$(# ;ith a #"t "$ (s$(# a&a#,sis a&! !si& a..#icati"&s)

Page 37: Ball and Beam pid

8/17/2019 Ball and Beam pid

http://slidepdf.com/reader/full/ball-and-beam-pid 37/52

A&"thr '&$it is th as, ;a, t" crat .#"ts "$ si&a#s) F(rthr th a'i#it, t" asi#, a&!*(ic#, si1(#at a 1"!# '(i#t i& Si1(#i& is a&"thr '&$it ;ith this 1"!#i& .r"ra1)

H";r it #acs th '&$its "$ M"!#ica t" !$i& i1.#icit *(ati"&s a&! r#ati"&shi.s)

¾ "&tr"# !si& thr"(h "'srr 

Fi(r 6)3? Si1(#ati"&s "'tai&! ;ith th N;t"&>s sc"&! #a; 1"!# a&! "'srr 

I& Fi(r 6)3 ; ca& s th 'hai"r ;ith th ca#c(#at! c"&tr"##r a&! "'srr) Th

c#"s! #"". s,st1 'has ;##)P ca& "'srr h"; th ."siti"& a&! th ."siti"& sti1at "$ th 'a## ar a#1"st th sa1)

+"th rs."&ss ar sta'i#i! at : #i th r$r&c a&! 'si!s ; ca& s that th 'a1 a&#

a&! th #"cit, sti1at ar sta'i#i! i& $; sc"&!s)

Page 38: Ball and Beam pid

8/17/2019 Ball and Beam pid

http://slidepdf.com/reader/full/ball-and-beam-pid 38/52

33

Chapter 3

Experiments

This cha.tr !scri's th =.ri1&ta# st(. $"r th +a## a&! +a1 =.ri1&ts) I&itia#

=.ri1&ts ar .r$"r1! t" i!&ti$, .r"css .ara1trs a&! $i&a##, th c"&tr"# =.ri1&ts ar .r$"r1!) A& a#tr&ati i1.#1&tati"& t" th "& !scri'! i& ha.tr 6 is .rs&t!)

3(1 Experimental Setup

P (s th 'a## a&! 'a1 .r"css sh";& i& Fi(r 7)2) Th 'a1 is c"&tr"##! ', a D-

1"t"r a&! th 'a1 a&# ca& ' 1as(r!) Th 'a## ."siti"& is sti1at! $r"1 a isi"& s,st1;ritt& ', T"1as <#ss"& hD st(!&t at th D.art1&t "$ A(t"1atic "&tr"# a&! (ss a Fir-i

ca1ra c"&&ct! t" a r(&&i& a K'a## !tcti"& .r"ra1) Th 'a## c""r!i&ats ar s&t ia a

&t;"r c"&&cti"& t" a Li&(= r(&&i& th c"&tr"# i1.#1&tati"& i& a ra#-ti1 =t&si"& "$ Mat#a'/Si1(#i& !#".! ', A)+#"1!##) A stch "$ th c"&&cti"&s ca& ' is(a#i! i&

Fi(r 7):)

Page 39: Ball and Beam pid

8/17/2019 Ball and Beam pid

http://slidepdf.com/reader/full/ball-and-beam-pid 39/52

ha.tr 7) E=.ri1&ts

Fir-i

Visi"& [ P i& ! " ;s 0

  1atc"11

Si1(#i& ct r# [ Li&( = 0

Fi(r 7):? Stch "$ th c"&&cti"&s 't;& (s! 'a## a&! 'a1 isi"& s,st1 a&! >s

3(! ,o# to do the experiments

Th $irst tas i& this ;"r c"&sists "$ !tr1i&i& ;hich is th c"rrct 1"!# "$ th ra#

 .r"css "$ th 'a## a&! 'a1 i&c#(!i& $i&!i& a..r".riat .ara1trs) T" $i&! this c"rrct1"!# ; !" s"1 =.ri1&ts ;ith th ra# .r"css) Th K'a## a&! 'a1-.r"css is sh";&

 '#"; a&! th c"&tr"##r is i1.#1&t! i& Mat#a'/Si1(#i& ;ith a ra#-ti1 =t&si"& ;hr a

Si1(#i& '#"c r.rs&ts th c"&&cti"& t" a&a#" i&.(ts a&! a&a#" "(t.(ts s Fis) 7)2 a&!7)3)

Fi(r 7)2? +a## a&! +a1 (s!

Page 40: Ball and Beam pid

8/17/2019 Ball and Beam pid

http://slidepdf.com/reader/full/ball-and-beam-pid 40/52

Page 41: Ball and Beam pid

8/17/2019 Ball and Beam pid

http://slidepdf.com/reader/full/ball-and-beam-pid 41/52

Th .ri"! ti1 "$ th "sci##ati"& is a..r"=i1at#, 3 sc"&!s thr$"r th $r*(&c,; ≈ 2ra!/s) N"; that ; ha "(r $r*(&c, ; ca& $i&! ;hich ar "(r !a1.i& a&! "(r "rsh""t)

Pith ths a#(s a&! (si& t""#s "$ Mat#a' ; ca& "'srr th i1.(#s rs."&s "$ th

s,st1 'i& this sh";& i& th Fi 7)6?

Fi(r 7)6? I1.(#s Rs."&s "$ th +a## a&! +a1 .r"css

P ca& "'srr $r"1 th rs."&s that thr is a& a!!iti"&a# !a1.i& a&! a& "sci##at"r,

 'hai"r i& c"1.aris"& ;hat ; ha !isc(ss! .ri"(s#,)

Fr"1 Fi(r 7)6 ; ca& sti1at th i1.(#s rs."&s c"rrs."&! t" a s,st1 ;hichtra&s$r $(&cti"& has a ai& ≈ 22) This ai& has '& ca#c(#at! thr"(h "$ th Fi(r 7)5)

; = 22

 s2

+ 0)6 ⋅  s + 4

Thr"(h this tra&s$r $(&cti"& ; ca& r.rs&t th s,st1 i& stat-s.ac $"r1 !"i& itth $"##";i& ;a,?

( ,

22

 s 2 + 0)6 ⋅  s + 4

 s2

⋅  y + 0)6 ⋅  s ⋅  y + 4 ⋅  y = 22 ⋅ u

Page 42: Ball and Beam pid

8/17/2019 Ball and Beam pid

http://slidepdf.com/reader/full/ball-and-beam-pid 42/52

; ha =:, th& th stat *(ati"&s ar?

 "M: = "

2

 "M2

= M yM

s('stit(ti&?

 "M2

= M yM = −0)6 ⋅  yM − 4 ⋅  y + 22 ⋅ u

 "M2

= −0)6 ⋅  "2

− 4 ⋅  ":

+ 22 ⋅ u

Th stat-s.ac r.rs&tati"& is sh";& '#";?

⎧⎡ "M:

⎤  ⎡   0 : ⎤  ⎡ ":⎤   ⎡0 ⎤

⎪  ⎢   ⎥  = ⎢ ⎥ ⋅ ⎢ ⎥ + ⎢ ⎥ ⋅ u

⎪⎣ "M2 ⎦⎨   ⎣− 4 − 0)6⎦   ⎣ "2 ⎦   ⎣22⎦ (7):) ⎪   ⎡ "

: ⎤⎪  y = [: 0]⋅ ⎢   ⎥

 ⎩   ⎣ "2 ⎦

T" !" th st(!, "$ th s,st1 ; ;rit a& 1-$i# i& Mat#a') I& this 1-$i# ; i&c#(! th

1atrics "$ stat-s.ac s,st1 a&! th "'tai&! a#(s "$ !sir! $r*(&c, a&! !a1.i&) Pith

ths a#(s ; ca& ca#c(#at th !sir! r""ts "$ "(r s,st1)

 N"; ; ha "(r ."#s ; ca& (s Mat#a' t" $i&! a c"&tr"##r 1atri= ', (si& th place c"11a&! s ha.tr 6)

T" i1.#1&t "(r c"&tr"##r ; ha t" $i&! a& "'srr ;hich ca& !" a& sti1ati"& "$ 

th (&1as(ra'# stat aria'#s) N"r1a##, th ."#s "$ th "'srr ar $astr tha& th"s "$ thc"&tr"##r) P .#ac th ."#s t;" ti1s $astr tha& "(r c"&tr"##r) Th "'srr is 'asica##, a

c"., "$ th .#a&t@ it has th sa1 i&.(t a&! a#1"st th sa1 !i$$r&tia# *(ati"&) A& =tra tr1

c"1.ars th act(a# 1as(r! "(t.(t , t" th sti1at! "(t.(t  yZ @ this ;i## ca(s th

sti1at!

stats  "Z t" a..r"ach th a#(s "$ th act(a# stats =) Th rr"r !,&a1ics "$ th "'srr ar

i& ', th ."#s "$ A-L) I& th sa1 ;a, as '$"r ;ith th c"11a&!  place ; $i&! th

"'srr L 1atri=)

Th &=t st. is t" !" th Si1(#i& 1"!# ;ith th .#a&t "$ th ra# .r"css a&! th

"'tai&! "'srr a&! c"&tr"##r) This Si1(#i& 1"!# is sh";& i& th Fi 7)7)

37

Page 43: Ball and Beam pid

8/17/2019 Ball and Beam pid

http://slidepdf.com/reader/full/ball-and-beam-pid 43/52

Fi(r 7)7? Si1(#i& 1"!# "$ "'srr 'as! c"&tr"# "$ 'a1 a&#

P ca& &"; si1(#at th c#"s!-#"". rs."&s a&! ; ca& chc i$ th $"(&! 1"!# is

c"rrct) ha&i& th a#(s th ; ; ca& "'srr i$ th s,st1 is $astr "r s#";r a&! ; ca&s i$ its 'hai"r is riht) P ca& a#s" cha& th a#(s "$ th i&.(ts th chc i$ th rs."&s

"$ th ra# .r"css is c"rrct i& r, 1"1&t)

A !si& .r"'#1 !"s &"t &cssari#, ha a (&i*( a&s;r) Usi& this 1th"! "r a&,

"thr 1a, rs(#t i& 1a&, !i$$r&t c"1.&sat"rs)

F"r th i1.#1&tati"& t" c"&tr"# th ra# .r"css ; (s a !iscrt-ti1 $!'ac $r"1 a&

"'srr 'as! "& a sa1.#! rsi"& "$ th s,st1 7):)

P ha (s! th Mat#a' c"11a&! c2! t" c"&rt 't;& c"&ti&("(s a&! !iscrt ti1)

Th sa1.#i& ti1 $"r th Si1(#i& c"&tr"##r ;as st t" :01s) Th ."#s "$ th !iscrt-ti1!si& (s! i&  place ;as tra&s$"r1! $r"1 c"&ti&("(s-ti1 s.ci$icati"&s acc"r!i& t"!iscJ."#=.c"&tJ."#) tsa1.)

39

Page 44: Ball and Beam pid

8/17/2019 Ball and Beam pid

http://slidepdf.com/reader/full/ball-and-beam-pid 44/52

 %all controller 

F"r th ra#-ti1 i1.#1&tati"& "$ th 'a## c"&tr"##r ; ha ch"s& t" !" a casca!-!si& r-(si& th 'a1-c"&tr"##r $r"1 th .ri"(s s('scti"& $"r th i&&r #"". i&sta! "$ 

th c"&tr"##! .rs&t! i& ha.tr 6)

Th c""r!i&ats "$ th 'a## $r"1 th isi"& s,st1s ar (.!at! ;ith 30H) H";r th

ca1ra .ict(rs 1a, ' !#a,! \ 301s i& th c"&tr"##r a&! th ca1ra is &"t s,&chr"&i!

;ith th rst "$ th c"&tr"##r) T" ha&!# this (&crtai&t, ; ha ch"s& t" r(& a $astr i&&r #"". a&! a& "(tr-#"". ;ith a s#";r sa1.#i& rat)

Fr"1 ha.tr 4 ; ha a& a..r"=i1at 1"!# "$ a !"('# i&trat"r $r"1 'a1 a&# t" 'a## ."siti"& a&! ; start t" !" a si1.# =.ri1&t t" $i&! "(t th ai& ;ith rs.ct t" th

 ."siti"& .r"i!! ', th isi"& s,st1) P ca& is(a#i it i& th $i(r 7)9)

Fi(r 7)9? ra.hic t" $i&! "(t th ai& ;ith rs.ct t" th ."siti"& .r"i!! ', th isi"& s,st1

A i!" s*(&c "$ th =.ri1&t ca& ' $"(&! at :3)

3C

Page 45: Ball and Beam pid

8/17/2019 Ball and Beam pid

http://slidepdf.com/reader/full/ball-and-beam-pid 45/52

Fi(r 7)C? Si1(#i& 1"!# t" !" th 'a1 c"&tr"#

40

Page 46: Ball and Beam pid

8/17/2019 Ball and Beam pid

http://slidepdf.com/reader/full/ball-and-beam-pid 46/52

Fi(r 7):0? Si1(#i& 1"!# t" !" th 'a## ."siti"& c"&tr"#s tr"(h th isi"& s,st1

Page 47: Ball and Beam pid

8/17/2019 Ball and Beam pid

http://slidepdf.com/reader/full/ball-and-beam-pid 47/52

Chapter 8

Conclusions

I& this cha.tr th c"&c#(si"&s "$ this ;"r ar .rs&t! $"##";! ', s(sti"&s "& h";

t" c"&ti&( th !#".1&t)

8(1 Conclusions

Th 1ai& "a# "$ this thsis ;as t" !" th 1"!#i& a&! c"&tr"# "$ th +a## a&! +a1

 .r"css) This "'8cti has '& $(#$i##! ', th .rs&tati"& "$ sra# i&!s "$ c"&tr"# ;hich

ha '& !"& thr"(h M"!#ica a&! Mat#a' a&! $i&a##, ', =.ri1&t "& th ra# .r"css)

<r this thsis ; ca& is(a#i h"; c"&tr"# th"r, r#ats t" ra# s,st1s) "1.(tr 

si1(#ati"&s ca& h#. '(t si1(#ati"&s a#"& ar #i1it! ', h"; ;## th s,st1 i& *(sti"& has

 '& 1"!#!) It is 1"r &#iht&i& i$ th rs(#ts "'tai&! th"rtica##, ar act(a##, a..#i! t"a .h,sica# s,st1) A..#,i& th th"rtica##, ca#c(#at! rs(#ts t" a ra# s,st1 h#.s (s &"t "&#,

is(a#i '(t t" a#(at h"; ;## th 1"!# ;as a'# t" .r!ict th s,st1 .r$"r1a&c)

Th 'st ;a, t" #ar& a'"(t c"&tr"# s,st1s is t" !si& a c"&tr"##r a..#, it t" th s,st1

a&! th& ;atch th s,st1 i& ".rati"&) A s,st1 is 1"!#! "& a c"1.(tr a&! ;ith th h#.

ra.hics th s,st1 ca& ' s& i& acti"&) H";r th s,st1 'i& "'sr! i& th si1(#ati"&

is i& ra#it, 8(st a 1"!# "$ th tr( s,st1) Th 1"!# 1(st a#;a,s ' a si1.#i$i!r.rs&tati"& "$ th s,st1 a&! ca&&"t r.r"!(c a## as.cts "$ s,st1 'hai"r) S(ch $$cts

ar !i$$ic(#t t" si1(#at a&! ar 'st (&!rst""! $r"1 ha&!s-"& =.ri&c ;ith th .h,sica#

s,st1)

42

Page 48: Ball and Beam pid

8/17/2019 Ball and Beam pid

http://slidepdf.com/reader/full/ball-and-beam-pid 48/52

List of &igures

Chapter !

Fi(r 2):? M"t"r !ri ;ith M"!#ica #i'raris )))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) 6

Chapter +

Fi(r 3):? Diara1 "$ +a## a&! +a1 ))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) C

Fi(r 3)2? +a## a&! +a1 c"&&ct! ia ar'"= )))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) :0

Fi(r 3)3? +a## a&! +a1 !irct#, c"&&ct! t" th a=is "$ a D-1"t"r ))))))))))))))))))))))))))))) ::

Chapter /

Fi(r 5):? D,1"#a si1(#ati"&? Rs."&s "$ 'a1 a&# ."siti"& "$ th 'a## a&!#"cit, ".&-#"". rs."&s $"r 1"!# 'as "& N;t"&>s sc"&! #a; )))))))))))))))))))))))))))))))) 2:

Fi(r 5)2? D,1"#a si1(#ati"&? Rs."&s "$ 'a1 a&# ."siti"& "$ th 'a## a&!

#"cit, <.& #"". rs."&s $"r th Lara&ia& 1"!# ))))))))))))))))))))))))))))))))))))))))))))))))))))))) 22

Fi(r 5)3? Architct(r "$ "'tai&! 1"!# ;ith M"!#ica #i'raris )))))))))))))))))))))))))))))))))))) 24

Fi(r 5)4? A&i1ati"& "$ "'tai&! 1"!# ;ith M"!#ica #i'raris )))))))))))))))))))))))))))))))))))))) 25

Chapter 2

Fi(r 6):? Si1(#i&? N;t"&Bs sc"&! #a; 1"!#@ .#a&t-"'srr a&! c"&tr"##r ))))))))))))))) 27

Page 49: Ball and Beam pid

8/17/2019 Ball and Beam pid

http://slidepdf.com/reader/full/ball-and-beam-pid 49/52

Fi(r 6)2? "&tr"##r "$ #i&ar Lara&ia& 1"!# i& Si1(#i& )))))))))))))))))))))))))))))))))))))))))))) 3:

Fi(r 6)3? Si1(#ati"&s "'tai&! ;ith th N;t"&>s sc"&! #a; 1"!# a&! "'srr ))))))))) 32

Chapter 3

Fi(r 7):? Stch "$ th c"&&cti"&s 't;& (s! 'a## a&! 'a1 isi"& s,st1 a&!

>s)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) 34

Fi(r 7)2? +a## a&! +a1 (s! )))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) 34

Fi(r 7)3? "&tr"##r "$ th +a## a&! +a1 .r"css )))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) 35

Fi(r 7)4? +a## a&! 'a1 ;ith !ista&c! ))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) 35

Fi(r 7)5? Rs."&s "$ th 'a1 ;ith a..#i! i1.(#s )))))))))))))))))))))))))))))))))))))))))))))))))))))) 35

Fi(r 7)6? I1.(#s Rs."&s "$ th +a## a&! +a1 .r"css ))))))))))))))))))))))))))))))))))))))))))))))) 36

Fi(r 7)7? Si1(#i& 1"!# "$ "'srr 'as! c"&tr"# "$ 'a1 a&# ))))))))))))))))))))))))))))))))) 39

Fi(r 7)9? ra.hic t" $i&! "(t th ai& ;ith rs.ct t" th ."siti"& .r"i!! ', th

isi"& s,st1 ))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) 3C

Fi(r 7)C? Si1(#i& 1"!# t" !" th 'a1 c"&tr"# ))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) 40

Fi(r 7):0? Si1(#i& 1"!# t" !" th 'a## ."siti"& c"&tr"#s tr"(h th isi"& s,st1 )))))) 4:

Page 50: Ball and Beam pid

8/17/2019 Ball and Beam pid

http://slidepdf.com/reader/full/ball-and-beam-pid 50/52

Biliography

: Hi#!i& E#1*ist Da +r]c S& Eri Mattss"& Ha&s <#ss"& a&! Marti& <ttr Dymola Dynamic 6odelling &aboratory *ser<s 6anual+ rsi"& 5 S.2002

2 D,&asi1 A+ Rsarch ar I!"& SE-22370 L(&! SPEDENhtt.?//;;;)D,&asi1)s

3 M"!#ica H"1.a?

htt.?//;;;)1"!#ica)"r

4 D,1"#a H"1.a?htt.?//;;;)!, 1"#a)c"1

5 M"!#ica Ass"ciati"& 2002?

=6odelica . A *nified >b?ect.>rientec &anguage for @hysical Systems

 6odeling=+ &anguage Specification+ 8ersion /1+ ,1 7anuary /11/

6 Micha# Ti##r #ntroduction @hysical 6odeling with 6odelica 200:

#(;r Aca!1ic ('#ishrs +"st"& IS+N 0-7C23-7367-7

7 +i&&r t(t"ria#?htt.?//;;;)1"!#ica)"r/"&$r&c2002/+i&&rsT(t"ria#)i.

9 M"!#ica !"c(1&ts?htt.?//;;;)1"!#ica)"r/!"c(1&ts)sht1#

C A!a&c! t(t"ria#?

htt.?//;;;)1"!#ica)"r/"&$r&c2002/A!a&c!T(t"ria#)i.

Page 51: Ball and Beam pid

8/17/2019 Ball and Beam pid

http://slidepdf.com/reader/full/ball-and-beam-pid 51/52

:0 Mastr Thsis r"8ct?

 Bavier allier ) D.art1&t "$ A(t"1atic "&tr"#) L(&! I&stit(t "$ Tch&"#",)

A((st 2002 ^ %a&(ar, 2003

:: Mastr Thsis r"8ct?

 2rancesco alugi) D.art1&t "$ A(t"1atic "&tr"#) L(&! I&stit(t "$ 

Tch&"#",) <ct"'r 200: ^ A.ri# 2002

:2 htt.?//;;;)1"!#ica)"r/"&$r&c2003/.a.rs)sht 1 #

Sssi"& 9AMchatr"&ic S,st1s - II

2C7

Ia& I) "ss&" a&! Maia S) Star"saia M"sc"; Stat U&irsit, "$ thSric R(ssia? Cow >ne an Simulate Dynamics of 'olling %odies via Dymola Approach to 6odel 6ultibody System Dynamics *sing 6odelica

:3 htt.?//;;;)c"&tr"#)#th)s/!(cati"&/ 1 astrthsis/+a+Ji!")&.

Page 52: Ball and Beam pid

8/17/2019 Ball and Beam pid

http://slidepdf.com/reader/full/ball-and-beam-pid 52/52