Matlab&DAQ

Embed Size (px)

Citation preview

  • 8/15/2019 Matlab&DAQ

    1/27

    ANADOLU UNIVERSITY

    ENGINEERING AND ARCHITECTURE FACULTY

    ELECTRICAL AND ELECTRONICS ENGINEERING

    DEPARTMENT( SPRING – 2008 )

    EEM494 Digit! C"#t$"! S%&t'& L"$t"$%

    MATLA* AND HARD+ARE PRO,ECT REPORT ( 29-0.-08 )

    NAME OF INSTRUCTOR / A&&i&t P$"1 A%3# AY*AR

    NAME OF STUDENT / D'#i 5ER6MO7LU

    STUDENT ID/ 8880::08;

    NAME OF STUDENT / E#'& DAYANGA<

    STUDENT ID/ :;9;0;.4

  • 8/15/2019 Matlab&DAQ

    2/27

    TA*LE OF CONTENTS

      Pg'&

    S=>'?t ....................................................................................................................................1

    I#t$"=?ti"# .......................................................................................................................1

    2 P=$@"&' "1 t' R'@"$t 

    2 ADVANTECH PCI 0 DB D'i?'............................................................................1

      22 F=#'#t!& "1 R'!Ti' T""!" i# Mt!........................................................2

      22 R'! Ti' +i#"& T$g't (RT+T) T""!"..................................................2 

    222 +t "'& R'!Ti' '#............................................................................3 

    22: R'! Ti' +"$&"@ T""!" # R'!Ti' 5'$#'! (OS) =i!t i# Mt!.3

      2: H" t" i#t'$1?' ADVANTECH PCI 0 DB D'i?' it Si=!i#.......................5

      24 Di11i?=!ti'& t" U&' t' PCI 0 DAJ& C"##'?t"$ .................................................11

      24 T""!&...................................................................................................................11 

    242 Mi#g O=$ O# P$i#t' Ci$?=it.....................................................................11

     24: N"t'& "=t t' Mit=$' ..................................................................................12

      2. DC M"t"$ S@'' C"#t$"! i DAJ # MATLA*......................................................13

      2; Di&@!%i#g M"t"$& S@'' (RPM) it S''# S'g'#t...........................................17

      2 R'&=!t&/ C"@$i&"# "1 t' ?t=! &%&t'& "=t@=t& # &i=!ti"# "=t@=t&....20

      28 G$% ?"'......................................................................................................................23

    : C"#?!=&i"# …....................................................................................................................24

  • 8/15/2019 Matlab&DAQ

    3/27

  • 8/15/2019 Matlab&DAQ

    4/27

    22 F=#'#t!& "1 R'!Ti' T""!" i# Mt!

    Before %eginning t(e ad!u&t*ent of configuration& in )i*u$in+ for PCI 1710 'e 'i$$introduce t(e funda*enta$ roce&& and idea of (o' a PC 2articu$ar$- Mat$a%3 co**unicate&

    'it( a PCI Daq device over indo'& 5erating )-&te* in rea$.ti*e and (o' )i*u$in+ 

    *anage& rea$.ti*e a$ication u&ing /ea$ Ti*e indo'& Target Too$%o under indo'&'(ic( i& a non.rea$ ti*e 5erating )-&te*, T(en 'e 'i$$ i&&ue interfacing t(e PCI 1710 Daq

    device 'it( )i*u$in+ &te %- &te,

    22 R'! Ti' +i#"& T$g't (RT+T) T""!"

    /ea$.Ti*e indo'& Target 2/TT3 &oft'are i& a %ui$t.in too$%o under )i*u$in+ '(ic( ena%$e& -ou to run )i*u$in+ and )tatef$o' *ode$& in rea$ ti*e on -our co*uter, 5ne

    can create and contro$ a rea$.ti*e a$ication t(roug( )i*u$in+ &oft'are, /ea$.Ti*e indo'&

    Target inc$ude& I;5 device driver& to &uort nu*erou& nu*%er& of I;5 %oard&4 ena%$ing u& to

    interface to Daq device&4 &en&or&4 actuator&4 and ot(er device& for eeri*entation4deve$o*ent4 and te&ting of rea$.ti*e &-&te*&, )o /TT &uort& our ADVANETCH PCI

    1710 Daq Device too,

    /ea$.Ti*e indo'& Target inc$ude& a &et of I;5 %$oc+& t(at rovide connection&

     %et'een t(e (-&ica$ I;5 %oard and t(e rea$.ti*e *ode$, 5ne can run (ard'are.in.t(e.$oo

    &i*u$ation& 2HIL)3 and quic+$- o%&erve (o' t(e )i*u$in+ *ode$ re&ond& to rea$.'or$d %e(avior, T(e B$oc+ Li%rar- $et& -ou connect I;5 &igna$& for oeration 'it( nu*erou& I;5

     %oard&, )o /TT &uort& our Daq device ADVANTECH PCI 1710 too,

    Here 'e (ave *entioned a%out t(e (ard'are.in.t(e.$oo &i*u$ation& 2HIL)3, HIL) i& a

    device t(at foo$& -our e*%edded &-&te* into t(in+ing t(at it@& oerating 'it( rea$.'or$d inut&and outut&4 in rea$.ti*e, )o 'e &i*u$ate t(e &-&te* a& if it i& in a rea$.ti*e environ*ent,

     

    =igure &(o'& a &i*$e %$oc+ diagra* of an e*%edded &-&te* %eing te&ted u&ing HIL),

  • 8/15/2019 Matlab&DAQ

    5/27

    222 +t "'& R'!Ti' '#

    e *entioned a%out running or &i*u$ating rea$.ti*e a$ication&, But '(at *a+e& ana$ication a rea$.ti*e one And %e&ide& '(at i& a rea$.ti*e a$ication fir&t of a$$ T(e

    an&'er& to t(e&e que&tion& are *ade ea&- once -ou (ave covered t(e eact *eaning of rea$.

    ti*e, T(e rea$.ti*e a$ication i& an a$ication t(at run& concurrent$- 'it( t(e inut&&u$ied and give& t(e outut 'it(in a neg$ecta%$e a*ount of de$a-4 t(at i& it *u&t re&ond to

    t(e given inut& in no ti*e &o t(at t(e a$ication doe& not cra&(, Here are &o*e rea$.ti*e

    a$ication& t(at 'e face in our dai$- $ife

    • Videoconference A$ication&

    • VoIP 2Voice 5ver Internet Protoco$3

    • 5n$ine >a*ing

    • Pendu$u*.Cart )-&te* in t(e $a%

    T(e rea$.ti*e a$ication&4 &-&te*& *u&t %e contro$$ed4 o%&erved and &i*u$ated in rea$.

    'or$d environ*ent concurrent$- t(at t(e- *u&t not %e faced 'it( unredicta%$e de$a-&, Ani*ortant que&tion ari&e& (ere I& indo'& a /ea$.Ti*e 5erating )-&te* 2/T5)3 t(at

    a$ication& under indo'& run rea$.ti*e Con&ider t(e &i*$e ea*$e %e$o' ou 'ant to$i&ten to &o*e *u&ic and -ou dou%$e c$ic+ed on -our favorite &ong to %e $a-ed 'it( ina*,

    Even at fa&t co*uter -ou 'ait 1.: &econd& for t(e &ong to %e oened and if -ou are running

    &o*e ot(er a$ication& %e&ide& ina* t(i& 'aiting eriod *a- %e F." &econd&, )o t(e&-&te* face& 'it( unredicta%$e de$a-, A& c$ear$- &een fro* t(i& ea*$e indo'& i& not a

    /ea$.Ti*e 5erating )-&te* 2/T5)3,

    22: R'! Ti' +"$&"@ T""!" # R'!Ti' 5'$#'! (OS) =i!t i# Mt!

    e are to run rea$.ti*e a$ication& in rea$.ti*e 'it( Mat$a%;)i*u$in+ under indo'&, But a& 'e (ave *entioned a%ove indo'& can not run a$ication& in rea$.ti*e

     %ecau&e of t(e unredicta%$e de$a-&, Mat$a%4 articu$ar$- /ea$.Ti*e indo'& Target Too$%o

    u&e& a &*a$$ /ea$.Ti*e Gerne$ 2in t(e genera$ *eaning +erne$ *ean& 5erating )-&te*3 toen&ure t(at t(e rea$.ti*e a$ication run& in rea$ ti*e, T(e +erne$ intercet& t(e interrut fro*

    t(e PC c$oc+ %efore t(e indo'& oerating &-&te* receive& it, ou *a- need to revi&e t(e

    $ecture note& in Microroce&&or& I or II cour&e& for t(e concet of interrut, T(e +erne$ t(enu&e& t(e interrut to trigger t(e eecution of t(e )i*u$in+ *ode$, A& a re&u$t4 t(e +erne$ i& a%$e

    to give t(e rea$.ti*e a$ication t(e (ig(e&t riorit- avai$a%$e,

    T(e rea$.ti*e +erne$ can u&e t(e CPJ& re&ource& direct$- 'it(out t(e er*i&&ion of indo'& and u&e& t(e %ui$t.in PC c$oc+ a& it& ri*ar- &ource of ti*e, Becau&e of t(e&e

     roertie&4 a$ication& under t(e /ea$.Ti*e Gerne$ &u$ied 'it( t(e Mat$a% can %e run in

    rea$.ti*e,

  • 8/15/2019 Matlab&DAQ

    6/27

    ou *u&t in&ta$$ t(e rea$.ti*e +erne$ once to u&e it, In&ta$$ing t(e +erne$ configure& it to

    &tart running in t(e %ac+ground eac( ti*e -ou &tart -our co*uter, To in&ta$$ t(e +erne$

    In t(e MATLAB Co**and indo'4 t-e

    rt'intgt Kin&ta$$

    And recede t(e in&ta$$ation %- re&&ing -,

    )ince 'e are to run )i*u$in+ *ode$& under t(e rea$.ti*e +erne$4 )i*u$in+ need& to

    convert t(e created *ode$& '(ic( con&i&t of %$oc+& into C code to generate an eecuta%$e fi$eto %e run under t(e rea$.ti*e +erne$, More reci&e$-4 'e need to convert t(e )i*u$in+& %$oc+&

    into C code to %e u&ed 'it( t(e rea$.ti*e +erne$, Here t(e /ea$.Ti*e or+&(o Too$%o

    co*e& into t(e con&ideration,

    /ea$.Ti*e or+&(o generate& and eecute& &tand.a$one C code for deve$oing andte&ting a$gorit(*& *ode$ed in )i*u$in+, T(e re&u$ting code can %e u&ed for *an- rea$.ti*e

    and non.rea$.ti*e a$ication&, ou can tune and *onitor t(e generated code u&ing )i*u$in+  %$oc+& and %ui$t.in ana$-&i& caa%i$itie&4 or run and interact 'it( t(e code out&ide t(e

    MATLAB and )i*u$in+ environ*ent,

    Ba&ica$$- /ea$.Ti*e or+&(o rovide& t(e uti$itie& to convert our )i*u$in+ *ode$

    into C code %- t(e /ea$.Ti*e or+&(o Code >eneration )oft'are, T(en it u&e& 5en

    atco* C;C Co*i$er to co*i$e and create a rea$.ti*e eecuta%$e fi$e 'it( ,r'd eten&ionto %e run 'it( t(e rea$.ti*e +erne$, T(i& co*i$er i& &u$ied 'it( t(e /ea$.Ti*e indo'&

    Target &oft'are and no ot(er co*i$er& are needed or can %e u&ed,

    )i*u$in+ Eterna$ Mode Interface Modu$e rovide& co**unication %et'een )i*u$in+ &oft'are and t(e rea$.ti*e a$ication, T(i& *odu$e ta$+& direct$- to t(e rea$.ti*e +erne$ and i&

    u&ed to &tart t(e rea$.ti*e a$ication4 c(ange t(e %$oc+ ara*eter&4 and retrieve &coe data,

    )o )i*u$in+ Eterna$ Mode a$$o'& u& to c(ange ara*eter& %- editing t(e %$oc+ diagra* ando%&erve t(e effect of t(e&e c(ange& '(i$e running a &i*u$ation in eterna$ *ode4 in rea$.ti*e,

     Ne' ara*eter va$ue& are auto*atica$$- tran&ferred to rea$.ti*e a$ication '(i$e it i&

    running, T(at i& t(e eact *eaning of t(e 'ord rea$.ti*e, But note t(at not a$$ ara*eter can %e c(anged in rea$.ti*e, (en &o*e ara*eter& (ave %een c(anged t(e code need& to %e

    reco*i$ed,

    Para*eter& are c(anged fro* t(e B$oc+ Para*eter Dia$og Boe&, 5ening a dia$og %ofor a &ource %$oc+ cau&e& )i*u$in+ to au&e, (i$e )i*u$in+ i& au&ed4 -ou can edit t(e

     ara*eter va$ue&, ou *u&t c$o&e t(e dia$og %o to (ave t(e c(ange& ta+e effect and a$$o'

    )i*u$in+ to continue, Ea*$e ara*eter& a*$itude of a gain4 frequenc- of a &ine 'ave,)coe %$oc+& can %e u&ed to vi&ua$i

  • 8/15/2019 Matlab&DAQ

    7/27

    Here is the basic procedure of how a real-time application is run and configured

    e create a rea$.ti*e a$ication in t(e &a*e 'a- a& 'e create an- ot(er )i*u$in+ *ode$ %-

    u&ing t(e &tandard )i*u$in+ B$oc+&, T(e /ea$.Ti*e or+&(o code generation &oft'arecreate& C code fro* our )i*u$in+ *ode$, T(en t(e 5en atco* C;C Co*i$er co*i$e&

    t(e C code to an eecuta%$e t(at run& 'it( t(e rea$.ti*e +erne$, (en running our *ode$& inrea$.ti*e 4 /TT &oft'are cature& t(e &a*$ed data fro* one or *ore inut c(anne$&4 u&e&

    t(e data a& inut to our %$oc+ diagra* *ode$4 i**ediate$- roce&&e& t(e data and &end& it %ac+ to t(e out&ide 'or$d t(roug( an outut c(anne$ on our I;5 %oard,

    2: H" t" i#t'$1?' ADVANTECH PCI 0 DB D'i?' it Si=!i#

    !reating a "odel

     You need to create a Simulink model before you can run a simulationor create a real-time application.[1]. Here is the Simulink Model, let name it

    deneme.mdl

     

    !onfiguring a "odel

    After you create a Simulink model, you can enter con!uration andsimulation parameters  for u&e %- /ea$.Ti*e or+&(o code generation &oft'are for 

    creating C code and %ui$ding a rea$.ti*e a$ication, . "hese parameters control manyproperties of the model for simulation and code !eneration. "his sectioncontains the essential information you need #hen settin! con!urationparameters for a $eal-"ime %indo#s "ar!et application.

      After -ou create a

    )i*u$in+ *ode$4 -ou can u&e t(e rt'inconfig&et function to &ecif- a defau$t /ea$.Ti*e

    indo'& Target configuration &et for t(e *ode$,1, But for t(e &a+e of under&tanding t(e

     rocedure 'e 'i$$ fo$$o' t(e configuration *anua$$-,

    #ntering !onfiguration and $imulation %arameters "anuall&

    T(e configuration ara*eter& give infor*ation to )i*u$in+ &oft'are for running a

    &i*u$ation in rea$.ti*e,

    1 In t(e )i*u$in+ 'indo'4 and fro* t(e $imulation *enu4 c$ic+ !onfiguration %arameters,In t(e Configuration Para*eter& dia$og %o4 c$ic+ t(e $ol'er ta%, T(e $ol'er ane oen&,

    2 In t(e $tart time fie$d4 enter 0,0, In t(e $top time fie$d4 enter t(e a*ount of ti*e -ou 'ant-our *ode$ to run, =or ea*$e4 enter 10,0 &econd&,

  • 8/15/2019 Matlab&DAQ

    8/27

    3 =ro* t(e (&pe $i&t4 c(oo&e =ied.&te, /ea$.Ti*e or+&(o code generation &oft'are doe&

    not &uort varia%$e &te &o$ver&,

    4 =ro* t(e $ol'er $i&t4 c(oo&e a &o$ver, =or ea*$e4 c(oo&e t(e genera$ uro&e &o$ver ode,

    5 In t(e )i*ed step si+e fie$d4 enter a &a*$e ti*e, =or ea*$e4 enter 0,001 &econd& for a

    &a*$e rate of 1000 &a*$e&;&econd,

    , =ro* t(e (asing "ode $i&t4 c(oo&e )ing$eTa&+ing, 2=or *ode$& 'it( %$oc+& t(at (ave

    different &a*$e ti*e&4 c(oo&e Mu$tiTa&+ing,3

    our $ol'er ane $oo+& &i*i$ar to t(e net figure,

    7 C$ic+ t(e Hardware mplementation node,

    / =ro* t(e e'ice t&pe $i&t4 c(oo&e F:.%it /ea$.Ti*e indo'& Target,

    Jnder #mulation hardware4 &e$ect None,

    10 C$ic+ t(e eal-(ime orshop node, T(e eal-(ime orshop ane oen&,

    11 In t(e (arget selection &ection4 c$ic+ t(e rowse %utton at t(e ( s&stem target file $i&t,T(e $&stem (arget )ile rowser oen&,

  • 8/15/2019 Matlab&DAQ

    9/27

    12 )e$ect t(e &-&te* target fi$e for %ui$ding a /ea$.Ti*e indo'& Target a$ication4 and

    c$ic+ 6 ,

    T(e &-&te* target fi$e rt'in,t$c4 t(e te*$ate *a+efi$e rt'in,t*f4 and t(e *a+e

    co**and *a+ert' are auto*atica$$- entered into t(e eal-(ime orshop ane,

    our eal-(ime orshop ane $oo+& &i*i$ar to t(e figure,

    13 C$ic+ ppl& to a$- t(e c(ange& to -our *ode$ and 5G for c$o&ing t(e ane,1

    !reating a eal-(ime pplication

    After -ou enter ara*eter& into t(e Configuration Para*eter& dia$og %o for u&e %- t(e

    /ea$.Ti*e or+&(o code generation &oft'are4 -ou can %ui$d a rea$.ti*e a$ication,

    1 In t(e )i*u$in+ 'indo'4 fro* t(e (ools *enu4 oint to eal-(ime orshop4 and t(enc$ic+ uild "odel. 2ctr$B3, T(e %ui$d roce&& doe& t(e fo$$o'ing

    8 T(e /ea$.Ti*e or+&(o code generation &oft'are create& t(e C code &ource fi$e& dene*e,cand dene*e,(,

  • 8/15/2019 Matlab&DAQ

    10/27

    8 T(e *a+e uti$it- *a+ert',ee create& t(e *a+efi$e dene*e,*+ fro* t(e te*$ate *a+efi$e

    rt'in,t*f,

    8 T(e *a+e uti$it- *a+ert',ee %ui$d& t(e rea$.ti*e a$ication dene*e,r'd u&ing t(e

    *a+efi$e dene*e,*+ created a%ove, T(e fi$e rt'in*ode$,r'd i& a %inar- fi$e t(at 'e refer toa& -our rea$.ti*e a$ication, ou can run t(e rea$.ti*e a$ication 'it( t(e /ea$.Ti*e

    indo'& Target +erne$,

    2 Connect -our )i*u$in+ *ode$ to -our rea$.ti*e a$ication,

    #ntering dditional $cope %arameters for $ignal (racing

    )i*u$in+ eterna$ *ode connect& -our )i*u$in+ *ode$ to -our rea$.ti*e a$ication,

    T(i& connection a$$o'& -ou to u&e t(e )i*u$in+ %$oc+ diagra* a& a gra(ica$ u&er interface to

    -our rea$.ti*e a$ication,

    After -ou (ave created a rea$.ti*e a$ication4 -ou can enter &coe ara*eter& for 

    &igna$ tracing 'it( )i*u$in+ eterna$ *ode

    1 In t(e )i*u$ation 'indo'4 fro* t(e )i*u$ation *enu4 c$ic+ !onfiguration %arameters,

    2 )e$ect t(e eal-(ime indows (arget node,T(e eal-(ime indows (arget ane oen&,

    3 )e$ect t(e #*ternal mode c(ec+ %o, T(e eal-(ime indows (arget ane &(ou$d aear a& fo$$o'&,

  • 8/15/2019 Matlab&DAQ

    11/27

    4 C$ic+ 6 ,

    5 In t(e )i*u$ation 'indo'4 and fro* t(e (ools *enu4 c$ic+ #*ternal "ode !ontrol %anel,

    T(e Eterna$ Mode Contro$ Pane$ dia$og %o oen&,

    , C$ic+ t(e $ignal 9 (riggering %utton, T(e Eterna$ )igna$ O Triggering dia$og %o oen&,

    7 )e$ect t(e $elect all c(ec+ %o, =ro* t(e $ource $i&t4 c(oo&e manual, =ro* t(e "ode $i&t4

    c(oo&e normal,

    / In t(e uration fie$d4 enter t(e nu*%er of &a*$e oint& in a data %uffer, =or ea*$e4 to

    &ecif- a &a*$e rate of 1000 &a*$e&;&econd and a &to ti*e of 10 &econd&4 enter 10000

    )e$ect t(e rm when connecting to target c(ec+ %o,

    T(e Eterna$ )igna$ O Triggering dia$og %o $oo+& $i+e t(i&

    10 C$ic+ ppl& to a$- t(e c(ange& to -our *ode$ and c$o&e to c$o&e t(e ane,

  • 8/15/2019 Matlab&DAQ

    12/27

  • 8/15/2019 Matlab&DAQ

    13/27

    4 In t(e )i*u$ation 'indo'4 and fro* t(e $imulation *enu4 c$ic+ isconnect )rom (arget,

    24 Di11i?=!ti'& t" U&' t' PCI 0 DAJ& C"##'?t"$

    ;8Pi# SCSI F'!'

    T(e PCI DA card (a& 89.in connector4 &(o'n a%ove4 '(ic( inc$ude&Q ana$og 4digita$

    inut& and outut&4 ground& and ti*er;counter in&,

    =ir&t$-4 'e (ad a ro%$e* to te&t it %ecau&e in order to connect a ca%$e to t(i& connector i,e,

    a digita$ *eter& ca%$e& 'ere connected to it direct$- to *ea&ure t(e ana$og outut&, (i$edoing t(i&4 'e 'ere tr-ing to %e carefu$ to get rid of &(ort.circuit,

    In &(ort.circuit ca&e %et'een an- in& 4 it 'i$$ cau&e to get out of u&age of t(e DA card,

    =urt(er*ore4 $i+e t(at4 'e cannot connect on it *ore t(an t'o ca%$e&, In e$ectronic& &(oing

    center in Tur+e-4 an aroriate connector& are not &o$d, In &(ort4 'e cou$d not connect t(eca%$e& to t(e DA card efficient$- and 'e (ave decided to *a+e a circuit interface connector,

    24 T""!&

    a3 F" dou%$e connector& 2 +$e*en& 3

     %3 89.Pin )(ie$ded ca%$e

    c3 A co*uter 

    d3 A $a&er Printer 

    e3 Enoug( &i

  • 8/15/2019 Matlab&DAQ

    14/27

     !u&t $a&er rinted i& 'or+ed for it %ecau&e of it& &ecia$ c(e*ica$4 'e *ean t(at an- ot(er rinter 'i$$

    not 'or+ for PCB,

    A& a net &te4 'e carefu$$- tae to (o$d t(e rinted (oto aer on t(e c$eaned coer %oard in

    one o&ition 'it(out an- *ove*ent, After t(i& &te4 u&ing a ver- (ot iron4 for a $ong ti*e4 'e ut t(e

    Iron on our coer %oard %ecau&e 'e 'aited to *a+e t(e trac+ attern to tran&fer fro* t(e aer to t(e

    coer %oard, Actua$$-4 'e &ucceed t(i& art at a &econd ti*e, At fir&t tr-ing4 'e did not *a+e it

    enoug( (ot and ut t(e Iron on it for $ong4 and 'it(out 'aiting it get& coo$ after tran&ferring t(e trac+ 

    to it4 'e *ade t(e coer %oard and t(e rinted aer $eft eac( ot(er, =ortunate$-4 at t(e &econd ti*e4

    'e ut t(e Iron on t(e* for $ong ti*e4 and t(en4 'e ut it in 'ater4 t(en 'e o%&erved t(at in 'ater4 t(e

    coer $eft t(e aer ea&i$-,

    T(en4 'e ut it in t(e *iture of F00*$.H-drogen Peroide and #00.H-droc($oric Acidu&ing a enoug( $arge $a&tic cu, T(erefore4 t(e trac+& are aeared,

    =ina$$-4 'e c$eaned and dr- t(e %oard 'it(out da*aging t(e trac+&, In addition4 'e *ade a (o$e

    on t(e dot '(ere 'e ut t(e C$e*en& and connect to t(e ca%$e, After *a+ing (o$e& on it4 'e found out

    t(e ca%$e& &ort to &o$id it and t(en 'e &o$id it and C$e*en& on it and te&ted t(e* '(et(er t(ere i& a &(ortcircuit or not, In conc$u&ion4 t(ere 'a& no ro%$e* and 'e &ucceed it and it& icture i& %e$o'Q

    24: N"t'& "=t t' Mit=$'/

    a) Even t(oug( H-droc($oric Acid can %e %oug(t at ever-'(ere4 H-drogen Peroide i&

     !u&t &o$d in DET)AN co*an- in E&+i&e(ir due to t(e fact t(at it i& in t(e grou of dangerou&c(e*ica$,

     %3 T(eir rate &(ou$d %e 1;F,c3 (en 'e ut a coer %oard in t(i& *iture, A c(e*ica$ reaction &tart&,

    This reaction is;

    Cu H:5:  :HC$ .. R CuC$:  :H:5

    T(at i&4 after t(e reaction4 'ater and coer c$orid occur&, Coer +$orid4 CuC$ : i& a dangerou&

    ga&, T(erefore4 '(i$e doing t(i& &te4 t(i& ga& *u&t %e %reat(ed,

  • 8/15/2019 Matlab&DAQ

    15/27

    2. DC M"t"$ S@'' C"#t$"! i DAJ # MATLA*

    In t(i& art of our ro!ect4 'e contro$ t(e &eed of t(e DC *otor a& r* 2root er 

    *inute3 'it( PI contro$,

    T(e *otor feature&Q

    /SF,8Q '(ic( i& t(e tota$ of 'inding /a and Ter*ina$ /+4 o(*

    LS,8610.FQ '(ic( i& t(e inductance4 (enr-US,0610.FQ '(ic( i& t(e ar*ature inertia4

     %etaS,0:1Q '(ic( i& t(e &tatic friction $o&&

    G1S,10Q '(ic( i& a con&tant

    T(e *otor &tate.&ace according to t(e a%ove va$ue&

    AS./;L 0 .G1;L Q 0 0 1 Q G1;U 0 .%eta;UBS1;L Q 0 Q0

    CS0 0 1

    DS0P1Stf2&&2A4B4C4D33

    A S

      1,0e00F 6

      .0,8":# 0 .0,0197  0 0 0,0010

      1,#0#1 0 .0,F919

    B S

      179,71"

      0  0

    C S

      0 0 1

    D S

      0

    Tran&fer function

      F,"0#e00

  • 8/15/2019 Matlab&DAQ

    16/27

  • 8/15/2019 Matlab&DAQ

    17/27

      Output Error 

    T(i& ta%$e4 '(ic( i& a%ove4 *a- (e$ to find t(e G and Gi coefficient&,

    De&igning )i*u$in+ *ode$ for t(e rea$ ti*e &eed contro$ a$ication

    In t(i& art of our &tud-ing4 'e fo$$o' t(i& &te&Q

    1.Put t(e ana$og outut in&tead of &tate.&ace)tate.&ace &u%&titute our DC *otor

    :. Connect t(e ana$og inut a& negative feed%ac+ 'it( conver&ion&

    .Tac(o*eter give& u& t(e &eed of t(e *otor a& vo$tage

    .If it& outut i& 1"V4 t(i& *ean& it i& rotating at 1000r*

      .J&ing t(i& infor*ation4 'e *u$ti$- tac(o outut 'it( 1000;1".If 'e 'ant to &(o' t(e &eed a& rad;&econd4 t(en 'e *u$ti$- it again 'it( 1;80

    If one 'i&(e&4 t(e one doe& not (ave to convert r* to rad;&ec4 %ut t(i& ti*e t(e one &(ou$d not

    divide reference r* 'it( 80,

    :, Mu$ti$- a$&o ana$og inut 'it( 10 and a$*o&t 8,

  • 8/15/2019 Matlab&DAQ

    18/27

      Ana$og inut& give u& a va$ue %et'een 0 and 14 if 'e *u$ti$- 'it( 104 'e get t(e

    correct deci*a$ va$ue,

    T(i& correct deci*a$ va$ue i& *u$ti$ied %- 8, Becau&e4 our taco out i& nor*a$$-

    *ai*u* F0V4 and our DA ana$og inut &(ou$d %e in V, B- u&ing o.a*4 'e divide

    it 'it( 8, In &(ort4 to get t(e t(i& correct va$ue again4 a& &oft'are4 'e *u$ti$- it 'it( 8,

      T(i& circuit i& u&ed a& vo$tage divider '(ic( i& &(o'n %e$o', =or in&tance4 if t(e

    inut i& :"4 t(e outut i& ", T(e fir&t o.a* outut i& ."V and t(en t(e &econd outut i&"V, e (ave to u&e t(e &econd o.a* to *a+e it o&itive due to t(e fact t(at DA&

    >ND& are &(ort circuit&,

    )o4 fina$ our ,*d$ fi$e i& &(o'n %e$o'4 and it i& a$$ *entioned a%ove,

  • 8/15/2019 Matlab&DAQ

    19/27

    2., ispla&ing "otor:s speed;rpm< with se'en segment.

     

    In t(i& 'e (ave intended to di&$a- t(e &eed of t(e *otor on a " digit 7 &eg*ent di&$a-,

    e (ave i*$e*ented t(e rogra* u&ing t(e )i*u$in+ B$oc+& in t(e %e$o' figure, e (ave

    a$&o $aced t(e &i*out %$oc+ to &ee t(e actua$ &-&te*& error4 cotro$$er outut4 tac(o*eter outut& and &i*u$ative error4 cotro$$er outut4 tac(o*eter outut&

  • 8/15/2019 Matlab&DAQ

    20/27

  • 8/15/2019 Matlab&DAQ

    21/27

     

    Here i& t(e &u%&-&te* %$oc+ t(at doe& t(e &canning roce&&,

     

  • 8/15/2019 Matlab&DAQ

    22/27

     

    2.7 esults !omparison of the actual s&stem:s outputs and simulation outputT(e&e va$ue& are ta+en at 0041000 and 100r* re&ective$-,

  • 8/15/2019 Matlab&DAQ

    23/27

  • 8/15/2019 Matlab&DAQ

    24/27

  • 8/15/2019 Matlab&DAQ

    25/27

  • 8/15/2019 Matlab&DAQ

    26/27

    28 G$% ?"'/

    e %ui$d our o'n &i*u$in+ *ode$ '(ic( convert& gra- code to deci*a$ va$ue, It i& a 1: %it&

     %inar- va$ue& and it i& got fro* DA digita$ inut& Q DI . DI 18,

    T(i& gra- code can %e u&ed to convert t(e gra- code va$ue fro* t(e *otor o&ition and convert

    it to contro$ it& o&ition,

    In order to t(i&4 'e ut t(e DA Digita$ Inut %$oc+&4 and 'e e or eac( %it in a a$gorit(*4 it i&

    &(o'n t(e %e$o' rint.&creen icture&, And t(ere i& &u%&-&te* '(ic( c(ec+ t(e %it after e or, If t(e %it

    i& 14 t(e outut of t(e %it i& one 4 ot(er'i&e4 it i&

  • 8/15/2019 Matlab&DAQ

    27/27

    3. !=!>?$=

      Digita$ Contro$ )-&te*& La%orator- c(a$$enged u& to i*rove our (ard'are and &oft'are

    i*$e*entation a%i$itie&, T(ere 'ere $ot& of (andica& t(at 'e faced and overca*e,

      In t(e fir&t $ace 'e (ave dea$t 'it( t(e &oft'are i*$e*entation& of Advantec( PCI1710 Daq Device 'it( Mat$a%, e (ave fir&t$- tried to u&e t(e Daq device 'it( Mat$a% 6,*

    fi$e& %ut t(en 'e (ave &een t(at u&ing )i*u$in+& B$oc+ Diagra*& gave u& *ore f$ei%i$it-

    a%out interfacing t(e Daq device and Mat$a%, Here t(e /ea$.Ti*e indo'& Target Too$Bounder )i*u$in+ &u$ie& u& Ana$og Inut4 Ana$og 5utut4 Digita$ Inut4 Digita$ 5utut B$oc+&

    to direct$- u&e t(e Daq device,

    After 'e (ave $earnt a%out Mat$a%& a%i$itie& 'e t(en di&covered t(at $ot& of rea$.ti*e

    a$ication& can %e i*$e*ented 'it( Mat$a% and )i*u$in+, Mat$a% inc$ude& $ot& of too$& &uc(a& /T4 /TT4 PC4 and *an-, )uc( too$& connect t(e a$ication& to t(e rea$ 'or$d ea&i$-

    via Daq device, Actua$$-4 t(e&e connection& can %e done 'it( C4 %ut 'it( *uc( *ore effort,

    In t(e net &te4 t(at i& after 'e 'ere a%$e to u&e t(e )i*u$in+& I;5 %$oc+& 'e (ave dea$t

    'it( t(e &eed contro$ of a DC Motor 'it( t(e PI contro$, T(e &i*u$ation& and t(e actua$

    re&u$t& concerning t(e &-&te*& error and tac(o*eter outut (ave fitted in t(e acceta%$e

    range, T(en 'e (ave i*$e*ented t(e &oft'are and (ard'are &etu to &(o' t(e *otor& &eedin r* at " digit &even &eg*ent di&$a-,

    eferances1/TT J&er >uide

    [2](tt;;''',%i$te+,tu%ita+,gov,tr;*era+etti+$erini