scieee Open visual document viewer

DC Motor Simulation with ARM Based Hardware in the Loop

Csikós, Sándor; Bálint, Ádám

Abstract

Hardware in the loop testing is increasingly important product testing for cutting down time to market. In my previous article I identified the parameters of a DC motor control system using system identification. An implementation of the resulting transfer function was developed on an ARM based hardware in the loop system and has been verified against the original system. The results show that the hardware in the loop system produces responses within tolerance to the stimulus signals and can be used for testing of controlsystems.

Full text

Recen Inno a ions in Mecha onics (RIiM) Vol. 3. (2016). No. 1-2. DOI: 10.17667/ iim.2016.1-2/15. DC Mo o Simula ion wi h ARM Based Ha dwa e in he Loop Sándo Csikós Uni e si y o Szeged Facul y o Enginee ing TechnicalIns i u e Szeged, Hunga y [email protected] Ádám Bálin Uni e si y o Szeged Facul y o Enginee ing Technical Ins i u e Szeged, Hunga y Abs ac —Ha dwa e in he loop es ing is inc easingly impo an p oduc es ing o cu ing down ime o ma ke . In my p e ious a icle I iden i ied he pa ame e s o a DC mo o con ol sys em using sys em iden i ica ion. An implemen a ion o he esul ing ans e unc ion was de eloped on an ARM based ha dwa e in he loop sys em and has been e i ied agains he o iginal sys em. The esul s show ha he ha dwa e in he loop sys em p oduces esponses wi hin ole ance o he s imulus signals and can be used o es ing o con olsys ems. Keywo ds—Ha dwa e in he loop, LabVIEW, ARM mic ocon olle I. INTRODUCTION Model based design is a me hodology used in designing and es ing con olle so wa e implemen ed in PLCs o mic ocon olle s. The h ee phases ha phases o model based design a e model in he loop (MIL) whe e only he ma hema ical ep esen a ions o he plan and con ol sys em a e used, so wa e in he loop (SIL) whe e a simula ed implemen a ion o he con olle con ols a simula ion o he plan and ha dwa e in he loop (HIL) whe e a eal con olle con ols a eal- ime simula ion o a plan . As he las simula ion s age o p oduc de elopmen ha dwa e in he loop simula ion is used o cu down es ing ime, ensu e he co ec ness o he implemen ed con ol algo i hm and dec ease es ing cos s. As such i is impo an o make he simula ing de ice be as close o he eal sys em as possible. Cu en applica ions use eal- ime ope a ing sys ems o ensu e he high e esh a e needed o such simula ions and a e usually qui e cos ly such as he dSPACE simula o o he Na ional Ins umen s PXI sys ems jus o name a ew. Real- ime compu ing is di ided in o so eal- ime, whe e he use ulness o a esul deg ades a e i s deadline, i m eal- ime whe e in equen deadline misses a e ole a ed and ha d eal- ime whe e missing a deadline is o al sys em ailu e. Missing deadlines deg ades he sys ems quali y he e o e a ha d eal- ime simula ion me hod would gi e us he bes esul s. The e a e nume ous eal- ime simula ions (RTS) cu en ly in li e a u e [1-6], howe e hese sys ems a e so eal- ime. Simila esea ch has been conduc ed by [7] eaching simula ion s ep imes o 250-50 µs wi h a low cos ha dwa e implemen a ion. In his pape expe imen s we e concluded o see i a low cos implemen a ion using an ARM p ocesso could achie e he same esul s o simple sys ems, hus u he lowe ing he es ing cos o es ing, also p o iding an oppo uni y o c ea e a sys em o he a e age use . Such a sys em could also be used in educa ion due o he low p ice and s ong connec ion o he cu en con ol sys ems cou se ma e ial being augh a he Uni e si y o Szeged. The desi ed end esul would be o c ea e a amewo k ha enables ha d eal- ime ha dwa e in he loop es ing o linea ime in a ian MIMO sys ems and sys ems wi h nonlinea cha ac e is ics such as he pneuma ic a i icial muscle (PAM) since he o he main esea ch opic a he Uni e si y o Szeged Facul y o Enginee ing is he high accu acy posi ioning o pneuma ic a i icial muscles o obo ics and ehabili a ion applica ions [8]. II. METHODOLOGY The hypo hesis being es ed was ha a 32bi ARM mic ocon olle could be used o ha d eal- ime ha dwa e in he loop simula ion. The mic ocon olle chosen was he STM32F746ZGT6 on he STM32F746 Nucleo boa d (Fig. 1). Fig. 1. STM32F746 Nucleo boa d The STM32F746ZGT6 ea u es a 216 MHz ARM p ocesso wi h a buil in single p ecision loa ing poin uni enabling ope a ions on numbe s ep esen ed as loa s o be comple ed unde a couple o cycles depending on he ope a ion. A loa ing poin uni is o key impo ance as i will be shown. The p og amming en i onmen used was he Keil MDK wi h he STM32CubeMX o pin se up and ini ializa ion.Measu emen s we e done using LabVIEW, he Recen Inno a ions in Mecha onics (RIiM) Vol. 3. (2016). No. 1-2. DOI: 10.17667/ iim.2016.1-2/15. da a acquisi ion de ice used was a myRIO (Fig. 2) om Na ional Ins umen s. Fig. 2. myRIO om Na ional Ins umen s To es he hypo hesis a physical sys em was cons uc ed consis ing o a small DC mo o wi h a magne moun ed on he o a y sha and an AS5145 absolu e magne ic o a y encode wi h 12 bi s o esolu ion moun ed pe pendicula o he sha (Fig. 3). Fig. 3. Sys em o be simula ed.DC mo o wi h magne and AS5145 magne icencode . The p ocedu e used was he ollowing. Assuming he model o he sys em o be he one shown on Fig. 4 whe e he inpu o he sys em is ol age and he ou pu is he o a ional speed o he sha equa ion (1) and (2) can be de i ed. Fig. 4. Block diag am o mo o whe e:  – ol age di e ence be ween + and - inV  i– cu en lowing h ough he mo o inA  R – esis ance o he mo o inΩ  L – induc ance o he mo o inH  K – cons an o p opo ionali y inV/ ad/s  J – ine ia inkgm2  b – o a ional dampening cons an Nms/ ad  󰇗 – o o speedin ad/s F om he block diag am equa ion (1) and (2) can be de i ed. (1) (2) Knowing equa ion (1) and (2) we can apply he Laplace ans o m o hem. By exp essing he cu en we can subs i u e (1) in (2) and exp ess he ans e unc ion o he mo o (3) whe e he ol age is he inpu and o o speed is he ou pu . ( ) 󰇗 ( ) ( ) ( ( ) ) (3) Knowing he nomina o and denomina o o de s o he ans e unc ion polynomials enables he pa ame ic sys em iden i ica ion o he sys em once a s ep inpu o 1 V has been applied and i s esponse measu ed. Since he o a y encode only gi es ou absolu e posi ion he angula eloci y had o be calcula ed. To calcula e he angula eloci y an FPGA p og am had been w i en ha uns pe iodically e e y 400 µs. The esul s ob ained and he esul o he sys em iden i ica ion can be seen on Fig. 5. Fig. 5. Resul s o measu emen (blue) and sys em iden i ica ion ( ed) The ans e unc ion om sys em iden i ica ion can be seen in equa ion (4) Recen Inno a ions in Mecha onics (RIiM) Vol. 3. (2016). No. 1-2. DOI: 10.17667/ iim.2016.1-2/15. ( ) 󰇗 ( ) ( ) ( ) (4) To implemen he acqui ed ans e unc ion on he mic ocon olle a bilinea ans o ma ion was pe o med wi h he sampling equency o 100kHz o ans o m i om he s plane o he z plane gi ing us equa ion (5) wi h he ollowing coe icien s. ( ) 󰇗 ( ) ( ) ( ) (5) Using an in e se z- ans o m he di e ence equa ion was ob ained om he disc e e ime ans e unc ion. Implemen ing he disc e e ime ans e unc ion is a simple ma e . Since he equa ion only con ains addi ion mul iplica ion and sub ac ion and each o hese ope a ions only equi es 1-3 cycles o he ARMmic ocon olle . III. RESULTS Fig. 6 shows a measu emen o a s ep inpu applied o he implemen ed ha dwa e in he loop sys em in con as wi h a pu e ma hema ical model. Fig. 6. Resul s o s ep inpu applied o ha dwa e in he loop (squa es) and con inuous ime sys em model ( ed) F om he compa ison i is isible ha he wo esponsesa e close o each o he , wi h an a e age absolu e e o o 0.88004 ad/s we concluded ha using an ARMmic ocon olle is iable o ha d eal- ime ha dwa e in heloop simula ion. The STM32F746ZGT6 has a 12 bi analoginpu wi h a maximum sampling equency o 2.4 MHz husplacing he maximum sampling equency o he bilinea ans o ma ion a 2.4 MHz, in iple in e lea e mode hesampling equency can be boos ed o 7.2 MHz, doing so educes he capabili ies o he mic ocon olle o a single inpu sys em. REFERENCES [1] S. Len ijo, A. Mon i, E. San i, C. Welch, and R. Dougal, “A new es ing ool o powe elec onic digi al con ol,” in P oc. IEEE PESC, Jun. 2003, ol. 1, pp. 107–111. [2] V. Dina ahi, R. I a ani, and R. Bone , “Design o a eal- ime digi al simula o o a D-STATCOM sys em,” IEEE T ans. Ind. Elec on., ol. 51, no. 5, pp. 1001–1008, Jun. 2004. [3] H. Li, M. S eu e , K. Shi, S. Wood u , and D. Zhang, “De elopmen o a uni ied design, es , and esea ch pla o m o wind ene gy sys ems based on ha dwa e-in- he-loop eal- ime simula ion,” IEEE T ans. Ind. Elec on., ol.53,no.4,pp.1144–1151,Jun.2006. [4] F. Piazza, S. Squa ini, R. Toppi, M. Na a i, M. Pon illo, F. Be a elli, and A. La anzi, “Indus y-o ien ed so wa e-based sys em o quali y e alua ion o ehicle audio en i onmen s,” IEEE T ans. Ind. Elec on., ol. 53, no. 3, pp. 855–866, Jun.2006. [5] P. Ba acos, G. Mu e e, C. Rabba h, and W. Jin, “Enabling pc-based HIL simula ion o au omo i e applica ions,” in P oc. IEEE IEMDC, Jun. 2001, pp. 721–729. [6] M. Pa k and I. Yu, “A no el eal- ime simula ion echnique o pho o ol aic gene a ion sys ems using RTDS,” IEEE T ans. Ene gy Con e s., ol.19,no.1,pp.164–169,Ma .2004. [7] Lu, Bin, Xin Wu, He nan Figue oa, and An onello Mon i. "A low-cos eal- ime ha dwa e-in- he-loop es ing app oach o powe elec onics con ols." IEEE T ansac ions on Indus ial Elec onics 54, no. 2 (2007): 919-931. [8] Sá osi J.: “Accu a e Posi ioning o Humanoid Uppe A m” In e na ional Jou nal o Enginee ing, Annals o Facul y o Enginee ing Hunedoa a, 2011, Vol. 9, No. Ex a, ISSN 1584-2673, pp. 33-36