This document provides instructions for integrating the Rotary Motion Servo Plant SRV02 with QUARC. It describes designing Simulink models using QUARC blocks to interface with hardware and run controllers on the SRV02. Models are created to apply a voltage to the DC motor, read the potentiometer and encoder measurements, and measure speed with the tachometer. Instructions are included on compiling models, running QUARC code, and using scopes to view and save data.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0%(2)0% found this document useful (2 votes)
567 views21 pages
01 - SRV02 QUARC Integration - Instructor Manual
This document provides instructions for integrating the Rotary Motion Servo Plant SRV02 with QUARC. It describes designing Simulink models using QUARC blocks to interface with hardware and run controllers on the SRV02. Models are created to apply a voltage to the DC motor, read the potentiometer and encoder measurements, and measure speed with the tachometer. Instructions are included on compiling models, running QUARC code, and using scopes to view and save data.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 21
Rotary Motion Servo Plant: SRV02
Rotary Experiment #00:
QUARC Integration Using SRV02 with QUARC Instructor Manual SRV02 QUARC Integration Instructor Manual Table of Contents 1. INTRODUCTION..........................................................................................................................................1 2. PREREQUISITES.........................................................................................................................................1 3. OVERVIEW OF FILES..................................................................................................................................1 4. SRV02 AND QUARC INTEGRATION.........................................................................................................2 4.1. Applying a Voltage to the DC Motor...............................................................................................2 4.1.1. Designing the Simulink Model...............................................................................................................3 4.1.2. Compiling the Model.............................................................................................................................5 4.1.3. Running !ARC Code.......................................................................................................................... " 4.2. Measuring SRV#2 $otentiometer....................................................................................................." 4.2.1. Reading $otentiometer Voltage.............................................................................................................." 4.2.2. Adding Cali%ration and S&opes..............................................................................................................' 4.3. Measuring SRV#2 (a&hometer......................................................................................................11 4.4. Measuring SRV#2 )n&oder............................................................................................................13 4.5. *ther !ARC +un&tions................................................................................................................1" 4.5.1. Digital Display..................................................................................................................................... 1" 4.5.2. Sa,ing S&ope Data............................................................................................................................... 1" 4.5.3. Signal and (riggering........................................................................................................................... 1- 5. REFERENCES...........................................................................................................................................19 Document Number 701 Reision 1!2 "age i SRV02 QUARC Integration Instructor Manual ! Intro"uction (his manual demonstrates ho. to design !ARC &ontrollers /or the uanser SRV#2 system. !sing !ARC %lo&ks0 se,eral Simulink model are designed to send a ,oltage to the SRV#20 read the load gear angle using a potentiometer and an en&oder0 and measured the speed o/ the load sha/t using the ta&hometer. (he /ollo.ing topi&s are &o,ered in this la%oratory1 Designing a Simulink model that inter/a&es .ith hard.are using the %lo&ks /rom the !ARC li%rary 2uilding !ARC &ode /rom a Simulink diagram Running the &ode to implement &ontrollers and other algorithms on the SRV#2. 3o. to use s&opes in order to ,ie. data as .ell as sa,e that data /or o// line analysis. Regarding Gray Boxes1 4ray %o5es present in the inst!"t# $%n!%& are not intended /or the students as they pro,ide solutions to the pre6la% assignments and &ontain typi&al e5perimental results /rom the la%oratory pro&edure. #! $rere%uisites 7n order to su&&ess/ully &arry out this la%oratory0 the user should %e /amiliar .ith the /ollo.ing1 Data a&8uisition &ard 9e.g. $7D:0 the po.er ampli/ier 9e.g. Volt$A:0 and the main &omponents o/ the SRV#2 9e.g. a&tuator0 sensors:0 as des&ri%ed in Re/eren&es ;1<0 ;4<0 and ;5<0 respe&ti,ely. =iring and operating pro&edure o/ the SRV#2 plant .ith the ampli/ier and DA de,i&e0 as dis&ussed in Re/eren&e ;5<. Simulink en,ironment enough to kno. its %asi& operations. !ARC should %e installed as di&tated in Re/eren&e ;3<. &! '(er(ie) of *iles (a%le 1 %elo. lists and des&ri%es the ,arious /iles supplied .ith the SRV#2 !ARC 7ntegration la%oratory. Document Number 701 Reision 1!2 "age 1 SRV02 QUARC Integration Instructor Manual File Name Description ## > SRV#2 !ARC 7ntegration > Student.pd/ Manuals that e5plains ho. to use !ARC .ith the uanser SRV#2 plant. ## > SRV#2 !ARC 7ntegration > 7nstru&tor.pd/ Same as student ,ersion e5&ept the shaded %o5es sho. the solutions. 8?sr,#2?,olt.mdl Simulink /ile used .ith !ARC to send a ,oltage to the SRV#2. 8?sr,#2?pot?ra..mdl Simulink /ile used .ith !ARC to send a ,oltage to the SRV#2 and display the potentiometer ,oltage measurement. 8?sr,#2?pot.mdl Simulink /ile used .ith !ARC to send a ,oltage to the SRV#2 and display the potentiometer load gear angular measurement. 8?sr,#2?ta&h.mdl Simulink /ile used .ith !ARC to send a ,oltage to the SRV#2 and read angular rate o/ the load gear using the ta&hometer 9as .ell as read the angle /rom the potentiometer:. 8?sr,#2?en&.mdl Simulink /ile used .ith !ARC to send a ,oltage to the SRV#2 and display the load gear angle using the en&oder 9also displays the load gear ,elo&ity .ith the ta&hometer and the load gear angle using the potentiometer:. 8?sr,#2?pot?addl.mdl Same as 8?sr,#2?pot.mdl0 e5&ept it in&ludes a Digital Display to display the load gear angle and the s&ope is &on/igured to sa,e a ,aria%le to the Matla% .orkspa&e. e5?plotting?measured?data.m Matla% s&ript used to plot the data in the sa,ed ,aria%le theta?l /rom 8?sr,#2?pot?addl.mdl. @ote that 8?sr,#2?pot?addl must %e ran .ith !ARC %e/ore running this s&ript in order to ha,e a theta?l ,aria%le in the Matla% .orkspa&e. Table 1: Files supplied with the SRV02 QUARC Integration eperi!ent" +! ,R-0# an" QUARC Integration 7n Se&tion 4.10 a Simulink model is designed using %lo&ks /rom the !ARC li%rary to send a ,oltage to the SRV#2. (his Simulink model is then modi/ied to read /rom the potentiometer0 as di&tated in Se&tions 4.2. (he model /rom Se&tion 4.2 is /urther modi/ied to in&lude the angular rate o/ the load gear using the ta&hometer0 dis&ussed in Se&tion 4.30 and the angular position o/ the load gear using an en&oder measurement0 des&ri%ed in Se&tion 4.4. 4.1. Applying a Voltage to the C Motor 3ere are the %asi& steps to apply a ,oltage to the SRV#2 motor using !ARC1 1. Design a Simulink model that intera&ts .ith the data6a&8uisition de,i&e using %lo&k /rom the Document Number 701 Reision 1!2 "age 2 SRV02 QUARC Integration Instructor Manual !ARC li%rary. (his e5plained in Se&tion 4.1.1. 2. 2uild the &ode /rom the Simulink model0 as di&tated in Se&tion 4.1.2. 3. As e5plained in Se&tion 4.1.30 e5e&ute the &ode. +!!! .esigning t/e ,imulin0 Mo"el 7n this se&tion0 it is sho.n ho. to design a Simulink Model using !ARC %lo&ks to /eed a sinusoid ,oltage to the SRV#20 as sho.n in +igure 1. (he %lo&ks /rom the QUARC Targets li%rary are used to intera&t .ith the data a&8uisition %oard0 e.g. uanser 26!S2 or $7D de,i&e. Figure 1: Sa!ple Si!ulin# $odel used to %eed sinusoid &oltage to the SRV02" +ollo. these steps to design the Simulink diagram1 1. Aoad the Matla% so/t.are. 2. Create a ne. Simulink Diagram %y &li&king on File B 'ew B $odel item /rom the menu %ar. 3. *pen the Simulink Ai%rary 2ro.ser .indo. %y &li&king on the View B (ibrar) *rowser item in the Simulink menu %ar or &li&king on the Simulink i&on. 4. As illustrated in +igure 20 e5pand the QUARC Targets item and go to the +ata A,-uisition . /eneri, . Con%iguration /older. 5. Cli&k6and6drag the 37A 7nitialiCe %lo&k /rom the li%rary .indo. into the %lank Simulink model. (his is used to &on/igure your data6a&8uisition de,i&e0 e.g. the uanser $7D or 26!S2 %oard. ". 7n the Ai%rary 2ro.ser0 go to the /eneri, D I!!ediate I01 &ategory. (his &ontains ,arious %lo&ks used to intera&t .ith a&tuators and sensors. Document Number 701 Reision 1!2 "age # SRV02 QUARC Integration Instructor Manual Figure 2: QUARC Con%iguration %older in the Si!ulin# (ibrar) *rowser window" E. Cli&k6and6drag the 37A =rite Analog %lo&k /rom the li%rary into the Simulink diagram. (his %lo&k is used to output a ,oltage /rom a digital6to6analog &hannel0 i.e. DFA0 on the data6 a&8uisition de,i&e. -. Add a Signal 4enerator %lo&k 9Si!ulin# D Sour,e /older:0 a Slider 4ain %lo&k 9Si!ulin# D $ath 1perations &ategory:0 and a 4ain 9Si!ulin# D $ath 1perations &ategory: into the Simulink model. Conne&t the %lo&ks as sho.n in +igure 1. I' !sin( % V#&tPAQ) $%*+ s!+ ,#! s+t t-+ (%in #n t-+ V#&tPAQ t# 1. '. Dou%le6&li&k on the 37A 7nitialiCe %lo&k. 1#. 7n the *oard t)pe /ield0 sele&t the %oard that is installed in your $C0 e.g. i/ using the 26!S2 then sele&t -22usb. 11. 7/ more than one %oard is installed0 ensure the *oard nu!ber /ield is set &orre&tly0 e.g. i/ t.o %oards are used then &hoose either # or 1. 12. (he de/ault settings /or the %oard are /ine /or this e5periment. +or more in/ormation on this %lo&k0 &li&k on its 3elp %utton. *ther.ise &li&k on the *G %utton and pro&eed. Document Number 701 Reision 1!2 "age $ SRV02 QUARC Integration Instructor Manual 13. Dou%le6&li&k on the 37A =rite Analog %lo&k. 14. Set *oard na!e to 3I(41. 2y de/ault0 Channels is set to # and the Sa!ple ti!e /ield is set to 61. Re&all that0 as instru&ted in Re/eren&e ;5<0 the DC motor is &onne&ted to Analog *utput Channel H# on the hard.are6in6the6loop %oard. (here/ore Channels should %e set to #. Also0 setting the Sa!ple Ti!e to 41 implies that the sampling inter,al is inherited /rom the pre,ious %lo&k. (his setting is /ine as .ell. 15. Cli&k on the *G %utton to sa,e and &lose the 37A =rite Analog %lo&k properties. 1". Sa,e the Simulink mode %y sele&ting the File B Sa&e item in the menu %ar or &li&king on the Sa&e i&on. +!!#! Compiling t/e Mo"el (he Simulink model &an no. %e used %y !ARC to generate &ode .hi&h .ill later %e e5e&uted to send a ,oltage to the SRV#2. +ollo. these steps to generate &ode /rom a Simulink diagram1 1. 7n the Simulink diagram designed in Se&tion 4.1.10 go to the QUARC B Set de%ault options item to set the &orre&t Real6(ime =orkshop parameters and setup the Simulink model /or e5ternal use 9as opposed to the simulation mode:. 2. (o ,ie. the &ompiler options0 go to QUARC B 1ptions in the Simulink model tool %ar. 7n the Real6(ime =orkshop pane0 the S)ste! target %ile is set to (arget Aanguage Compiler /ile -uar,2windows"tl, and0 in the $a#e%ile ,on%iguration se&tion0 the $a#e ,o!!and is set to !a#e2rtw and the Te!plate !a#e%ile is set to -uar,2de%ault2t!% /ile. 3. Cli&k on the the Sol&er item in the le/t6hand pane. 4. 7n the Si!ulation ti!e se&tion0 the Stop ti!e is set to in% in order /or the &ode to %e e5e&uted &ontinuously until it is stopped manually %y the user. Alternati,ely0 the Stop ti!e parameter &an %e set to the desired duration 9&ode .ill &ease e5e&uting .hen the stop time ,alue is rea&hed:. 5. 7n the Sol&er options se&tion0 the T)pe parameter is set to Fied4step and the Sol&er is set to dis,rete. (here are no &ontinuous %lo&ks inside the designed Simulink model0 there/ore ha,ing a dis&rete sol,e is /ine. 3o.e,er0 i/ an 7ntegrator %lo&k or another &ontinuous system is used then the Sol&er /ield .ould ha,e to &hanged to an integration method su&h as ode1 56uler7. ". (he Fied4step si8e /ield sets the sampling inter,al0 or sampling time0 o/ the &ontroller. 2y de/ault this is set to #.##1 se&onds0 .hi&h is a sampling rate o/ 1 k3C. E. Cli&k on the *G %utton to &lose the Con/iguration $arameters .indo.. -. Sele&t the QUARC B *uild item. Various lines in the Matla% Command =indo. should %e displayed as the model is %eing &ompiled. '. *n&e done &ompiling0 a !ARC =indo.s e5e&uta%le /ile along .ith a /older &ontaining ,arious C and Matla% /iles are generated. @ote that on&e the e5e&uta%le is &reated0 the /older is no longer needed. 1#. @ote that the e5e&uta%le and asso&iated &ode /older may %e remo,ed /rom the &urrent dire&tory %y &li&king on QUARC B Clean item.
Document Number 701 Reision 1!2 "age % SRV02 QUARC Integration Instructor Manual +!!&! Running QUARC Co"e *n&e the Simulink Model has %een &ompiled0 the &ode &an %e e5e&uted and the ,oltage set in the Simulink model &an %e sent to the SRV#2 motor. 4o through these steps1 1. (urn *@ the po.er o/ the the po.er ampli/ier. 2. (o %egin e5e&uting the &ode0 &li&k on the QUARC B Start item in the Simulink model. (he SRV#2 e5ternal gears on the SRV#2 should %egin rotating %a&k6and6/orth. (his &ommand a&tually does t.o things1 it &onne&ts to the target and then e5e&utes the &ode. Alternati,ely0 users may de&ide to go through these steps indi,idually. (o do this /irst &li&k on the Conne,t to target i&on0 or sele&t the Si!ulation B Conne,t to target item /rom the menu %ar0 and then &li&k on the Run i&on0 or /rom the menu &hoose the Si!ulation B Start Real4Ti!e Code item0 to e5e&ute the &ode. 3. Dou%le6&li&k on the Signal 4enerator %lo&k to open its parameter .indo.. 4. Set the Fre-uen,) /ield to #.5 3C and &li&k on the *G %utton. Remark ho. the parameter &hange e//e&ts the SRV#2 immediately1 the gears on the SRV#2 %egin to s.it&h %a&k6and6/orth more slo.ly. 5. Vary the ,alue o/ the Slider 4ain %lo&k %et.een # and 2. )5amine ho. the angular rate o/ the SRV#2 gears &hange proportionally .ith the amplitude o/ the sine .a,e. ". Sele&t the QUARC B Stop item to stop the &ode /rom running 9or &li&k on the Stop %utton in the Simulink model tool %ar:. E. $o.er *++ the ampli/ier i/ no more e5periments .ill %e ran in this session. 4.2. Meas!ring SRV02 Potentio"eter 7n this se&tion0 the Simulink Model pre,iously designed in Se&tion 4.1.1 is modi/ied to o%tain readings /rom the SRV#2 potentiometer sensor. +!#!! Rea"ing $otentiometer -oltage Design a Simulink model0 similarly as pi&tured in +igure 30 %elo.0 that reads the potentiometer ,oltage. Document Number 701 Reision 1!2 "age & SRV02 QUARC Integration Instructor Manual Figure 9: Si!ulin# !odel used to send &oltage to the SRV02 and obtain readings %ro! the potentio!eter sensor" +ollo. this pro&edure to design the Simulink diagram1 1. +rom the /eneri, D Ti!ebases &ategory in the Simulink Ai%rary 2ro.ser0 &li&k6and6drag the 3I( Read Ti!ebase %lo&k into the Simulink diagram &reated pre,iously in Se&tion 4.1.1. (his %lo&k &an %e &on/igured to read /rom analog0 en&oder0 and digital &hannels. 7n this &ase it .ill %e used to read a ,oltage /rom an analog6to6digital &hannel0 i.e. AFD0 on the data6a&8uisition de,i&e. !sing a Ti!ebase type %lo&k &auses the running model to %e triggered %y the hard.are hard.are timer on the data6a&8uisition %oard as opposed to the system &lo&k. (his in&reases per/orman&e o/ the &ontroller %y redu&ing Iitter and allo.ing /or greater sampling rates. (he system &lo&k .ould instead %e used i/0 /or instan&e0 the 37A Read %lo&k /rom the I!!ediate I01 &ategory .as sele&ted. 2. Dou%le6&li&k on the 37A Read (ime%ase %lo&k to open its properties. 3. Set *oard na!e to 3I(41. 4. Re&all that0 as instru&ted in Re/eren&e ;5<0 the potentiometer is &onne&ted to Analog 7nput H# on the hard.are6in6the6loop %oard. (here/ore the de/ault setting o/ Analog &hannels set to # is /ine. 5. Add a S&ope %lo&k /rom the Si!ulin# D Sin#s /older in the Ai%rary 2ro.ser and &onne&t it to the output o/ the 37A Read Analog %lo&k0 similarly as sho.n in +igure 30 a%o,e0 ". Set the Fre-uen,) parameter in the Signal 4enerator %lo&k to 1.# 3C and the Slider 4ain %lo&k to 1. E. Dou%le6&li&k on the S&ope i&on. -. Sa,e the Simulink model 9you may .ant to sa,e the model as a di//erent /ile:. '. $o.er *@ the ampli/ier. 1#. 4o to QUARC B *uild to &ompile the &ode. 11. Cli&k on QUARC B Start to e5e&ute the &ode. As the SRV#2 rotates %a&k6and6/orth0 the S&ope should display the potentiometer readings similarly as sho.n in +igure 4. Remark that the readings sho.n are the ,oltage output o/ the potentiometer and not an angular measurement in degrees or radians. Document Number 701 Reision 1!2 "age 7 SRV02 QUARC Integration Instructor Manual Figure :: Reading raw &oltage %ro! the SRV02 potentio!eter" NOTE. I' t-+ s"#/+ is n#t 0is/&%,in( %n, 0%t% %n0 t-+ SRV02 is #t%tin() t-+n s++ S+"ti#n 4.5.3 t# +1"#n'i(!+ t-+ RTW Si(n%& 2 Ti((+in( /#/+ti+s. 12. Vary the sine .a,e /re8uen&y %et.een #.1 and 2 3C and the Slider 4ain ,alue %et.een # and 2. Jou may noti&e the dis&ontinuity present in the potentiometer0 as illustrated in +igure 5. Figure ;: <otentio!eter reading when en,ountering its dis,ontinuit)" 13. As dis&ussed in Re/eren&e ;5<0 the potentiometer is an a%solute sensor. (o demonstrate this0 set the Slider 4ain to # V. Document Number 701 Reision 1!2 "age ' SRV02 QUARC Integration Instructor Manual 14. Manually rotate the gears su&h that the potentiometer is reading a ,alue other than # V. 15. Stop the &ode %y &li&king on !ARC B Stop. 1". Start the &ode again0 i.e. sele&t !ARC B Start and e5amine ho. the ,oltage reading is the same as pre,iously set. 1E. Stop the &ode again. +!#!#! A""ing Calibration an" ,copes (he Simulink model .ill no. %e modi/ied to read the load angle /rom the potentiometer and the ,oltage &ommanded to the motor0 similarly as sho.n in +igure ". Figure =: Si!ulin# !odel used to send &oltage to the SRV02 and obtain angular readings %ro! the potentio!eter" Continue to modi/y the Simulink diagram %uilt in the pre,ious se&tion .ith these steps1 1. Aa%el the S&ope %lo&k that is presently &onne&ted to the 37A Read Analog %lo&k to theta2l 5deg7. (his .ill display the angular measurement o/ the load gear in degrees. 2. Add a S&ope %lo&k /rom the Si!ulin# D Sin#s /older in the Ai%rary 2ro.ser and &onne&t it to the output o/ the Slider 4ain %lo&k0 as sho.n in +igure "0 a%o,e. Aa%el the S&ope %lo&k V! 5V7 .hi&h stands /or the input motor ,oltage. 3. +rom the Si!ulin# D $ath 1perations &ategory in the Ai%rary 2ro.ser0 add t.o 4ain %lo&ks into the Simulink model. 4. Conne&t the 4ain %lo&ks as illustrated in +igure ". $la&e one 4ain %lo&k %et.een the A!pli%ier <re4Co!pensation 4ain and the 37A =rite Analog %lo&ks and la%el it $otor Calibration 5V0V7. Add the se&ond 4ain %lo&k %et.een the 37A Read (ime%ase and theta2l S&ope %lo&ks and denote it <otentio!eter Calibration 5deg0V7. 5. Re6&ompile the Simulink model0 i.e. &li&k on QUARC B *uild. ". Cli&k on QUARC B Start to run the &ode. Document Number 701 Reision 1!2 "age ( SRV02 QUARC Integration Instructor Manual E. *pen the V! 5V7 and theta2l 5deg7 s&opes. -. 7n the Signal 4enerator0 set the Fre-uen,) parameter to #.25 3C. '. Set the Slider 4ain %lo&k to 1. (he input ,oltage signal in the V! 5V7 s&ope should %e as sho.n in +igure E. Figure >: Sinusoidal SRV02 input &oltage" 1#. Currently .hen the ,oltage goes positi,e the load gear rotates in the &lo&k.ise dire&tion. 3o.e,er0 the desired &on,ention is /or the load gear to rotate in the &ounter6&lo&k.ise dire&tion .hen the ,oltage goes positi,e. (hus set the $otor Calibration 5V0V7 %lo&k to 61. 11. As des&ri%ed in Re/eren&e ;5<0 the potentiometer outputs %et.een KF6 5V .hen it rotated 352 degrees. )nter the ,alue 352 F 1# in the <otentio!eter Calibration 5deg0V7 %lo&k. 12. 7n the theta2l 5deg7 s&ope0 &li&k on the Autos,ale i&on so the y6a5is range is in&reased and the /ull signal &an %e ,ie.ed. 13. Set the Slider 4ain %lo&k to #. 14. Rotate the load gear manually and e5amine the &orresponding response in the theta2l 5deg7 s&ope. Con/irm that0 indeed0 the &orre&t measurement is %eing taken. 15. $osition the load gear su&h that # is read in the theta2l 5deg7 s&ope . 1". Set the Slider 4ain %lo&k to 1. 1E. )5amine the relationship %et.een the input ,oltage and load position. =hen the input ,oltage in&reases in the positi,e dire&tion0 the potentiometer angle de&reases. Add a negati,e sign to the <otentio!eter Calibration 5deg0V7 %lo&k so the entered ,alue %e&omes 6352F1#. @o.0 the angular position o/ the load gear0 displayed in the theta2l 5deg7 s&ope0 reads in&reasingly positi,e .hen the &ommanded motor input ,oltage0 i.e. signal in the V! 5V7 s&ope0 is positi,e. Document Number 701 Reision 1!2 "age 10 SRV02 QUARC Integration Instructor Manual Figure ?: Input &oltage s,ope" Figure @: (oad gear position response when ,alibrated" 1-. Sele&t the QUARC B Stop item to stop the &ode /rom running. 1'. $o.er *++ the ampli/ier i/ no more e5periments .ill %e ran in this session. 4.#. Meas!ring SRV02 $a%ho"eter 7n this se&tion0 the Simulink diagram designed in Se&tion 4.2 is modi/ied to in&lude the readings /rom the ta&hometer. 2e/ore &ontinuing0 please ensure that the SRV#2 unit %eing used has a ta&hometer0 i.e. SRV#26( option. Document Number 701 Reision 1!2 "age 11 SRV02 QUARC Integration Instructor Manual Figure 10: Si!ulin# !odel used to send &oltage to SRV02 and read its potentio!eter and ta,ho!eter sensors" !sing the Simulink diagram %uilt in the pre,ious se&tion0 go through this pro&edure to add the ta&hometer /un&tionality1 1. Dou%le6&li&k on the 37A Read (ime%ase %lo&k to open its properties. 2. As detailed in Re/eren&e ;5<0 the ta&hometer is &onne&ted to Analog 7nput H2 on the hard.are6 in6the6loop %oard. (o add a &hannel0 set the Analog ,hannels /ield to ;#02< and &li&k on the *G %utton. 3. Add a S&ope %lo&k and a 4ain %lo&k /rom Ai%rary 2ro.ser into the Simulink model. 4. Conne&t the S&ope and 4ain %lo&ks as depi&ted in +igure 1#0 a%o,e. (hat is0 &onne&t the 4ain %lo&k to the output o/ Channel H2 /rom the 37A Read (ime%ase %lo&k and la%el it Ta,ho!eter Calibration 5rp!0V7. (hen0 &onne&t the output o/ this gain %lo&k to the input o/ the S&ope %lo&k and la%el the s&ope w2l 5rp!7. (his s&ope .ill display the measured speed o/ the load gear in thousand re,olutions per minute. 5. Set the Signal 4enerator +re8uen&y parameter to 1.# 3C and the Slider 4ain %lo&k to 1. ". *pen the V! 5V7 and the w2l 5rp!7 s&opes. E. $o.er *@ the ampli/ier. -. 4o to QUARC B *uild to &ompile the &ode. '. Cli&k on QUARC B Start to e5e&ute the &ode. As the SRV#2 rotates %a&k6and6/orth0 the w2l 5rp!0V7 s&ope should display the ta&hometer readings. Sin&e the Ta,ho!eter Calibration Document Number 701 Reision 1!2 "age 12 SRV02 QUARC Integration Instructor Manual 5#rp!0V7 gain has not %een &on/igured yet0 the s&ope is displaying the ta&hometer output ,oltage0 .hi&h is proportional to the speed o/ the load sha/t. 1#. (he %a&k6em/ &onstant o/ the ta&hometer sensor is 1.5 mVFrpm. 3o.e,er0 the measurement is taken dire&tly /rom the motor itsel/ 9see Re/eren&e ;5<:. (hus to read the ,elo&ity o/ the gear the ta&hometer &ali%ration gain must %e di,ided %y the gear ratio. )nter 1 F 1.5 F E# .hen using the SRV#2 in the high6gear &on/iguration or 6 1 F 1.5 F 14 .hen using the SRV#2 in the lo.6gear &on/iguration in the Ta,ho!eter Calibration 5#rp!0V7 gain %lo&k. 11. (he measurement .ill %e ,ery small. Cli&k on the Autos,ale i&on in the s&ope to Coom up on the signal. Alternati,ely0 the y6range o/ the s&ope &an %e set manually. (o do this0 right6&li&k on the y6a5is0 sele&t Aes <roperties /rom the drop6do.n menu0 and set the desired y6range ,alues. 12. )5amine the relationship %et.een the input ,oltage and load speed. =hen the input ,oltage in&reases in the positi,e dire&tion0 the ta&hometer ,elo&ity de&reases. As .ith the potentiometer .hen reading position0 the speed o/ the load sha/t should go positi,e .hen the input ,oltage is positi,e. (hus add a negati,e sign to the Ta,ho!eter Calibration 5rp!0V7 %lo&k so the entered ,alue %e&omes 61 F 1.5 F E# /or high6gear or 1 F 1.5 F 14 /or lo.6gear . (he input ,oltage and load ,elo&ity s&opes should read as sho.n in +igure 11 and +igure 12. Figure 11: Input &oltage s,ope"
Figure 12: (oad sha%t &elo,it) !easured b) ta,ho!eter" Note1 7/ you .ant the measurement to %e in R$M instead o/ kR$M0 enter 6 1### F 1.5 F E# /or high6gear or 6 1### F 1.5 F 14 /or lo.6gear. 13. Sele&t the QUARC B Stop item to stop the &ode /rom running. 14. $o.er *++ the ampli/ier i/ no more e5periments .ill %e ran in this session. 4.4. Meas!ring SRV02 &n%o'er (he Simulink diagram designed pre,iously is modi/ied to in&lude an en&oder measurement0 as illustrated in +igure 13 %elo.. 2e/ore &ontinuing0 please ensure that the SRV#2 unit %eing used has an en&oder0 i.e. SRV#26) option. Document Number 701 Reision 1!2 "age 1# SRV02 QUARC Integration Instructor Manual Figure 19: Si!ulin# !odel used to send &oltage to the SRV02 and read its potentio!eterA ta,ho!eterA and en,oder sensors" !sing the Simulink model designed in either se&tion 4.2 or 4.30 /ollo. this pro&edure to add en&oder /un&tionality1 1. Dou%le6&li&k on the 37A Read (ime%ase %lo&k to open its properties. 2. Re&all that0 as instru&ted in Re/eren&e ;5<0 the en&oder is &onne&ted to )n&oder 7nput H# on the data a&8uisition %oard. (hus set the 6n,oder ,hannels /ield to ;#<. (he de/ault en&oder &on/igurations in the 37A 7nitialiCe %lo&k are /ine %ut keep in mind that these &an %e &hanged. 3. Add a 4ain %lo&k and a S&ope %lo&k /rom the $ath 1perations and Sin#s /olders in the Ai%rary 2ro.ser0 respe&ti,ely0 into the Simulink model. 4. Conne&t the S&ope and 4ain %lo&ks as depi&ted in +igure 130 a%o,e. (hus &onne&t the 4ain %lo&k to the output la%eled e0 o/ the 37A Read (ime%ase %lo&k and la%el it 6n,oder Calibration 5deg0,ount7. (hen0 &onne&t the output o/ this gain %lo&k to the input o/ the S&ope %lo&k and la%el the s&ope en,: theta2l 5deg7. (his s&ope .ill display the measured angular position o/ the load gear in degrees. 5. Set the Fre-uen,) parameter in the Signal 4enerator %lo&k to 1.# 3C and the Slider 4ain %lo&k to 1. ". *pen the V! 5V7 and en,: theta2l 5deg7 s&opes. E. Sa,e the Simulink model 9you may .ant to sa,e the model as a di//erent /ile:. -. $o.er *@ the ampli/ier. '. 4o to QUARC B *uild to &ompile the &ode. Document Number 701 Reision 1!2 "age 1$ SRV02 QUARC Integration Instructor Manual 1#. Cli&k on QUARC B Start to e5e&ute the &ode. As the SRV#2 rotates %a&k6and6/orth0 the en,: theta2l 5deg7 should display the en&oder readings. Sin&e the 6n,oder Calibration 5deg0,ount7 gain has not %een &on/igured yet0 the s&ope is displaying the num%er o/ &ounts /rom the en&oder output0 .hi&h is proportional to the position o/ the load sha/t. 11. (he measurement .ill %e ,ery large. Cli&k on the Autos,ale i&on in the s&ope to Coom out and ,ie. the entire signal. Alternati,ely0 the y6range o/ the s&ope &an %e set manually. (o do this0 right6&li&k on the y6a5is0 sele&t Aes <roperties /rom the drop6do.n menu0 and set the desired y6range ,alues 12. As dis&ussed in Re/eren&e ;5<0 the en&oder outputs 4#'" &ounts /or e,ery /ull re,olution. (o measure the load gear angle0 set the 6n,oder Calibration 5deg0,ount7 gain %lo&k to 3"# F 4#'" degrees per &ount. 13. (he measurement .ill %e ,ery small. Cli&k on the Autos,ale i&on in the s&ope to Coom up on the signal or adIust the range o/ the y6a5is manually. (he input ,oltage and position s&opes should appear similarly as sho.n in +igure 14 and +igure 15. Remark that no /urther &ali%ration is needed1 the en&oder position in&reases .hen the input ,oltage goes positi,e. Figure 1:: Input sinusoidal &oltage" Figure 1;: (oad gear angle !easured with en,oder" 14. Set the Slider 4ain %lo&k to #. 15. Mo,e around the load gear and e5amine the response in the en,: theta2l 5deg7 s&ope. Rotate the gear so the measurement is a%out 12# degrees. 1". Sele&t the QUARC B Stop item to stop the &ode /rom running. 1E. 2egin running the &ontroller again. @oti&e in the theta2l 5deg7 s&ope that the en&oder is no. reading # degrees. (his demonstrates the di//eren&e %et.een a relati,e position measurement0 e.g. in&remental en&oder0 and an a%solute measurement0 e.g. potentiometer. 1-. Stop running the &ontroller. 1'. $o.er *++ the ampli/ier i/ no more e5periments .ill %e ran in this session. Document Number 701 Reision 1!2 "age 1% SRV02 QUARC Integration Instructor Manual 4.(. )ther QUARC *!n%tions +!1!! .igital .isplay 7t has %een sho.n ho. data /rom the output o/ a %lo&k &an %e displayed in a S&ope. 3o.e,er0 this data &an also %e displayed using a Digital Display. 7t is sometimes %ene/i&ial to ,ie. the numeri&al ,alue o/ the %lo&k at that time instant. 7n +igure 1" /or e5ample0 the measured angle o/ the load gear is displayed. Figure 1=: Si!ulin# !odel that sends a &oltage to the SRV02 and displa)s the potentio!eter using both a s,ope and a digital displa)" +!1!#! ,a(ing ,cope .ata (he s&opes in the Simulink model &an %e &on/igured to sa,e ,aria%les in the Matla% .orkspa&e. +or instan&e0 to &on/igure the load gear position s&ope theta2l 5deg7 in the Simulink model /rom Se&tion 4.2 per/orm the /ollo.ing1 1. *pen the theta2l 5deg7 s&ope 9dou%le6&li&k on it:. 2. Cli&k on <ara!eters i&on. 3. 7n the <ara!eters .indo.0 sele&t the +ata 3istor) ta%. 4. Sele&t the Sa&e data to wor#spa,e &he&k %o5. 5. Change the Variable name /ield to a desired ,aria%le0 e.g. theta2l. ". Set For!at to Arra). E. 2y de/ault0 the (i!it data points to last %o5 is set to 5###. (his means that only the last 5### Document Number 701 Reision 1!2 "age 1& SRV02 QUARC Integration Instructor Manual points o/ data .ill %e sa,ed in the ,aria%le. (hus0 gi,en that the &ontroller runs at 1 k3C0 this implies that the last 5 se&onds o/ data sho.n in the theta2l 5deg7 s&ope .ill %e &aptured. -. Cli&k on the 1B %utton. '. Sa,e the Simulink model. 1#. Sele&t QUARC B *uild to re%uild the model. 11. Cli&k on QUARC B Run. 12. A/ter the &ontroller has ran /or at least 5 se&onds0 &li&k on QUARC B Stop to &ease running the &ode. 13. =hen the &ontroller is stopped0 the ,aria%le is sa,ed to the .orkspa&e. (he ,aria%le theta2l is a t.o6dimensional array .ith 5### elements. (he /irst ,e&tor is the running time and the se&ond ,e&tor is the position o/ the load gear. (o plot these into a Matla% /igure0 see the s&ript sho.n in and the resulting s&ope that is generated a/ter the s&ript is ran. %% Example of Loading Response Data % %% Load sample data from the Matlab workspace into variables % Time vector (s) t theta!l("#$)% % Load gear position (deg) th!l theta!l("#&)% % %% 'lot response plot(t#th!l#(r)()% label((*theta!l (deg)() xlabel((time (s)()% title((*bf +R,-& .pen)loop 'osition Response()% Tet 1: Sa!ple s,ript used to plot sa&ed &ariable theta2l in a $atlab %igure" Figure 1>: $atlab %igure showing !easured response %ro! the sa&ed theta2l &ariable" Document Number 701 Reision 1!2 "age 17 SRV02 QUARC Integration Instructor Manual +!1!&! ,ignal an" Triggering 7/ a s&ope is not displaying any tra&es .hen running !ARC in )5ternal mode or you .ish to adIust the amount o/ data that &an %e displayed0 then the Signal L (riggering properties need to %e &on/igured. +ollo. this pro&edure these settings1 1. 7n the Simulink model0 sele&t the Tools B 6ternal $odel Control <anel item. 2. Cli&k on the Signal C Triggering %utton and the .indo. sho.n in +igure 1- .ill load. Figure 1?: Signal and Triggering window %or a Si!ulin# diagra! with a single S,ope" 3. As sho.n in +igure 1-0 ensure the Ar! when ,onne,tion to target option is sele&ted so that the s&ope plots in/ormation .hen the !ARC &ontroller is running. 4. (he +uration spe&i/ies the amount o/ points that are plotted. 7/ the %u//er is set to 1#0### points and the &ontroller runs at a sampling rate o/ 1 k3C0 i.e. sampling inter,al o/ #.##1 s0 then the s&ope .ill plot up to 1# se&onds o/ data. (hus to ,ie. up to 2# se&onds the +uration .ould ha,e to %e &hanged to 2# se&onds. 5. Make sure you &li&k on the Appl) %utton to &ommit the &hanges. ". Cli&k on Close .hen done. Document Number 701 Reision 1!2 "age 1' SRV02 QUARC Integration Instructor Manual 1! References ;1< DA !ser Manual ;2< !ARC !ser Manual 9type doc /0arc in Matla% to a&&ess:. ;3< !ARC 7nstallation Manual. ;4< Ampli/ier !ser Manual. ;5< SRV#2 !ser Manual. Document Number 701 Reision 1!2 "age 1(