[go: up one dir, main page]

0% found this document useful (0 votes)
86 views14 pages

Control Final

The document summarizes the design and implementation of a line following robot using a PIC microcontroller. It discusses the main components of the robot including sensors to detect the line, motors for movement, an H-bridge motor driver, and a PIC microcontroller to run the PID control algorithm and maneuver the robot along the line. The optical sensors use infrared LEDs and phototransistors to detect the black line on a white surface. The PID controller provides feedback to smoothly guide the robot and correct for errors in following the line.

Uploaded by

Saman Nazim
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as RTF, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
86 views14 pages

Control Final

The document summarizes the design and implementation of a line following robot using a PIC microcontroller. It discusses the main components of the robot including sensors to detect the line, motors for movement, an H-bridge motor driver, and a PIC microcontroller to run the PID control algorithm and maneuver the robot along the line. The optical sensors use infrared LEDs and phototransistors to detect the black line on a white surface. The PID controller provides feedback to smoothly guide the robot and correct for errors in following the line.

Uploaded by

Saman Nazim
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as RTF, PDF, TXT or read online on Scribd
You are on page 1/ 14

\documentclass[11pt]{article}

\usepackage{graphicx}
\graphicspath{ {images/} }
\title{DC motor}
\author{2011--1!"#2011--1!$#2011--1!%#2011--1!&#2011--
1!!}
\maketitle{}
\pagest'le{m'headings}
\(egin{document}
\section{)*+ ,-))-.*+/ 0-1-2}
\section{340D.40 D5)-67+2}
\section{*+682 9:927}
)*+ ,-))-.*+/ 0-1-2
De;inition<
)ine ;ollo=er is a machine that can ;ollo= a path> 2he path can (e ?isi(le
like a (lack line on a =hite sur;ace @or ?ice-?ersaA or it can (e in?isi(le like
a magnetic ;ield>
9cope o; the 6roBect<
2his proBect ;ocuses at designing and (uilding the line ;ollo=er ro(ot and
implement 6*D controller> 2here;ore# this ro(ot =ill co?er the scopes as
;ollo=<
1> Design line ;ollo=er ro(ot using 927"2)100 7icrocontroller>
2> 6*D controller implementation through programming in 927"2)100 ('
using (asic language>
"> *n the end o; proBect# ro(ots mo?ement =ith 6*D and =ithout 6*D
controller (' inspecting the pattern o; mo?ement o; the ro(ot =hile
;ollo=ing the track>
340D.40 D5)-67+2
2he line ;ollo=er is a sel;-operating ro(ot that detects and ;ollo=s a line that is dra=n on
the ;loor >2he line ;ollo=er ro(ot using 6*D controller is a sel;-operating s'stem that
detects and ;ollo=s track dra=n on the ;loor> 2he track consists o; a (lack tape on =hite
sur;ace or ?ice ?ersa> 2he control s'stem senses the line and maneu?ers the ro(ot to sta'
on course =hile constantl' correcting the =rong mo?es using 6*D control# thus might
;orming e;;ecti?e controlled s'stem>
1asic -peration<
2he (asic operations o; line ;ollo=er are as ;ollo=s<
1> Capture line position =ith optical sensors mounted at ;ront end o; the ro(ot> ,or this a
com(ination o; *0 )DC9 and phototransistor called an optical coupler has (een used>
0eDuirement ;or line sensing process are high resolution and high ro(ustness>
2> 0o(ot reDuires steering mechanism ;or tracking> 2=o motors go?erning =heel motion
are used ;or achie?ing this task>
2his line ;ollo=ing ro(ot =ill easil' lea?e its track ;rom the (lack line dra=n on the ;loor
(ecause it is an open loop s'stem> 2his pro(lem =ill make the motion o; the ro(ot to (e
rough>)ine ;ollo=ing ro(ot e?en though ;ollo=s the (lack line its motion still reDuires to
(e impro?ed>4pplication o; Digital 6*D algorithm can smooth the tracking motion> 6*D
control is a closed loop s'stem# =hich =ill pro?ide ;eed(ack and correct the error that
occurs =ith ;ast response>
*+682 9:927
9ensors<
2he ro(ot uses *0 sensors to sense the lineE an arra' o; ;i?e *0 )Ds @2FA and sensors
@0xA#;acing the ground used in this setup> 4n analog signal is o(tained in output#
depends on the amount o; light re;lected (ack>
2he sensors on the le;t named as )1# )2# )"# )$ and 01# 02# 0"# 0$#0% on the
right side>
4ssumption should (e considered that =hen a sensor is on the line it reads 0 and =hen it
is o;; the line it reads 1>2he microcontroller correspondence to the algorithm gi?en (elo=
decides the next mo?ement#tr'ing to position the ro(ot such that )1 and 01 (oth read
Gero and the rest read one>.ith sensors# ro(ots can react and respond to changes in their
en?ironment in =a's that appear intelligent or li;e-like>
*n;rared 9ensor<
2he *0 9ensor-9ingle is a general purpose proximit' sensor> 2he module consist o; a *0
emitter and *0 recei?er pair> 2he high precision *0 recei?er al=a's detects an *0 signal>
2he output o; sensor remains high i; it is *0 ;reDuenc' and lo= other=ise> 2he on-(oard
)D indicator helps the user ;or checking status o; the sensor =ithout using an'
additional hard=are> 2he po=er consumption in this module is lo=> *tCs output is digital
in nature> *; the orientation o; (oth 2F and 0x )DCs is parallel to each other# such that
(oth are ;acing out=ards# then their sensiti?it' is at maximum> *; the' get mo?ed a=a'
;rom each other# such that the' are inclined to each other soldered at the end# then their
sensiti?it' reduces> 2he output o; *0 recei?er goes lo= =hen it recei?es *0 signal> 2his
causes the output pin lo= since# though the *0 )D is continuousl' transmitting# due to
a(sence o; o(stacle# nothing is re;lected (ack to the *0 recei?er> 2he indication )D is
o;;> .hen an o(stacle encountered# the output o; *0 recei?er goes lo=E o(stacle sur;ace
re;lects *0 signal>

9trategies o; *0 sensors<
2here are di;;erent common strategies ;or *0 9ensor#=e ha?e used the re;lecting strateg'>
0e;lectance Con;iguration<
2he re;lecti?e in;rared sensor includes a source o; light ;rom the in;rared emitter )D
and a light detector ;rom the photodiode or phototransistor arranged in package> *n;rared
emitter @)DA emits light thus acting as a source> .hen the light reaching on o(Bect# it is
re;lected (ack to the source> 4 detector at the source =ill recei?e the re;lected light and
indicate that an o(Bect is present>
4rrangement o; sensors<
4n arra' o; sensors arranged in a straight ro= pattern is (olted under the ;ront o; the
ro(ot> *t locates the position o; line (elo= the ro(ot>.e can use an' num(er o; sensors> *;
=e ha?e lo= num(er then our ro(ot mo?ement is not smooth and it ma' ;ace pro(lems
during sharp turns> *; higher num(er o; sensors =ere# used ro(ot mo?ement =ill (ecome
smooth and relia(le ;or sharp turnsE it reDuires complex programming ;or micro-
controller and reDuires more hard=are# =hich is its disad?antage> 2hus# optimum num(er
o; sensors reDuired>
2he distance (et=een sensors depend on
1> +o o; sensors used
2> .idth o; straight line @distance (et=een sensors should (e less than =idth o; lineA>
"> Distance (et=een sensors ma' not (e constant @it depends on the logicA>
5oltage 0egulator H!0%<
5oltage regulators con?ert ;ixed DC output ?oltage ;rom ?aria(le 4C> H!0% and H!12 are
commonl' used> H!0% gi?es output ;ixed %5 DC ?oltage i; input ?oltage is in range o;
H>%5 to "%5> 2he' help to maintain a stead' ?oltage le?el despite ?ar'ing current
demands and input ?oltage ?ariations> *; input ?oltage is IH>% 5 then regulation =ill (e
improper i>e> i; input is &5 then output is %5 or $>!5# (ut there are parameters ;or the
?oltage regulators like maximum output current capa(ilit'# and line regulation etc> that
=onJt (e proper> .e ha?e used H!0%>
2he heat sink can (e seen a(o?e the ?oltage regulator (1-input, 2-gnd, 3-output).
Coupling capacitors are good ;or regulation>2here is no reDuirement ;or it in normal case>
*; H!0% used in analog circuit capacitor one should use# else the noise in the output
?oltage =ill (e high> 2hese are the mainl' a?aila(le H!xx *CCs =hich are H!0%#
H!0K#H!12#H!1%#H!2$# high sensiti?e>2he internal diagram o; ?oltage regulator is sho=n
(elo=>
-ptocouplers<
*t is a de?ice containing light-emitting and light-sensiti?e components# used
to couple isolated circuits>
7echanism o; -ptocouplers<
2he main ;unction o; an opto-isolator is to (lock high ?oltages and ?oltage
transients# so that a surge in one part o; the s'stem =ill not disrupt or destro'
another part o; the circuit> -pto-couplers allo= a signal to (e sent in digital
@some analogA (et=een circuits> 2his isolation used to take place using
isolation trans;ormers ?ia inducti?e coupling (et=een input and out sides
separated (' a dielectric>.e used 6C!1H in our design>there is a diode and a
transistor in this optocoupler>Di;;erent con;igurations @common
collector#common (ase#common emitterAo; this transistor can (e made>.e
con;igured the transistor as common emitter i>e># input has (een applied at
the (ase and output is taken ;rom collector>Collector is connected to 5cc
@%5A through 10kohms resistance>.e applied a 6.7 at (ase o; transistor
through diode in such a =a' =hen pulse amplitude is high#transistor is in
saturation mode so output at the collector terminal is 5C@satAL0>25>.hen
pulse amplitude is lo=#transistor is in cuto;; mode so the output at collector
terminal is %5>
60-C99*+/ 9:927
6.7 @6ulse .idth 7odulationA <
*n this experiment# =e ha?e applied 6.7 @6ulse .idth 7odulationA mechanism to
control the speed o; a motor> 8sing 6.7 control# the po=er consumption can (e reduced
and most importantl' a 6.7 control signal can (e generated (' a microcontroller ?er'
easil'>
7echanism o; 6.7<
.e ha?e con;igured p=m modes on pin 6C! and 6CK o; microcontroller> these pins =ere
con;igured (ecause in the microcontroller )Ds are also integrated =ith these pins so it
=as eas' to o(ser?e p=m on the controller>.e ha?e selected mode1 ;or (oth the pins ('
using -Cx7 (its in the CC702 register> 4lso 6.7 is con;igured acti?e lo= i>e> motor
runs =hen )D is o;; and ?ice ?ersa>-utput is made capture comparea(le using ccer
register> 4t the start o; con;iguration =e ha?e disa(led the timer# a;ter con;iguring the
timer =e =ill ena(le it using C0 register>Clock ;or the timer is ena(led using
0CCM4611+0 register> =e used internal clock ;or p=m timer =hich is "273G# (ut
internal clock is di?ided (' prescalar ?alue to get the output ;reDuenc' eDual to 13G>Dut'
c'cle can (e set using 400 and CC0 registers>
-82682 9:927
7otor Dri?er @)2K"DA<
7otor dri?er is a current enhancing de?iceE it can also (e act as 9=itching De?ice> 2hus#
a;ter inserting motor dri?er among the motor and microcontroller> 7otor dri?er taking the
input signals ;rom microcontroller and generate corresponding output ;or motor>
.e ha?e used )2K"D>2his is a motor dri?er *C that can dri?e t=o motor simultaneousl'>
9uppl' ?oltage @5ssA is the 5oltage at =hich =e =ish to dri?e the motor> /enerall'# &5
;or dc motor and & to 125 ;or gear motor are used# depending upon the rating o; the
motor> )ogical 9uppl' 5oltage deciding =hat ?alue o; input ?oltage should (e considered
as high or lo= >9o i; =e set )ogical 9uppl' 5oltage eDuals to N%5# then -0>"5 to 1>%5
=ill (e considered as *nput )o= 5oltage and 2>"5 to %5 is taken into consider as *nput
3igh 5oltage>
7echanism o; 7otor Dri?ers @)2K"DA<
2o control the DC motor# 'ou need to suppl' su;;icient po=er @currentA to the motor>
*n most cases# the microprocessor can act as a ?oltage source# @output highL%5 pro?ided
that high impedance o; loadA> 3o=e?er to dri?e a motor# the current deli?ered (' the
microprocessor is not su;;icient to dri?e the motor# thus external source =ith suita(le
current ampli;ication is needed> *n this experiment# =e use an *C )2K"D to act as the
current ampli;ier and to dri?e the motor> 2he )2K"D supports t=o outputs and can dri?e
t=o motors at the same time>*n this experiment#=e ha?e used t=o DC
dri?ers to rotate t=o DC motors indi?iduall' in order to pre?ent the *C ;rom (urning out
(ecause o; high current ratings o; motor>1ut the motors that =e ha?e used ha?e current
dra=ing capa(ilit' =ithin the sa;et' limits o; the *C#so#using t=o *Cs ;or motor dri?ing
purpose is Bust a precaution>2he dri?ers =e ha?e used can dri?e current upto &00m4 and
=e can appl' $>%-"&5 at pin ! o; )2K"D>*n this =a' =e can dri?e the motor at the
reDuired ?oltage>
lectric 7otor<
7otor is a de?ice that con?erts an' ;orm o; energ' into mechanical energ' or imparts
motion> *n constructing a ro(ot# motor usuall' pla's an important role (' gi?ing
mo?ement to the ro(ot> *n general# motor operating =ith the e;;ect o; conductor =ith
current and the permanent magnetic ;ield> 2he conductor =ith current usuall' producing
magnetic ;ield that =ill react =ith the magnetic ;ield produces (' the permanent magnet
to make the motor rotate> 2here are generall' three (asic t'pes o; motor# DC motor# e?en
ser?omotor and stepper motor# =hich are al=a's (eing used in (uilding a ro(ot>
DC 7otor<
2he DC motor is a de?ice that con?erts electrical energ' into mechanical energ'> 2he DC
motor consist a rotating armature in the ;orm o; an electromagnet> 4 rotar' s=itch kno=n
as commutator re?ersing the direction o; the electric current t=ice e?er' c'cle to ;lo=
through the armature so that the poles o; the electromagnet push and pull against the
permanent magnets on the outside o; the motor> 2he armature electromagnet passes the
poles o; the permanent magnets# since using the poles# the commutator re?ersing the
polarit' o; the armature electromagnet>During that instant s=itch o; polarit'# inertia
actuates the classical motor going in the proper direction>
7athematical *nterpretation<
0otational po=er @6rA is gi?en ('<
6rL 2orDue @2A O 0otational 9peed @A
i>e>#
6r is constant ;or DC motor ;or a constant input electrical po=er> 2hus torDue @2A is
in?ersel' proportional speed @A>,or increase in the ?alue o; torDue# =e ha?e to loose
speed#as
Controllers<
*n a process control s'stem controllerCs ;unction is to in;luence the control s'stem
through control signals so that the ?alue o; the controlled ?aria(les eDual to that o; the
?alue o; the re;erence> Controller can (e kno=n as the P1rainQ o; process control s'stem>
Controller generates a control signal sending to ;inal control element depending upon the
de?iation (et=een the set point and the measured ?alue o; the controlled
?aria(le>Controller mode is the =a' in =hich the controller responds to de?iation>
6*D Controller<
6roportional-*ntegral-Deri?ati?e @6*DA control is the most common control algorithm
used in industr' and has (een uni?ersall' accepted> 2he 6*D controller attri(utes are
partl' to their ro(ust per;ormance in a =ide range o; operating conditions>
6*D 4lgorithm<
4 6*D algorithm consists o; three (asic coe;;icients< proportional# integral and deri?ati?e>
2hese gains are ?aried to achie?e an optimal s'stem response>
2he (asic structure o; a s'stem =ith 6*D control implemented is illustrated (elo=> 2he
s'stem output @also called the process ?aria(leA =ith a sensor and compared to the
reading to the re;erence ?alue @also called the set pointA> 0e;erence and the measured
output are compared and the result is an error ?alue =hich is used in calculating
proportional# integral# and deri?ati?e responses> 9umming the three responses to o(tain
the output o; the controller> 2he output o; the controller is used as an input to the s'stem
'ou =ish to control# changing some aspect o; the s'stem> ,or example# i; motor is
controlled# the controller =ould pro?ide more or less current> 2he output o; the s'stem
gets measured and the process continues>
*teration o; the control loop can (e kno=n as completion o; the process in single time>
4;ter )aplace trans;er =e get#
.here
Rp = 6roportional gain
R*L *ntegral gain
RDL Deri?ati?e gain
e< rrorL9et point S6rocess 5alue>
t < *nstantaneous time
tI< *ntegral time
tD< Deri?ati?e time
6roportional controller<
2he proportional term is produced# in =hich an output ?alue that is proportional to the
present error ?alue> 2he proportional response is adBusted (' multipl'ing the error =ith a
constant Kp# called proportional gain constant>
2he proportional term is gi?en as<
-r
4 high proportional gain resulting in a large change in output ;or a gi?en change o; the
error> *; the proportional gain is ?er' high# the s'stem (ecomes unsta(le> .hereas# a
small gain results in a small output response to a large input error and a lo= responsi?e or
less sensiti?e controller> *; the proportional gain is much less# the control action ma' (e
too small =hen responding to the s'stem distur(ances> 2uning theor' and industrial
practice implies that# the proportional term must contri(ute to the (ulk o; the output>
*ntegral controller<
2he contri(ution o; the integral term is proportional to (oth the magnitude o; the error
and the duration o; error> *n a 6*D controller the integral is the sum o; the instantaneous
error o?er time and gi?es the accumulated o;;set that should ha?e (een pre?iousl'
corrected> 4ccumulated error gets multiplied (' the integral gain @RiA and added to the
controller output>
2he integral term is gi?en ('<
-r
2he integral term accelerates the mo?ement o; the process to=ards the set point and
eliminates the residual stead'-state error =hich occurs =ith a pure 6roportional
controller> *ntegral term responds to accumulated errors o; the past# it can result the
present ?alue to o?ershoot the set point ?alue>
Deri?ati?e Controller<
Deri?ati?e controller is used in the process =here o;;set ?alue is accepta(le# =here some
anticipation can (e considered and should ha?e lo= noise> 2he eDuation o; 6D Controller
is<
2he ideal trans;er ;unction o; 6D controller is gi?en ('<
6roportional *ntegral Deri?ati?e Controller @6*DA<
6*D control is deri?ati?e action in nature# also kno=n as the rate action# or pre-act> *ts
purpose is ;or anticipating =here the process is headed through looking at the time rate
change o; the error#and its deri?ati?e>2he eDuation is gi?en as<
.here tD>L deri?ati?e @or rateA time> >2he 6*D controller contains three terms# Rc or 61#
t* and tD# need to (e adBusted# @tunedA to o(tain satis;actor' control> 2he deri?ati?e action
pro?ides controller the a(ilit' to anticipate the direction o; the process that is# to through
calculation o; the deri?ati?e o; the error>
60-/0477*+/ 4+D 9*78)42*+/
2he program code acts as the decision-maker em(edded in the micro-controller deciding
a(out the outputs ;or particular set o; inputs> 2he ;ollo=ing program =as =ritten using
927"2)100>
\(egin{;igure}[htT]
\centering
\includegrahpics[trimL 0mm 0mm 0mm 0mm#clip# scaleL0>%]
{image}
\caption{;igure title}
\end{;igure}
\end{document}

You might also like