Home

Tower Crane - Alpha Control Lab

image

Contents

1. If you look under the Tower Crane model mask you can see its interior Fig 4 39 modeltcsimple is the executable dll file The scale factors are set to 1 These parameters relate to identification parameters like friction and tension of the belts gt PCL TCrane_first_model Tower Crane model File Edit wiew Simulation Format Tools Help D el S amp S p 30 Normal E se ha E e Y beta Scale 1 gt alfa Scale gt X Seale position scale gt Ea T Scale o Pi m m Eu H lu tu e 4 tu 2 im mr scalez model equations e Yw beta Scaled Scales a Aw alta Scale O z cor mr e fu Clugease Linki tu Ei E Tw Scale X velocity Fig 4 39 The interior of Tower Crane model Tower Crane User s Manual 36 In opposite to the real time model it is not necessary to rebuild the model before running Open Simulation parameters from the menu bar Notice the solver options Fixed step and Fixed step size set to 0 001 in the editable text box You can start a simulation from the menu bar When the simulation is running you can watch the results in the scope see Fig 4 40 Similarly as in the real time experiment the data are saved in the scope in the EX structural variable Plotting four curves as functions of time Fig 4 40 1s produced by gt gt plot EX time EX signals values We perform simulations related to the previous experiments The para
2. pressed See ResetEncoder RailLimitSwitch 7 11 Therm Purpose Read thermal flags of the power amplifiers Synopsis Therm get tcrane Therm Description Returns three thermal flags of three power amplifiers When the temperature of a power amplifier is too high the appropriate flag is set to x See ThermFlag 7 12 ThermFlag Purpose Control an automatic power down of the power amplifiers Synopsis ThermFlag get terane ThermFlag set tcrane ThermF lag NewThermFlag Tower Crane User s Manual 59 Description The ThermFlag and NewThermFlag are 1x3 vectors If an element of these vectors is equal to 1 the DC motor corresponding to it is not excited by the PWM wave when it is overheated See Therm 7 13 Time Purpose Return time information Synopsis T get tcrane Time Description The towercrane object contains the time counter When a towercrane object is created the time counter 1s set to zero Each reference to the Time property updates its value The value is equal to the number of milliseconds past since the object was created 7 14 Quick reference table Property Name Description Read the version of the logic design for the RT DAC PCI board Encoder Read the incremental encoder registers PWM Set the parameters of the PWM waves PWMPrescaler Determine the frequency of the PWM waves ResetEncoder Reset the encoder counters RailLimit Control the operating range
3. 4 50 please notice the scales of deviations Tower Crane User s Manual 40 0 01 0 005 0 005 0 01 0 015 gt APA AE i D005 0010015 0 02 0 02 0018 001 0 005 i D005 0 01 D015 Fig 4 49 Unstabilised deviations of Fig 4 50 Stabilised deviations of the payload the payload in the X Y plane in radians in the X Y plane in radians The controls in the X and T directions are shown in Fig 4 51 and Fig 4 52 Two cases of control with and without stabilisation of angles are compared The magnifications of the chosen areas are present in Fig 4 53 and Fig 4 54 Fig 4 51 The controls normalised units Fig 4 52 The controls normalised units in in the X direction vs time seconds the T angle direction vs time seconds Notice that the controls related to the case of angles stabilisation share their actions between two tasks tracking a desired position of the cart and stabilising the payload in its down position Tower Crane User s Manual 41 with stbilization 0 22 with stbilization 0 18 0 16 0 14 without stbilization Fig 4 53 The controls normalised units Fig 4 54 The controls normalised units in in the X direction vs time seconds the T angle direction vs time seconds Tower Crane User s Manual 42 5 Prototyping your own controller in the real time environment In this section the process of building your own control system is described The RealTime
4. Signal RT_DACIPC Tower Crane Driver Z reference control part activated only PCI_TCrane_first File Edit wiew Simulation Format Tools Help D co e amp gt 100 External E da ha El X axis PID Controller A reference A position control 0 24 middle of A position Signal reference Position angle of the payload middle of odo T angle position ame T angle om af the arm Signal T reference Enable 21 Pi Y angle 0 25 Z position P of the payload middle of of the payload Z position 0000 oo Signal RT_DACIPCI Tower Crane Driver 2 reference Fig 4 26 Two PID controllers applied in a real time experiment The first step PID of X position of the cart 1s active The second step both controllers are active Tower Crane User s Manual 28 We define a source of a desired x position signal as the X reference Generator from the Simulink library see Fig 4 27 Source Block Parameters Signal X reference Signal Generator Output various wave forms Yit mp avetorm Freg t Parameterz Wave form Sal Elie yt Time ft Use simulation time 4 Amplitude Frequency 0 07 see ooo Interpret vector parameters as 1 0 Fig 4 27 Signal Generator becomes the square wave signal source As usual at the begining the GO HOME and GO TO CENTER actions are performed The proper experiment starts in the middle of the x y rails Therefor
5. 0 1 0 7 5 PWMPrescaler Purpose Determine the frequency of the PWM waves Synopsis Prescaler get tcrane PWMPrescaler set tcrane PWMPrescaler NewPrescaler Tower Crane User s Manual 57 Description The prescaler value can vary from 0 to 63 The O value generates the maximum PWM frequency The value 63 generates the minimum frequency See PWM 7 6 ResetEncoder Purpose Reset the encoder counters Synopsis set tcrane ResetEncoder ResetFlags Description The property is used to reset the encoder registers The ResetFlags is a 1x5 vector Each element of this vector is responsible for one encoder register If the element 1s equal to 1 the appropriate register 1s set to zero If the element is equal to 0 the appropriate register remains unchanged See Encoder Example To reset the first and fourth encoder registers execute the command set tcrane ResetEncoder 10010 7 7 RailLimit Purpose Control the operating range of the tower crane system Synopsis Limit get tcrane RailLimit set tr3 RailLimit NewLimit Description The Limit and NewLimit variables are 1x3 vectors The elements of these vectors define the operating range of the cart and the maximum length of the lift line If a flag defined by the RailLimitFlag property is set the corresponding to it PWM wave stops when the corresponding to it encoder register exceeds the limit Se
6. 4 Fig 4 36 Table 4 1 Parameters for the experiments Tower Crane User s Manual 33 The results of five experiments are presented in Fig 4 35 and Fig 4 36 X ret X ref X pos X pos X control X control X angle P set to 2 5 P set to 5 Fig 4 35 Only one controller 1s active desired x position of the cart 1s tracked X ref X ref X pos E X pos X contro l X control X angle X angle P of the cart position set to 2 5 P of the cart position set to 5 P of the payload angle set to 1 P of the payload angle set to 2 X ref X pos X control X angle e P of the cart position set to 5 P of the payload angle set to 4 Fig 4 36 Two controllers desired x position of the cart and X angle of the payload are tracked Tower Crane User s Manual 34 The left hand side of Fig 4 35 shows that the P value set to 2 5 is too small for a proper x position tracking The static error of x position is large A higher gain P equal to 5 the right hand side of Fig 4 35 reduces the static error but results in the saturation of control In Fig 4 36 one can see similar results obtained for two active controllers We focus our attention on the x angle control The trade off between two acting controllers is well visible in the upper left hand picture of Fig 4 36 One control signal serves for two control purposes follow the desired value of the cart x position and si
7. Derivative IIA Fig 4 30 Setting of the PID controllers Mark Simulation External item in the TowerCrane_ first model window see Fig 4 31 Tower Crane User s Manual 30 7PCI_TCrane first File Edit View Simulation Format PCI_TCrane_first File Edit Tools Help View RAE Format DO a he D hs Model Advisor Model Dependencies Connect To Target Ckrl T Configuration Parameters CtrltE Fixed Point Lookup Table Editor Data Class Designer Bus Editor Normal 4ccelerator Rapid Accelerator w External Signal amp Scope Manager Real Time Workshop dale el External Mode Control Panel za position T Data Object Wizard middle of lt position Ope 100 Sets 100 Fig 4 31 External control mode Next invoke the Tools External mode control panel item The External Mode Control Panel window opens see Fig 4 32 PCI_TCrane_first External Mode Control Panel Ea Connection and triggering Connect Floating cope Enable data uploading Duration Parameter tuning Batch download Configuration Signal amp Triggering Data Archiving Fig 4 32 Setting data acquisition options By clicking on the Signal amp Triggering button invoke the window shown in Fig 4 33 In this window we define a triggering mode for marked blocks In our case only one block exists XT Scope We mark XT Scope set So
8. Off limits are 0 2 and 0 6 This means that the crane will move between these limits with the speed corresponding to the control value equal to 0 5 e To choose the starting point inside the 0 5 0 5 range go to the PCI TCrane Main window and click the Go to Center button Tower Crane User s Manual 24 Then choose the Tools pull down menus in the Simulink model window The pop up menus provide a choice between predefined items Choose the RTW Build item A successful compilation and linking process is finished with the following message T Function Block Parameters Relay Relay Output the specified on or off value by comparing the input to the specified thresholds The on off state of the relay is not affected by input between the upper and lower limits Main Signal Data Types Switch on point Switch off point 0 1 Output when on 0 5 Output when off 0 5 Enable zero crossing detection Sample time 1 for inherited 1 Fig 3 23 X PWM controller parameters Model TowerCrane_Relay rtd successfully created HHH Successful completion of Real Time Workshop build procedure for model TowerCrane_Relay If any error occurs then the message corresponding to the error is displayed in the MATLAB command window Next click the Tools External Mode Control Panel item and next click the Signal Triggering button The window shown in Fig 3 24 opens e Select XT Scope set Source as the manual opt
9. Windows Target RTWT toolbox of MathWorks are used In this section we give indications how to proceed in the real time environment Before start test your MATLAB configuration and compiler installation by building and running an example of real time application Real time Windows Target includes the model rtvdp mdl Running this model will test the installation by running Real Time Workshop your third party C compiler Real Time Windows Target and the Real Time Windows Target kernel In the MATLAB Command Window type rtvdp Next build and run the real time model For details refer to the Real Time Windows Target help section Installation and Configuration 7 PCI_TCrane_DevDriv aca File Edit View Simulation Format MEWS Help Y gt mj E B External Model Advisor Model Dependencies d Tower Cran FretPont gt Cl Lookup Table Editor Data Class Designer Bus Editor o Signal amp Scope Manager a Real Time Workshop Options External Mode Control Panel Build Model Data Object Wizard RT_DAC PE Tower Crane Driver Generate ATW code 100 odes To build the system that operates in the real time mode the user has to Tower Crane User s Manual 43 e create a Simulink model of the control system which consists of the Tower Crane Driver and other blocks chosen from the Simulink library e build the executable file under RTWT e start the real time code to run from th
10. has different parameters These parameters are shown in Fig 8 69 Notice that system target file towercrane tlc is the same as in the previous example But the template makefile responsible for compilation and linking process 1s towercrane_openwatcom tmf In the next step a user must click the External mode in Interface edit window see Fig 8 70 After that the user have to set R7 CON tcpip in the Transport layer edit window Tower Crane User s Manual 61 Data Import Export Optimization Diagnostics Sample Time Data Validity Type Conversion Connectivity i Compatibility Model Referencing Saving Hardware Implementation Model Referencing Simulation Target Symbols Custom Code E RealTime Workshop System target file Language Description towercrane OpenWatcom Build process TLC options Makefile configuration Generate makefile Make command make_rtw Template makefile towercrane_openwatcom tmf Code Generation Advisor Select objective Sheck ote bere genes code FP Generate code only Software environment Target function library C 9 C90 ANST Data exchange Interface External mode ka Host Target interface Transport layer RT CON tepip MEX file name rtcon_ext_comm MEX file arguments Mernory management A Static memory allocation Apply Fig 8 70 Interface page Tower Crane User s Manual 62 In the RT CON options a user can mark the Display start up messag
11. options to Fixed step and Fixed step size equal to 0 001 atmost ES A greater value results in errors Tower Crane User s Manual 23 The C source code of the modeltc c file 1s attached to the DevDriv directory 3 3 Demo Controllers A number of control algorithms are given These demos can be used to familiarise the user with the crane system operation and enable to create the user defined control systems The examples must be rebuilt before using Due to similarity of the examples we focus our attention only on one of them Click the Relay button the model appears see Fig 3 22 PCI_TCrane_Relay File Edit view Simulation Format Tools Help co hl E fino External Die P ds Ala E 3DOF Relay Controller Scope T Position Z Position X Angle Relay Rate Limiter T Rate Limiter Z RT_DACIFCI Tower Crane Driver Fig 3 22 Control system with the relay controllers Notice that the model looks like a typical Simulink model The device driver is applied in the same way as other blocks from the Simulink library The only difference is that the model is used by RT CON to create the executable library which runs in the real time mode The goal of the model is the relay control in the x axis only Therefore GainY and GainZ are set to zero e Look at the mask of the Relay block connected to the X PWM input Fig 3 23 Note that the control generated by the controller has two values 0 5 and 0 5 The On
12. simulation control of load posto ninas 39 5 PROTOTYPING YOUR OWN CONTROLLER IN THE REAL TIME ENVIRONMENT 43 Sl Creatine a model Ad 45 5 2 Code seneration and the build POC A AAA A pea 47 6 MATHEMATICAL MODEL OF THE TOWER CRANE essssscsecsecsecseccecsecoecsseoecoseosecsecscoseseseseseseseoe 51 A 51 6 2 Comparison between the mathematical model and laboratory SySteID oocccccccccccnnnnninannnnnananaananoss 52 7 DESCRIPTION OF THE TOWER CRANE CLASS PROPERTIES eesscsscsecscesecsceseoececscscsescseseseseoe 55 Teke BIC Adde A A RR O A O RS 56 FD A A IS O SN AN 56 ES A A AA O IR EAA E NN TA SF E IN A O O A A US IN A T E E E A 57 E A A A AN NR T E EEEE A a7 TsO PROS CUR TAC A A A II Sa see tt eset ne ta cE 58 A E ee OX RTO A ACE AVE OTE A ee OER A 58 A on Teo aE eer 58 Fie Pe AMM AA ERTE RN se ws sine sn tec cea ela NR es 59 PAO ARCSCUS WECM AO xo 22 Sata chee ads 59 OF A E E RNA EAEAN erasers cea Seeks A e a E ENE 59 PrN ice o 59 SA ee ee nT eT OP eee ce nee See ET Se eR Ay ae ree een eee eee ee ee 60 FIA Quick Te lerenCe TaD o PORO OA OE POCO Tn aut E AN 60 8 HOW TO FILL IN THE COMPILATION SETTINGS PAGE ocooccccccccncccnccnoccnoncnnccnoncnnoconconcnococoncnoconos 61 Tower Crane User s Manual 3 Tower Crane User s Manual Tower Crane The industrial tower crane model controlled from PC The control goal to track a trajectory and not to swing the load 1 Introduction and general description To
13. the DC control signals moving the system outside the operating range Position limit m or rad The field defines the maximum accessible position expressed in meters or radians If the system reaches this position the board is able to stop the generation of the DC control signals moving the system outside the operating range The maximum position expressed in meters or angle position expressed in radians is obtained as the result of the multiplication of 64 maximum position expressed in bits and the corresponding scale coefficient Max position limit flag If the checkbox is selected the board turns off the control when the system is going to move outside the operating range It is recommended to keep this checkboxes selected all the time Tower Crane User s Manual 20 Home position limit switch The boxes that present the state of the home limit switches If a limit switch 1s pressed the corresponding box is selected Home autoreset flag The flag that causes automatic reset of the encoder counter when the corresponding home limit switch is pressed If the checkbox is unchecked the flag is inactive the state of the limit switch does not influence the state of the encoder counter Therm state The signal that presents the state of the thermal flag of the power interface The system contains three power amplifiers for the DC drives If the power amplifier is overheated the corresponding box is checked Therm flag The flag that
14. 65533 65534 bit gt 0 0022207 m 0 29847 m 0 38411 m 0 004602 rad 0 003068 rad gt gt Z displacement 0 32 m gt gt PWM 0 062561 0 031281 1 gt gt PWMPrescaler 60 gt gt RailLimit 361 381 815 64 bit lt gt 23104 24384 52160 bit gt gt 0 90013 0 95 1 0002 m gt gt RailLimitFlag 1 1 1 gt gt RailLimitSwitch O 1 gt gt ResetSwitchFlag 0 0 gt gt Therm 1 1 1 gt gt ThermPlag 1 1 1 gt gt Time 1 041 sec l 0 Read the base address BA get tcrane BaseAddress 7 2 BitstreamVersion Purpose Read the version of the logic design for the RT DAC PCI board Synopsis Version get tcrane BitstreamVersion Description This property determines the version of the logic design of the RT DAC PCI board The Tower Crane 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 Tower Crane User s Manual 56 7 3 Encoder Purpose Read the incremental encoder registers Synopsis enc get tcrane Encoder Description The property returns five digits The first two measure the position of the cart linear and angle The third digit is used to measure the length of the lift line and the last two measure the angles of the lift line The returned values can vary from 0 to 65535 16 bit counters When a register is reset the value is s
15. So000 Rail limit milrad m 0 433 3 115 0 736 Wlas rail limit flag Home rail lirnit switch A Home autoreset flag Thermal state Z control PYM prescaler Thermal flag 00 Fig 3 18 The Manual Setup window RT DAC PCI RT DAC USB board The frame contains the parameters of the RT DAC PCI or RT DAC PCI boards detected by the computer With respect to the interface board applied to control the system the program operates with RT DAC PCI or RT DAC USB boards No of detected boards The number of detected RT DAC boards If the number is equal to zero 1t means that the software has not detect any board When more then one board is detected the Board list must be used to select the board that communicates with the program Board The list applied to select the board currently used by the program The list contains a single entry for each RT DAC PCI or RT DAC USB board installed in the computer A new selection executed at the list automatically changes values of the remaining parameters within the frame If more then one RT DAC USB board 1s detected the selection at the list must point to the board applied to control the tower crane system Otherwise the program 1s not able to operate in a proper way Tower Crane User s Manual 17 Bus number The number of the PCI bus where the current RT DAC PCI board is plugged in The parameter may be useful to distinguish boards when more then one board 1s used and the
16. Tower Crane MATLAB R2009a b and R2010a PCI version User s Manual WWW NW M ver 9 3 COPYRIGHT NOTICE O Inteco Limited All rights reserved No part of this publication may be reproduced stored in a retrieval system or transmitted in any form or by any means electronic mechanical photocopying recording or otherwise without the prior permission of Inteco Ltd ACKNOWLEDGEMENTS Inteco Ltd acknowledges all trademarks IBM IBM PC are registered trademarks of International Business Machines MICROSOFT WINDOWS 2000 XP are registered trademarks of Microsoft Corporation MATLAB Simulink and RTW are registered trademarks of Mathworks Inc Tower Crane User s Manual 2 Contents 1 INTRODUCTION AND GENERAL DESCRIPTION ccoccccccccccccncccnoccnoccnoconoconoccnononoccnnocnnccnoncnnoccncnncnoconos 5 sa A AA 6 BOER REGUE MEN AA ee Ree A ee ee ee 7 2 STARTING TESTING AND STOPPING PROCEDURES ccccccsssscsscccccsscsccccccccesscccccccesescsceeeces 9 ZAS Tarn NOC CAU taa 9 22e ESTO and Moules OOO A ia 9 ZF SLOP PUN PEO CC isa 14 3 IVPAIN CONTROL WENDO Wi ia 15 PI O EN 15 ee A o OO 22 30 Demo Controles a a daa 24 4 YOUR FIRST REAL TIME CONTROL EXPERIMENT ccccsscssscsssccssccscccssccsscccscesceccccesccce 26 LA eee see cae E E E 32 Ae ald UOC ESS IN ic oe Ba ee aa oe att egg Coal ot cele aise ace ge neat mht oat lath 33 aE ESAD N ET 0 OINA el Westen te DTN a de ATA A N 35 4 4 PID
17. causes to turn off the control 1f the power amplifier is overheated If the flag is unchecked the power amplifier is overheated and the temperature increases the amplifier itself turns off the control signal It is recommended to keep this checkboxes selected all the time Click the Go to Center button and open next Manual Setup button You will see the changes of measured positions Note that the X position 9 angle position and Z position have changed their values and become the center positions in the crane workspace Tower Crane User s Manual 21 3 2 Drivers The main driver is located in the RT Device Driver column The driver is a software go between for the real crane MATLAB environment and the RT DAC PCI board This driver is dedicated to the control and measurement signals Click the Tower Crane Device Drivers button and the driver window opens Fig 3 19 PCI TCrane_DevDriv File Edit View Simulation Format Tools Help Db oe H a Lp i 00 External Tower Crane Device Driver PCI x Position T Position Z Position Angle T Angle x Switch T Switch Z Switch RT DACKPCI Tower Crane Driver 100 Fig 3 19 Tower Crane Device Drivers The driver has three PWM inputs DC motor controls for the X and Z axes and T angle direction There are 10 outputs of the driver X position T position Z position two angles see section 8 and additionally three safety switches According to a pre programmed logic
18. chosen Sh Configuration Parameters MySystem RTWin Active Select Software environment p Solver Target floating point math environment C89 C90 ANSI we Data Import Export E l 2 Optimization Utility function generation Auto ho l Diagnostics i Sample Time panned MAT file variable name modifier Type Conversion i Connectivity Data exchange m Compatibilit P y Interface External mode has Model Referencing Hardware Implementation Hoste T arget interface eel le name eeAeak time Warkshen Transport layer AT CON tepip MEX file name rtcon_est_ comm Comments MEX arguments a O Symbols Custom Code Verhication Meman management C Static memory allocation m Fig 5 61 Interface option of the Configuration parameters page Tower Crane User s Manual 49 If all parameters are set properly you can start the DLL executable building process For this purpose press the Build push button on the RTW page Fig 5 59 or click Ctrl B at keyboard being in the model window Successful compilation and linking processes generate the following message Model MyModel rtd successfully created HHH Successful completion of Real Time Workshop build procedure for model MyModel Otherwise an error massage is displayed in the MATLAB command window Before starting the experiment set the initial position of the cart the arm and the payload in a safe zone The Go Home and Go To Cen
19. computer system contains more then a single PCI bus This parameter 1s only active 1f the RT DAC PCI boards are applied Slot number The number of the PCI slot where the current RT DAC PCI board is plugged in The parameter may be useful to distinguish boards when more then one board is used This parameter is only active if the RT DAC PCI boards are applied Base address The base address of the current RT DAC PCI board The RT DAC PCI board occupies 256 bytes of the I O address space of the microprocessor The base address is equal to the beginning of the occupied I O range The I O space is assigned to the board by the computer system and may be different among computers This parameter is only active if the RT DAC PCI boards are applied The base address is given in the decimal and hexadecimal forms Logic version The number of the configuration logic of the on board FPGA chip A logic version corresponds to the configuration of the RT DAC board defined by this logic and depends on the version of the tower crane model I O driver status The status of the driver that allows the access to the I O address space of the microprocessor The status has to be OK string In other case the twer crane software HAS TO BE REINSTALLED Control The frame enables to set the control signals of three DC drives X control O control Z control The control signals of the X and Z DC drives may be set by entering a new value into the corresponding
20. cope and the control saturation blocks You need a scope to watch how the system runs You also need the saturation blocks to constraint the controls to match the maximal PWM signals sent to the DC motors The saturation blocks are built in the Tower Crane driver block They limit currents to the DC motors for safety reasons However they are not visible for the user who can be surprised that the controls saturate Other blocks that remain in the window are not necessary for our new project Creating your own model on the basis of an old example ensures that all internal options of the model are set properly These options are required to proceed with compiling and linking in a proper way To put the Tower Crane Device Driver into the real time code a special make file is required This file is included to the Tower Crane software You can apply most of the blocks from the Simulink library However some of them cannot be used see MathWorks references manual Tower Crane User s Manual 45 The scope block properties are important for appropriate data acquisition and watching how the system runs The Scope block properties are defined in the Scope property window see Fig 5 57 This window opens after the selection of the Scope Properties tab You can gather measurement data to the Matlab Workspace marking the Save data to workspace checkbox The data is placed under Variable name The variable format can be set as structure or matrix The defaul
21. e RailLimitFlag 7 8 RailLimitFlag Purpose Set range of limit flags Synopsis LimitFlag get tcrane RailLimitFlag set tr3 RailLimitFlag NewLimitFlag Description The RailLimitFlags is a 1x3 vector The first two elements control the operating range of the cart a length of the rail and an angle position of the tower The last element controls the maximum length of the lift line If the flag is set to 1 and the encoder register exceeds the range the DC motor Tower Crane User s Manual 58 corresponding to it stops If the flag is set to 0 the motion continues in spite of the range limit exceeded in the encoder register See RailLimit RailLimitSwitch 7 9 RailLimitSwitch Purpose Read the state of limit switches Synopsis LimitSwitch get terane RailLimitSwitch Description Reads the state of three limit switches Returns a 1x3 vector If an element of this vector is equal to 0 it means that the switch has been pressed See RailLimit RailLimitFlag 7 10 ResetSwitchFlag Purpose Control the auto reset of the encoder registers Synopsis ResetSwitchFlag get tcrane ResetSwitchtFlag set tcrane ResetSwitchFlag ResetSwitchFlag Description The ResetSwitchFlag and NewResetSwitchFlag are 1x3 vectors If an element of these vectors is equal to 1 the corresponding to it encoder register is automatically reset in the case when the corresponding to it limit switch is
22. e Simulation Start real time code pull down menus USB_TCrane_ Relay Ea fx File Edit View Simulation Format De Hg E External eo p fi Fixed Point Settings Model Advisor Model Dependencies r nt ro i I er Lookup Table Editor Data Class Designer Bus Editor Coverage Settings Signal amp Scope Manager Ba Real Time Workshop Options A External Mode Control Panel Build Model Rate Limiter Control Design E ses E Fi A Data Object Wizard FF gt Position Relay Rate Limiter T GainT l Z Punt o A X Angle PEM a Rate Limiter Z Gainz i Y Angle i RT DACUSB KA ads Tower Crane Driver Generate RTW code Fig 5 55 Creating the executable file using RTW and RT CON Tower Crane User s Manual 44 5 1 Creating a model The simplest way to create a Simulink model of the control system 1s to use one of the models included in the TCrane Main window as a template For example click on the Relay button and save it as MySystem mdl name The MySystem Simulink model is shown in Fig 5 56 File Edit View Simulation Format Tools Help bons Foo Extemal a X Position 3DOF P Controller l Y Angle Fig 5 56 The MySystem Simulink model Now you can modify the model You have got absolute freedom to develop your own controller Remember to leave the Tower Crane Device driver model Though it is not obligatory we recommend you to leave the multiplexer with the s
23. e checkbox Fig 8 71 Ta Configuration Parameters MySystem Configuration x Solver i Data Import E sport Optimization Diagnostics Sample Time ce Data Validity ne Type Conversion Connectyity Compatibility Model Referencing a Hardware Implementation d Model Referencing Real Time Workshop Comments gt Symbols m Custom Code al MAT fle variable name modifier rt e Display start up message ok Cancel Help Apply a Fig 8 71 RT CON options window If this checkbox is marked the message on loading real time code is displayed Fig 8 72 after connecting to target in the model window InTeCo 2K RT CON for Win95 98 NT 2000 XP null R RTW LOAD RT CON DLL model MySystem loaded Sampling period 0 01sec Final time 999sec Compiled Feb 25 2009 18 38 03 RT CON mode external Fig 8 72 Start up message Tower Crane User s Manual 63
24. e the constant block shift is required Next we define the signals to be used These are X reference the desired x position value X position X control and X angle These signals among others are connected to the Scope block The properties of this block are defined below see Fig 4 28 This window opens after the selection of the Scope Properties tab Mark the Save data to workspace checkbox define the Variable name as EX1 and the data format as structure This means the collected data within 30 seconds time range are saved to the workspace in the structure EX The sampling period set in the Simulation Parameters window see Fig 4 28 is equal to 0 01 Sampling Decimation is set to 10 Therefore the size of EX is equal to 30 s 0 01 s X 10 1 301 Scope parameters Ea Scope parameters General Data history Tip try right clicking on axes General bata history Tip try right clicking on axes AMES 7 Limit data points to last 5000 OOO Mumber of axes C floating scape Time range Save data to workspace Sampling Format structure with time Ww a Ae Tower Crane User s Manual 29 Fig 4 28 Setting of the Scope block Next return to TCrane first and select the Simulation Parameters item In the Solver tab select Fixed Step and set Stop time equal to 30 The Real time Workshop options must be defined as in Fig 4 29 a Configuration Parameters PCI_TCrane_first RTWin Active Select Target se
25. ed if a metalic object comes closer to the switch e Double click the Test limit switches button The window presented in Fig 2 7 opens Tower Crane User s Manual 10 EJ Switch detected x E BasicTestFunction S x Test limit switches Press manually all the limit switches x AXIS SWITCH Press OK button to stop DR DR Fig 2 7 Test limit switches window Fig 2 8 Switch detected window Turn on manually one by one all switches related to x O and z directions The z axis switch turn on by your finger The contactless switches turn on putting a coin close to the switches When a switch is turned on one can hear a sound signal If one turns on the x axis limit switch then the window shown in Fig 2 8 appears It means that the switch operates properly Close the window click the OK button When an arbitrary switch 1s not detected please check cables corresponding to the undetected switch Next you can check if the cart arm and payload move in the right direction and if the system stops at the desired limit position The system 1s moved in the chosen direction until 1t reaches the zero position at this point the switch limit must be active e Double click the Go Home X axis T angle direction and Z axis button and observe the behaviour of the system The window Fig 2 9 opens You can interrupt the motion clicking the OK button BasicTestFunction Step3 EIOS System moves to the T angle home posit
26. edit field or by dragging the corresponding slider The control values may vary from 1 0 to 1 0 The value of 1 0 0 and 1 mean respectively the maximum control in a given direction zero control and the maximum control in the opposite direction to that defined by 1 If a new control value is entered in an edit field the corresponding slider changes respectively its position If a slider 1s moved the value in the corresponding edit field changes as well STOP The pushbutton is applied to switch off all the control signals When pressed all the control values are set to zero PWM prescaler Tower Crane User s Manual 18 The control signals are generated as PWM waves The PWM prescaler sets the divider of the PWM reference signal The frequency of the PWM controls 1s equal to Frwu 20000 1023 1 PWMPrescalerr kHz This parameter sets the frequency of all PWM control signals The parameter may vary from O to 63 It causes the changes of the frequency of the PWM control signals from 19 55kHz to 305Hz X and Z positions The frame presents data related to the X 60 and Z axis positions The X position is the arm position The position relates to the angle position of the crane arm with the cart The position of the load is denoted as Z All position measurements are performed by the incremental encoders There are the following four fields associated with each axis Scale coefficient The value applied to calculate t
27. erform the experiment twice for first time without two angle controllers X ag and Y ag For the second time the angle controllers are included The weights of each controller are set in the C and C1 Simulink blocks For the first experiment we set the gains to the 0 1 values see Fig 4 44 and Fig 4 45 For the second experiment we set the gains of the C and C1 block to the 0 3 1 values E Function Block Parameters C Gain Gain Element wize gain y K u or matris gain y Ku ory uk Element wize gain y K u or matris gain y K u ory uK Main Signal Attributes Parameter Attributes i Signal Attributes Parameter Attributes Gain 01 Multiplication Matrix E u w Multiplication W atrisik u w Sample time 1 for inherited Sample time 1 for inherited Ea JC Js Js x Cea O Tower Crane User s Manual 39 T ang X pos 0 05 Of O45 02 0 25 0 8 0 45 0 4 0 45 0 5 0 55 contr vs T c contr vs T c ON IAS X ang vs Y an tr X ang vs Y an Fig 4 47 The controls normalised units and Fig 4 48 The controls normalised units and the payload angles rad on the X Y plane the the payload angles rad on the X Y plane the angles without control angles with control Notice that the control curve in the XT plane for the case of uncontrolled deviations of the payload is smoother than that for the controlled deviations case The payload deviations are zoomed in Fig 4 49 and Fig
28. esigned the code for the real time mode can be generated compiled linked and downloaded into the processor The code is generated by the use of Target Language Compiler TLC see description of the Simulink Target Language The make file is used to build and download object files to the target hardware automatically First you have to specify the simulation parameters of your Simulink model in the Configuration parameters dialog box The RTW page appears when you select the Real TimeWorkshop option Fig 5 59 The RTW page enables to set the real time build options and then to start the building process of the RTW DLL executable file Tower Crane User s Manual 47 eh Co nfiguration Parameters MySystem RTWin Active Select Target selection o System target File Data Import Esport is rose Diagnostics E Sample Time p Data Validity E Type Conversion E Connectivity Compiler optimization level gt Compatibility Model Referencing Saving Makefile configuration Hardware Implementation Model Referencing Description Real Time Windows Target Build process TL options Generate makefile a Make command mal PE ml Template makefile i Select objective Unspecified wt H Symbols spol Fig 5 59 RTW option of the Configuration parameters dialog box The system target file name is towercrane tlc for R2007a R2008a b R2009a b and R2010a It manages the code generation process The towercrane_vc tmf
29. espectively They are denoted by 4 and in the mathematical model See Fig 6 62 Scale coefficient The value applied to calculate the angle expressed in radians The value read from the encoder counter is multiplied by the corresponding scale coefficient to obtain the angle in radians Angle bit The value read from the corresponding encoder counter Angle rad The angle expressed in radians The value read from the encoder counter is multiplied by the corresponding scale coefficient to obtain the position in radians Reset The checkbox applied to reset the corresponding encoder counter If the box 1s checked the related angle is set to zero The box has to be unchecked to allow angle measurements As the incremental encoders are not able to detect an origin position the origin of the system has to be set in programming manner by a user The angle reset checkboxes should be checked when the load remains motionless 1n the downright position Status and flags The frame presents status data and flags related to the X and Z directions There are seven fields associated with each directions Position limit 64 bit The board is able to automatically turn off the control signal if the tower crane system is going outside the operating range The field defines the maximum value of the corresponding encoder determining the maximum accessible position If the encoder reaches this position the board is able to stop the generation of
30. et to zero When a rail limit flag 1s set 1t disables the movement outside the defined working range rail limit When a reset switch flag 1s set the encoder register 1s reset automatically when the appropriate switch 1s pressed The incremental encoders generate 4096 or 2048 pulses per rotation The values of the See 7 4 PWM Purpose Encoder property should be converted into physical units ResetEncoder RailLimit RailLimitFlag ResetSwitchFlag Set the parameters of the PWM waves Synopsis PWM get tcrane PWM set tcrane PWM NewPWM Description The property determines the duty cycle and direction of the PWM waves for three DC motors The first two DC motors control the position of the cart and the last motor controls the length of the lift line The PWM and NewPWM variables are 1x3 vectors Each element of these vectors determines the parameters of the PWM wave for one DC motor The values of the elements of these vectors can vary from 1 0 to 1 0 The value 1 0 means the maximum control in one direction the value 0 0 means zero control and the value 1 0 means the maximum control in the opposite direction The PWM wave 1s not generated if e arail limit flag is set and the cart or lift line are going to operate outside the working range e atherm flag is set and the power amplifier is overheated See RailLimit RailLimitFlag Therm ThermFlag Example set tcrane PWM 0 3 0
31. eters of the laboratory 3 dimensional setup The most important data transferred from the RT DAC PCI board and the measurements of the crane signals as well as status signals and flags may be shown Moreover the control signals of three DC drives may be set Double click the Manual Setup button and the screen shown in Fig 3 18 opens The application contains five frames The RT DAC PCI board frame presents the main parameters of the PCI board The Control frame allows to change the control signals The x 9 andz positions are given in the X 9 and Z positions frame The X and Y angles frame contains the angle measurements The Status and flags frame displays state of the status signals and flag values All the data presented in the Tower Crane Manual Setup program are updated 20 times per second Tower Crane User s Manual 16 H Tower Crane Manual Setup AT DAL42PCI AT DAC USB board td ps Theta E Mo of detected boards USB 1 Scale coefficient 5 815738 005 0 00157 9 3484e 005 Board Y Position bit 4695 1038 4251 Bus number j Position m lrad m 0 273 1 630 0 423 E E E Slot number Bice Base address ee a and Y angles OIC version Angle Angle Y Scale coefficient 0 007 534 0 007 534 Angle bit 15 J Control Angle rad 0 023 0 005 E E 40 driver status 2 control Reset H Status and flags Theta contrat a Theta E Rail limit 5 4 but 8576 1364
32. f 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 display the property values when the object name is entered in the MATLAB command window This section describes all the properties of the towercrane class The description consists of the following fields Provides short description of the propert Shows the format of the method calls Description Describes what the property does and the restrictions of is subjected to Describes arguments of the set method Refers to other related properties Provides examples how the property can be used Tower Crane User s Manual 55 7 1 BaseAddress Purpose Read the base address of the RT DAC PCI board Synopsis BaseAddress get tcrane BaseAddress Description The base address of RT DAC PCI board is determined by OS Each towercrane object has to know the base address of the board When the towercrane object is created the base address is detected automatically The detection procedure detects the base address of the first RT DAC PCI board plugged into the PCI slots Example Create the towercrane object tcrane towercrane Display its properties by typing the command tcrane gt gt Type towercrane Object gt gt BaseAddress 528 gt gt Bitstream ver x33 gt gt Encoder 65479 7661 20032
33. he position expressed in meters or radians The value read from the encoder counter 1s multiplied by the corresponding scale coefficient to obtain the position in meters or radians Position bit The value read from the corresponding encoder counter Position m The position expressed in meters The value read from the encoder counter 1s multiplied by the corresponding scale coefficient to obtain the position in meters Position rad The position expressed in radians The value read from the encoder counter is multiplied by the corresponding scale coefficient to obtain the position in radians Reset The checkbox applied to reset the corresponding encoder counter If the box is checked the related position is set to zero The box has to be unchecked to allow position measurements As the incremental encoders are not able to detect an origin position the origin of the system has to be set by limit switches see the description of the Home autoreset flag or has to be set in a programming manner by a user The Reset checkboxes are applied to set the origin position zero position in a programming way X and Y angles The frame presents data related to the X axis angles of the load The angle measurements are performed by the incremental encoders There are the following four fields associated with each angle Tower Crane User s Manual 19 Angle X and angle Y denote the angle deviations in X and perpendicular to X RS direction r
34. ilt The TCrane first model is given in Fig 4 26 To invoke it click Model for control experiment button in the The TCrane Main window In this case the active control corresponding to the x cart position is all you need The Simulink blocks included in the control are drawn with dropped shadows to distinguish active control loops from disabled PCI_TCrane_first DER File Edit wiew Simulation Format Tools Help D Hg 100 fExtemal E A la E X axis PID Controller A reference X position X contro ay X Angle Scope 0 24 middle of A position 0000 2 A reference 03 E ew Pi E Position angle ofthe payload middle of T angle position Enable T of the arm Enable 21 Y angle 0 25 position ofthe payload of the payload middle of position doug oo p Signal RAT_DACIFCI Tower Crane Driver reference loops In our first experiment we use the X position of the cart PID controller with its P Tower Crane User s Manual 27 PCI_TCrane_first File Edit wiew Simulation Format Tools Help EA amp gt 100 External ka ds Ala E X axis PID Controller A reference A position control middle of A position 0000 oo Signal X reference en al Z Position A angle of the payload middie gf 0000 T angle position Angle T angle 99 of the arm Signal T reference Enable 21 Z position of the payload middle of Z position Y angle of the payload ooo oo
35. ion Press OF button to stop immediately Fig 2 9 Go Home T angle direction window After performing tests along three directions the system is stopped at the zero position The encoders of the x and z directions are automatically reset to zero value If motion in a given direction is not observed check the cables and plugs related to this direction The next three steps perform the change of the system position from the initial position to the initial 0 3 m or 0 3 rad position along a selected direction e Double click the x axis 9 direction and z axis Movement button The window see Fig 2 10 opens where you can stop the motion by clicking the OK button Tower Crane User s Manual 11 BasicTestFunction Step 5 EOR System moves to the asis 0 3 m position Fress OF button to stop immediatelly Fig 2 10 x axis movement window Click the OK button and the plot of the movements appears see Fig 2 11 Figure 1 File Edit View Insert Tools Desktop Window Help Deus Rana OB so position movement 0 35 A position m 25 3 3 5 Time sec Fig 2 11 Plot of the x axis test movement In the next step double click the Go To Centre button The system moves to the centre of the physical system workspace The operational space boundaries are limited by the sizes of the laboratory set They are fixed in the program The window shown in Fig 2 12 opens BasicTestFunction E 5 x System moves t
36. ion mark the Arm when connect to Target option and close the window e Return to the model window and click the Simulation Connect to Target option Next click the Simulation Start real time code item Tower Crane User s Manual 25 PCI_TCrane_ Relay External Signal Triggering Signal selection PCI TCrane Relay Scopel A Select all Trigger Duration 3000 Delay oo e Arm when connecting to target z be Fig 3 24 External Signal amp Triggering window e Observe the plots in the scope and click Stop Simulation after some time Results of the example are shown in Fig 3 25 EE S PLL AmE LAR Time offset O Fig 3 25 Results of the relay controller demo experiment Tower Crane User s Manual 26 The X position starts from 0 38 and changes between 0 4 and 0 1 The control magenta line is a square wave in the range 0 5 0 5 The control is switched when the limit values are reched by the X position Note that the X angle in the form of a sinusoidal curve is modulated by the control interacting with friction 4 Your first real time control experiment We recommend two experiments In the first one only the control loop in the x direction is defined In this case stabilisation of the angle of the payload is neglected In the second experiment the stabilisation of the payload angle is added We begin from a simple real time control experiment A PID controller for the X position of the cart is bu
37. ions The Tower Crane 1s driven by three DC motors There are five measuring encoders measuring five state variables the cart co ordinates on the polar coordinates plane the lift line length and two deviation angles of the payload The encoders measure movements with a high resolution equal up to 4096 pulses per rotation ppr These encoders together with the specialised mechanical solution create a unique measurement unit The deviation of the load is measured with a high accuracy equal to 0 0015 rad The power interface amplifies the control signals which are transmitted from the PC to the DC motors The PC equipped with the RT DAC PCI multipurpose digital I O board communicates with the power interface The whole logic necessary to activate and read the encoder signals and to generate the appropriate sequence of pulses of PWM to control the DC motors 1s configured in the Xilinx chip of the RT DAC PCI board All functions of the board are accessed from the Tower Crane toolbox which operates directly in the MATLAB Simulink environment KEY FEATURES of Tower Crane Three dimensional laboratory model of industrial crane A highly nonlinear MIMO system It can be easily installed There are high resolution sensors unique 2D angle measuring unit The set up is fully integrated with MATLAB Simulink and operates in real time in MS Windows e Real time control algorithms can be rapidly prototyped No C code programming is requi
38. l controlled by the P regulator The payload oscillates freely being uncontrolled After 30 seconds the experiment stops The history of the EX7 variable is visible in the Scope see Fig 4 34 Notice the harmonic uncontrolled angle signal of the payload the square wave generated by Signal Generator followed by the cart x position signal The static error is due to the inadequate P control action The control has the highest magnitude among other signals visible in the figure When an abrupt change in the wave signal occurs then it results in the saturation of the control signal Tower Crane User s Manual 32 ejeje EEN E Time offset O Fig 4 34 Data visible in the scope during the experiment 4 2 Data processing The results are saved to the workspace as a structure variable EX If you write the variable name in the MATLAB command window then you obtain the answer EX time 301x1 double signals 1x1 struct blockName TCrane pid all Scope This data can be plotted in many ways For example use the following command gt gt plot EX1 time EX1l signals values 1 4 You can repeat the experiment several times using different P parameter settings and including another P controller for the x angle The parameters of the controllers for successive five experiments are given in Table 4 1 Number P of the cart position P of the payload Figure of angle experiment Fig 4 35 Fig 4 35 Fig 4 36 Fig 4 36
39. l 1 while the xw pos PID controller acts with the weight 0 3 This causes the the control algorithm mainly dumps the oscillation The result of the experiment with the working X ag controller presents Fig 4 42 SH 222 4588 Sas Time offset Fig 4 42 Dumped oscillations of the X angle Tower Crane User s Manual 38 One may observe that the oscillations are minimized by the controller but a desired position of the cart square wave 1s tracking in a worse way then in the previous experiment 4 4 PID simulation control of load position In our experiment the cart is following the desired trajectory similar to Lissajous curves We invoke the TCrane_impres model from MATLAB Command Window see Fig 4 43 We put the cart into motion in two directions The desired cart positions are generated as two sinusoidal signals There are two generators identical in amplitudes equal to 0 2 m and different in frequencies The X motion frequency is 0 05 rad s Fig 4 44 and the T angle motion frequency 1s 0 1 rad s iver rane_impres File Edit View Simulation Format Tools Help D Wa d 130 Normal DAS ha E X axis PID Controller simulation A TA behs 0000 ps alfa angle i a gt pp product 2 X reference ee ua E 2 ali Al sin A a e ii pe mo fave hat E Lift Line Lengt velocities T offset Tower Crane model oooo oO T reference Fig 4 43 The controller built for the cart to follow a Lissajous curve We p
40. l 53 untitled Hle Edit View Simulation Format Tools Help beta angle bet O a Ml aa alfa angle Scale rate x d Product gt duvide Teentr i gt asin Scale rate T j4 sz w angle Producti Tower Crane model Fig 6 67 The modified Simulink window to introduce the initial values of the states To assure a control signal compatibility velocity acceleration two Simulink block Derrivative are added and two gains Scale rate x and Scale rate T A conversion between the angles o f and X Y describes two formulas X arcsin cosf sina Y arcsin ue cos X The clockwise rotation in the system and counterclockwise rotation in the model have been equalized The gain 1 in the n2 block was introduced and the Scale rate T factor was multiplied by 1 as well Tower Crane User s Manual 54 7 Description of the Tower Crane class properties The towercrane 1s a MATLAB class which gives the access to all the features of the RT DAC PCI board equipped with the logic for the Tower Crane model The RT DAC PCI board is an interface between the control software executed by a PC computer and the power interface electronic of the Tower Crane model The logic on the board contains the following blocks e incremental encoder registers five 16 bit registers to measure the position of the incremental encoders There are five encoders measuring five state quantities two cart positions a
41. lection System target file rtwin tle Browse Data Import Export E Optimization Language Cc Diagnostics Sample Time Data Validity i Type Conversion l Connectivity Compatibility Model Referencing Saving Makefile configuration Hardware Implementation Description Real Time Windows Target Build process Compiler optimization level Optimizations on Faster runs v Choose compiler optimization level TLC options Generate makefile Make command make_rtw Template makefile _rtwin tr E inn Custom Code Real Time Workshop Select objective Unspecified vi v Check model Check model before generating code OFF C Generate code only Fig 4 29 The Configuration Parameters window Set the PID controllers We set the Proportional part of the X position of the cart PID controller as indicated by the arrow in Fig 4 30 The X angle of the payload PID controller remains inactive The other controlling loops are disabled due to the Gain blocks set to zero see Fig 4 26 Function Block Parameters X position of the cart PI Controller mask Enter expressions for proportional integral and derivative terns P s Ds Parameters dl Integral O Derivative OO set PID Controller mask Enter expressions for proportional integral and denyvatrye terns P l s Ds Parameters Proportional Integral AA
42. meters of the xw pos PID regulator are set to P 3 I 0 3 The results are visible in Fig 4 40 They are similar to the results of the real time experiments The model reflects characteristic features of the laboratory crane The model compatibility to the real crane strongly depends on such parameters as the payload lift line length the static cart friction the belt tension etc These and other parameters are written into the C source code of the modeltowecrane c file attached in the DevDriv directory If you wish to modify this file please make a copy and introduce the new parameters in the copy Remember to produce an executable dll file afterwards 48S ABBAR Time offset O Fig 4 40 Simulation data visible in the scope Let us turn on the controller PID X ag responsible for dumping the X angle oscillation To do this we change the value of the gain vector C block from the 0 1 value to the 1 0 3 see Fig 4 41 Tower Crane User s Manual 37 Function Block Parameters C ain Element wise gain p K ul or matris gain y Ktu or y UE Main Signal ttibutes Parameter Attributes Multiplication M atrifF L Sample time 1 for inherited sob Fig 4 41 New parameters of the C block The calculations of the dumping oscillations controller X ag are taken now with the weight equa
43. multaneously stabilises the payload in its hanging down position 4 3 Simulation We can execute the experiment similar to experiments from the previous section in a purely simulated form We invoke the TCrane first model window Notice two differences The TCrane real time driver block has been replaced by the Tower Crane model simulation model block The External mode of operation has been replaced by the Normal mode of operation see Fig 4 37 PCI_TCrane_first_model File Edit View Simulation Format Tools Help EI p sfo ho HAS PARES X axis PID Controller simulation Fig 4 37 Two PID controllers applied in a simulated experiment The first step PID of X position of the cart is active The interior of Tower Crane model includes the complete non linear model described in section 6 After clicking on Tower Crane model the mask given in Fig 4 38 opens You can set the initial values of eight variables The length of the lift line is constant In our example all initial conditions are set to zero The Z position set to 0 6 and the last variable set to 1 Setting to 1 denotes that the source of time is the RTWT clock Tower Crane User s Manual 35 Function Block Parameters Tower Crane model Subsystem mask Parameters Model with constant length Initial conditions s s Th TH alfa alfa beta beta t 0 0 0 0 0 0 0 0 1 se Fig 4 38 Mask of Tower Crane model
44. o the center position Press OF button to stop immediatelly Fig 2 12 Go to Centre window Tower Crane User s Manual 12 Click the OK button the plot of the movement is displayed Fig 2 13 Figure 1 File Edit wiew Insert Tools Desktop Window Help Dae S ilana Elng ATZ position movement ATZ position m rad m Time sec Fig 2 13 Plot of the movement to the center Notice that the centre point has not been exactly reached This is due to the open loop control mode The control signal is turned off when the system exceeds the centre point The following steps are related to angle measurements e Double click the Reset Angle Encoders button The window shown in Fig 2 14 opens Basiclestrunction tep 10 Set the load motionless Do vou want to set the origin angles of the load Fig 2 14 Reset Angle Encoders window Now you must set the load motionless and click Yes The angle encoders are reset and the zero position 1s memorised by the system e To check if the angles are correct double clicks the Check Angles button The window shown in Fig 2 15 opens Then manually move the load to a non zero position and release it Click the OK button Observe the motion at the screen Fig 2 16 Tower Crane User s Manual 13 BasicTestrunction Step 10 Move the load and observe the resulte on the stcreen Do you want to start Fig 2 15 Start observation window Figure 1 E ax File Edit View In
45. of the Tower Crane system RailLimitFlag RailLimitSwitch ResetSwitchFlag Therm ThermFlag Control the automatic power down of the power amplifiers Return time information Tower Crane User s Manual 60 8 How to fill in the compilation settings page The Simulation Configuration Parameters page decides how works the process of compilation and linking This page depends on the used third party compiler In Fig 8 68 the Configuration Parameters page for the Visual C compiler is shown Eh Configuration Parameters USB_TCrane_first RTWin Active Select Data lmport Esport Optimization Diagnostics Sample Time Data Validity Type Conversion Connectivity Compatibility i Model Referencing Hardware Implementation Model Referencing SE Real Time Workshop Comments Symbols Custom Code Target s lection System tng oneness Description towercrane Visual C C Documentation C Generate HTML report Launch report automatically Build process Makefile configuration Generate makefile Make command Template makefile C Generate code only App Fig 8 68 Configuration Parameters page for the Visual C compiler Notice that system target file towercrane tlc is chosen Also note that template makefile responsible for compilation and linking process is towercrane_vc tmf It means the MS VC compiler is used in this case If the OpenWatcom compiler is used the Configuration Parameters page
46. r of pushbuttons ready to use 2 2 Testing and troubleshooting This section explains how to perform the tests These tests enable to check the correctness of the mechanical assembling and wiring The tests have to be performed obligatorily after assembling the system They are also necessary in a case of an incorrect operation of the system The tests can be helpful to find an eventual reason of the system fail The tests have been designed to validate the existence and sequence of measurements and controls They do not relate to accuracy of the signals The operational space of the tower crane 1s illustrated in Fig 2 5 Tower Crane User s Manual 9 y direction rotary direction o EN home position x 0 m 0 0 rad z 0 m the payload hangs at the suspension level y direction Fig 2 5 Operational space of Tower Crane First you have to be aware that all signals are transferred in a proper way Eleven checking steps are applied e Double click the Basic Tests button The following window appears Fig 2 6 File Edit View Simulation Format Tools Help Fig 2 6 Tower Crane Basic Tests window The first step 1s to check the proper operation of the limit switches There are three switches applied to stop the system motions and to secure the system against destruction 1f the cart or the arm approach the limits The z axis motion switch 1s a typical mechanical one two other switches are contactless activet
47. red e The software includes complete dynamic models e User s Manual contains the library of basic controllers and a number of pre programmed experiments which familiarise the user with the system in a fast way e tis ideal for illustrating complex nonlinear control algorithms 1 1 Product overview The tower crane is delivered in partially mounted form SETUP COMPONENTS hardware e mechanical unit e interface and Power Interface Unit e RT DAC PCI I O board the PWM control logic is stored in a XILINX chip Tower Crane User s Manual 6 Fig 1 3 X axis drive software e TowerCrane Toolbox operating in MATLAB Simulink environment e manuals e Installation Manual e User s Manual 1 2 Requirements e Pentium or AMD based personal computer e MS Windows 2K XP W7 32 bit e MATLAB versions R2009a b or R2010a with appropriate versions of Simulink RTW and RTWT toolboxes not included Tower Crane User s Manual 7 Tower Crane User s Manual 2 Starting testing and stopping procedures 2 1 Starting procedure Combine the acquisition board Control Interface and 3DCrane together Invoke MATLAB and type Ter The PCI TCrane Main window opens see Fig 2 4 The pushbuttons indicate an action that executes callback routines when the user selects a menu item eX Fig 2 4 The PCI TCrane Main window The window contains testing tools drivers models and demo applications You can see a numbe
48. s 1 3 and the kinetic and potential energy of the payload are calculated Based on the Lagrange equations Amjed A Al Mousa gives the following equations that describes the dynamics of the tower crane X X5 X X6 X3 X gt F a l 2 2 2 x gt 2gcosx sinx1 4x x c08x x sin 2x c0s x 2x3xgsin xsin x 2L 2 2 4 Lx x cos x cosx L xgsin 2 x 2sin x sin x u 2 x Cos x u 2 Lsin x u gsinx x xcosx Lx sin x cos x cos x 2 L x x Cos x cosx 6 8 2T X3 Xg 2 8 2 1 2 5X8 1 2 Lcosx 2 Lx x sinx cosx u Lsin x cos x u X7 U Xg U where x B 5 X 5A 9 X3 X 5 x 0 xs B 5 X 7A X Xy 9 x 0 U X u 0 It is assumed that the length of the lift line L is constant 6 2 Comparison between the mathematical model and laboratory system Figures 6 63 and 6 64 presents v2 sbles and directions used in the model and syste S l a I 7 gt S i amp 1 1 I S I pe i I A amp PA ho e Tisi ji S Pa i 1 P X Sua x l x Se ai 4 N s r _ n Se l E I Sy gt I amp 4 ZA y e PX Yo Zo Fig 6 63 Variables and axis assumed at the Fig 6 64 Variables and axis adopted at the mathematical model mechatronic laboratory system The basic differences between the model and system are as follows e the control signal it is the acceleration inside the model it is the velocity inside the sys
49. sert Tools Desktop Window Help D des i 2879 2088 A Close this figure to terminate the test 0 5 0 4 03 0 2 0 1 02 03 04 05 4 Angle Fig 2 16 Y vs X angles trajectory 2 3 Stopping procedure The system 1s equipped with the hardware stop pushbutton It cuts off the transfer of control signals to the crane The pushbutton does not terminate the real time process running in the background Therefore to stop the task you have to use Simulation Stop from the pull down menu in the model window Tower Crane User s Manual 14 3 Main Control Window The user has a rapid access to all basic functions of the Tower Crane control system from PCI TCrane Main It includes tests drivers models and application examples PCI TCrane Main shown in Fig 2 4 contains four groups of the menu items Tools Drivers Demo Controllers Experiments 3 1 Tools The respective buttons in the TOOLS column perform the following tasks Basic Tests checks the measurements and control Go Home moves the crane to the zero position resets the encoders and sets control signals to zero This button 1s frequently used before starting an experiment When the Go Home procedure 1s finished we can be sure that the values of all measured signals have been set to zero Reset Angles resets the angle measuring encoders in a fixed position If you stop the payload manually perform the Reset Angles operation to be sure that the payload angles mea
50. sured by the encoders show zeros Go to Center moves the crane to the center of the crane operational space and switches off the control Remember that the zero position of the crane is in the point where the x position and the angle are equal zero Most experiments cannot be started from the zero point Go to Center enables the crane quickly move to the center Set Parameters enables the user to change the default values of Rail limits Base Address and z displacement The default value of the Base Address may cause a conflict with other devices installed in the computer One has to be ensured that his computer configuration 1s free from address conflicts The user can also need to adjust the crane operational space dimensions to his requirements Fig 3 17 presents the window where such changes can be done The user has to type numerical values into the editable text boxes Tower Crane User s Manual 15 Tower Crane Set Parameters Rail limit bit Rail limit m rad m displacement bit 2 displacement m Base address Autodetect E Update Close Fig 3 17 Set Parameters window All introduced modifications are written to the configuration file Please be RS careful with introducing them Writing the rail limit values exceeding the real rail limits may result in damage of the system elements Manual Setup The Tower Crane Manual Setup program gives access to the basic param
51. t Sampling Decimation parameter value is set to 1 This means that each measured point is plotted and saved Often we choose the Decimation parameter value equal to 5 or 10 This is a good choice to get enough points to describe the signal behaviour and to save the computer memory J Scope properties Mal ES Scope properties Mal ES General Data history Tip try right clicking on axes General Data history Tip try right clicking on axes pa e ee W Limit data points to last 3000 Mumber of aes 1 floating scope Time range ET W Save data to workspace Tick labels bottom axis only y Variable name EJ Sampling Format Structure withtime OF Cancel Help Apply Fig 5 57 Setting the parameters of the Scope block OK Cancel Help Apply When the Simulink model is ready click the Tools External Mode Control Panel option and next click the Signal Triggering button The window presented in Fig 5 58 opens Select XT Scope set Source as manual set Duration equal to the number of samples you intend to collect and close the window Tower Crane User s Manual 46 MySystem External Signal Triggering EBR Signal selection Myoysten scope A Select all Trigger SOURCE Mode Duration 3000 Delay o Arm when connecting to target hed a Fig 5 58 External Signal amp Triggering window 5 2 Code generation and the build process Once a model of the system has been d
52. t the cylindrical plane the lift line length and two deviation angles of the payload e incremental encoder resets logic The incremental encoders are able to generate different output waves when the encoder rotates clockwise and the counter clockwise The encoders are not able to detect the reference zero position To determine the zero position the incremental encoder registers can be set to zero from the computer program or an encoder register is reset when the corresponding limit switch to the encoder is reached e PWM generation block generates three sets of signals Each set contains the PWM output signal the direction signal and the brake signal The PWM prescaler determines the frequency of all the PWM waves The PWM block logic can prevent the cart from motion outside the rail limits and the lift line angles from lying outside the operating range The operating ranges are detected twofold by the limit switches and by three limit registers e power interface thermal flags when the temperature of the power interface for the DC motors is too high the thermal flags can be used to disable the operation of the corresponding overheated DC motor All the parameters and measured variables from the RT DAC PCI board are accessible by appropriate methods of the towercrane class The object of the towercrane class is created by the command object_name towercrane The get method 1s called to read a value of the property o
53. tem e the angles of the payload see the completely different notification in the above figures 1 Amjed A Al Mousa Control of Rotary Cranes Using Fuzzy Logic and Time Delayed Position Feedback Control Virginia Polytechnic Institute and State University 27 th November 2000 Tower Crane User s Manual 52 e the tower rotate clockwise in the model and counterclockwise in the system The Tower Crane system is supplied with a Simulink block Tower Crane model that is based on the mathematical model see Fig 6 65 7 untitled E File Edit View Simulation Format Tools Help Tower Crane model joo fF Fig 6 65 Simulink representation of the mathematical model The model is equipped in two control inputs X control and T control that correspond to the appropriate accelerations The third input feeds a constant as the lift line length The state variables are collected as the outputs Double clicking the Tower Crane model block to introduce the initial values of the ststes Fig 6 66 Function Block Parameters Tower Crane model Subsystem mask Parameters Model with constant length Initial conditions s s Th TH alfa alta beta beta t Brel Fig 6 66 Simulink window to introduce the initial values of the states To adopt the mathematical model to the system a number of modifications of the Simulink model have been introduced see Fig 6 67 Tower Crane User s Manua
54. template makefile is responsible for C code generation using the Visual C compiler The Solver page appears when you select the Solver option Fig 5 60 The Solver page enables to set the simulation parameters Several parameters and options are available in the window The Fixed step size editable text box is set to 0 01 this is the sampling period in seconds The Fixed step solver is obligatory for real time applications If you use an i gt arbitrary block from the discrete Simulink library or a block from the driver library remember that different sampling periods must have a common divider Tower Crane User s Manual 48 Si Co nfiguration Parameters My5ystem RTWin Active Simulation time p Data Import Export an emis Op Cine E Optimization E Diagnostics Sample Time Type Fixed step Solver jodeS Dormand Prince wt Data Validity Connectivity Compatibility p Model Referencing Solver options Tasking and sample time options Tasking mode for periodic sample times SingleTasking a C Automatically handle rate transition For data transfer E Custom Code Higher priority value indicates higher task priority EJ Real Time Workshop Report Comments p Symbols Custom Code see Fig 5 60 Solver option of the Configuration parameters page The Start time has to be set to 0 The solver has to be selected In our example the fourth order integration method ode4 Runge Kutta is
55. ter buttons are applied to fulfil these tasks Tower Crane User s Manual 50 6 Mathematical model of the Tower Crane 6 1 Equations The schematic diagram related to the tower crane matheamtical model is shown in Fig 6 62 Po Yo 2 Fig 6 62 Tower Crane model coordinates There are five measured quantities e X denotes the distance of the cart along the arm from the center of the construction frame e 0 denotes the angular position of the arm e L denotes the length of the lift line e denotes the angle between the z axis and the projection of the lift line onto XZ plane e P denotes the angle between the projection of the lift line onto the XZ plane and the lift line e Xx y Z define coordinates of the payload An important element in the construction of the mathematical model is the appropriate choice of the coordinates The center point x 0 y 0 z 0 of the Cartesian system is in the center of the crane tower at the level equal to the suspension point of the load The position of the payload is described by two angles and p shown in Fig 6 62 The Cartesian system rotates according to the tower movement described by the 0 angle It is assumed that the lift line is permanently stretched The position of the payload according to Fig 6 62 is described by the formulas x x 7 Lcos f sin a 1 y Lsinb 2 Z Lcos acos f 3 Tower Crane User s Manual 51 The first derivatives of the equation
56. the internal XILINX program of the RT DAC PCI board can use the switches to stop the DC motors When one wants to build his own application one can copy this driver to a new model Do not make any changes inside the original driver They can be made only RS inside its copy Simulation Model the simulation model of the crane 1s located under this button Its signal environment is identical as the model given in the Tower Crane Device Drivers except the lack of the safety switches see Fig 3 20 These switches are not used in the simulation mode The simulation model is used for many purposes identification controllers design etc Tower Crane User s Manual 22 Ta PCI TCrane_model File Edit View Simulation Format Tools Help Pb E 2 Mormal a Tower Crane Simulation Model o beta angle A control alfa angle xu T angle Lift Line Length Tower Crane model 100 ode45 E Fig 3 20 Tower Crane Simulation Model In the mask shown in Fig 3 21 one can introduce initial values for the model state variables Additionally by marking the checkbox you can use the model with constant length see section 8 for details Function Block Parameters Tower Crane model Subsystem mask Parameters Model with constant length Initial conditions 4 1 th tH alfa_alfa beta beta 2 2 t Fig 3 21 Mask of the simulation model The simulation model is running in the normal simulation mode Set solver
57. urce as the manual option mark Arm when connect to target and close the window Now we can build the real time model To do it select the Simulation Parameters item and then the Real Time Workshop option in the model window and click the Build item Successful compilation and linking process should be finished with the following message HHH Created Real Time Windows Target module PCI TCrane first rwd HH Successful completion of Real Time Workshop build procedure for model PCI TCrane first Tower Crane User s Manual 31 PCI_TCrane_first External Signal Triggering Signal selection Block PCI TCrane first Scope A Select all Trigger Signal Go To Block Trigger Duration 3000 Delay o Arm when connecting to target ba a Fig 4 33 Setting triggering of signals 4 1 Real time experiment Having prepared the controller model you can start the real time experiment Two actions GO HOME and GO TO CENTER must be performed at the beginning in the TCrane window The crane is ready for the experiment The cart is in the middle of the cylindrical x O plane the payload is hanging down in its rest position Open the Scope figure clicking on the Scope block Now return to the model window and click the Simulation Connect to Target item Next click the Simulation Start real time code item It activates the experiment lasting 30 seconds Observe the cart motion in the X direction The cart follows the desired square wave signa
58. wer Crane is a nonlinear electromechanical system having a complex dynamic behaviour and creating challenging control problems It is controlled from a PC Therefore it 1s delivered with hardware and software which can be easily mounted and installed in a laboratory You obtain the mechanical unit together with the power supply and interface to the PC and the dedicated digital board configured in the Xilinx technology The software operates under MS Windows using MATLAB and RTW toolbox package Besides the hardware and the related software you obtain User s Manual The manual e shows step by step how to design and generate your own real time controller in the MATLAB Simulink environment e contains the library of ready to use real time controllers e includes the set of preprogrammed experiments th a angle sensors SIXB Z 9 angle drive J j tem rotary direction guy Fig 1 1 The Tower Crane setup Tower Crane User s Manual 5 The Tower Crane setup Fig 1 1 consists of a payload hanging on a pendulum like lift lime wound by a motor mounted on a cart The payload is lifted and lowered in the z direction Both the arm and the cart are capable of horizontal motion the cart in the radial x direction along the arm and the arm in the rotary direction The angular position of the arm is expressed by the 9 angle The payload attached to the end of the lift line can move freely in three dimens

Download Pdf Manuals

image

Related Search

Related Contents

マットレス組立・取扱説明書  Gira Système d`appel 834 Installation, mise en service, commande  Enermax P-089 storage enclosure  Cables Direct RJ11/BT 3m  WEBT@LKER 100 - Prestasicurezza.com  CelluLyser™ Lysis and cDNA Synthesis Kit    ULC-R+ - Healthy Alternatives  

Copyright © All rights reserved.
Failed to retrieve file