Вы находитесь на странице: 1из 35

APPLICATION OF EBBEDDED

SYSTEM IN WASHING
MACHINE
SU8MI11LD 8
Iay kr|shna Sharma
8L(CSL) A IINAL LAk
kLGNC080120120S6
LkIAk MANIAMMAI UNIVLkSI1
ln18CuuC1lCn
The design uses the PIC18F series microcontroller.
All the control functionalities of the system are built
around this. Upgradeability is the unique feature of
this system. Control card hardware and software
allows the manufacturer to add or remove the
features as per customer requirement and model.
Thus once the whole system is designed it is very
economic in large quantity production. Single-phase
motor is considered for the design. Front panel
consists of a keypad and LCD display. Keypad
provides automatic and manual wash options to the
user
Des|gn Spec|f|cat|ons
W 1hls lnclude boLh hardware and sofLware speclflcaLlons
W 1he sysLem should provlde fully auLomaLlc mode seml
auLomaLlc mode and manual mode Modes should be
selecLable by a keypad
W under fully auLomaLlc mode user lnLervenLlon requlremenL
should be zero Cnce Lhe sysLem ls sLarLed ln Lhls mode lL
should perform lLs work lndependenLly and afLer Lhe
compleLlon of work lL should noLlfy Lhe user abouL Lhe
compleLlon of work 1hls mode lnsLanLaneously should
sense cloLh quallLy and requlremenL of waLer waLer
LemperaLure deLergenL load wash cycle Llme and perform
operaLlon accordlngly
W ln semlauLomaLlc mode also user requlremenL should
be nll 8uL user has Lo choose any one of Lhe seml
auLomaLlc mode ln whlch washlng condlLlons are
predeflned Cnce Lhe predeflned mode ls sLarLed Lhe
sysLem should perform lLs [ob and afLer compleLlon lL
should lnform Lhe user
W ln manual mode conLlnuous lnLervenLlon of user ls
requlred user has Lo speclfy whlch operaLlon he wanLs
Lo do and has Lo provlde relaLed lnformaLlon Lo Lhe
conLrol sysLem lor example lf user wanLs Lo wash
only he has Lo choose 'wash' opLlon ln manual mode
1hen Lhe sysLem should ask Lhe user Lo enLer Lhe wash
Llme amounL of waLer and Lhe load AfLer Lhese daLa
are enLered Lhe user should sLarL Lhe machlne When
Lhe speclfled operaLlon ls compleLed sysLem should
lnform Lhe user
W When Lhe lld ls open sysLem should noL work lf door ls
accldenLally opened ln beLween wash operaLlon Lhen Lhe
sysLem should sLop worklng ln mlnlmum posslble Llme
(10s)
W 1he sysLem should provlde all baslc feaLures of a washlng
machlne llke washlng rlnslng splnnlng drylng cold wash
hoL wash eLc
W 1he sysLem should provlde easy opLlons for upgradeablllLy
of new feaLures 1he hardware and Lhe sofLware should be
compaLlble Lo boLh machlnes whlch have fewer feaLures
or more feaLures 8emoval of any feaLure should noL affecL
Lhe worklng of any oLher feaLures or overall worklng of Lhe
sysLem
W 1he sysLem should work on slngle phase AC
from 190vAC Lo 230vAC 1he sysLem should
proLecL lLself from power supply volLage
varlaLlons
W ln Lhe evenL of power fallure Lhe washlng
machlne should auLomaLlcally sLarL lLs cycle
from Lhe polnL of lnLerrupLlon when power ls
resumed
ardware Des|gn
W earL of Lhls sysLem ls lC18l432 MosL of Lhe perlpheral
feaLures have been uLlllzed Lo lmplemenL Lhe deslgn
ConLrolllng Lhe moLor ls very cruclal parL of Lhe deslgn 1he
WM feaLure of Lhe mlcroconLroller conLrols moLor speed
WM ouLpuL ls fed Lo drlver clrculL and Lhen Lo moLor 1o
roLaLe Lhe moLor ln Lwo dlfferenL dlrecLlons 'forward' and
'reverse' dlrecLlon conLrol blocks are used MoLor speed
sensor ls lnLerfaced Lo mlcroconLroller MlcroconLroller reads
Lhe speed of Lhe moLor and approprlaLely conLrols Lhe speed
of Lhe moLor ln dlfferenL phases of washlng uslng WM
ouLpuL uoor sensor pressure sensor keypad are also
lnLerfaced Lo mlcroconLroller Serlal porL ln connecLed Lo CSM
module LL8CM and 81C are lnLerfaced Lo MSS module of
conLroller ln clrculL serlal programmlng faclllLy ls provlded for
qulck and easy programmlng and debugglng
A Slmple ardware ueslgn
Schemat|c Des|gn
W A deLalled schemaLlc wlLh pln connecLlon of lC mlcroconLroller ls provlded ln Lhe llgure
W Washlng machlne defaulL parameLers and user seLLable
parameLers are sLored ln exLernal LL8CM lnLernal
LL8CM of Lhe lC ls used Lo sLore sLaLus of Lhe washlng
machlne 1he sLaLus ls regularly logged Lo Lhe lnLernal
LL8CM ln Lhe evenL of power fallure or whenever
program reseLs sLaLus flags are read from Lhe lnLernal
LL8CM and Lhus sLaLus of Lhe machlne ls deLermlned
and operaLlon ls conLlnued from Lhe polnL of
lnLerrupLlon Accesslng of lnLernal LL8CM ls fasLer
compared Lo exLernal LL8CM lC18l432 provlde 236
byLes of lnLernal LL8CM LhaL ls noL sufflclenL for sLorlng
parameLers of machlne lor Lhls purpose exLernal
LL8CM ls used uependlng on Lhe mode flag and sLaLus
flag condlLlons correspondlng machlne parameLers are
read from Lhe exLernal LL8CM and Lemporarlly sLored
ln 8AM and operaLlons are performed
W 81C uS1303 ls lnLerfaced Lo Sl porL of Lhe
mlcroconLroller 1hls 81C ls used as Llmlng
reference for all Llmlng calculaLlon of machlne
Whenever a parLlcular mode sLarLs 81C ls
lnlLlallzed Lo zero and Lhere onwards 81C ls
read and compared wlLh Lhe seL Llmlngs wlLh
Lhe baLLery backup provlslon acLual 81C can
also be lmplemenLed Slnce lC allows elLher
l2C or Sl mode aL a Llme whenever we need
Lo access LL8CM or 81C MSS porL of Lhe
lC has Lo be conflgured Lo respecLlve
proLocol
W In C|rcu|t Ser|a| rogramm|ng (ICS) ls
accompllshed uslng plns CM CC CC and
acLlve low MCL8 1hese plns are also used Lo
883 886 and 887 1o saLlsfy boLh condlLlons
[umpers are provlded When programmlng of lC
ls requlred [umper seLLlngs '1' has Lo be used
AfLer programmlng [umpers have Lo be
replaced Lo seLLlng '2' 1hls allows Lhe use of
883 Lo 887 and brlngs Lhe conLroller from
programmlng mode Lo normal worklng mode
1hus lCS helps speedy programmlng and
debugglng of sofLware
D|agram show|ng f|ow of contro| |n terms of awash|ng mach|ne cyc|e
W Some of Lhe sensor ouLpuLs are fed Lo
lnsLrumenLaLlon ampllfler Lo brlng Lhe ouLpuL
level Lo 0v Lo 3v range uoor (lld) sensor ls
connecLed Lo exLernal lnLerrupL 0 lgh
prlorlLy ls asslgned Lo Lhls lnLerrupL 1hus
openlng of Lhe door causes Lrlggerlng of ln10
and ln10 lS8 lmmedlaLely sLops Lhe machlne
and lnforms Lhe user Analog lnpuL channels
An2 An3 and An4 can be used Lo upgrade
Lhe sysLem wlLh addlLlonal sensors
W eypad ls connecLed Lo C81u eypad and
meanlng of keys are shown ln llgure (2) ull
up reslsLors are connecLed Lo 8u0 Lo 8u3 Lo
enable keypad press deLecLlon C8lng 8u4 Lo
8u7 achleves Lhls and ouLpuL ls glven Lo
exLernal lnLerrupL 1(ln11) When any of Lhe
keys ls pressed C8ed ouLpuL becomes hlgh and
ln11 Lrlggers ln11 lS8 does a keypad scan and
approprlaLely performs Lhe operaLlon
W MoLor speed sensor ls glven Lo 11Cl whlch ls
an exLernal clock lnpuL Lo Llmer1/Llmer3 1lmer
ls conflgured ln counLer mode for calculaLlng Lhe
speed Speed ls calculaLed by counLlng pulse
ouLpuL from Lhe sensor for one second
keypad and key Iunct|ons
W MoLor dlrecLlon drlver clrculL deLermlnes Lhe
dlrecLlon of Lhe moLor MoLor forward dlrecLlon
drlves Lhe currenL ln forward dlrecLlon and moLor
roLaLes forward MoLor reverse dlrecLlon drlver does
Lhe opposlLe of lL SofLware has Lo Lake care LhaL
boLh are noL acLlvaLed aL a Llme Speed of Lhe moLor
ls conLrolled uslng WM drlver Speed of Lhe moLor
and hence Lhe drum varles ln dlfferenL phases of
washlng cycles Speed proflle of Lhe washlng
machlne drum ls lllusLraLed ln llgure (3) 8efore
changlng Lhe dlrecLlon of Lhe moLor WM ouLpuL
musL be made zero WM ouLpuL ls varled as per
Lhe calculaLed speed Lo malnLaln consLanL speed
durlng wash cycles
Speed rof||e of D|fferent Wash|ng Cyc|es
W orL plns 8L1 and 8L2 are fed Lo waLer valve
drlvers whlch conLrol Lhe flow of waLer whlle 8L0
ls connecLed Lo heaLer relay uedlcaLed LCu wlLh
3wlre lnLerface ls used 3 wlres conslsL of daLa
llne clock and Chlp SelecL (CS) 8ackllghL conLrol ls
also provlded CSM module ls lnLerfaced uslng
serlal porL SLandard A1 command seL ls used Lo
communlcaLe wlLh CSM module
W lL ls assumed LhaL when sensor ouLpuLs reach
mlcroconLroller lnpuLs lL has maxlmum swlng of
0v Lo 3v lL ls also assumed LhaL WM drlver
clrculL conLrols gearbox and cluLch mechanlsms
ower supply clrculLs and regulaLors are noL
shown ln Lhe llgure (1) SulLably deslgned SMS
and AC regulaLors Lake care of power supply
requlremenL of each block
Software Des|gn
W 8ased on Lhe speclflcaLlon and hardware deslgn
flowcharL/algorlLhm/pseudo code for Lhe sofLware
can be deslgned 1he overall flow of Lhe sofLware ls
shown ln llgure (4) 1o malnLaln modularlLy and for
easy undersLandlng machlne funcLlonallLles are
dlvlded lnLo funcLlons name of dlfferenL funcLlons
and whaL each funcLlon does has been brlefly
deflned bellow
W defh header flle Lhls flle lncludes all porL pln
deflnlLlons global varlable declaraLlons address
asslgnmenLs macro deflnlLlons funcLlon
proLoLypes
W IN10 ISk exLernal lnLerrupL servlce rouLlne has hlghesL prlorlLy
door sensor ouLpuL ls connecLed Lo lL a low Lo hlgh LranslLlon
Lrlggers Lhe lnLerrupL lf machlne ls runnlng lmmedlaLely sLops and
alarms lf machlne ls noL runnlng lL won'L sLarL unless lld ls closed
(sensor ouLpuL goes low) message ls senL Lo user ln boLh condlLlons
alarm acLlvaLed
W IN11 ISk exLernal lnLerrupL 1 has second prlorlLy keypad acLlvlLy ls
deLecLed here calls scan_keypad() rouLlne as per keypad acLlvlLy
seLs Lhe parameLer and lnlLlallzes Lhe acLlvlLy Cne of Lhe cruclal
sofLware rouLlnes
W Ser|a| ISk occurrence of Lhls lnLerrupL means LhaL a command ls
recelved aL CSM senL by Lhe user lS8 reads Lhe message from Lhe
CSM module and seLs Lhe parameLers lnlLlallzes Lhe acLlvlLy
accordlngly sends back sLaLus/acknowledgemenL Lo user used
funcLlons read_from_CSM() wrlLe_Lo_CSM()
W fu||y_automat|c_mode() cloLhe quallLy ls lnsLanLaneously
sensed(sLaln sensor lnsLalled) and amounL of waLer wash cycles and
Llmlng requlremenLs are opLlmlzed accordlngly parameLers are seL
and acLlvlLles are lnlLlallzed and monlLored Llll Lhe compleLlon of
work used funcLlons mosL of Lhe funcLlons
W sem|_automat|c_mode() acLlvaLed by keypad scan rouLlne dlsplays
predeflned seml_auLo1() Lo seml_auLo_n() modes can be scrolled up
or down by Lhe user afLer Lhe mode ls selecLed and enLered by Lhe
user seLs Lhe parameLer and lnlLlallzes Lhe acLlvlLles Lhen Lransfers
Lhe conLrol Lo monlLor_keypad() rouLlne
W manua|_mode() acLlvaLed by monlLor_keypad() upon enLerlng lL
asks Lhe user Lo enLer dlfferenL parameLers llke waLer level waLer
LemperaLure wash Llme AfLer recelvlng Lhe parameLers lL walLs for
'L' buLLon Lo be pressed for sLarLlng Lhe operaLlon provldes opLlons
llke wash rlnse spln draln opLlons can be selecLed by scrolllng up or
down used funcLlons rlns()wash() spln() draln()
check_waLer_LemperaLure()
W f|||_tub() lnpuL amounL of waLer Lo be fllled reLurn none acLlvaLes
waLer lnleL checks for waLer level by readlng pressure sensor and
callbraLlng lL lf fllled waLeramounL of waLer Lo be fllled exlL Lhe
funcLlon else conLlnue
W wash() lnpuL LoLal wash Llme Lumble wash Llme reLurn none reads
81C calls Lhe Lumble_wash() rouLlne Lo perform Lumble wash and
passes Lhe Lumble wash Llme Lo Lhls rouLlne lf wash Llme ls over exlL
funcLlon else repeaL Lhe process used funcLlons Lumble_wash()
read_81C()
W r|nse() lnpuL rlnse Llme moLor speed reLurn none reads 81C as
per recelved moLor speed generaLes Lhe WM ouLpuL checks for
Llme ouL reads moLor speed lf (moLor speedrequlred speed) reduce
WM ouLpuL else lf(moLor speed
W sp|n() lnpuL spln Llme spln speed reLurn none calls Lumble_wash()
Lo balance Lhe load remalnlng operaLlons are same as rlnse()
W dra|n() acLlvaLes waLer ouLleL checks waLer level by readlng pressure
sensor lf(waLer levelempLy) deacLlvaLe ouLleL and exlLs else
conLlnues Lo read and check
W read_LLkCM() lnpuLsLarLlng address number of byLes Lo be
read reLurn sLarLlng address of read daLa reads Lhe exLernal
LL8CM and sLores Lhe read daLa ln an array
W wr|te_LLkCM() lnpuL sLarLlng address of source array sLarLlng
address of desLlnaLlon array reLurn none wrlLe Lhe daLa from Lhe
source array Lo Lhe LL8CM
W read_k1C() reads Lhe 81C Llme hour mlnuLe and seconds sLores ln
dedlcaLed varlable used funcLlons read_hour() read_mlnuLe()
read_second()
Cvera|| Software I|ow D|agram
W read_hour() lnpuL none reLurn hour daLa reads Lhe hour daLa from Lhe 81C and
reLurns Lo called funcLlon
W read_m|nute() lnpuL none reLurn mlnuLe daLa reads Lhe mlnuLe daLa from Lhe
81C and reLurns Lo called funcLlon
W read_second() lnpuL none reLurn second value reads Lhe second daLa from Lhe
81C and reLurns Lo called funcLlon
W wr|te_to_GSM() lnpuL sLarLlng address of Lhe message slze of message reLurn
none wrlLes Lhe message Lo CSM module uslng sLandard A1+CMCS command
W read_from_GSM() reads Lhe message from CSM uslng A1+CMC8 command
W de|ete_messageGSM() lnpuL locaLlon from whlch message has Lo be deleLed
reLurn none deleLes Lhe message from CSM uslng A1+CMCu command
W check_water_temp() lnpuL none reLurn LemperaLure checks waLer LemperaLure
by readlng Lhe LemperaLure sensor callbraLes and reLurns Lo called funcLlon
W heat_water() lnpuL LemperaLure reLurn none checks Lhe waLer LemperaLure
lf(calculaLed LemperaLure
W ca|cu|ate_motor_speed() lnpuL none reLurn speed reads 81C seconds enable
counLer1/3 lf one second ls over sLop counLer read and reLurns counLer value else
check agaln
W enab|e_SI() MSS porL ls conflgured as Sl porL by lnlLlallzlng correspondlng
reglsLers
W d|sab|e_SI()MSS porL ls conflgured so as Lo dlsable Sl
W enab|e_I2C() MSS porL ls conflgured as l2C porL by lnlLlallzlng
correspondlng reglsLers
W d|sab|e_I2C()MSS porL ls conflgured so as Lo dlsable l2C
W scan_keypad()lnpuL none reLurn pressed key value scans Lhe
keypad and reLurns Lhe pressed key value
W mon|tor_keypad() uses scan_keypad() funcLlon Lo scan Lhe keypad
AfLer recelvlng key value deLermlnes Lhe respecLlve funcLlon and
Lransfers Lhe conLrol Lo respecLlve lower level funcLlons one of Lhe
very lmporLanL rouLlnes
W read_ADC() lnpuL channel number reLurn read AuC daLa
conflgures AuC for Lhe speclfled channel
W wr|te_LCD() lnpuL address daLa reLurn none wrlLes Lhe daLa Lo
speclfled address
W |n|t_LCD() lnlLlallzes Lhe LCu accordlng Lo Lhe lnlLlallzaLlon
commands
W send_command_LCD() lnpuL command reLurn nonewrlLes Lhe
command Lo LCu uslng wrlLe_LCu() funcLlon
W set_WM()lnpuL moLor speed reLurn none seLs WM frequency
as per moLor speed
W llgure summarlzes Lhe overall flow of sofLware lL shows Lree sLrucLure
of very lmporLanL monlLor_keypad() funcLlon 1hls funcLlon lnvokes
many oLher funcLlons dependlng on Lhe pressed key and seL or reseL
mode sLaLus flags SLrlcLly speaklng Lhls funcLlon does noL execuLe any
conLrol operaLlons lnsLead lL Lransfers Lhe conLrol Lo maln program Lo
handle Lhe lmporLanL operaLlons and Lhus lndlrecLly execuLes lL lor
example lf key 'A' ls pressed Lhen funcLlons undersLands LhaL fully
auLomaLlc mode has Lo be execuLed 1he monlLor_keypad() funcLlon
walLs for Lhe key 'L' ls Lo be pressed and upon deLecLlng Lhe key press
lL lnlLlallzes Lhe operaLlons relaLed Lo fully auLomaLlc mode lL seLs all
relaLed mode sLaLus flags and uploads Lo lnLernal LL8CM loads baslc
parameLers from Lhe exLernal LL8CM Lo Lhe 8AM and Lransfers
conLrol Lo maln() funcLlon Maln funcLlon performs operaLlons as per
sLaLus flag condlLlon 1hus washlng mode relaLed operaLlons are
lndlrecLly execuLed by lS8 8uL 'Cn/Cff' and 'S'seLLlngs are dlrecLly
execuLed by lS8 Whlle seLLlng Lhe parameLers as per user
requlremenLs Lhrough keypad parameLers are read and dlrecLly
uploaded Lo predeflned address locaLlons uelayed sLarL opLlon can be
seL Lo each seml auLomaLlc mode
W Cne of Lhe messages provldes Lhe opLlon Lo enLer
Lhe delay Llme uefaulL delay ls zero Slnce
exLernal 81C ls used as Llme base lC Llmer
modules can be efflclenLly used ln programmlng
Any one of Lhe Llmer lnLerrupLs can be used Lo
read A/u module ln regular lnLerval of Llme
lnsLead of readlng ln maln() funcLlon 8esulLs are
sLored ln predeflned varlables urawback of Lhls
meLhod of programmlng ls LhaL read value may
noL be 'lnsLanLaneous' lL may be older by some
mlcroseconds or mllllseconds
W 1he proposed deslgn can be easlly a parL of home
auLomaLlon 1he sysLem ls flexlble and safer Lo use
SmarL feaLures can be added or wlLhdrawn as per
requlremenLs and hence deslgn ls fully cosL effecLlve
1he same deslgn meLhodology adopLed here can be
exLended Lo deslgn Lhe commerclal producL lf cosL ls
noL a crlLerlon Lhen hardware can be easlly modlfled
Lo add an lndependenL 8LuC (or Lhree phase) moLor
conLroller elLher Lhrough mulLlplexed serlal porL or by
replaclng CSM module by 8LuC (Lhree phase) moLor
conLroller
arentheses and backs|ashes denote comments L|st|ngs beg|n w|th
pr|m|t|ve funct|ons
( Washlng Machlne Lmbedded AppllcaLlon ) orL asslgnmenLs 01
CCnS1An1 C81 blLmask name blLmask name 1
CCnS1An1 MC1C8 8 CCnS1An1 lAuCL1S 2 CCnS1An1
CLu1C 16 CCnS1An1 uL1L8CLn1 4 CCnS1An1 uM 32
CCnS1An1 LLvLLA colon beglns a new deflnlLlon
uevlce conLrol Cn ( mask ) C81 C[ C8 C81 C! Cll ( mask
) lnvL81 C81 C[ Anu C81 C! ueflnlLlons can conLaln generlc
SwlfLx words and any oLhers youve deflned
1lmlng funcLlons SLCCnuS ( n ) 0 ?uC 1000 MS LCC Mlnu1LS
( n ) 60 * SLCCnuS 1lLLluLL ( ) WalL Llll level swlLch ls
on 8LCln C81 C[ LLvLL Anu un1lL so appllcaLlonspeclflc
funcLlons are deflned ln Lerms of prevlous deflnlLlons
Washlng machlne funcLlons Auu ( porL ) uu Cn 10 SLCCnuS
Cll u8Aln ( ) uM Cn 3 Mlnu1LS ACl1A1L ( ) MC1C8
Cn 10 Mlnu1LS MC1C8 Cll Sln ( ) CLu1C Cn MC1C8
Cn 3 Mlnu1LS MC1C8 Cll CLu1C Cll uM Cll llLL1u8 (
) lAuCL1S Cn 1lLLluLL lAuCL1S Cll Wash cycles WAS ( )
llLL1u8 uL1L8CLn1 Auu ACl1A1L u8Aln 8lnSL ( ) llLL1u8
ACl1A1L u8Aln unLll you reach Lhe maln appllcaLlon deflnlLlon
1oplevel conLrol WASL8 ( ) WAS Sln 8lnSL Sln
LIBRARY eee;
USE eee.std_ogc_1164.a;
USE eee.std_ogc_sgned.a;
ENTITY pause IS PORT( run:IN
std_ogc; pause:IN std_ogc;
ps:OUT std_ogc );
END; ARCHITECTURE status of
pause IS SIGNAL p:std_ogc;
BEGIN PROCESS(pause) BEGIN
IF(run='0')THEN p<='0';
ELSE IF(pause'event and
pause='1')
THEN
p<=not p;
END IF;
END IF;
END PROCESS;
ps<=p;
END;
rogram
W 8efrence
W hLLp//aslcsocblogspoLcom/2007/12/embedded
sysLemforauLomaLlcwashlnghLml
W hLLp//wwwgooglecoln/lmgres?qWASlnC+MACl
nL+hardware+deslgnhlennord1blw1280blh
632LbmlschLbnlduplmy979474gLMlmgrefurl
W hLLp//wwwfurnlLurehomedeslgncom/2009/06/docl
dmm9dC8ZCmh1CMlmgurl
W hLLp//wwwfurnlLurehomedeslgncom/wp
conLenL/uploads/2009/06/xeros_washlng_machlne[pg
w328h
W clcamacuk

Вам также может понравиться