at res edesign 3
TRANSCRIPT
-
8/16/2019 At Res Edesign 3
1/22
E-Design 314: Gate controller
Z. Du Toit
17042844
-
8/16/2019 At Res Edesign 3
2/22
Declaration
I, the unersigne, here!" eclare that the #or$ containe in this re%ort is &" o#n #or$
unless other#ise state.
'ignature: ((((((((((((
Z. Du Toit
Date: ((((((((((((((
1
-
8/16/2019 At Res Edesign 3
3/22
'u&&ar"
2
-
8/16/2019 At Res Edesign 3
4/22
Ta!le o) *ontents
*ha%ter 1: Introuction.................................................................................................7
*ha%ter 2: '"ste& Descri%tion........................................................................................8
*ha%ter 3: Detaile Design..........................................................................................10
3.1 +o#er 'u%%l"...................................................................................................10
3.2 uer ............................................................................................................10
3.2.1 *alculationsDesign o) the !uer ....................................................................10
3.3 uttons /Incluing !uttons use on re&ote..............................................................11
3.3.1 + calculations )or !uttons...........................................................................11
3.4 *D.............................................................................................................. 12
3. I re&ote trans&itter an recei5er .........................................................................12
3..1 *alculations )or I trans&itter ri5er circuit.......................................................13
3.6 otor ri5er, otor an Gate...............................................................................13
*ha%ter 4: +rogra&s..................................................................................................14
4.1 +rogra& )unctions.............................................................................................14
4.2 iles in the &ain %rogra&....................................................................................16
4.3 lo# iagra& o) &ain %rogra&.............................................................................16
*ha%ter : easure&ents an results..............................................................................17
*ha%ter 6: *onclusion................................................................................................18
e)erences.............................................................................................................. 20
3
-
8/16/2019 At Res Edesign 3
5/22
ist o) a!!re5iations an s"&!ols
olts
%% +ea$-to-%ea$ 5oltage
% +ea$ 5oltage
9 9&%eres
9D* 9nalogue to igital con5erter
+ igh +ass ilter
+ o# +ass ilter
; ser inter)ace
* esistor-*a%acitor
ET iel E))ect Transistor
?ET ?unction iel E))ect Transistor
@+@ @egati5e-+ositi5e-@egati5e
+@+ +ositi5e-@egati5e-+ositi5e
4
-
8/16/2019 At Res Edesign 3
6/22
?T i%olar ?unction Transistor
-
8/16/2019 At Res Edesign 3
7/22
Ta!le o) igures
Figure 1: Block diagram describing the sstem as a !hole.........................8
Figure 2: "ircuit used #or the $o!er su$$l...............................................10
Figure 3: "ircuit used #or the bu%%er..........................................................11
Figure 4: &ush button circuit......................................................................12
Figure 5: 'ri(er circuit #or the )* transmitter.............................................12
Figure 6: Files contained in the +nal $ro,ect..............................................16
6
-
8/16/2019 At Res Edesign 3
8/22
Chapter 1: Introduction
7
-
8/16/2019 At Res Edesign 3
9/22
Chapter 2: System Description
In this cha%ter, the general )unctionalit" o) the gate controller is eB%laine. In igure 1 !elo#,
a !loc$ iagra& is sho#n, illustrating all the &aCor co&%onents use, incluing the &anner in
#hich the" co&&unicate #ith the &icro-controller. @ote that the irection o) the arro#s
sho#ing the irection o) co&&unication to, )ro& or !i-irectionall" )ro& the &icro-
controller.
9s in igure 1 a!o5e, the gate controller #as i&%le&ente !" using the enesas 78G14
&icro-controller. The s"ste& is %o#ere !" a 10 D* %o#er su%%l" /
-
8/16/2019 At Res Edesign 3
10/22
*D is a 16 !" 1 is%la" that uses %arallel %orts on the &icro-controller to sen an recei5e
ata an co&&ans. The *D is use to is%la" an" necessar" ata to the en-user.
9 F?T38 6 D* &otor /inclues gear!oB is co&%letel" asse&!le !" instructions gi5en
u%on recei%t. 9 D8801 &otor ri5er is use #hich contains a )ull -!rige that is use to
ri5e the F?T38 6 D* &otor.
astl", T'
-
8/16/2019 At Res Edesign 3
11/22
Chapter 3: Detailed Design
*ha%ter 3 )ocusses on the esign etail o) the gate controller. This cha%ter %ro5iesin)or&ation a!out all the &aCor an &inor co&%onents use, incluing so&e calculations that
lea the esign choices o) the s"ste&.
3.1 Power Supply
igure 2 !elo# sho#s the circuit use to %o#er the gate controller s"ste&. This esign #as
irectl" gi5en eBternall" an !" the 780s ata sheet, )or an out%ut o) . The ca%acitors
sta!ilises the out%ut o) the regulator. The 780 re=uires at least 7 , so the s"ste& is
ca%a!le o) !eing %o#ere !" a !atter". o#e5er, the a!solute &aBi&u& 5oltage that can !e su%%lie to the 780 is aroun 30 , though the s"ste& #as generall" run on 10 .
The reason )or regulating the 5oltage in this s"ste& is !ecause &ost o) the co&%onents use
in this s"ste& #ere esigne an &anu)acture )or an 3.3 .
Figure 2: Circuit used for the power supply
3.2 Buzzer
The circuit )or the T12G-2+ /144713 !uer is sho#n on the )ollo#ing %age in igure 3.
The !uer can !e o%erate in a range o) )re=uenciesH ho#e5er, the &icro-controller #as onl"
a!le to su%%l" an aui!le signal at 1 $ an 2 $. sing the ata sheet o) transistor F1, &oel 2@304.
10
-
8/16/2019 At Res Edesign 3
12/22
I) I* 10 &9, E/sat &in 0.6 , *E/sat 0.2 #ith hE/&in 100 an hE/&aB 300:
⇒
2¿ (5−1.5−0.2)
10m 330 ; an 3 (5−0.65)0.1m
=¿ 43. $;
Figure 3: Circuit used for the buzzer
3.3 Buttons #Including "uttons used on remote$
igure 4 sho#s the %ush !utton esigne use on the re&ote an the &ain s"ste&. The circuit
is relati5el" si&%le an in5ol5e choosing a %ull o#n resistor. The %ur%ose o) the circuit isto %ro5ie a logical lo# )or the 78G14 to register a !utton %ress. 9 logical lo# is
registere as an" 5oltage less than 1 , an a logical high is registere as greater than 4 .
9 %ro!le& that neee to !e o5erco&e is the )act that the !uttons o not s#itch cleanl" )ro&
one state to another as a result o) a &echanical 5i!ration it unergoes !ecause o) a %h"sical
%ress. Three ðos #ere consiere to o5erco&e this %ro!le&. The )irst ðo is to use a
&aCorit" 5ote #ithin so)t#are an the secon ðo is to use a si&%le * +. The thir
ðo #as to use another so)t#are ðo !" &a$ing use o) interru%ts /'to%%ing the
interru%t as soon as an ege is etecte, resol5ing it an then s#itching the interru%t on
again. o#e5er, the thir ðo #as onl" use on the 78G12 /The re&ote as the78G14 i not ha5e enough interru%t %ins re&aining as it #as use )or other )unctions.
The secon ðo #as use instea an although the * net#or$ is not sho#n in igure 4,
a calculation )or the * + #ill !e sho#n. This )ilter shoul !e ae Cust !e)ore the 78
+in as sho#n in igure 4.
3.3.1 %P& calculations !or "uttons
11
-
8/16/2019 At Res Edesign 3
13/22
The a5erage ti&e a !ounce in a %ress lasting 200 &s to 800 &s is aroun 1 &s to &s. 'o
gi5en that the )re=uenc" o) the !ounce is a%%roBi&atel" 100 to 200 , an * net#or$,
using a resistor 330 $; an a ca%acitor 0.01A su))ices to e-!ounce the signal.
Figure 4: ush button circuit
3.' %CD
9s eB%laine !e)ore, the *D #as integrate into the s"ste& si&%l" as a 5isual ai to the
en-user. o#e5er, it &a" !e #orth noting that the *D contrast can !e set !" 5ar"ing 2
/9s in sche&atic !et#een 600 ; an 1 $;. The higher the resistance, the lighter the contrast
an 5ice 5ersa.
3.( I) remote transmitter and recei*er
The 78G12 #as use to ri5e the I re&ote. *- %rotocol #as i&%le&ente in the
esign o) the I re&ote. irstl", the ti&ers #ere set in coe to generate +J signal that
ser5es as the I carrier. anchester line coing #as then use to e&!e &essages into the
carrier. The cc )or the re&ote is set to 3.3 .
Figure !: "ri#er circuit for the $% transmitter
ollo#ing this, using a T'96200 I e&itting ioe an a '170 transistor #as use. igure
sho#s the co&%lete ri5er circuit )or the trans&itter. 9s sho#n in igure , 1 is a %ullo#n resistor an #as si&%l" chosen as 10 $;.
12
-
8/16/2019 At Res Edesign 3
14/22
The circuit )or the recei5er #as gi5en in the ata sheet )or the T'
-
8/16/2019 At Res Edesign 3
15/22
14
-
8/16/2019 At Res Edesign 3
16/22
Chapter ': Programs
This cha%ter escri!es the *-coe that the &icro-controller runs to i&%le&ent the gatecontroller. 9 !rie) escri%tion o) the )unctions use, is gi5en, as #ell as a structure la"out
sho#ing all the )iles in the )inal %roCect. The coe #as #ritten in the enesas Electronics E2
'tuios En5iron&ent. *alculations use in the %rogra& are inclue. 9 )lo# iagra&
etailing the )lo# o) the &ain %roCect )ile is also gi5en.
'.1 Program !unctions
The )unctions liste are in no %articular orer. These )unctions #ere, ho#e5er, use)ul as the"
#ere the &ost )re=uentl" use:
• 5oi ela"@oInt/unit16Lela"H
This %ro5ies a ela" o) a user-e)ine a&ount o) &icrosecons, using the internal
ti&ers o) the &icro-controller. The &aBi&u& ti&e that can !e ela"e %er call is
63 &icrosecons.
• 5oi esto%/5oiH
This )unction sa)el" %er)or&s an e&ergenc" sto% #hen a !utton on the +* is
%resse. It oes it !" setting the ut" c"cle o) the +J controlling the &otor to ero,
then a)ter a slight ela", %uts the &otor to slee%, sto%%ing it instantl".
• 5oi !utton
-
8/16/2019 At Res Edesign 3
17/22
• int #hatIsIt/5oiH
This )unction )urther anal"ses the arra" that is store !" the )unction ecoee&ote.
It accesses the co&&an #ithin the recei5e ata an returns an integer to clari)"
one o) 3 co&&ans sent )ro& the re&ote.
• 5oi re&oteoo/5oiH
This )unction si&%l" reas the states in to eter&ine #hen the gate is o%ening or
closing an is%la"s this in)or&ation onto the *D.
• 5oi #rite"tec/uint8Lt reg, uint8Lt 5alueH
This )unction ta$es in a co&&an or instruction an sens it to the *D
• 5oi initc/5oiH
This )unction initialises the *D.
• 5oi #rite'tring/char N#or,char lengthH
This )unctions uses #rite"tec to #rite long strings to the *D. This )unction
ta$es in a char %ointer #ith its length an uses this in)or&ation to #rite 9'*II
characters onto the *D.
• 5oi scroll/char lengtho)aH
This )unction ta$es in a length /generall" larger than 16, so that all the characters on
the *D is is%la"e an scrolls the shi)ts the aresses on the is%la" )ro& right to
le)t on the *D.
• 5oi LT9>0L*hannel3L*hangeDut"L)orL'er5o/uint8Lt ser5oLratioH
This )unction sa)el" changes the ut" c"cle o) the +J to an" %ercentage it is calle
#ith. This )unction sa5es ti&e )ro& ha5ing to use a %eri%heral coe generator to
change the ut" c"cle o) the +J.
• 5oi rLintc1Linterru%t/5oi an 5oi rLintc2Linterru%t/5oiH
These )unctions are use to etect a logical lo# )ro& t#o &icro-s#itches to inicate
#hether the gate has co&%letel" o%ene or close. oth o) these )unctions are
interru%ts an it uses the LT9>0L*hannel3L*hangeDut"L)orL'er5o )unction to sto%
the &otor sa)el".
16
-
8/16/2019 At Res Edesign 3
18/22
'.2 &iles in the main program
igure 6 !elo# sho#s a structure %roCect )ile sho#ing all o) the )iles in the co&%lete gate
controller %roCect.
'.3 &low diagram o! main program
The )lo# iagra& sho#ing the &ain )unction in o) the %rogra& use in the &icro-controller
can !e )oun in 9%%eniB D.
17
Figure &: Files contained inthe 'nal pro(ect
-
8/16/2019 At Res Edesign 3
19/22
Chapter (: ,easurements and results
The )ollo#ing &easure&ents #ere ta$en on the gate controller that #as !uilt.
)able 1: *hows di+erent currents and #oltages during di+erent commands for the mainsystem, including the remote
*urrent /@or&al &oe, ile
*urrent /utton %resse
*urrent /e&ote, ile
*urrent /e&ote, trans&itting!utton %resse
*urrent /Gate
-
8/16/2019 At Res Edesign 3
20/22
-
8/16/2019 At Res Edesign 3
21/22
)e!erences
enesas Electronics, 201, 78G14 icro-controllers ar#are anual
20
-
8/16/2019 At Res Edesign 3
22/22
enesas Electronics, 201, 78G14 icro-controllers 'o)t#are anual
airchil 7801, 2014, oltage egulator Datasheet
Dioes Incor%orate, na, 14@007 Dioe Datasheet
TDI *hu%, 2013, T230' >9T Datasheet
Das O 'ons International, use Datasheet
TeBas Instru&ents, 201, D8801, ull rige otor Dri5er
21