You are on page 1of 17

St.

Horys 0niversity, Son Antonio


"Elevatoi uesign anu contiol
simulation using LabvIEW
inteiface "
Asbutosb )aiswal, Amir Ameli
llnAL 8C!LC1
4/19/2007

"Flevotor Jesiqn onJ control simulotion usinq lobvlFW interfoce " 2007

2
uaLa AcqulslLlon, resenLaLlon and Analysls ,SL. Mary's unlverslLy

Abstract
1he pro[ecL deslgn conslsLs of an elevaLor model whlch ls belng conLrolled
by Lab vlLW sofLware, uslng Lhe dlglLal porL of Lhe nl LLvlS developmenL sysLem.
1he pro[ecL was deslgned keeplng ln mlnd appllcaLlons of daLa acqulslLlon ln real
Llme and lLs real Llme lmplemenLaLlon. lL helped ln undersLandlng Lhe pracLlcal
problems LhaL occur ln real Llme lmplemenLaLlon and served as a drlvlng force Lo
seek for answers Lo solve Lhem. 1he pro[ecL also requlred some lnLerface clrculLry
ln order Lo conLrol Lhe elevaLor.
Introduct|on
LlevaLors began as slmple rope or chaln holsLs. An elevaLor ls essenLlally a
plaLform LhaL ls elLher pulled or pushed up by a mechanlcal means. A modern day
elevaLor conslsLs of a cab (also called a "cage" or "car") mounLed on a plaLform
wlLhln an enclosed space called a shafL, or ln CommonwealLh counLrles called a
"holsL way". ln Lhe pasL, elevaLor drlve mechanlsms were powered by sLeam and
waLer hydraullc plsLons. ln a "LracLlon" elevaLor, cars are pulled up by means of
rolllng sLeel ropes over a deeply grooved pulley, commonly called a sheave ln Lhe
lndusLry. 1he welghL of Lhe car ls balanced wlLh a counLerwelghL. SomeLlmes Lwo
elevaLors always move synchronously ln opposlLe dlrecLlons, and Lhey are each
oLher's counLerwelghL.
1he mosL common way of conLrolllng an elevaLor ls Lo monlLor lLs currenL
poslLlon and compare lL wlLh a selecLed poslLlon. uependlng on Lhe selecLlon Lhe
elevaLor ls pulled up or down, unLll lL reaches Lhe selecLed floor. 1he modern day
elevaLors make use of dlglLal clrculLs whlch comprlse of mlcroconLrollers or
mlcroprocessors, ln order Lo conLrol lL. Powever, ln Lhls pro[ecL we have
lmplemenLed Lhe conLrol uslng Lab vlLW lnLerface, wlLh nl LLvlS. 1he dlglLal porL
of LLvlS was uLlllzed. A small elevaLor proLoLype was consLrucLed uslng some
baslc hardware accessorles.
Some lnLerface clrculLry has been deslgned ln order Lo conLrol Lhe elevaLor
or ln oLher words, Lo enable Lhe elevaLor Lo read and wrlLe daLa from and Lo Lhe
dlglLal porL. 1he pro[ecL conslsLs of Lhree maln funcLlonal blocks,
"Flevotor Jesiqn onJ control simulotion usinq lobvlFW interfoce " 2007

3
uaLa AcqulslLlon, resenLaLlon and Analysls ,SL. Mary's unlverslLy

a) 1he hardware seL up (proLoLype) of Lhe elevaLor
b) Some lnLerfaclng clrculLs and sensors
c) Lab vlLW sofLware Lo conLrol Lhe elevaLor

1he baslc block dlagram of Lhe sysLem ls glven ln llg 1.










I|g 1: 8aslc 8lock ulagram of Lhe LlevaLor SysLem

System Descr|pt|on
1. notJwote ltototype.
1he hardware proLoLype ls Lhe acLual elevaLor sysLem LhaL was deslgned
uslng hardware Lools. A deLalled dlagram of Lhe hardware consLrucLlon ls shown
ln llg 2. 1he ouLer frame ls made wlLh alumlnum and ls mounLed on a wooden
frame, ln order Lo serve as Lhe body of Lhe elevaLor sysLem. 1wo Lhreads are Lled
on Lhe lnner sldes of Lhls frame on boLh Lhe sldes ln order Lo serve as guldes Lo
Lhe elevaLor car. 1he car ln Lurn has four pulleys on Lhe edge of Lhe four
exLenslons (Lwo on each slde), ln order Lo be gulded along Lhe Lhread. 1hls ls
requlred ln order Lo make sure LhaL Lhe elevaLor does noL wobble or change lLs
paLh whlle movlng up or down. A sLrlng ls Lled Lo Lhe elevaLor car, whlch ls
wounded by shafL of Lhe moLor. 1he moLor ls mounLed on Lhe roof, ln order Lo
LLLvA1C8
PA8uWA8L -
SLnSC8
lnlC8MA1lCn

ln1L8lACL
Cl8Cul18?

nl LLvlS (ulCl1AL
C81)

uAC CA8u (1o
CompuLer)

uC MC1C8

4

have easy access Lo Lhe car's sLrlng. Cn Lhe lefL slde of Lhe car, Lhere ls a small
noLch whlch ls used Lo provlde lnformaLlon Lo Lhe floor sensors. Lach floor has a
seL of llghL bulb and a Lu8 (L
LhaL Lhere ls always llghL falllng on Lhe Lu8. 8uL whenever Lhe elevaLor passes
Lhrough a cerLaln floor, Lhe noLch obsLrucLs Lhe llghL falllng on Lhe Lu8, whlch
varles Lhe reslsLance of Lhe Lu8 and hence ac
dlrecLlon ls conLrolled by Lhe moLor drlver clrculL.
2. lotetfoce cltcoltty
1he clrculL LhaL ls used Lo lnLerface nl LLvlS wlLh Lhe sysLem comprlses of
Lhree maln blocks,
l)

uaLa AcqulslLlon, resenLaLlon and Analysls
have easy access Lo Lhe car's sLrlng. Cn Lhe lefL slde of Lhe car, Lhere ls a small
noLch whlch ls used Lo provlde lnformaLlon Lo Lhe floor sensors. Lach floor has a
seL of llghL bulb and a Lu8 (L
LhaL Lhere ls always llghL falllng on Lhe Lu8. 8uL whenever Lhe elevaLor passes
Lhrough a cerLaln floor, Lhe noLch obsLrucLs Lhe llghL falllng on Lhe Lu8, whlch
varles Lhe reslsLance of Lhe Lu8 and hence ac
dlrecLlon ls conLrolled by Lhe moLor drlver clrculL.
lotetfoce cltcoltty
1he clrculL LhaL ls used Lo lnLerface nl LLvlS wlLh Lhe sysLem comprlses of
Lhree maln blocks,
) 1he sensor clrculL
"Flevotor Jesiqn onJ control simulotion usinq lobvlFW interfoce "
AcqulslLlon, resenLaLlon and Analysls
have easy access Lo Lhe car's sLrlng. Cn Lhe lefL slde of Lhe car, Lhere ls a small
noLch whlch ls used Lo provlde lnformaLlon Lo Lhe floor sensors. Lach floor has a
I|g 2: ueLalled dlagram of Lhe hardware seL
seL of llghL bulb and a Lu8 (L
LhaL Lhere ls always llghL falllng on Lhe Lu8. 8uL whenever Lhe elevaLor passes
Lhrough a cerLaln floor, Lhe noLch obsLrucLs Lhe llghL falllng on Lhe Lu8, whlch
varles Lhe reslsLance of Lhe Lu8 and hence ac
dlrecLlon ls conLrolled by Lhe moLor drlver clrculL.
lotetfoce cltcoltty
1he clrculL LhaL ls used Lo lnLerface nl LLvlS wlLh Lhe sysLem comprlses of
Lhree maln blocks,
1he sensor clrculL
"Flevotor Jesiqn onJ control simulotion usinq lobvlFW interfoce "
AcqulslLlon, resenLaLlon and Analysls
have easy access Lo Lhe car's sLrlng. Cn Lhe lefL slde of Lhe car, Lhere ls a small
noLch whlch ls used Lo provlde lnformaLlon Lo Lhe floor sensors. Lach floor has a
ueLalled dlagram of Lhe hardware seL
seL of llghL bulb and a Lu8 (LlghL dependenL 8eslsLor). 1he arrangemenL ls such
LhaL Lhere ls always llghL falllng on Lhe Lu8. 8uL whenever Lhe elevaLor passes
Lhrough a cerLaln floor, Lhe noLch obsLrucLs Lhe llghL falllng on Lhe Lu8, whlch
varles Lhe reslsLance of Lhe Lu8 and hence ac
dlrecLlon ls conLrolled by Lhe moLor drlver clrculL.
1he clrculL LhaL ls used Lo lnLerface nl LLvlS wlLh Lhe sysLem comprlses of
1he sensor clrculL
"Flevotor Jesiqn onJ control simulotion usinq lobvlFW interfoce "
AcqulslLlon, resenLaLlon and Analysls ,SL. Mary's unlverslLy
have easy access Lo Lhe car's sLrlng. Cn Lhe lefL slde of Lhe car, Lhere ls a small
noLch whlch ls used Lo provlde lnformaLlon Lo Lhe floor sensors. Lach floor has a
ueLalled dlagram of Lhe hardware seL
lghL dependenL 8eslsLor). 1he arrangemenL ls such
LhaL Lhere ls always llghL falllng on Lhe Lu8. 8uL whenever Lhe elevaLor passes
Lhrough a cerLaln floor, Lhe noLch obsLrucLs Lhe llghL falllng on Lhe Lu8, whlch
varles Lhe reslsLance of Lhe Lu8 and hence acLlvaLes Lhe sensor clrculL. 1he moLor
dlrecLlon ls conLrolled by Lhe moLor drlver clrculL.
1he clrculL LhaL ls used Lo lnLerface nl LLvlS wlLh Lhe sysLem comprlses of
"Flevotor Jesiqn onJ control simulotion usinq lobvlFW interfoce "
,SL. Mary's unlverslLy
have easy access Lo Lhe car's sLrlng. Cn Lhe lefL slde of Lhe car, Lhere ls a small
noLch whlch ls used Lo provlde lnformaLlon Lo Lhe floor sensors. Lach floor has a
ueLalled dlagram of Lhe hardware seL-up
lghL dependenL 8eslsLor). 1he arrangemenL ls such
LhaL Lhere ls always llghL falllng on Lhe Lu8. 8uL whenever Lhe elevaLor passes
Lhrough a cerLaln floor, Lhe noLch obsLrucLs Lhe llghL falllng on Lhe Lu8, whlch
LlvaLes Lhe sensor clrculL. 1he moLor
dlrecLlon ls conLrolled by Lhe moLor drlver clrculL.
1he clrculL LhaL ls used Lo lnLerface nl LLvlS wlLh Lhe sysLem comprlses of
"Flevotor Jesiqn onJ control simulotion usinq lobvlFW interfoce "
,SL. Mary's unlverslLy
have easy access Lo Lhe car's sLrlng. Cn Lhe lefL slde of Lhe car, Lhere ls a small
noLch whlch ls used Lo provlde lnformaLlon Lo Lhe floor sensors. Lach floor has a
up
lghL dependenL 8eslsLor). 1he arrangemenL ls such
LhaL Lhere ls always llghL falllng on Lhe Lu8. 8uL whenever Lhe elevaLor passes
Lhrough a cerLaln floor, Lhe noLch obsLrucLs Lhe llghL falllng on Lhe Lu8, whlch
LlvaLes Lhe sensor clrculL. 1he moLor
1he clrculL LhaL ls used Lo lnLerface nl LLvlS wlLh Lhe sysLem comprlses of
"Flevotor Jesiqn onJ control simulotion usinq lobvlFW interfoce " 2007
have easy access Lo Lhe car's sLrlng. Cn Lhe lefL slde of Lhe car, Lhere ls a small
noLch whlch ls used Lo provlde lnformaLlon Lo Lhe floor sensors. Lach floor has a

lghL dependenL 8eslsLor). 1he arrangemenL ls such
LhaL Lhere ls always llghL falllng on Lhe Lu8. 8uL whenever Lhe elevaLor passes
Lhrough a cerLaln floor, Lhe noLch obsLrucLs Lhe llghL falllng on Lhe Lu8, whlch
LlvaLes Lhe sensor clrculL. 1he moLor
1he clrculL LhaL ls used Lo lnLerface nl LLvlS wlLh Lhe sysLem comprlses of
2007
have easy access Lo Lhe car's sLrlng. Cn Lhe lefL slde of Lhe car, Lhere ls a small
noLch whlch ls used Lo provlde lnformaLlon Lo Lhe floor sensors. Lach floor has a
lghL dependenL 8eslsLor). 1he arrangemenL ls such
LhaL Lhere ls always llghL falllng on Lhe Lu8. 8uL whenever Lhe elevaLor passes
Lhrough a cerLaln floor, Lhe noLch obsLrucLs Lhe llghL falllng on Lhe Lu8, whlch
LlvaLes Lhe sensor clrculL. 1he moLor
1he clrculL LhaL ls used Lo lnLerface nl LLvlS wlLh Lhe sysLem comprlses of
"Flevotor Jesiqn onJ control simulotion usinq lobvlFW interfoce " 2007

S
uaLa AcqulslLlon, resenLaLlon and Analysls ,SL. Mary's unlverslLy

ll) LaLchlng clrculL
lll) MoLor urlver clrculL

2.1. Sensor ClrculL:
1he sensor clrculL ls used ln order Lo converL Lhe sensor lnformaLlon lnLo a
11L loglc level. ln oLher words Lhe ouLpuL of Lhe clrculL should glve a loglc hlgh
whenever Lhe elevaLor car's noLch blocks Lhe llghL from falllng on Lhe sensor and
should glve a loglc low when Lhere ls llghL falllng on Lhe sensor. ln order Lo do Lhls
lC333 was used ln bl-sLable mode. 1he ldea was Lo form a volLage dlvlder uslng
Lhe sensor on Lhe Lrlgger pln of Lhe 333. 1he Lu8 along wlLh anoLher reslsLor
(C1) would resulL lnLo a volLage dlvlder and Lhls volLage can be ad[usLed. 1hls
way Lhe senslLlvlLy of Lhe clrculL can be used by Lunlng Lhe C1. Whenever, Lhe
llghL falllng on Lhe sensor ls blocked, Lhe reslsLance of Lhe Lu8 lncreases, whlch
decreases Lhe volLage on Lhe Lrlgger pln. A decrease ln volLage causes Lhe lnLernal
comparaLor's (of 333) lnpuL volLage Lo go over Lhe reference volLage, drlvlng Lhe
ouLpuL on pln 3 of Lhe lC hlgh. As soon as Lhere ls llghL falllng agaln, Lhe ouLpuL ls
pulled back Lo low.
1he clrculL dlagram ls shown ln llg 3.

I|g 3: SchemaLlc of Lhe sensor clrculL, used for deLecLlng floor number
LLu
"Flevotor Jesiqn onJ control simulotion usinq lobvlFW interfoce " 2007

6
uaLa AcqulslLlon, resenLaLlon and Analysls ,SL. Mary's unlverslLy

Powever, Lhe sensor wlll keep Lhe ouLpuL Lo loglc hlgh as long as Lhe llghL
falllng on Lhe sensor ls blocked. Cnce Lhe noLch moves away from Lhe llghL and
sensor, Lhe ouLpuL ls pulled down Lo low. 8uL lL ls lmporLanL Lo keep Lhe ouLpuL
hlgh even afLer Lhe elevaLor passes a floor (lf lL ls ln LranslLlon), because we need
Lo hold Lhe prevlous floor value. ln order Lo do Lhls a laLchlng clrculL ls used.
2.2. LaLchlng ClrculL:
As menLloned above, lL ls requlred Lo hold Lhe sensor clrculL's ouLpuL ln
order Lo have Lhe prevlous floor lnformaLlon avallable. 1hls ls accompllshed uslng
a u-fllp flop.
A u-fllp flop conslsLs of a u, Clock, reseL & 8eseL as lnpuLs and C and C as
ouLpuLs. A clocked u-fllp flop ls shown ln llg 4 below. Whenever, Lhere ls a rlslng

I|g 4: Loglc Symbol of a u-fllp flop

clock edge, Lhe sLaLe of uaLa lnpuL (u) ls laLched Lo Lhe ouLpuL (C). AL any glven
Llme, lrrespecLlve of Lhe clock edge, Lhe ouLpuL can be forced Lo be reseL uslng Lhe
acLlve low reseL pln.
8ased on Lhls operaLlon, Lhe laLchlng clrculL for Lhe elevaLor was deslgned.
As seen ln llg 3, Lhe ouLpuL of Lhe sensor clrculL ls used as Lhe clock and Lhe u
lnpuL ls always kepL aL a loglc hlgh sLaLe (+3v). 1he reason Lo do Lhls ls LhaL
whenever Lhe sensor clrculL glves a loglc hlgh ouLpuL (aL rlslng edge), Lhe u-lnpuL,
whlch ls always hlgh, ls clocked Lo Lhe ouLpuL. Cnce Lhe ouLpuL from Lhe sensor
clrculL goes low, Lhe ouLpuL (C) conLlnues Lo remaln hlgh slnce lL does noL change
wlLh falllng edge of Lhe clock. 1he C now conLlnues Lo remaln hlgh unLll lL ls reseL.
"Flevotor Jesiqn onJ control simulotion usinq lobvlFW interfoce " 2007

7
uaLa AcqulslLlon, resenLaLlon and Analysls ,SL. Mary's unlverslLy

1he Llmlng dlagram of Lhls operaLlon ls shown ln llg 3.










I|g S: 1lmlng dlagram for Lhe u-fllp flop laLch used ln Lhe clrculL deslgn
1he nexL lssue ls Lo deLermlne when Lo reseL Lhe ouLpuL back Lo loglc low.
1hls would be requlred when Lhe elevaLor reaches Lhe nexL desLlnaLlon. 1hls
clearly lmplles LhaL Lhe floor (sensor) oLher Lhan Lhe currenL floor should provlde
Lhe reseL slgnal Lo Lhe currenL floor. 1hls can be easlly explalned wlLh an example.
Suppose Lhe elevaLor's currenL poslLlon ls lloor 1. 1hls means LhaL Lhe ouLpuL of
Lhe laLch assoclaLed wlLh floor 1 ls hlgh. now, lf Lhe user selecLs lloor 2 as Lhe
nexL desLlnaLlon, Lhe elevaLor sLarLs movlng upwards. As soon as lL reaches lloor
2, lL needs Lo reseL Lhe u-fllp flop of lloor 1. 1hls can be done by uslng Lhe sensor
ouLpuL of lloor 2 as a reseL slgnal Lo lloor 1. So as soon as Lhe elevaLor reaches
lloor 2, lL reseLs lloor 1, hence updaLlng lLs currenL floor value. Powever, Lhe user
may also choose Lo go Lo lloor 3 lnsLead of lloor 2. ln LhaL case, lloor 3 should
also reseL lloor 1's u-fllp flop. 1hls makes lL clear LhaL an C8 comblnaLlon of Lhe
Lwo floors would solve Lhe problem. 8uL because Lhe 8LSL1 slgnal ls an acLlve low
slgnal, we use a nC8 gaLe. 1he enLlre clrculL ls shown ln llg 6.
As seen ln Lhe flgure, Lhe floor oLher Lhan Lhe floor lLself, provlde a reseL
slgnal Lo Lhe floor. 1he ouLpuLs from Lhese laLches are glven Lo Lhe dlglLal porL of
Lhe nl LLvlS, whlch ls read ln form of dlglLal word and an acLlon ls Laken
dependlng on Lhe currenL floor and Lhe selecLed floor.
u-lnu1
CLCCk
Cu1u1
8LSL1
"Flevotor Jesiqn onJ control simulotion usinq lobvlFW interfoce " 2007

8
uaLa AcqulslLlon, resenLaLlon and Analysls ,SL. Mary's unlverslLy

2.3. MoLor urlver ClrculL
1he moLor drlver clrculL ls requlred ln order Lo drlve Lhe moLor, for pulllng
or lowerlng Lhe elevaLor car. 1he dlglLal conLrol slgnal provlded by nl LLvlS does
noL dellver sufflclenL currenL Lo drlve Lhe moLor. Pence, a drlver clrculL, whlch ls
capable of changlng Lhe dlrecLlon of moLor uslng Lhe loglc slgnals and ls capable of
belng drlven aL hlgh currenL, ls used. 1he hearL of Lhe clrculL ls Lhe L293u moLor
drlver lC. 1he lC ls capable of drlvlng moLor wlLh volLage up Lo 36v.
Powever, a volLage of 3v ls recommended for low Lorque appllcaLlons. 1he
schemaLlc of Lhe clrculL ls shown ln llg 7.






I|g 6: LaLchlng clrculL for floor number acqulslLlon
1C ulCl1AL C81
1C ulCl1AL C81
1C ulCl1AL C81
"Flevotor Jesiqn onJ control simulotion usinq lobvlFW interfoce " 2007

9
uaLa AcqulslLlon, resenLaLlon and Analysls ,SL. Mary's unlverslLy


I|g 7: SchemaLlc of Lhe moLor drlver clrculL uslng L293u
ln Lhe above clrculL, vln ls Lhe supply volLage for Lhe lC as well as for Lhe
moLor. u1 and u2 are Lhe lnpuLs whlch are used Lo conLrol Lhe dlrecLlon of Lhe
moLor. 8oLh u1 and u2 are 11L loglc level lnpuLs. 1he Lable below (1able 1) shows
Lhe dlfferenL comblnaLlons of u1 and u2, wlLh lLs effecL on moLor's operaLlon,
1ab|e 1: ComblnaLlons of u1 and u2 for conLrolllng moLor dlrecLlon
D1 D2 Motor D|rect|on
1 0 Clockwlse ulrecLlon
0 1 An-Clockwlse ulrecLlon
1 1 88AkL (S1C)
0 0 88AkL (S1C)

1hls ls lmplemenLed ln Lhe LabvlLW program ln order Lo change Lhe moLor
dlrecLlon or ln order Lo sLop Lhe moLor, based on Lhe acLlon requlred Lo be Laken.
A plcLure of Lhe clrculL board, along wlLh soldered componenLs ls shown ln llg 8.
1hls may be used as a guldellne Lo operaLe Lhe elevaLor uslng Lhe dlglLal porL of
Lhe nl LLvlS.
1he lnpuLs on Lhe lefL slde of Lhe board are from Lhe hardware sysLem of
Lhe elevaLor. 1hese lnpuLs provlde lnformaLlon from sensors and have lnpuL Lo
Lhe moLor. lL also needs supply for llghLs, whlch ls provlded from Lhe board Loo.

"Flevotor Jesiqn onJ control simulotion usinq lobvlFW interfoce " 2007

10
uaLa AcqulslLlon, resenLaLlon and Analysls ,SL. Mary's unlverslLy



I|g 8: lcLure of Lhe compleLe lnLerface board
(*1bese ote tbe lopots to tbe bootJ ftom tbe levotot botJwote)
1he color codlng for each of Lhe wlres from Lhe elevaLor hardware ls llsLed
ln Lhe Lable below (1able 2)
1ab|e 2: Color codlng for Lhe wlres from elevaLor hardware
CCLCk IUNC1ICN
?ellow lloor 1 sensor
8rown lloor 2 sensor
Crey lloor 3 sensor
Creen LlghL bulbs
8ed +3v
8lack Cnu



IC SSS CIkCUI1 -INU1 IkCM kLSLC1IVL
SLNSCkS
D-ILI ILCS ICk LA1CnING
nC8 CA1L
MC1C8 u8lvL8
Cl8Cul1
1o and
from
ulglLal
orL
*Sensor - lloor 2
*Sensor - lloor 1
*Sensor - lloor 3
*LlghLs Supply
*MoLor +
*MoLor -
*+3v *Cnu
"Flevotor Jesiqn onJ control simulotion usinq lobvlFW interfoce " 2007

11
uaLa AcqulslLlon, resenLaLlon and Analysls ,SL. Mary's unlverslLy

2.4. u-Sub connecLor
A u-sub connecLor was used Lo connecL Lhe lnLerfaclng board Lo Lhe nl
LLvlS board. ln llg 8 Lhe arrow showlng 1o and from ulglLal orL" has seL of wlres
whlch are lnLerfaced Lo Lhe nl LLvlS uslng u-sub connecLor. 1he pln conflguraLlon
of Lhe u-sub connecLor ls shown ln 1able 3. ApproprlaLe connecLlons can be
made.
1ab|e 3: ln ouL for Lhe u-sub connecLor
D-Sub Connector |n number *Input]output Iunct|on
uSu8ln1 **Supply vcc (+3v)
uSu8ln2 **Supply vcc(+13v)
uSu8ln3 **Supply Cnu
uSu8ln4 CuLpuL MoLor u1
uSu8ln3 CuLpuL MoLor u2
uSu8ln6 lnpuL lloor 1
uSu8ln7 lnpuL lloor 2
uSu8ln8 lnpuL lloor 3
uSu8ln9 - -
(* lopot/ootpot Jltectloo ls wltb tespect to tbe Jlqltol pott. lot exomple, lopot meoos tbot tbot
plo ls oo lopot to tbe Nl lvl5 Jlqltol pott ooJ Ootpot meoos tbot lt ls oo ootpot ftom tbe Jlqltol pott
** 1bese plos sboolJ be coooecteJ to tbe sopply of tbe Nl lvl5. 1be motot Jtlvet cltcolt sboolJ
be qlveo oo extetool sopply)
J. Nl lvl5 ulqltol lott
1he dlglLal porL of Lhe nl LLvlS needs Lo be undersLood before uslng lL. 1he
nl LLvlS ls lnLerfaced wlLh Lhe compuLer vla a uAC card. 1he uAC card only
accepLs dlglLal daLa. So even Lhough an analog lnpuL ls read, lL needs Lo be flrsL
converLed Lo dlglLal daLa uslng A/u converLer (wlLh a speclfled sampllng raLe), and
ls Lhen reconsLrucLed on Lhe dlsplay of Lhe LabvlLW program. Powever, Lhe nl
LLvlS has llmlLed number of dlglLal llnes whlch lL uses for A/u converslon. 1he
same dlglLal llnes are avallable on Lhe dlglLal porL. ln order Lo access Lhem dlrecLly
lL ls necessary LhaL nl LLvlS does noL use Lhem anymore. So, ln order Lo use Lhe
dlglLal llnes, Lhe CommunlcaLlons" swlLch needs Lo be changed Lo 8ypass" on
"Flevotor Jesiqn onJ control simulotion usinq lobvlFW interfoce " 2007

12
uaLa AcqulslLlon, resenLaLlon and Analysls ,SL. Mary's unlverslLy

Lhe conLrol panel of Lhe nl LLvlS. now, Lhe hardware has been seL Lo access Lhe
dlglLal llnes. Powever, Lhls lnformaLlon needs Lo be updaLed even by Lhe
sofLware. ln order Lo do LhaL, a vl named Lnable CommunlcaLlon 8ypss.vl" needs
Lo be run prlor Lo uslng Lhe dlglLal porL. 1hls vl ls found under Lhe vl's of LabvlLW
7.0, under Lhe nl LLvlS folder. Powever, lf LabvlLW 8.0 or hlgher ls belng used,
Lhe requlred vl's can always be copled Lo Lhe local compuLer and run uslng
LabvlLW. 1he vl ls essenLlally a block whlch on double cllcklng wlll show Lhe fronL
panel of LhaL block. 1he fronL panel ls shown ln llg 9.
Cnce Lhe vl ls run, Lhe 8ypass Successful" LLu on Lhe fronL panel musL be
llL and Lhe sLaLus shows a check mark. 1hls would mean LhaL Lhe dlglLal porL ls
now ready Lo be used and can be programmed ln LabvlLW. ln case Lhe sLaLus ls
reLurnlng an error Lhen Lhe vl should be run wlLh Lhe proLoLyplng board's (of nl
LLvlS) power ln off poslLlon. lf lL ls sLlll glvlng an error, make sure LhaL Lhe
communlcaLlon swlLch ls seL Lo 8ypass".

I|g 9: lronL anel for Lnable CommunlcaLlon 8ypass.vl
"Flevotor Jesiqn onJ control simulotion usinq lobvlFW interfoce " 2007

13
uaLa AcqulslLlon, resenLaLlon and Analysls ,SL. Mary's unlverslLy

LA8VILW Software
Cnce Lhe hardware was conflgured, Lhe sofLware ls developed based on Lhe
hardware deslgn. lrom sofLware polnL of vlew, Lhe deslgn needs Lo conslder Lhe
lnpuLs comlng from Lhe elevaLor (floor lnformaLlon) and Lhen Lake approprlaLe
acLlon based on Lhe Lask Lo be performed (ouLpuL conLrol Lo moLor). So Lhe maln
lnpuLs Lo Lhe program would be Lhe lnpuL from Lhe user who selecLs Lhe
desLlnaLlon floor and Lhe lnpuL from Lhe dlglLal porL, whlch glves currenL floor
number. Cn comparlng Lhese Lwo quanLlLles, Lhe conLroller Lhen has Lo Lake an
approprlaLe acLlon Lo conLrol Lhe moLor.
8ased on Lhls concepL a flow charL may be represenLed as shown ln llg 10.

I|g 10: llowcharL represenLaLlon of Lhe elevaLor conLrol sofLware


"Flevotor Jesiqn onJ control simulotion usinq lobvlFW interfoce " 2007

14
uaLa AcqulslLlon, resenLaLlon and Analysls ,SL. Mary's unlverslLy

3.1. SofLware 8lock dlagram
1he block dlagram of Lhe vl used for conLrol of Lhe elevaLor ls shown ln llg
11.

I|g 11: LabvlLW program block dlagram
As seen ln Lhe block dlagram, Lhe user flrsL selecLs a floor as Lhe desLlnaLlon
floor. 1hls ls Lhen compared wlLh Lhe currenL floor whlch ls read from Lhe dlglLal
porL of Lhe nl LLvlS. 1he program lmplemenLed Lhls uslng 8ead ulglLal Llne.vl"
whlch reLurn a Lrue or a false 8oolean value dependlng on wheLher lL ls loglc hlgh
or a loglc low respecLlvely. Lach floor has a dedlcaLed dlglLal llne and Lhe
respecLlve llne ls hlgh whenever Lhe elevaLor ls on LhaL floor. 1hls 8oolean value ls
Lhen converLed Lo Lhe floor number by uslng a selecL swlLch, LhaL reLurns Lhe floor
number lf Lhe lnpuL ls Lrue, oLherwlse lL reLurns a zero. 1hls way each dlglLal llne
reLurns Lhe correspondlng floor number whenever lL ls Lrue. ln order Lo mulLlplex
Lhls lnLo a slngle llne, all Lhe Lhree ouLpuLs are added LogeLher and Lhe resulLanL ls
"Flevotor Jesiqn onJ control simulotion usinq lobvlFW interfoce " 2007

1S
uaLa AcqulslLlon, resenLaLlon and Analysls ,SL. Mary's unlverslLy

glven Lo Lhe case sLrucLure where lL ls compared wlLh Lhe user's selecLlon. 1he
resulLanL ls always Lhe currenL floor number as only one floor's lnpuL wlll be
acLlve aL a glven Llme and Lhe oLhers wlll have a resulL of zero.
Cnce Lhe currenL floor number ls read, lL ls Lhen compared wlLh Lhe user's
selecLlon wlLhln Lhe case sLrucLure. uependlng on Lhe floor selecLed Lhe case
sLrucLure deLermlnes Lhe dlrecLlon of Lhe moLor. 1he dlrecLlon of Lhe moLor ls
conLrolled uslng 1able 1. ulglLal llnes u0 and u1 are used Lo wrlLe daLa on Lhe
dlglLal porL of Lhe nl LLvlS. WrlLe Lo ulglLal Llne.vl" ls used ln Lhls case. 1he maln
advanLage of wrlLlng daLa Lo a dlglLal llne and noL Lo Lhe dlglLal porL ls LhaL Lhe
same porL can be used Lo read or Lo wrlLe daLa, whlch ls an essenLlal requlremenL
for Lhe worklng of Lhls pro[ecL.
1he fronL panel for Lhe above block dlagram ls shown ln llg 12. 1he fronL
panel conslsLs of an lndlcaLor showlng Lhe currenL floor and a couple 8oolean
LLu's, marked wlLh arrows, whlch lndlcaLe Lhe dlrecLlon of Lhe elevaLor A

I|g 12: lronL panel of Lhe maln program
"Flevotor Jesiqn onJ control simulotion usinq lobvlFW interfoce " 2007

16
uaLa AcqulslLlon, resenLaLlon and Analysls ,SL. Mary's unlverslLy

LroubleshooLlng box showlng Lhe moLor dlrecLlon and Lhe currenL floor readlng ls
also provlded Lo resolve any problems, when dealL wlLh.
kesu|t and Conc|us|on
1he pro[ecL was deslgned and fabrlcaLed successfully. 1he elevaLor worked
as expecLed and Lhe lnLerfaclng hardware also responded well Lo Lhe sofLware.
Powever, Lhe maln problem was encounLered when Lhe clrculL was drlvlng Lhe
moLor. When Lhe moLor was acLlvaLed, lL would draw a huge amounL of currenL
and generaLe a back e.m.f whlch would generaLe volLage splkes ln Lhe oLher parLs
of Lhe clrculL. 1he u-laLches belng very senslLlve Lo volLage levels Lend Lo geL
Lrlggered wlLhouL a valld lnpuL, because of Lhese volLage splkes. Cne way Lo geL
around Lhe problem ls Lo have a capaclLance of 0.01uf and 1uf ln parallel beLween
Lhe power supplles of each of Lhe lC's, close Lo Lhe chlp. 1hls would geL rld of Lhe
splkes and would avold Lhe laLches from geLLlng Lrlggered wlLhouL a valld lnpuL.
1hls problem was however addressed by reduclng Lhe moLor volLage and hence
decreaslng Lhe back e.m.f LhaL lL would generaLe and would proporLlonally
decrease Lhe volLage splkes.
Also, Lhe wlrlng for Lhe moLor was done separaLely ln Lhe elevaLor
hardware. lL was noLlced LhaL when Lhe wlrlng of moLor was done along wlLh Lhe
sensor wlrlng, Lhe sensors Lrlggered Lhe laLches, whenever Lhe moLor drew
currenL. 1hls was because hlgh currenL generaLe elecLromagneLlc fleld whlch
affecLed Lhe Lrlggerlng clrculL (sensor clrculL). Cnce Lhe moLor wlres were
separaLed, Lhls problem was solved.
1he elevaLor sofLware responded very well Lo Lhe hardware and Lhe
uLlllzaLlon of Lhe dlglLal porL Lo conLrol and slmulaLe Lhe elevaLor was successfully
demonsLraLed.
Iuture Work
1he elevaLor was deslgned Lo poslLlon lLself Lo a floor selecLed by Lhe user.
Powever, lL dld noL lmplemenL a calllng swlLch whlch can be used Lo call Lhe
elevaLor Lo Lhe floor where Lhe swlLch was pressed. Also, no sLorage elemenLs
"Flevotor Jesiqn onJ control simulotion usinq lobvlFW interfoce " 2007

17
uaLa AcqulslLlon, resenLaLlon and Analysls ,SL. Mary's unlverslLy

were used ln Lhe deslgn. lor example, durlng Lhe LranslLlon of elevaLor from floor
2 Lo floor 3, lf Lhe user selecLs floor 2 agaln, Lhe elevaLor sLops ln beLween. lf a
sLorage elemenL was used Lhen lL could hold Lhe currenL floor value and walL for
Lhe nexL call Llll lL execuLes Lhe currenL operaLlon fully. 1hese are Lhe few Lhlngs
LhaL can be lmplemenLed uslng Lhls hardware and uslng LabvlLW as Lhe
conLrolllng sofLware.

You might also like