Home

User`s Manual - Alpha Control Lab

image

Contents

1. i I i po 000 Sa elt oes 2 Selene a 1 I w wm uv jm s u AWOOTIA peg T T A A em ne SS el EE WE mE 1 1 a oo gt m ur uoprsod peg Time s Time s T T T l l I l I AS oe e a RE ME i i neo i i i Sa aa ae an ae T Se 1 1 oc o st N o o MHD WAid 1000073 V 1Ua 1mo roo Time s Time s Fig 49 LQ simulation the desired position is in a square wave form 33 MLS User s Manual Similarly we perform the LQ simulation for the desired position assumed in a square wave form The simulation results are consequently shown in Fig 49 Remember that the obtained results are correct as long as the control and gt state variables do not saturate Otherwise the control algorithm has nothing to do with the LQ policy 2 3 4 LQ tracking If you click the LQ tracking button the following windows open see Fig 50 We do remember that the LQ control policy has been calculated for a given equilibrium point To improve the LQ control action we introduce the LQ tracking policy For each new
2. ci E d 9 005 pususg csgdu zaj A 2 8 0 1 0 1 2 3 4 0 1 2 3 4 Time s Time s 1 4 0 8 e o Pepe mme h E q a K l e N T I I I I I I I I I L OG rrr Coil current A amp i 3 T l L HE A l l E l l i i Control PWM duty Eh __ AAA n gt J _ E ZE 2 E 2 SS SS a 1 2 3 4 0 1 2 3 4 Time s Time s Fig 60 LQ real time experiment The desired position as a constant x 10 11 l 0 1 g ihesa ZA x 0 05 L S aaa 5 LN z MO C EE w E gt 5 lwi viu Wi z Kii R r oe E S Gee eee u cj ss esee fevers Comers seme ea Ml r 7o 1 2 3 4 T 1 2 3 4 Time s Time s 13 l 0 8 EEN E EN ml z li pu Bip E s 4 lu E n N i AA W aq jt Sii Bit 3 B dA adea T ede ee V i yf Q i 0 8 Tul au 1 s 0 0 1 2 3 4 0 1 2 3 4 Time s Time s Fig 61 LQ real time experiment The desired position in a sine wave form MLS User s Manual 40 E g Bei E a 3 ea Time s 1 5 i Z 1 eerte EE S 5 I si is aaea E I I I Wi I o ma 0 5 IL Laa e o I I I i 0 L I L 0 1 2 3 4 Time s Ball velocity m s Control PWM duty p eh
3. I 1 2 3 4 Time s Fig 62 LQ real time experiment The desired position in a square wave form 2 4 3 LQ tracking Double click the LQ tracking button The real time LQ tracking controller opens see Fig 63 The results of the real time experiment are shown in Fig 64 Fig 65 and Fig 66 A Eile Edit View Simulation Format Tools Help Dc Gs S S gt sena Hew mme Desired position m Signal Generator Magnetic Levitation Velocity m Current A MagLev system Control and States Fig 63 LQ tracking real time experiment MLS User s Manual 9 5 Ball position m Coil current A 0 8 L Pest krasie anty L E ac M n e aset reel Oh okr 1 0 1 2 3 4 Time s W IL bm brit pal fonty M Pla d i l 1 0 1 2 3 4 Time s Ball velocity m s 0 01 0 01 0 02 0 03 1 0 8 0 6 0 Control PWM duty 0 2 hundida NEN EWIE EE Time s in bis sr m w i 0 1 2 3 4 Time s Fig 64 LQ tracking real time experiment The desired position as a constant 0 015 E SES I I ATA 3 I I PA I 0 01 p p y s 3 DOE N I I a WE o SZL I I 0 005 0 1 2 3 4 Time s 1 4 r z 1 2 EE LT i 0 i O Gu Pa s o I A E N ur cU oed eee ee ee esc My l y I ok 0 6 0 1 2 3 4
4. Time s Fig 43 PID simulation the desired position is in a sine wave form x 10 s w Kjroo oA eg 11 ur uontsod peg Time s Time s T EE TAE SE se kod I I ee a I at cc A A A GA oo No t N AMP WMd 10000 T T I eee E E I al I gl I I SEE NES HT I EM id erue tna Resa ca Tia ca T eat l l e m 9 y yuan roo Time s Time s Fig 44 PID simulation the desired position is in a square wave form 30 MLS User s Manual 2 33 LQ If you click the LQ button the following windows open see Fig 45 Mtm 19 ax File Edit View Simulation Format Tools Help D Ua t Selo ep Normal ieee RL amp Magnetic Levitation Animation Position m i Velocity m s Velocity mps Current A Desired state LQ Controler Current A MagLev model Control and States Magnetic Levitation Control u0 model 100 Fig 45 LQ simulation The continuous LQ regulator is depicted on the basis of ml model4lq mdl see Fig 46 The user can use two files e MIL calc steady state m e ML calc lq m The first one calculates the equilibrium point of the system The second one calculates the LQ controller para
5. RN hu n up 1 i w hay s w iM ij 4 i 3 Fig 57 PID real time experiment The desired position in a sine wave form 38 4 x 10 12 l I I 0 3 I I I NC E ll 2 go UAL QN pace LEN a T eques E OlL r r r pon 1 1 amp Boiss mE L ya f b Wikii an Vm lu m E WY 3 om i HUM MU ai i 0 1 2 3 4 0 1 2 3 4 Time s Time s 1 4 14 i l EE PARA RE A e SE A RA eem i ji C T E Woli wyw E End Bop i o I I I I Ik I I Wh l I I IM PAL S o8L NENNEN LI ogl MM Mtn ous SR do 0 6 0 6 i 0 1 2 3 4 0 1 2 3 4 Time s Time s Fig 58 PID real time experiment The desired position in a square wave form 2 4 2 LQ Double click the LQ button The real time LQ controller opens see Fig 59 The results of the real time experiment are shown in Fig 60 Fig 61 and Fig 62 mis 19 A nl x File Edit View Simulation Format Tools Help Dc HS SBS K sens Jeeu RMT Desired position m Signal Generator Desired state Magnetic Levitation MagLev system Control uO System Control and States Ready 100 lodes Fig 59 LQ real time experiment MLSUsersManual 3G x 10 AN ES AN 0 1 il d ios PRZE AEG SESS adul s b E lu Ju E S oh Nu indie amp gl
6. Time s Ball velocity m s 0 02 0 01 0 01 0 8 0 6 0 4 0 2 Control PWM duty Time s Fig 65 LQ tracking real time experiment The desired position in a sine wave form MLS User s Manual 42 x10 T T lt T I I I I I i I I I I i I AG OR ES EP joe e I 3 I I I I i I I I I Y I EAD m m a e I I 1 I I i I i I I Y I AA al A I I i I I I I 4 I I i I L E T z T e e s u AWOOTIA peg T T t I I I j I I I I I I d Eg ET e i I 1 I I I I I I I I A dc CE N I I I I I I I I I I I I I I I EEEE PEPE er Ene et e at I I I I I I I I I I I I E I I I i o N oo o Y unt ur uoprsod peg Time s Time s I I gt I AA po ED I i I I N gt AAA FE pa E H A o v MP Md 010073 T T I I I I I I I I iog I I i I I I I Reps ea ih elo ehh eet e I I I I I i I I I I I I M I I iod t re MERE I a I A I l I I i I I I I I I i I I rzecza SE eer A I 1 I I E I I I I i I I I iod I I b I I L L v bit m V 102105 roo Time s Time s Fig 66 LQ tracking real time experiment The desired position in a square wave form 43 MLS User s Manual 3 Description of the Magnetic Levitation class propert
7. 0 00438 1 0 03884 238 Fig 33 Mask of the Magnetic Levitation model In Fig 32 enter into the File option and choose Look under mask The interior of the Magnetic Levitation model block shown in Fig 34 opens MLm_OpenLoop Magnetic Levitation model C SYN Position m Current model Velocity m s Current A Control Control PWMDuty PWM Duty Saturation Fig 34 Interior of the ML model Notice two integrator blocks in Fig 34 In fact we deal with third order dynamical system The third integrator related to the coil current is visible in Fig 35 LS MLm_OpenLoop Magnetic Levitation model Current model Fig 35 Interior of the Current model block The Simulink model is also equipped with the animation block When a simulation starts the following window opens see Fig 36 The animation screen is updated in every sample time All state variables the ball position and velocity and also the coil current are animated Magnetic Levitation Animation x m 0 009 x m s 0 000 x A 0 934 Fig 36 ML animation MLS User s Manual 24 Mathematical model The Simulink model is consistent with the following nonlinear mathematical model Model nieliniowy X X Fon X g m X ku Te Me FG F x F xs emPl exp 1 em emP2 P po fi x LW lt pe Ao um where x 0 0 016 x ER x xyw 2 3
8. I I I P I I f I I I EU iT a la l N I I I I RR I I EN L E V 1091100 LoD Time s Time s Fig 52 LQ tracking simulation the desired position is in a sine wave form 35 MLS User s Manual x 10 T T i i i E A O A SE MN i Se Se erem E Al 1 1 w uv uv o e s u AWOOTIA peg T T I I bo sz T SA 22e p er dct dex det ule asd icd ici ied dert ieri ird ii i e d ed 3 i a oo gt ur uoprsod peg Time s Time s T I rh T T ters Hs MPs apri Bri ir n As See sej at ess ee I sean n bon SSS E I TT NI T A I oo o Y N o AMP Md 010073 T T ARA SZORC I I a a ay eg E EL RAS eere AA EH Ls Se ees er eed l l ME m 9 V 102105 roo Time s Time s Fig 53 LQ tracking simulation the desired position is in a square wave form 36 MLS User s Manual 2 4 Levitation All simulation experiments can be repeated as real time experiments In this w
9. V te m Look Up Table Perform 1 D linear interpolation of input values using the specified table Extrapolation is performed outside the table boundaries Parameters Vector of input values SensorD ata Sensor V end 1 1 Vector of output values SensorD ata Distance m end 1 1 MM Show additional parameters Cancel Help Apply Fig 8 Look Up Table to be fulfilled with vectors of input and output values The approximated polynomial the red line is shown in Fig 9 The polynomial approximation will be not used in this manual due to the fact that the entire model is built in Simulink Therefore we recommend to model the characteristics as a Look Up Table block see Fig 7 Sensor signal V and Fig 8 0 002 0 004 0 006 0 008 0 01 0 012 0 014 0 016 0 018 Distance m Fig 9 The sensor characteristics approximated by the fifth order polynomial MLS User s Manual 0 2 1 2 Actuator static mode In this subsection we examine static features of the actuator i e the electromagnet Notice that the sphere is not present Click the Actuator static mode button and the window shown in Fig 10 opens LZ ML_ActStatSteps Fig 10 Identification window of a static current voltage characteristics Now we can perform button by button the operations depicted in Fig 10 We begin from the Build model for data acquisition button The window of the real time task
10. display the property values when the object name is entered in the MATLAB command window This section describes all the properties of the MagLev class The description consists of the following fields Provides short description of the property Shows the format of the method calls Description Describes what the property does and the restrictions subjected to the property Describes arguments of the set method Refers to other related properties Provides examples how the property can be used MLS User s Manual 44 3 1 BaseAddress Purpose Read the base address of the RT DAC4 PCI board Synopsis BaseAddress get ml BaseAddress Description The base address of RT DAC4 PCI board is determined by computer Each CML object has to know the base address of the board When a CML object is created the base address is detected automatically The detection procedure detects the base address of the first RT DAC4 PCI board plugged into the PCI slots Example Create the MagLev object ml Maglev Display their properties by typing the command ml Type InTeCo ML object BaseAddress 54272 D400 Hex Bitstream ver x901 Input voltage 0 8451 0 0244 V PWM 0 PWM Prescaler 0 Thermal status 0 Time 0 00 sec Read the base address BA get ml BaseAddress 3 2 BitstreamVersion Purpose Read the version of the logic stored in the RT DAC4 PCI board Synopsis Version get
11. ml BitstreamVersion Description The property determines the version of the logic design of the RT DAC4 PCI board The magnetic levitation models may vary and the detection of the logic design version makes it possible to check if the logic design is compatible with the physical model 3 3 PWM Purpose Set the duty cycle of the PWM wave Synopsis PWM get ml PWM set ml PWM NewPWM MLS User s Manual 45 Description The property determines the duty cycle and direction of the PWM wave The PWM wave is used to control the electromagnet so in fact this property is responsible for the electromagnet control signal The NewPWM variable is a scalars in the range from 0 to 1 The value of 1 means the maximum control 0 0 means zero control See PWMPrescaler Example set ml PWM 0 5 3 4 PWMPrescaler Purpose Determine the frequency of the PWM wave Synopsis Prescaler get ml PWMPrescaler set ml PWMPrescaler NewPrescaler Description The prescaler value can vary from 0 to 16 The 0 value generates the maximal PWM frequency The value 16 generates the minimal frequency The frequency of the generated PWM wave is given by the formula PWM frequency 4OMHz 4095 Prescaler 1 See PWM 3 5 Stop Purpose Sets the control signal to zero Synopsis set ml Stop Description This property can be called only by the set method It sets the zero contro
12. required The equilibrium stage of two forces the gravitational and electro magnetic has to be maintained by this controller to keep the sphere in a desired distance from the magnet When two electromagnets are used the lower one can be used for external excitation or as contraction unit This feature extends the MLS application and is useful in robust controllers design The position of the sphere may be adjusted using the set point control and the stability may be varied using the gain control Two different diameter spheres are provided The band width of lead compensation may be changed and the stability and response time investigated User defined analogue controllers may be tested 1 1 Laboratory set up A schematic diagram of the laboratory set up is shown in Fig 1 Electromagnet Frame Fig 1 MLS laboratory set up MLS User s Manual 232 One obtains the mechanical unit with power supply and interface to a PC and the dedicated RTDAC4 PCI I O board configured in the Xilinx technology The software operates in real time under MS Windows 98 NT 2000 XP using MATLAB 6 5 RTW and RTWT toolboxes Control experiments are programmed and executed in real time in the MATLAB Simulink environment Thus it is strongly recommended to a user to be familiar with the RTW and RTWT toolboxes One has to know how to use the attached models and how to create his own models The control software for the MLS is included in the MLS toolbox Th
13. shown in Fig 11 opens and the RTW build command is executed the executable code is created MET MLs ActStat velocity m s codi du ROCKA l Magnetic Levitation MagLev system System Control and States Fig 11 Real time model built to examine the current in the electromagnetic coil Click the Set control gain button It results in activation of the model window and the following message is displayed see Fig 12 MagLev E E E xj Fig 12 Message Set the Control Gain In Fig 11 one can notice the Control signal block In fact the control signal increases linearly We can modify the slope of this signal changing the Control Gain value Click the Data acquisition button Within 10 seconds data are acquired and stored in the workspace Click the Data analysis button The collected values of the coil current are displayed in Fig 13 MagLev The characteristics is linear except a small interval at the beginning We can locate the cursor at the point where a new line slope starts see the red line in the picture We can move the cursor in two ways by writing down a value into the edition window or by drugging the slider In this way the current characteristics is prepared to be analyzed in the next step The line is divided into two intervals the first from the beginning of measurements to the cursor and the second from the cursor to the end of measurements After setting the cursor p
14. the big ball dashed horizontal line is crossing the curve at the 0 009 m distance from the electromagnet 3 5 T T T T I I I I A o peo a i I I I HUE I I I NE I I I A I I I V DO RS baze ARA aa AAA SE gt I I I I c o I I I PA I e I I I I ea EG AJ POZO tae 7 D I I I E I I I I 2 I I PA I EO ODRZE eae pa a urns PE e I I P4 I o I I I I KO I I I I E KA I Ww I I 05p secet Sea A A E RNA I x I I I I I I I 0 1 I I l 0 0 5 1 1 5 2 2 5 Coil current A Fig 38 Electromagnetic force vs coil current The gravity force of the big ball dashed horizontal line is crossing the curve at the 0 9345 A coil current The electromagnetic force depends on two variables the ball distance from the electromagnet and the current in the electromagnetic coil This is clearly presented in Fig MLS User s Manual 26 37 and Fig 38 We can show these dependencies in three dimensional space see Fig 39 9 345 10 It means that the ball 0 col 9 107 velocity remains equal to zero The ball is levitating kept at the 9 mm distance from the bottom of the electromagnet The 0 9345 A current flowing through the magnetic coil is the appropriate value to balance the gravity force of the ball The ball is stabilized at Em Mas xi LO N 6210 oneuBeuo1129 3 Position m Coil current A Fig 39 Electromagnetic force vs coil current and distance fro
15. 1 PID simulation Magnetic Levitation Magnetic Levitation Animation Current A Velocity m s Velocity m Current A MagLev model Control and States The parameters given bellow are used in the PID controller K K K 130 500 6 The simulated stabilization results are shown below x 10 7 0 15 r 10 L e s zi TONER eo ao EE Moa po l E PX S 0 1 L Same ss lt b m z7 i 5 0 05 NE M amp NE E E OS ae ede S op 0 05 i 0 0 5 1 1 5 0 0 5 1 1 5 2 Time s Time s 1 5 T T T 0 8 T T T B j lt i 3 06r os SE aaa pes 1 p uc SSS eA I I I U SASS mai Hoo H I I A 0 4 TR cli iC powa jeno 5 S pf 3 g 05 p posce SKG ARA a eee eee rt p o i 0 I L 0 fi L l 0 0 5 1 1 5 2 0 0 5 1 1 5 2 Time s Time s Fig 42 PID simulation the desired position is a constant MLS User s Manual 29 x 10 x10 s w amp aroo oA reg 11 ur uonrsod peg Time s Time s I I S I NL N l R H eo o m o AMP NMd 104000 x Y ILU M I I I x E boo e I I I ma p I I pF ZSEE I FE I iY I I M I I a I I ue RE EE RE No NOK i L Ta L c W uml W ion uv e eN o o y Juarmo IoD Time s
16. 3 5 STO dedos 46 3 6 VOLTAGE 0 RA AAA A NW AO AAAA O 46 3 7 THERMSTATUS seca estet pectet nitet net OAI Wt O did 47 3 8 TIME ESA RADNA OD a eoe ONA OJ 47 3 9 QUICK REFERENCE TABLE s adas er e ede vi leet diua 47 MLS User s Manual De Introduction The Magnetic Levitation System MLS is a complete after assembling and software installation control laboratory system ready to experiments The is an ideal tool for demonstration of magnetic levitation phenomena This is a classic control problem used in many practical applications such as transportation magnetic levitated trains using both analogue and digital solutions to maintain a metallic ball in an electromagnetic field MLS consists of the electro magnet the suspended hollow steel sphere the sphere position sensors computer interface board and drivers a signal conditioning unit connecting cables real time control toolbox and a laboratory manual This is a single degree of freedom system for teaching of control systems signal analysis real time control applications such as MATLAB MLS is a nonlinear open loop unstable and time varying dynamical system The basic principle of MLS operation is to apply the voltage to an electromagnet to keep a ferromagnetic object levitated The object position is determined through a sensor Additionally the coil current is measured to explore identification and multi loop or nonlinear control strategies To levitate the sphere a real time controller is
17. 8 The parameters of the above equations are given in the table below Parameters Values Units m 0 0571 big ball kg g 9 81 m s F function of x and x N Ps 1 752110 H P 5 823110 m f o function of x 1 s Fa 1 4142 10 ms pt 4 562610 m c 0 0243 A k 2 5165 A Kaui 0 03884 A Winks 0 00498 MLS User s Manual 25 The electromagnetic force vs position diagram is shown in Fig 37 and the electro magnetic force vs coil current diagram is shown respectively in Fig 38 3 T I T T I T T I T I I I I I I I I I I I I I I I I I I I I I I I I I I I I I I I I I I I I EL ene zabi zaa ees NINE eee bist asi trow I I I I I I I I I I I I I I I I I I I I I I I I I I I Ex NJ I I I I I I I I A A O dT e RI A EM 2 N I I I I I I I I gt N I I I I I I I I 2 IN I I I I I I I I o DN I I I I I I I I B LES I I I I I I I I QD d E Se so A EEEE E ts 422 EE E S dac wu MR uu EG ELE E ME KN i i i o I ie aS I I I I I I I 8 l pan Na E 4 O EA E SAS PR Se PSS PPA Z SRO RRT A ui E y i 1 I I T rd I 1 i I I I I I I I I I I I I I I Deh I I I io a a gt RAR as GRA EET I I I I pos I I I I I I I I b ee I I I I I I I I I SS NN I I I I I I I I I T 0 i l I I l I i l I 0 0 002 0 004 0 006 0 008 0 01 0 012 0 014 0 016 0 018 0 02 Position m Fig 37 Electromagnetic force vs position The gravity force of
18. INTECO Krakow Magnetic Levitation System MLS User s Manual version 1 6 for MATLAB 6 5 Krak w March 2005 Table of contents INTRODUCTION SEGA Quar eras EE eR eve EN Da redeo E EUM RES 3 1 1 LABORATORY SETUP iiie iie testes qoe riore bet teet mide ee Da EPOR Ted ods 3 1 2 HARDWARE AND SOFTWARE REQUIREMENTS cccococonononononononononononononononononononononononos 4 1 3 FEATURES OP MIS 5 aiii cO I Denim 5 1 4 TYPICAL TEACHING APPLICATIONS sese 5 1 5 SOFTWARE INSTALLATION Iquitos iii o a 5 2 ME MAIN WINDOW zew ASO r us eve A o 6 2 1 IDENTIFICATION 5 i W AO O AO O dac eve esso iii 7 2 1 1 YA 2T 7 2 1 2 Actuator static mode eene ENN ee RA nennen nene nene nene r nnn 11 2 1 3 Minimal control e e Ret edite deese tee 14 2 1 4 Actuator dynamic mode tesi oec ituri coser Sd A d Vu Ne Fuge 17 2 2 MAGLEV DEVICE DRIVERS eee eee 19 2 3 SIMULATION MODEL amp CONTROLLERS ccce enne enne teta enn 22 2 3 4 OPEREN A COP AREA o Deu dbi 22 2 3 2 PIDA ia e eese ee a ee ia bes E Aro 26 2 3 3 E ooo waka O aedi bete O 31 2 3 4 LOVAINA GOO Ai 34 2 4 EEVITATI N AA A AA YZ T M TE Sods 37 2 4 1 PD A tee date A id 37 2 4 2 BOONE A ndm i ms A ede eus 39 2 4 3 LO a cis dA BYS a 41 3 DESCRIPTION OF THE MAGNETIC LEVITATION CLASS PROPERTIES44 3 1 BASEADDRESS SD IUD iria 45 3 2 BITSTREAMV ERSION 3 ee tertie tra idad QU Eee dd 45 3 3 PW Mors i dd aii 45 3 4 PWMEPRESCALER nocia acrobat neo kai ao his 46
19. The K and f parameters are iteratively changed during the optimization procedure The current curve is fitted four times This is due to the control signal form 0 7 01 F T n q Po pd AEK i I i I measured current i modeled current I T T I I I I I I I L j I 06 1 puc ser qun CEDE e e o a o h e e e I I I I I I I I I I I I I I I I I I I I 0 5 A PER E I I I I I I I I I I I I I I I I I I I I I T 0 4 NODZE KOGOS REN En I I I I I 5 I I I I I E I I I I I Bg bo o eee eee ee ee do oe eee O A e eel pus I I I I I I I I I I I I I I I I I I I I 0 2 PM 042 jp a p o a a I I I I I I I I I I I I I I I I I I i 1 I I 1 0 08 0 1 0 12 0 14 0 16 0 18 Time s Fig 25 Current curve the fitting result of the optimization procedure Finally the information about the mean values is displayed see Fig 26 The advanced user can use the functions code to perform a detailed analysis Fig 26 Optimization results MLS Users Manual 18 2 2 MagLev device drivers The driver is a software go between for the real time MATLAB environment and the RT DAC4 PCI acquisition board The control and measurements are driven Click the RTWT Device Drivers button in the Magnetic Levitation Main window The following window opens see Fig 27 i ML_DevDriv MagLev Device d
20. ar characteristics i u k u c a 2 60798876298869 b 0 01077522109792 The constant c is obtained for u 0 The family of linear characteristics is used to obtain the coefficients k vs control u Current A Current A i i i i i i 0 0 1 0 2 03 0 4 05 06 07 08 09 1 Control PWM duty 05 i i i Fig 17 Current vs PWM duty cycle 2 1 3 Minimal control In this subsection we examine the minimal control to cause a forced motion of the sphere from the supporting structure tablet toward the electromagnet against the gravity force Notice that in this experiment the sphere is not levitating It is kept nearby the electromagnet by the supporting structure Click the Minimal control button and the window shown in Fig 18 opens MLS User s Manual 14 57 ML_MinCtiSteps Fig 18 Window to identify the minimal control vs distance between the sphere and electromagnet Now we proceed button by button the operations depicted in Fig 18 similarly to the procedure described in the previous subsection We begin from the Build model for data acquisition button The window of the real time task shown in Fig 19 opens File Edit View Simulation Format Tools Help Da eX Gg S gt iens Jae RET amp Velocity m s Current A Control signal Magnetic Levitation MagLev system System Control and States fos f bds Z7 Fig 19 Real time model b
21. ation R S property may be read and set MLS User s Manual 47
22. ay one can verify accuracy of modelling If we double click the levitation button in the ML Main window the following window opens see Fig 54 CT n Eie Edit View Simulation Format Tools Help Fig 54 Experimental controllers Now we can choose the controller we are interested in We start from the PID control 2 4 1 PID Double click the PID button The real time PID controller opens see Fig 55 The results of the real time experiment are shown in Fig 56 Fig 57 and Fig 58 A ES File Edit View Simulation Format Tools Help Velocity m s Desired position m locity m s Current A Controller Magnetic Levitation MagLev system System Control and States Signal Generator Fig 55 PID real time experiment MLS User s Manual 37 Ball position m Coil current A Ball position m Coil current A x 10 p ME wa 0 1 2 3 4 Time s Mia aa heel li W lul d 0 1 2 3 4 Time s Ball velocity m s sll Lb o jn Holl LIA Time s Control PWM duty o S m ii u ii lr 2 i 0 1 2 Time s Fig 56 PID real time experiment The desired position as a constant x 10 11 AN KPO 8 OE Soon LE 0 1 2 3 4 Time s 1 2 jak Why W p 0 8 0 1 2 3 4 Time s MLS User s Manual Ball velocity m s Control PWM duty
23. d peg Time s Time s T T T I zadko ME T T hs uti Herb AP pes rei De ABs Dee ins ema Sets es Fa ee deme Ea t t ee I I mi ami tet AA A Ve st se st sal Y e N mi AMP Md 010073 T T EEN RE PATA I SOA SRA Sea e QA AE eee A ere ered EA Li A oo c V 1021105 roo 1 5 0 5 1 5 0 5 Time s Time s Fig 51 LQ tracking simulation the desired position is a constant x10 T T T I I E I I I I I I I I I I I T tos For r gt H e I I I I I i I I I I I I I I A e I I 1 I I I I if I I I I I if OS RZN ay Sie fe SNS Sse I I 1 T I I fi I I Jl I I I I I m i a j o cen N O s u AWOOTIA Teg T R T t I NS I I Sal I I aie I I EK I I MN Jess d xu JO R en I I DN I I FI I d I I LA I d I NE iS MEN s I Pp I LA Way I I ff I I PO R AAA AT n I I N IN I I Sz I I L R I I I I I fi i i i ON oo gt 4 4 ur uonrsod peg Time s Time s Aynp AMd 00u00 OK o I l I I I I I Ng FS js ATEN ae I I Foi I I y d I za I I 4 I men P gt oA SZA I I M I I
24. e V characteristics is shown in Fig 30 Current A 0 0 5 1 1 5 2 2 5 Measured signal V Fig 30 Current vs voltage characteristics approximated by the red curve The characteristic can be approximated by a polynomial of the second order I U aU aU du where I current U voltage from the A D converter Ag dj a identified parameters of the polynomial a 0 0168 a 1 0451 ay 0 0317 2 3 Simulation Model 8 Controllers Click the Simulation Model amp Controllers button in the Magnetic Levitation Main window The following window opens see Fig 31 Te ML_Sim Fig 31 Simulation Model amp Controllers window 2 3 1 Open Loop Simulink model Next you can click the first Open Loop button The following window opens see Fig 32 Notice that the scope block writes data to the MLSimData variable defined as a structure with time The structure consists of the following signals Position m Velocity m s Current A Control PWM duty 0 1 mz i7 MLm_OpenLoop Magnetic Levitation Animation Position m i an pg Velocity r G FNE MagLev model Magnetic Levitation Control and States model Fig 32 Open loop simulation MLS User s Manual 22 If you click the Magnetic Levitation model block the following mask opens see Fig 33 Block Parameters Magnetic Levitation model I AA 5165 0 0243 IU 41 142e 4 4 1 5626e ed
25. ies The MagLev is a MATLAB class which gives the access to all the features of the RT DAC4 PCI board supported with the logic for the MLS model The RT DAC4 PCI board is an interface between the control software executed by a PC computer and the power interface electronic of the modular servo model The logic on the board contains the following blocks e PWM generation block generates the Pulse Width Modulation output signal Simultaneously the direction signal and the brake signal are generated to control the power interface module The PWM prescaler determines the frequency of the PWM wave e power interface thermal status the thermal status can be used to disable the operation of the overheated actuator unit e interface to the on board analog to digital converter The A D converter is applied to measure the position of the ball light sensor and to measure the coil current of the actuator All the parameters and measured variables from the RT DAC4 PCI board are accessible by appropriate properties of the MagLev class In the MATLAB environment the object of the MagLev class is created by the command object name MagLev for example ml maglev The get method is called to read a value of the property of the object property value get object name property name The set method is called to set new value of the given property set object name property name new property value The display method is applied to
26. ion we examine dynamic features of the actuator i e the electromagnet It means that the moving sphere generates an electromotive force EMF EMF diminishes the current in the electromagnet coil Click the Actuator static mode button and the window shown in Fig 23 opens i7 ML_ActDynSteps Fig 23 Identification window of a dynamic current voltage characteristics A user should perform three experiments without the sphere Without ball with the sphere on the supported structure Ball on the tablet and with the sphere fixed to the rigid screw Ball fixed We begin from the Build model for data acquisition button The window of the real time task shown in Fig 24 opens We have to set the control gain If we are going to modify the control magnitude then we set the default gain to 1 and the subsequent duty cycles to 0 25 0 5 0 75 and 1 Click the Data acquisition button and save data under a given file name MLs_ActDyn Control signal Magnetic Levitation MagLev system Control and States Fig 24 Real time model built to examine EMF influence on the coil current Click the Data analysis button It calls the ml_find_curr_dyn m file The following window opens see Fig 25 The parameters optimization procedure starts The optimization routine is based on the mlm_current mdl model When ml_find_curr_dyn m runs the optimization function fminsearch is executed Fminsearch uses the ml_opt_current m file
27. is toolbox uses the RTWT and RTW toolboxes from MATLAB MLS Toolbox is a collection of M functions MDL models and C code DLL files that extends the MATLAB environment in order to solve MLS modelling design and control problems The integrated software supports all phases of a control system development e on line process identification e control system modelling design and simulation e real time implementation of control algorithms MLS Toolbox is intended to provide a user with a variety of software tools enabling e on line information flow between the process and the MATLAB environment e real time control experiments using demo algorithms e development simulation and application of user defined control algorithms MLS Toolbox is distributed on a CD ROM It contains software and the MLS User s Manual The Installation Manual is distributed in a printed form 1 2 Hardware and software requirements Hardware Hardware installation is described in the Assembling manual It consists of s Electromagnet e Ferromagnetic objects e Position sensor e Current sensor s Power interface e RTDAC4 PCI measurement and control I O board s Pentium or AMD based personal computer Software For development of the project and automatic building of the real time program is required The following software has to be properly installed on the PC e MS Windows 2000 or Windows XP MATLAB version 6 5 with Simulink 5 Signal Processing Toolbox and Contr
28. l of the electromagnet and is equivalent to the set ml PWM 0 call See PWM 3 6 Voltage Purpose Read two voltage values MLS User s Manual 46 Synopsis Volt get ml Voltage Description Returns the voltage of two analog inputs Usually the analog inputs are applied to measure the ball position and the coil current 3 7 ThermStatus Purpose Read thermal status flag of the power amplifier Synopsis ThermSt get ml ThermStatus Description Returns the thermal flag of the power amplifier When the temperature of a power amplifier is too high the flag is set to 1 3 8 Time Purpose Return time information Synopsis T get ml Time Description The MagLev object contains the time counter When a MagLev object is created the time counter is set to zero Each reference to the Time property updates its value The value is equal to the number of milliseconds which elapsed since the object was created 3 9 Quick reference table BaseAddress BE XX Read the base address of the RT DACA PCI board Bitst Vena Read the version of the logic design for the M dai uo RT DAC4 PCI board PWM Read set the parameters of the PWM wave PWMPrescaler Read set the frequency of the PWM wave Stop Set the control signal to zero Voltage Read the input voltages ThermStatus Read the thermal flags of the power amplifier Time Read time information e R read only property S allowed only set oper
29. lation Format Tools Help Fig 2 The Magnetic Levitation Main window In the ML Main window one can find testing tools drivers models and demo applications You can see a number of pushbuttons ready to use The ML Main window shown in Fig 2 contains four groups of the menu items e Tools identification e RTWT Device Driver MagLev device driver e Simulation model and controllers e Real time experiments levitation Section 2 is divided into four subsections Under each button in the ML Main window one can find the respective portion of software corresponding to the problem announced by the button name These problems are described below in four consecutive subsections MLS User s Manual 6 2 1 Identification If we click the identification button the following window see Fig 3 opens There are the default values of all parameters defined by the manufacturer Nevertheless a user is equipped with a number of identification tools He can perform the identification procedures to verify and if necessary modify static and dynamic characteristics of MLS ML_Identification Fig 3 The identification window Four identification steps have been preprogrammed They are described below 2 1 1 Sensor In this subsection the position sensor characteristics is identified If you click the Sensor button the following window opens see Fig 4 Fig 4 Sensor signal in V vs the sphere distance from the electr
30. m the electromagnet In Fig 40 the f x diagram is shown Eu en 0 014 0 016 0 018 0 02 0 035 0 012 1 0 Position m 0 004 0 006 0 008 0 0 002 Fig 40 Function f x zyj MLS User s Manual u Linear continuous model ML is a highly nonlinear model It can be approximated in an equilibrium point by a linear model The linear model can be described by three linear differential equations of the first order in the form x Ax Bu y Cx Oo 1 0 0 A a 0 daal B 0 b 51 0 dz 3 The elements of the A matrix are expressed by the nonlinear model parameters in the following way 2 _ 10 X30 E emPl Femp2 a 2 1 2 m Eps _ 0 zd yee 2X6 Tum F nP2 J3 F C m emP2 2 f Mo iPl fipa az ku TC Kan 5 e fipa z 4 a33 f Xio NS 1 b k f Xo The C vector elements correspond to an applied controller For example The PID controller shown in the next subsection requires C in the form C lt o o 2 3 2 PID If you click the PID button the following windows open see Fig 41 The interior of the Magnetic Levitation model block has been shown in Fig 34 The PID controller is built in the form u t Kp elt K edt K Le dt e t x t xy t MLS User s Manual 28 MLm_PiD File Edit View Simulation Format Tools Help 2nixi DU 1 Gs K m Normal Heol RETE Desired position m Controller Signal Generator Fig 4
31. meters using linmod and lgr linmod obtains linear models from systems of ordinary differential equations In the ML calc Iq m file we encounter the following command A B C D linmod ml_model4lq 5 modeldlq BS zioni x File Edit view Simulation Format Tools Help CO ce ed k S K m Normal Heo RETE Current model Ready 100 lode4 Z Fig 46 MI model4lq mdl to extract an LQ regulator The state space linear model of the system of ordinary differential equations described in the block diagram model4lq is returned in the form of the A B C D matrices The state variables and inputs are set to the defaults specified in the block diagram Having obtained the linear model calculated at x10 x20 x30 equilibrium point for the assumed value u0 of the control we are ready to calculate the K gains of the LQ controller We only need to assume the Q and R matrices From the ML_calc_lq m file we have Q eye 3 3 Q 1 1 300 Q 2 2 0 001 Q 3 3 10 R 10 5 The following assumptions corresponding to the Q and R weighting matrices have to be satisfied Q20 R gt 0 The following command from the ML_calc_lq m file K S E lqr A B Q R calculates the optimal gain matrix K such that the state feedback law u 2 Kx minimizes the cost function f x Qx u Ru dt subject to the state dynamics R Ax Bu Now the gain vector K can be used as the optimal feedback see the Simulink diagram in Fig 45 We s
32. ol Toolbox from MathWorks Inc to develop the project e Real Time Workshop to generate the code e Real Time Windows Target toolbox MLS User s Manual 4 The MLS toolbox which includes specialised drivers for the MLS System These drivers are responsible for communication between MATLAB and the RT DAC4 PCI measuring and control board MS Visual C to compile the generated code 1 3 Features of MLS 1 4 Aluminium construction Two ferromagnetic objects spheres with different weight Photo detector to sense the object position Coil current sensor A highly nonlinear system ideal for illustrating complex control algorithms None friction effects are present in the system The set up is fully integrated with MATLAB Simulink and operates in real time in MS Windows 98 2000 XP The software includes complete dynamic models Typical teaching applications System Identification SISO MISO BIBO controllers design Intelligent Adaptive Control Frequency analysis Nonlinear control Hardware in the Loop Real Time control Closed Loop PID Control 1 5 Software installation Insert the installation CD and proceed step by step following displayed commands MLS User s Manual 5 2 ML Main Window The user has a rapid access to all basic functions of the MLS System from the MLS Control Window In the Matlab Command Window type ML Main and then the Magnetic Levitation Main window opens see Fig 2 Ele Edit View Simu
33. omagnet in mm MLS User s Manual fe The following procedure is required to identify the characteristics l 2 7 Screw in the screw bolt into the seat Screw in the black sphere and lock it by the butterfly nut Notice that the sphere is fixed to the frame Turn round the screw so the sphere be in touch with the bottom of the electromagnet Switch on the power supply and the light source Start the measuring and registration procedure It consists of the following steps Push the Measure button the voltage from the position sensor is stored and displayed as Measured value V One can correct this value by measuring it again Push the Add button the measured value is added to the list A rotation number value is automatically enlarged by one see Fig 5 Rotation number 15 Measure Mesaured value V 3 0972 Add Distance mm Sensor output V 0 0000 5 0220 Fig 5 Characteristics of the sphere position sensor Manually make one full rotation of the screw Repeat three last steps so many times as none change in the voltage vs position characteristics is observed Push the Export Data button the data are written to the disc see Fig 6 Data are stored in the ML Sensor mat file as the SensorData structure with the following signals Distance mm Distance m and Sensor V In the Simulink real time models the above characteristics is used as a Look Up Table model The block named Posi
34. osition consequently click the Analyze button The following message see Fig 14 appears We obtain the dead zone values corresponding to the control and current The constants a and b of the linear part are the parameters of the line equation i u au b Fig 13 Current in the electromagnetic coil MagLev Fig 14 Coefficients of the actuator characteristics These parameters namely u yy 0 00498 x 0 03884 k 2 5165 and c 0 0243 are going to be used in the simulation model in section 2 3 1 see the differential equations parameters To obtain a family of static characteristics for linear controls with different slopes we repeat the following experiment We apply a PWM voltage signal in the time interval from 0 to 10 s The PWM duty cycles for the subsequent ten experiments are varying linearly in the ranges 0 0 1 0 0 2 0 1 0 see Fig 16 QM QE MEE CE GE EE JE E 0 7r Control PWM duty o o o o w R al o o m T e a Time s Fig 15 Family of the input PWM characteristics Consequently we obtain diagrams of the currents corresponding to ten experiment see Fig 16 Each characteristics is approximated by a polynomial of the first order Finally the entire current vs PWM duty cycle relation is depicted black points in Fig 17 The red line represents the linear approximation of measurements We obtain the following numerical values of line
35. river Velocity m s Magnetic Levitation MagLev system System Control and States Fig 27 RTWT MagLev device driver window Notice that the scope block writes data to the MLExpData variable defined as a structure with time The structure consists of the following signals Position m Velocity m s Current A Control PWM duty 0 1 The interior of the Magnetic Levitation System block it means the interior of the driver block is shown in Fig 28 ML_DevDriv Magnetic Levitation System 4 Analog Inputs 0 01s 1 PWM Mode Velocity Filter S Velocity m s PWM Prescaler o EJ gt gt SE ae Thermal Flag S ch Current scalling Current Filter Current A IV to A Control PWM Du o aa Control PWM duty Fig 28 Interior of the driver block MLS User s Manual 19 In fact there are two drivers ML_Analoglnputs and ML_PWM There are also two characteristics the ball position m vs the position sensor voltage V and the coil current vs the current sensor voltage V The driver uses functions which communicates directly with a logic stored at the RT DAC4 PCI board When one wants to build his own application one can copy this driver to a new model Do not introduce any changes inside the original driver They can be gt introduced only inside its copy Make a copy of the installation CD The Simulink Look Up Table model named Position scaling see Fig 7 representing
36. tart the LQ simulation for a constant desired value and for the desired position assumed in a sine wave form We obtain the results shown in Fig 47 and Fig 48 x10 9 5 l 0 03 E g 9 02 1 pe am a go E E 8 0 01 r pese dug 5 T 8 5 Bae ct atat Pat tat at AAA APO I hl a 0 01 0 0 5 1 1 5 0 0 5 1 1 5 2 Time s Time s 1 i i i 0 4 R 4 GK RE zg nd ues ME M RAM e aso a OE 4 DOMUS Z ZE E I I 1 A 0 2 ARAS a AAN a 3 i i i i im Uu ES SS ERO T E S KAM NOGE T OG I I I O I I 0 7 L L L 0 L l l 0 0 5 1 1 5 2 0 0 5 1 1 5 2 Time s Time s Fig 47 LQ simulation the desired position is a constant x10 0 04 s w AWOOTOA Teg ur uoprsod peg Time s Time s I I Eo GA if I if I d I i i EE AA AA a L n R oo No t N AMP Md 010073 N CONS d i i us udi ELE Pi l E RI d AE ean a I I I r I I m gt AM TERE DEM i i i Ps 1 l E l l m o 0 D o o V 1021105 roo Time s Time s Fig 48 LQ simulation the desired position is in a sine wave form x10 T T
37. the position sensor characteristics has been already described Now let us present the second Simulink Look Up Table model named Current scaling see Fig 29 Current scalling V to A Fig 29 The Simulink Look Up Table model representing the current sensor characteristics To build the above characteristics it is necessary to measure the current of the electromagnet coil The algorithm in the computer is the source of the desired value of the control in the form of the voltage PWM signal This PWM is the input voltage signal transferred to the LMD18200 chip of the power interface Due to a high frequency of the PWM signal the measured current values correspond to the average current value in the coil This characteristics has been built by the manufacturer It is not recommended to repeat measurements by a user because to do so one must unsolder the input wires of the electromagnet On the basis of the data given in the table below one can generate his own characteristics For a fixed PWM frequency and a variable duty cycle the coil amperage is measured The measured data are given below in the table PWM duty cycle amperage A voltage V 0 0 0 374811 0 1 0 25 0 262899 0 2 0 51 0 510896 0 3 0 77 0 752465 0 4 1 02 0 993620 0 5 1 28 1 229133 0 6 1 52 1 459294 0 7 1 74 1 651424 0 8 1 99 1 875539 0 9 2 21 2 076814 1 2 43 2 269865 MLS User s Manual 20 The current A vs voltag
38. tion scaling is located inside the device driver block of MLS see Fig 7 Notice that the characteristics shows meters vs Volts In Fig 6 there were shown Volts vs meters It is obvious that we require the inverse characteristics because we need to define the output as the position in meters MLS User s Manual 8 Sensor signal V 0 5 0 0 002 0 004 0 006 0 008 0 01 0 012 0 014 0 016 0 018 Distance m Fig 6 The sensor characteristics after being measured and exported to the disc osition scaling V to m Fig 7 The Simulink Look Up Table model representing the position sensor characteristics If we click this block the window shown in Fig 8 opens Any time you like to modify the sensor characteristics you can introduce new data related to the voltage measured by the sensor The voltage corresponds to the distance of the sphere set by a user while the identification procedure is performed The sensor characteristics is loaded from the ML_sensor dat file which has been created during the identification procedure If the curve of the Position scaling block is not visible please load the file with data The sensor characteristics can be approximated by a polynomial of a given order For example we can use a fifth order polynomial PLO lt pa Po Ds 25697073504 59 p 1245050011 25 p 18773635 92 p 79330 24 p 150 21 and pu 5 015 MLS Users Manual 9 Block Parameters Position scaling
39. uilt to examine the minimal electromagnetic force Click the Set control gain button It results in activation of the model window and the following message is displayed see Fig 20 MagLev rei x e Set the control Gain value on the MLs MinControl model EN Fig 20 Message set the Control Gain It means that we can set a duty cycle of the control PWM signal The sphere is located on the support and the experiment starts Click the Data acquisition button A forced motion of the ball toward the electromagnet begins MLS User s Manual 15 Click the Data analysis button The collected values of the ball position are displayed in Fig 21 MaqgLev Fig 21 The sphere motion The sphere motion is visible We can locate the cursor at the point slightly before a position jump occurs takes place see the red line in the picture We can move the cursor in two ways by writing down a value into the edition window or by drugging the slider In this way the acquired data are prepared to be analyzed in the next step After setting the cursor position consequently click the Analyze button The following message see Fig 22 appears This information means that the sphere located 15 82 mm from the electromagnet begins to move toward it when the PWM control over crosses the 0 49485 duty cycle value Fig 22 Message of the experiment results MLS User s Manual 16 2 1 4 Actuator dynamic mode In this subsect
40. value of the ball position the ball velocity coil current values and the control are recalculated on the basis of nonlinear dynamical equations of ML the ML_GetStState s function is used In fact we should introduce a no stationary LQ it means solve the Riccati equation for every new equilibrium point to obtain a new value of the gain vector K cl MLm_LQtrack inl xl File Edit View Simulation Format Tools Help Di dessmm o m Normal BIH TE Desired position m p c SSR l Current A Signal Generator LQ Controler PWM Tm MagLev model Magnetic Levitation Control and States model Ready 100 lodes 2 Fig 50 LQ tracking simulation Now the gain vector K can be used as the optimal feedback see the Simulink diagram in Fig 50 We start the LQ tracking simulation for a constant desired value and for the desired position assumed in sine and square wave forms We obtain the results shown in Fig 51 Fig 52 and Fig 53 MLS User s Manual 34 x 10 T T N i i i Y Bee Sea O O I I mem be me ese qaii i ZZ ELA ee ee NUI vi I I I p poer c N o gt o o o s u Kjroo oA peg l v br Seel all Ue 4 res A o ms md Ka el P T 2 I o me A M Ov oo w uonrso

Download Pdf Manuals

image

Related Search

Related Contents

ダウンロード - レンタルサーバーのWADAX @Next Style  Gemmy 37563 Instructions / Assembly  Media-Tech MT1504 gaming control  Philips CarStudio Car media docking system CMD305A    PLレポート 2009年度 No.11  Very High-Speed Counter Modules  Ultrasonic Level Transmitter and Sensor User Manual    HP SmartCalc 300s User's Manual  

Copyright © All rights reserved.
DMCA: DMCA_mwitty#outlook.com.