Home
3DCrane
Contents
1. 4 Angle rad 11 po U TF b LAC driver status control 0 00 Reset Btatus and Flags control 0 00 5 Y Z lt Rail imit 64i 17182 18880 36544 000 Riail limit m 0 396 1 09 0 799 control btas rail limit Hag Iv Iv Iv Home rail limit switch Bn a Home autoreset flag Iv Iv Iv Thermal state r Hi PaM prescaler ED i Thermal flag m E Fig 4 2 The Manual Setup window RT DAC4 PCI board The frame contains the parameters of the RT DACA PCI boards detected by the computer No of detected boards The number of detected RT DACA PCI boards If the number is equal to zero 1t means that the software has not detect any RT DACA PCI board When more then one board 1s 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 DACA PCI 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 DACA PCI board is detected the selection at the list must point to the board applied to control the 3D crane system Otherwise the program 1s not able to operate in a proper way 8DCrane Users Manual e Bus number The number of the PCI bus where the current RT DAC
2. Parameters Initial condition 4 x v y alfa alfa beta beta z z t 0500080080050 Fig 5 13 Mask of Crane5D model 3DCrane User s Manual 40 If you look under the Crane3D_model mask you can see its interior Fig 5 14 model3dddm is the executable dll file The scale factors are set to 34 These parameters relate to friction and tension of the belts X Position 7 Y Position scale1 model3dddm AE MIUX scale2 i model inteco X angle scale3 Z Position lt Ul z lt gt 3 A 6 D Fig 5 14 The interior of Crane3D_model In opposite to the real time model it 1s 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 1s running you can watch the results in the scope see Fig 5 15 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 5 15 1s produced by gt gt plot EX1 time EXI signals values We perform simulations related to the experiments 2 and 5 from Table 5 1 The results are visible in Fig 5 16 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 str
3. M JX Y Y X desired cart position 0 55 0 65 0 7 0 7 0 65 0 6 0 55 Fig 5 20 The desired cart positions thin line and the cart positions thick line in meters 0 8 0 6 Y control vs X control Y control vs X control 0 4 0 2 J er gle vs X angle d D lt pp x lt Y angl n d Fig 5 21 The controls normalised units Fig 5 22 The controls normalised units and the payload angles rad on the X Y plane and the payload angles rad on the X Y plane the angles without control the angles with control 8DCrane Users Manual 4A Notice that the control curve in the X Y 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 5 23 and Fig 5 24 please notice the scales of deviations 0 08 0 015 LX 0 01 0 06 0 04 0 005 0 02 0 0 005 Y angle vs X angle 0 02 0 01 0 015 0 08 j 0 06 0 04 002 0 002 004 0 06 0 01 0 005 0 0 005 0 01 Fig 5 23 Unstabilised deviations of Fig 5 24 Stabilised deviations of the payload the payload in the X Y plane in meters in the X Y plane in meters The controls in the X and Y directions are shown in Fig 5 25 and Fig 5 26 Two cases of control with and without stabilisati
4. 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 Crane3D 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 of 1s subjected to Describes arguments of the set method See Refers to other related properties Provides examples how the property can be used 3DCrane User s Manual 75 9 1 BaseAddress Purpose Read the base address of the RT DAC PCI board Synopsis BaseAddress get cr3 BaseAddress Description The base address of RT DAC PCI board is determined by OS Each Crane3D object has to know the base address of the board When a Crane3D 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 PCT slots Example Create the Crane3D object cr3 crane3d Display its properties by typing the command cr3 gt gt T ype Crane3D Object gt gt BaseAddress 528 gt gt Bitstream ver x33 gt gt Encoder 65479 7661 20032 65533 65534 bit gt gt 0 00
5. 4 RQ sina a R Ra Rf sin a cos D 2Raf cos asin B 2R Ra cosacos f 2RB RB sin sin p We denote id gin Xp X5 a aea x P Xy X Xy X domos E Xy R Xs Q Mo 2 Xy R S SINX C COS X u 2 Vs 555Xg X9 2X19Xg 8C5C7 Vs 2x5 C5X6Xg 5X19 857 V 2sixix 4x2 7 S5 Xg Xo T 8S5C7 t X6 Xo Finally we obtain ten equations describing the dynamics of the crane with varying pendulum length ue 67 x N uc N 68 X3 X4 69 x N Jsss N 70 X Xe 71 Xe ss C554 N 44 455 Jc555N V5 Xo 72 X4 Xg 73 Xg c N My ssc 55 N4 V 55 9 74 75 Xio CsN 5554 N 1 c 4055252 IN 4 V4 76 The denominator in equation 74 includes sin x5 When the crane operates in its real range then sin x 0 8DCrane Users Manual TA 9 Description of the Crane3D class properties The Crane3D is a MATLAB class which gives the access to all the features of the RT DAC PCI board equipped with the logic for the 3DCrane 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 3DCrane 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 identical encoders measuring five state quantities two cart positions at
6. e Double click the Basic Tests button The following window appears Fig 3 3 Fig 3 3 The Basic Tests window The first step in testing the crane is to check the proper operation of the limit switches There are three switches applied to stop the moving parts of the system and to secure the system against destruction 1f the cart or the rail approaches the limits e Double click the Test limit switches button The window presented in Fig 3 4 opens 3DCrane users Manual A 4 Switch detected x Test limit switches Press manually all the limit switches X AXIS SWITCH Press OK button to stop OK OK Fig 3 4 Test limit switches window Fig 3 5 Switch detected window Then close manually one by one all switches related to x y and z axes After each closing you hear a sound signal If you switch on the x axis limit switch then the window presented in Fig 3 5 appears This means that the switch works properly Close the window click the OK button When a switch is not detected please check connection of the appropriate cables to the undetected switch Next you can check if the cart rail and payload move in the right direction and if the system stops at the desired limit position The system is moved in the chosen direction until it reaches the zero position at this point the switch limit must be active e Double click the Go Home X axis Y axis and Z axis button and observe the behaviour of the syste
7. Senpe E jii Position E xX Angle I Y Angle ae pes X Switch zs Y Switch E d Z Switch l ooo Crane 3D Ready 10035 lodes m Fig 7 2 The MySystem Simulink model Now you can modify the model You have absolute freedom to develop your own controller Remember to leave the 5DCrane driver model and the Set Base Address button in the window This is necessary to activate transferring the base address of the I O card to the model as a MATLAB workspace variable Though it is not obligatory we recommend you to live the multiplexer with the scope 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 1n the Crane 5D driver block They limit currents to DC motors for safety reasons However they are not visible for the user who may amaze at the saturation of controls Other blocks remaining 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 3DCrane Device Driver into the real time code a special make file is required This file is included to the 3DCrane software 3DCrane User s Manual 63 You can apply most of the blocks from th
8. 31 to 21 25 five equations with five unknowns AQ Af x Vy and R are obtained The solution of this set of equations with respect to the second derivatives and the introduction of new variables Ww 3 cy Rom SA My Y nma X4 Xy X X AB Re M Xy R xs AQ Xy X R leads to the final simplified system of state equations for the 3D crane Xe 32 x N ux Ns 33 ues 34 x N 4x Na 35 deae 36 Xe N tyxs Ns 8X5 2x91 Xo 37 i E 38 Xy 2 N5 ox Ns gx 2xgX10 Xo 39 mc 40 Xo N3 2 41 The proposed simplification results in a partial separation of the equations of the crane The equations which describe the motion of the crane along the y axis that is the equations for x1 X2 Xs Xe are not connected with the equations for the variables x3 x4 x7 xs describing the motion along the x axis The crane can be thus treated as two independent subsystems This separation is partial as both these subsystems depend on xy the length of the lift line R A complete separation takes place if xy R const and T T are separated Note that cranes are always controlled in such a way that the swinging of the payload is suppressed and so the deviation angles are small The simplified model is then adequate 8DCrane Users Manual TT 8 3 Complete nonlinear model with constant pendulum length and two control forces We will now derive the crane equations without the simpl
9. 4 lo x Real Time Workshop Solver Workspace 1 0 Diagnostics Advanced Category Target configuration Build Configuration Syster target file rhiin tlc Browse Template makefile cranesd win vc tmf Make command make rw E Generate code only Stateflow options OK Cancel Help Spp Fig 7 5 RTW page of the Simulation parameters dialog box 3DCrane User s Manual 65 The system target file name is rtwin tlc It manages the code generation process The crane3d win vc tmf template makefile 1s responsible for C code generation using the Visual C C compiler There are three options which have to be properly marked as shown in Fig 7 5 e Inline parameters not used when building a real time program e Retain rtw file if marked auxiliary information is stored in the file with rtw extension e Generate code only if marked a code is generated but compilation is not performed The Solver page appears when you select the Solver tab Fig 7 7 The Solver page allows you to set the simulation parameters Several parameters and options are available in the window The Fixed step size editable text box 1s set to 0 01 this 1s the sampling period in seconds The Fixed step solver is obligatory for real time applications If you use an arbitrary block from the discrete Simulink library or a block from the driver library remember that different sampling periods must have a common divid
10. File Edit view Simulation Format Tools i section 4 1 After performing these steps the crane 1s ready to start an experiment Step 3 This step collects the X Y Z data The cart 1s steered forth and back in the X and Y directions The payload is lifted up and lowered These actions run simultaneously due to operating controllers as illustrated in Fig 6 2 There are three identical Relay blocks used as controllers You can see the control ranges by clicking on a block see Fig 6 3 The control values change from 0 5 to 0 5 a half of the maximal excitations The motion ranges are between 0 3 and 0 5 m Before starting the motion set the Base Address first Click the Set Base Address button in the 3DCrane 3DOF Relay Controller window see Fig 6 2 Next choose Tools from the window menu bar These pull down menus execute callback routines when the user selects an individual menu item Choose the Real Time Workshop menu and the Build Model submenu The model is rebuilt Finally choose Simulation from the window menu bar and click the Connect to target pull down menu When the system is running observe the Fig 6 1 Case study window real motion of the crane and the plot in the scope see Fig 6 4 The cart velocities in X and Y directions are much alike The payload moves slower down and up The angles of the payload are not closed loop controlled and in consequence the payload oscillates freely 35 The Matlab Opti
11. This window opens after the selection of the Scope Properties tab Mark the Save data to workspace checkbox define the Variable name as EX 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 5 3 1s equal to 0 01 Sampling Decimation is set to 10 Therefore the size of EX is equal to 30s 0 01 s x 10 12 301 2 Scope properties PIS ES 3 5cope properties Tip try right clicking on axes Beneral Data history n v Limit data points to last 3000 Number of axes 1 floating scope Time range ES V Save data to workspace Tick labels bottom axis only Pe Variable mame EXD Sampling Format Structure with time General Data history Tip try right clicking on axes OF Cancel Help Apply Fig 5 3 Setting of the Scope block OK Cancel Help Apply Next return to the Main Control Window and select the Simulation Parameters item In the Solver tab select Fixed Step and set Stop time equal to 30 The Real time Workshop tab must be defined as in Fig 5 4 3DCrane User s Manual 33 4 Simulation Parameters Crane3D_first J Simulation Parameters Lrane3D first 3 a of xl Solver Workspace 1 0 Diagnostics Advanced Real Time Workshop Solver Workspace 1 0 Diagnostics Advanced Real Time Workshop
12. by the Crane5D model simulation model block The External mode of operation has been replaced by the Normal mode of operation see Fig 5 12 All other parts remain as in the real time experiment 3DCrane User s Manual 39 E Crane3D_first_model _ d iy x File Edit View Simulation Format Tools Help Cleese tse loc eEet amp gt m Normal X axis PID Controller simulation 3X reference position control middle of position oo Y Position position Signal of the cart Z Position middle of E 0000 Y position cuo T position X angle of the cart of the payload Y reference Enable Cranesd model T angle C Z position of the payload of the payload middle of Z position unu o Signal reference Fig 5 12 Two PID controllers applied in a simulated experiment The first step PID of X position of the cart is active The second step both controllers are active The interior of Crane3D model includes the complete nonlinear model described in section 6 4 After clicking on Crane3D model the mask given in Fig 5 13 opens You can set the initial values of 10 variables You can mark the constant or varying pendulum length In our example all initial conditions are set to zero except the X position set to 0 55 and Z position set to 0 5 and the last variable ft set to 1 Setting t to 1 denotes that the source of time 1s the RTWT clock Block Parameters Lrane3d model Subsystem mask
13. m to 2 5 m width from 0 9 m to 2 5 m SETUP COMPONENTS e hardware e mechanical unit Fig 1 2 Cart and 2D angle measuring unit 3DCrane User s Manual 7 Fig 1 3 X axis drive e interface and Power Interface Unit e O RT DAC PCI board the PWM control logic is stored in a XILINX chip e software e 3DCrane Control Simulation Toolbox operating in MATLAB Simulink environment e manuals e Installation and Commissioning e User s Manual 1 2 Requirements PC 486 100MHz or higher RAM 64M Video card resolution 1024 x 768 pixels MATLAB 6 5 or 7 0 4 SP2 Simulink 5 x 6 x Real Time Workshop and Real Time Windows Target toolboxes Optimisation Toolbox needed only for one demo experiment The MS Visual C or Open Watcom 1 3 compiler 3 The 3DCrane toolbox supports Matlab 6 5 and Matlab 7 R14 SP2 MS Visual C or Open Watcom 1 3 compiler can be used 3DCrane User s Manual 8 2 Installation of the software 2 1 Installation for Windows 98 NT 2000 XP D The system administrator who has full access to all drivers and system settings must start the application To start the installation program insert the CD ROM into the drive and run manager exe placed in the main directory From the INTECO Software Manager application window select 3DCrane Toolbox Installation You will see the dialogue window Fig 2 1 INTECO Software manager i E x Select an appropriate item and click the Start b
14. on the z axis and the projection of the lift line onto the xz plane Denote also m My Ms Xo Yo Ze T S F F Fr Ln 3DCrane User s Manual mass of the payload mass of the cart mass of the moving rail coordinates of the payload reaction force in the lift line acting on the cart force driving the rail with cart force driving the cart along the rail force controlling the length of the lift line friction forces 68 8 1 Basic relationships An important element in the construction of mathematical model is the appropriate choice of the system of coordinates The Cartesian system although simple in interpretation and determining the position in space in a unique way in both directions 1s not convenient for the description of the dynamics of rotational motion The spherical system has therefore been adopted The position of the payload is described by two angles and D shown in Fig 8 1 A drawback of the spherical system of coordinates 1s that for every point on the y axis the corresponding value of D is not uniquely determined However the points on the y axis are not attainable 1n real crane systems The following symbols are used in the sequel Me n 4h qu m m m p F F u U y dm mM m m m T T T x y x anc PEU f y Tak m m m m N u 1 N u L N u S e The position of the payload is described by the equalities x x Rsin
15. 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 measured by the encoders show zeros Go to Center moves the crane to the center of the crane workspace and switches off the control Remember that the zero position of the crane is in the corner of the XY plane Most experiments cannot be started from the zero point Go to Center allows 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 is free from address conflicts The user can also need to adjust the crane workspace dimensions to his requirements Fig 4 presents the window where such changes can be done The user has to type numerical values into these editable text boxes 3DCrane User s Manual 19 Iv Crane 3D Set Parameters x Y Z Rail limit bit 361 aei 815 Rail limit m T 0 95 Z displacement bit 16689 displacement m 0 32 Base address Autodetect Update Close Fig 4 1 Set Parameters window All introduced modifications are written to the configuration file Please be 35 careful with introducing them Writing the rail limit values
16. type cr MATLAB brings up the window 3DCrane Main Control Window see Fig 3 1 Pushbuttons indicate an action that executes callback routines when the user selects a menu item E Crane3D_Main File Edit View Simulation Format Tools Help Fig 3 1 The Main Control Window of the 3DCrane system The Main Control Window contains testing tools drivers models and demo applications Also a case study 1s included You can see a number of pushbuttons ready to use 3 2 Testing and troubleshooting This section explains how to perform the tests These tests allow checking if mechanical assembling and wiring has been done correctly The tests have to be performed obligatorily after assembling the system They are also necessary after an incorrect operation of the system The tests are helpful to look for causes of errors when the system fails The tests have been designed to validate the existence and sequence of measurements and controls They do not relate to accuracy of the signals In this manual some terms are used which describe the location of the cart Fig 3 2 defines these terms 8DCrane Users Manual 18 Zero position Home Fig 3 2 View of the workspace of 3DCrane First you have to be aware that all signals are transferred in a proper way Eleven checking steps are applied Before starting the test move the cart and the rail manually to an arbitrary gt position different from the zero position Fig 3 2
17. unmatched model before optimisation and the matched model after optimisation are visible in Fig 6 8 and Fig 6 9 Figure No 1 ar ES Ele Edit Tools Window Help Isaaka Y Axis Position Velocity and Control 04 9 E UE O6 bee III bee MM 0 8 i 0 5 10 15 Time sec Press a key Fig 6 8 The model results unmatched to the real data measurements in the Y axis 3DCrane User s Manual 51 EXT Mo 1 File Edit Tools Window Help lOSB HES AALS Seo Position vs time blue simulation red real system Os 06 0 4 0 2 0 S 10 15 K 0 172034 Ts 0 129360 Fig 6 9 The model results matched to the real data measurements in the Y axis The following numerical values of K and T were obtains K 0 172034 T 0 129360 If we press a key again then the model optimisation in the Z direction starts again the simple model is used The initial stage before optimisation is visible in Fig 6 10 Figure No 1 Jof x Eile Edt iew Insert Tools Window Help Densa kAASL PRA Axis Position Velocity and Control 0 6 0 S 10 15 Time sec Press a key Fig 6 10 The model results unmatched to the real data measurements in the Z axis 3DCrane User s Manual 52 After optimisation the following picture 1s obtained see Fig 6 11 f Figure No 1 Im x File Edit Tools Window Help JOBS RAJA Boo Position ys time blue simulation red re
18. 22207 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 0 1 1 gt gt ResetSwitchFlag 0 0 0 gt gt Therm 1 1 1 gt gt ThermFlag 1 1 1 gt gt Time 1 041 sec Read the base address BA get cr3 BaseAddress 9 2 BitstreamVersion Purpose Read the version of the logic design for the RT DAC PCI board Synopsis Version get cr3 BitstreamVersion Description This property determines the version of the logic design of the RT DAC PCI board The 3DCrane 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 3DCrane User s Manual 76 9 3 Encoder Purpose Read the incremental encoder registers Synopsis enc get cr3 Encoder Description The property returns five digits The first two measure the position of the cart 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 O to 65533 16 bit counters When a register 1s reset the value 1s set to zero When a rail limit flag is set it disables the movement outside the defined wor
19. 3DCrane Version 1 4 User s Manual AA www inteco com pl COPYRIGHT NOTICE 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 95 98 2000 NT are registered trademarks of Microsoft Corporation MATLAB Simulink and RTW are registered trademarks of Mathworks Inc 3DCrane User s Manual 2 Contents 1 INTRODUCTION AND GENERAL DESCRIPTION cccccccccsccccccccccccccccccccccccccccccccccccccccees 5 VAS PLONE Was 7 12 Reun e MEN erosi T T T TN 8 2 INSTALLATION OF THE SOFTWARE esseseseccesesecseseoscsecccsesecccsesecsesesecsesesecsesesseseseosesesecseseseeseseosesese 9 2 1 Installation for Windows 98 NT 2000 X P sis 9 2 2 Uninstallation for Windows 98 NT 2000 XP cccecceccscescecceccsccscscecceccscesceccecescescescescscescesceseess 11 3 STARTING TESTING AND STOPPING PROCEDURES 0 0 cccossscccsscccsccccscsccccscccsccccsccccsescess 13 3 5tartitie PE OC CCUG ui ore telis laeto VD a CEU M LASTE 13 24 Testing and trOubleshooLIng uocis e v osa tabes edet cota be bU dv QweE Pe paiptv mn vetus eens 13 215 SLOPPING
20. A PCI board is plugged in The parameter may be useful to distinguish boards when more then one board is used and the computer system contains more then a single PCI bus Slot number The number of the PCI slot where the current RT DACA PCI board is plugged in The parameter may be useful to distinguish boards when more then one board is used Base address The base address of the current RT DAC4 PCI board The RT DACA 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 differ from computer to computer 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 DACA PCI board defined by this logic and depends on the version of the 3D 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 3D crane software HAS TO BE REINSTALLED Control The frame allows to set the control signals of three DC drives X control Y control Z control The control signals of the X Y and Z DC drives may be set by entering a new value into the corresponding edit field or by dragging the corresponding slider The control values may vary
21. B command window In the presented example the PI optimisation results in Kpx Kix 32 9328 8 82428e 007 Kpy Kiy 19 0999 4 74215e 006 Kpz Kiz 267 3002 3 414063e 007 The proportional gains are large This follows from the fact that the time constants in the previously identified models are very small The models are thus close to non dynamical systems In such a case the closed loop system requires very large K parameters for PI controllers to track the step reference signals Remember that the parameters tuned above relate only to the PI controllers of the desired X Y and Z cart positions They do not relate to the PID controllers of the X and Y angles 3DCrane User s Manual 57 Figure No 1 joy x File Edit Tools Window Help IDSHE S F AAS PPA Ke Ki Performancelndex 2 329327 1 65935e 006 27 1659 Os 0 d 10 ls 20 Position and desired position vs time 0 5 O 10 15 20 Control vs time Fig 6 18 The optimisation run window the final result for the X direction Figure No 1 File Edit Tools Window Help Densa kary par Ko Ki Performancelndex 19 0999 5 99252e 006 28 5961 0 8 0 D 10 la 20 Position and desired position vs time 05 0 a 10 15 20 Control vs time Fig 6 19 The optimisation run window the final result for the Y direction 3DCrane User s Manual 58 m Figure No 1 File Edit Tools Window Help DEBA KAAS PER p ki Perf
22. Bis ie AIAN er STO eec cotone spate ares saa A cs aD Ded 76 OC OU hl 1 G19 16 AAA E ds Mess E ced d A DEAE A Te ee EAEI Eos d D eod Em T A oda 71 DIEM QV NE NP A IEA A A a tient ee T1 OTe o AAA AE IIA IA A 71 DG o AN A A AA AA a Aue a 78 A AAA A IIA IA Ln 78 A A O adu NI II tenerae av patet ou nd 78 9go E A wett data tua UA ncaa cata a aa a lan ee a acu aeee aa 79 9 I0 AR Ge CS WUC MAS oa 79 DAL CDHePi socero consc M D A Len M A E MM LL MM TE 79 912 Let LAG PO A On PP e A cort eT ERU d 79 PS A monct TE 80 914 Omek reference tablilla 80 10 HOW TO FULFIL THE COMPILATION SETTINGS PAGE 1i cccccccccccccccccscccccccccccsccccccccees 81 3DCrane User s Manual 3 3DCrane User s Manual 3DCrane The industrial crane model controlled from PC A tool for control education and research 1 Introduction and general description The 3DCrane is a non linear electromechanical system having a complex dynamic behaviour and creating challenging control problems The system 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 with power supply and interface to a PC and the dedicated A D D A board configured in the Xilinx technology The software operates under MS Windows NT using MATLAB and RTWT toolbox package Besides the hardware and the related software you obtain the User s Manual The manual e shows step by step how to
23. Category Target configuration Build Configuration System target file rir the Browse Template makefile erare3d win vc tmt Make command make_rtws Generate code only Stateflow options simulation time Start time 0 0 Stop time 30 Solver options Type Fised step v adeb Dormand Prince l Fixed step size 0 01 Mode SingleT asking Output options Refine Output Hene acna D OK Cancel Help Anal OK Cancel Help Aon Fig 5 4 The Simulation Parameters window The next step is to 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 5 5 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 5 1 Block Parameters position of the cart Block Parameters angle of the payload Ea PID Controller mask PID Controller mask Enter expressions for proportional integral and derivative terms Enter expressions for proportional integral and derivative terms Pelar P ssDis Parameters Parameters Prapartiorial Frapartianal i Integral Integral Derivative Derivative Fig 5 5 Setting of the PID controllers Mark Simulation External item in the Crane3D_first model window see Fig 5 6 3DCrane User s Manual 34 7 Crane3D_first 7 Crane3D_first File Edit
24. DIOCOGQUIG doner rate user isos 18 4 MAIN CONTROL WINDOW o 19 A AA NORTH 19 A CMM A TO A O A A A Tt 26 2 OA eR NS CO OR OCT A eR DEM 28 5 YOUR FIRST REAL TIME CONTROL EXPERIMENT ccccccscscceccccccccccccccccccccccscecccccccees 32 dela Reale tire EX qae Ui 36 Su LoData PEO COSSA ARA cR od Kast deu em a ca CN E Ma EM EUR CENE T E seco vectes area DERE IM DE DU E EE Mr M DD LN LU ME UD ER EE TEE M UD IDE 39 35 9 PID Control Of load POSO R tro OU OIM eumd A maU dE D DUT US D cSs ER 43 GCASESTUDY uu iestedeeeesvegccusobestotescetyes cese iio 47 7 PROTOTYPING YOUR OWN CONTROLLER IN RTWT ENVIRONMENT eee eeeeeeceeceese 62 FT Moe AUN a THO Da sconto cest ei tomiS oce tehsedahare ro 63 7 26 0de seneration and the DULG DEOCOSS tds 65 8 MATHEMATICAL MODEL OF THE 3DCRANCE ee eee eee eee ee ee esee esee seeee see se see see sese ees eeose soe 68 Sl Basto relatos D E TUM 69 6 2 Simiphihed model with three control fOECES 3 9 etas tope daa 70 8 3 Complete nonlinear model with constant pendulum length and two control forces T2 8 4 Complete nonlinear model with varying pendulum length and three control forces 73 9 DESCRIPTION OF THE CRANE3D CLASS PROPERTIES ccccccccccssccscccccecccccccsscecccccscees 75 OAM S PAL Rei EN E E EE EE ER E ER RR RERO 76 92e
25. Note that the X position Y position and Z position have changed their values and become the center positions in the crane workspace ii 3D Crane Manual Setup Es ES aj x RT BACA PEI board A Y and positions A Y Z Scale coefficient 5 809e 005 5 809e 005 2 1859 005 Position bit 4557 36010 18518 Position m 2B 0 56 0 41 g E f Ma of detected boards l 1 Board Board 1 Bus number 0 Slot number 3 Base address Logic version 216 LAE driver status DE Heset Angle Angle Y Scale coefficient 0 001534 0 001534 Angle bit a T Angle rad 0 00 l 0 00 E p Reset Control contro 0 00 A and r angles Statue and flags Y control 0 00 e Y E Rail limit b4 bit 6576 158880 26044 000 Frail limit ra 0 438 1 097 0 799 z control bas rail linit flag Iv Iv Iv Home rail limit switch Ei r dE Home autoreset flag Iw Iv Iv Thermal state AN B dci ia i Thermal flag nm E r Fig 4 3 Manual Setup window after the Go to Center action 3DCrane User s Manual 25 4 2 Drivers The main driver is located in the RTWT Device Driver column The driver is a software go between for the real crane MATLAB environment and the RT DAC PCI acquisition board This driver serves to the control and measurement signals Click the 3Dcrane Device Drivers button and the driver window opens Fig 4 4 a Crane3D D
26. Start time 0 0 Stop time 999999 Solver options Type Fixed step ode5 Dormand Prince 7 Fixed step size 0 01 Mode SingleTasking Output options Bye w MITE OK Cancel Help Apply Fig 7 7 Simulation parameters 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 7 5 Successful compilation and linking processes generate the following message Model MyModel rtd successfully created 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 rail and the payload in a safe zone The Go Home and Go To Center buttons are applied to fulfil these tasks 8DCrane Users Manual 67 8 Mathematical model of the 3DCrane The schematic diagram of the crane 1s given in Fig 8 1 payload Mcg Fig 8 1 3DCrane system coordinates and forces There are five measured quantities e x not marked in Fig 8 1 denotes the distance of the rail with the cart from the center of the construction frame e y not marked in Fig 8 1 denotes the distance of the cart from the center of the rail e R denotes the length of the lift line e Q denotes the angle between the y axis and the lift line e D denotes the angle between the negative direction
27. View Simulation Format Tools Help Eie Edit View Simulation Format Tools Help 3 Em Statieatimne cade etre E 3 mil na EJ X En En E Sindir debuggen Connect to target Data explorer Simulation parameters Ctrl E Uem OESTE i Coverage settings Normal Model differences j Profiler Accelerator ad e External Linear analysis Repor t generator Real Time workshop i Click before building External mode control panel Eixed Paint mimi middle af middle of oOo position A position nam mm andes ae Fig 5 6 External control mode Next invoke the Tools External mode control panel item The External Mode Control Panel window opens see Fig 5 7 Crane3D_pid_all External Mode Control Panel Connect Sal eee code Ami Manel Parameter tuning 3 Batch download Download a Configuration I K K gt gt _ Target interface E Signal amp triggering a Data archiving Fig 5 7 Setting data acquisition in RTWT By clicking on the Signal amp Triggering button invoke the window shown in Fig 5 8 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 Source as the manual option mark Arm when connect to target and close the window Now we can buil
28. al system 0 8 0 6 0 4 0 2 0 D 1 ES velocity vs time blue simulation red real system 0 7 0 05 J pure 0 1 J 2 10 le kp 0 103062 Tsp 0 019731 Km 0 091699 Tsm 0 012947 Fig 6 11 The model results matched to the real data measurements in the Z axis The model matching in the Z direction results in two models identical in form and different in parameters We have Kp 0 103062 and Tsp 0 019731 when the payload is lifted and Km 0 091699 and Tsm 0 012947 when the payload is lowered The model shown in Fig 6 12 different from that presented in Fig 6 6 is used Crane3D_CSModelZ File Edit View Simulation Format Tools Help O mE g de i See IH m a bos Normal z Case Study Model Z 1 ES To Workspace Vel fus 0PKp u us 0 PF km a mu 0PTsp u lt 0 FP Tsm Di T Integratar1 Integrator To Workspace Pos Product HU deb Fig 6 12 Simple Dynamics in the Z direction Step 5 3DCrane User s Manual 53 Perform the Go To Center action Set the payload motionless After that it is necessary to reset the angle encoders Go to the Main Control Window and reset the angle encoders Step 6 Click on the Collect X Y Data button The corresponding controller denoted by 5DCrane Angle Excitation opens see Fig 6 13 Click Set Address button and rebuild the model Next choose successively Connect to Target and Start real time simulat
29. and lower limits Parameters switch on paint 0 5 switch off point AA Dutputwhen an B5 Output when off 0 5 Fig 6 3 Parameters of the Relay block 2 9 aja e ime ofset 0 Fig 6 4 Collected data visible in the scope figure 3DCrane User s Manual 49 4 Figure No 1 E n xj Ele Edit Tools Window Help JO SMS KAAS PED X Axis Position Velocity and Control 0 6 Time sec Press a key Ele Edit View Simulation Format Tools Help a i5e cc ismte x Case Study Model XY To Workspace Wel From hreaneneren Integrator To Workspace Pos Workspace Fig 6 6 Simple Dynamics in the X or Y directions Finally we obtain K and T parameters of the simple model In this example they have the following numerical values K 0 173511 T 0 074388 3DCrane User s Manual 50 The final plots after optimisation shown in Fig 6 7 indicate that the model matching 1s successful f Figure No 1 Inl x File Edit Tools Window Help JOSH S KAAS PER Position vs time blue simulation red real system 0 8 0 6 1 4 0 y 10 ls K 0 173511 Ts 0 074388 Fig 6 7 The model results matched to the real data measurements in the X axis After pressing a key again the program starts The same procedure is repeated in the Y axis A similar simple linear model of the crane dynamics in Y axis 1s assumed G 2 yet s T s 1 Results obtained for the
30. asin p Ye Y Rcos Ze Rsinacos p The dynamics of the crane is given by the equations Fig 8 1 m X E x m y S M Z 8S m g m m x F T 4 S n yu ILS where Sy S and S are the components of the vector S S S sin sin P S S cos a S Ssinacos f It is assumed that the lift line is always stretched that is 3DCrane User s Manual 1 2 5 4 5 6 7 8 9 10 11 69 Dye PED 0029 eee 12 In the case where the payload is lifted and lowered with the use of the control force Fr S 4 12 should be replaced as follows S F T 13 8 2 Simplified model with three control forces Assume that the deviation of the payload from the z axis 1s small Then Cos q cos AQ AQ 14 ms sin Y PU AQq 1 15 cos p ze 16 sin D AD 17 Equations 9 11 take the form S SAB 18 S SAa 19 S S 20 Substituting 18 20 and 13 in 4 8 we obtain x u T AB 21 y uz T JAQ 22 Ze U T3 8g 23 X u T u TAB 24 y U T u4 T344 Ao 25 With the simplification 14 17 the position of the payload satisfies x X RAD 26 Ye Yy RAG 27 z R 28 The acceleration of the payload is given by X X RAB 2RAB RAB 29 3DCrane User s Manual 70 y 2 Y RA 2RAG RAG 30 2 R 31 After the substitution of equalities 29
31. ask presented in Fig 4 6 you can introduce initial conditions for the model state variables Additionally by marking the checkbox you can use the model with constant length see section 8 for details Block Parameters Crane3d model I Model with constant length uunamumARERARERHARERHARERZEERRERSRRERRRZERRERARERRSRERRARERRERRAREER Initial conditions s y yl alfa alfa beta beta z 2 1 050000000 050 1 Se Help Appl Fig 4 6 Mask of the simulation model The simulation model is running in the normal simulation mode i gt Set solver options to Fixed step and Fixed step size equal to 0 001 at least A greater value could result in the errors of solution The C source code of the model3ddm c file is attached to the DevDriv directory 8DCrane Users Manual 87 4 3 Demo Controllers In this column some examples of control systems are given These demos can be used to familiarise the user with the crane system operation and allow creating the user defined control systems The examples must be rebuilt before using Due to similarity of the examples we focus our attention on one of them After clicking on the Relay button the model appears Fig 4 7 7 Lrane3D Relay m lal x File Edit view simulation Format Tools Help 7 gt Ho 6 em c z E a b Extemal DOF Relay Controller Y Position E zroci on x Switch Relay Y S
32. cope P 9 ale e eec bl eeseococMrticto5wcsstcteccst ltesciccclhoecmccttecectttsce tec c yr noorpoooqpoprrn oonoos o o paro o hipocoopoo o oo Fig 4 10 Results of the relay controller demo experiment 3DCrane User s Manual 30 The X position starts from 0 54 and changes between 0 2 and 0 6 The control red line 1s a square wave in the range 0 5 0 5 The control switches when the X position reaches one of the limit values Note that the X angle in the form of a sinusoidal curve is modulated by the control interacting with friction 3DCrane User s Manual 31 5 Your first real time control experiment We propose two experiments In the first experiment only one 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 built The Crane3D first model is illustrated in Fig 5 1 To invoke it click Model for control experiment button 1n the Main Control Window In this case the active control corresponding to the x cart position 1s all you need The Simulink blocks included in the control are drawn with dropped shadows to distinguish active control loops from disabled loops In our first experiment we use the X position of the cart PID controller activating only its P control part E Crane3D_f
33. d the real time model To do it select the Simulation Parameters item and then the Real Time Workshop tab in the model window and click the Build item Successful compilation and linking process should be finished with the following message Model Crane3D_first rtd successfully created 3DCrane User s Manual 35 Successful completion of Real Time Workshop build procedure for model Crane3D_first Crane3D pid all External Signal 2 Triggering Signal selection Block Path CUP PERLE aa TEES Clear all 6 gn C off Trigger signal ir Go to block Trigger Source manual Mode normal INGGER Saal Duration 10000 Delay 0 E Raja O Hamadai j v Armm when con to target DE q i DOC NM 9 Ire tst sino Revert Help Apply Close Fig 5 8 Setting triggering of signals 5 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 in the Main Control Window first The crane is ready for the experiment The cart is in the middle of the x y 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 tem 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 car
34. design and generate your own real time controller in MATLAB Simulink environment e contains the library of ready to use real time controllers e includes the set of preprogrammed experiments The 3DCrane setup Fig 1 1 consists of a payload hanging on a pendulum like lift line wound by a motor mounted on a cart 3DCrane User s Manual 5 Fig 1 1 The 3DCrane setup The payload is lifted and lowered in the z direction Both the rail and the cart are capable of horizontal motion in the x direction The cart is capable of horizontal motion along the rail in the y direction Therefore the payload attached to the end of the lift line can move freely in 3 dimentions The 3DCrane is driven by three DC motors There are five identical measuring encoders measuring five state variables the cart co ordinates on the horizontal plane the lift line length and two deviation angles of the payload The encoders measure movements with a high resolution equal 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 It also converts the encoders pulse signals to the digital 16 bit form to be read by the PC The PC equipped with the RT DAC PCI multipurpose digital VO board communicates with the po
35. dify system settings Next you will be asked to restart your system Click the Yes button to restart your system 2 2 Uninstallation for Windows 98 NT 2000 XP i gt The system administrator who has full access to all drivers and system settings must start the application To start the uninstallation program insert the CD ROM into the drive and run manager exe placed in the main directory From the INTECO Software Manager application window select 3DCrane Toolbox Uninstallation In the opened window click the UNINSTALL button to start the uninstallation program or choose EXIT to quit 3DCrane User s Manual 11 If you choose the UNINSTALL option you will see the dialogue window see Fig 2 5 containing information about the installed components If you want to remove an item select it on the list and click the Uninstall button otherwise click the Exit button The list box contains all 3DCrane Toolboxes installed on your computer On the left side of the item the check box is visible To uninstall an item the check box must be selected Crane3D Uninstallation Wizard software to uninstall Fig 2 5 Click the Next button 8DCrane Users Manual 1 3 Starting testing and stopping procedures 3 1 Starting procedure Combine the acquisition board Control Interface and 3DCrane together In the MS WINDOWS environment invoke MATLAB by double clicking on the MATLAB icon The MATLAB command window opens Then simply
36. e Simulink library However some of them cannot be used see Math Works references manual 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 7 3 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 1s placed under Variable name The variable format can be set as structure or matrix The default 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 4 Scope properties l Ea 3 5cope properties Tip Ary right clicking an ases Beneral Data history v Limit data points to last 5000 General Data history Tip ry right clicking on axes Axes Number of axes floating scope Time range 30 Tick labels bottom axis only Sampling Decimation 10 DE Cancel Help Apply OK Cancel Help Apply Fig 7 3 Setting the parameters of the Scope block M Save data to workspace Variable name Ex Format Structure with time When the Simulink model is ready click the Tools External Mode Control Pane
37. e coefficient to obtain the position in meters Position bit The value read from the corresponding encoder counter Position m The position expressed in meters The value read from the encoder counter is multiplied by the corresponding scale coefficient to obtain the position in meters 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 and Y axis angles of the load The angle measurements are performed by the incremental encoders There are the following four fields associated with each angle Angle X and angle Y denote the angle deviations in X and Y direction 35 respectively They are denoted by and p in the mathematical model see Fig 8 1 Scale coefficient The value applied to calculate the angle expressed in radians The value read from the encoder counter 1s multiplied by the corresponding scale coefficient to obtain the angle in radians Angle bit 3DCrane User s Manual 23 The value read fr
38. e maximum position expressed in meters 1s obtained as the result of the multiplication of 64 maximum position expressed in bits and the corresponding scale coefficient Max rail limit flag If the checkbox 1s selected the RT DACA PCI 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 Home rail 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 8DCrane Users Manual A 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 1s overheated the corresponding box is checked Therm flag The flag that causes to turn off the control if the power amplifier 1s 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 you can see the changes in the Manual Setup window see Fig 4 3
39. er If the Matlab 7 0 4 version 1s used a third party compiler is not requested The built in Open Watcom compiler is used to creating real time executable code for RTWT The Configuration parameters page for MATLAB 7 04 1s shown in Fig 7 6 Notice that rtwin tmf template makefile is used This file is default one for RTWT building process Configuration Parameters Tank3 Relay Configuration ae x Target selection He FOMEI System target file twin th Browse Data Import Esport Optimization Language E El Diagnostics Description Real Time Windows Target io rosample Time Er Data Integrity Documentation P omisi n Generate HTML report He Connectivity pa Compatibility Launchrrepart after code generation completes Model Referencing Hardware Implementation PAd process 0 0000000 C O O n Model Referencing TLE options n UI Real Time W arksha B Make command make rw H Comments po Symbols Template makefile rtint Debug Generate code only Bud Build Heal Time window l l Fig 7 6 Configuration parameters page for MATLAB ver 7 04 3DCrane User s Manual 66 The Start time has to be set to 0 The solver has to be selected In our example the fifth order integration method ode5 1s chosen Simulation Parameters Crane3D_identl Solver Workspace vol Diagnostics Real Time Workshop Simulation time
40. esssxs 4 55 Res55X V 45 Ress Qs 55Xg B t 44 55 Jes 2RACsXeXs Finally we obtain eight state equations describing the dynamics of the crane with constant pendulum length du 54 Xs 1 5252 N I4 5 5 4 N gt V A 55 Rm 56 x l 4565555 N 1 c2 N V A 57 Xs X 58 x 1 1 52 54N Bess N V KA 59 PELA 60 Xs 12 0555 75 N B ss c N V Ass 61 The expressions A R and sin xs are greater than zero Therefore the model is free from singularities 8 4 Complete nonlinear model with varying pendulum length and three control forces In order to derive the crane equations without the simplifications given in equations 14 17 formulas 9 11 and 13 are substituted into 4 8 which gives x uz T sin asin B 62 y u4 T cos amp 63 z uz T sin cos B g 64 X u T My u T sin sin B 65 y u T 4 u T cosa 66 The equations 1 3 are differentiated twice with taking into account that the length of the lift line R t varies in time due to the action of the control force Fg Proceeding as in section 6 2 the complete system of nonlinear state equations for the crane controlled by means of three forces is obtained 3DCrane User s Manual 73 x x R R RB sin Asin P 2RGB cos acos D 2Ra Ra cos asin f 2RB RB sin a cos p y Vy 4 R RG cosa 2R
41. evDriv File Edit View Simulation Format Tools bom m Position 4 X PIM prn El osition E Constant Position A Angle v PNIM d Y Angle Constant A ewitch Sj Y Switch E Pvt Switch E Constant a Crane 3D Ready 4 Dus adeb ve Fig 4 4 3DCrane Device Drivers The driver has three PWM inputs DC motor controls for the X Y and Z axes There are 10 outputs of the driver X position Y position Z position two angles see section 8 and additionally three safety switches According to a pre programmed logic 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 35 inside its copy Simulation Model the simulation model of the crane is located under this button Its external is identical as the model given in the 3Dcrane Device Drivers except the lack of the safety switches see Fig 4 5 These switches are not used in the simulation mode The simulation model is used for many purposes identification controllers design etc 3DCrane User s Manual 26 Crane_model Al X File Edit View Simulation Format Tools lsm rrej cer e Crane 3D Simulation Model x position Y Position Z Position Crane3d model Ur ID IS M i Fig 4 5 3DCrane Simulation Model In the m
42. exceeding the real rail limits may result in damage of the system elements Manual Setup The 3DCrane Manual Setup program gives access to the basic parameters of the laboratory 3 dimentional crane setup The most important data transferred from the RT DACA PCI board and the measurements of the crane 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 presented in Fig 4 2 opens The application contains five frames The RT DA C4 PCI board frame presents the main parameters of the PCI board The Control frame allows to change the control signals The X Y and Z positions are given in the X Y 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 by the 3D Crane Manual Setup program are updated 20 times per second 3DCrane User s Manual 20 Hi 3D Crane Manual Setup zr x H BAEA PEI board gt A T and Z positions i T Z Ho of detected boards l Scale coefficient 5 809e 005 5 809e 005 21859 005 Board Board 1 Position bit 224 553 11624 ed EE Posiionim am am 82 Slot number 3 CENE r m Z Boc 54272 04D400 Logic version ate Pee Angle Angler ok Scale poa 0 007 Baq 0 00t 534 Angle bit 4 Cat
43. form of square waves Abrupt changes in the cart movement result in oscillations of the payload These oscillations are immediately dumped due to the P angle controllers operation E Controls A be ime affset 1 Fig 6 22 The X Y and Z controls visible in the Controls scope 3DCrane User s Manual 60 ime offset D Fig 6 23 The X Y Z positions and X Y angles visible in the States scope 3DCrane User s Manual 61 T Prototyping your own controller in RTWT environment In this section the process of building your own control system is described The Real Time Windows Target RTWT toolbox is used An example how to use the Crane3D software is shown later in section 5 3 In this section we give indications how to proceed in the RTWT 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 To build the system that operates in the real time mode the user has to e create a Simulink model of the control system which consists
44. 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 is moved the value in the corresponding edit field changes as well STOP The pushbutton 1s applied to switch off all the control signals When pressed all the control values are set to zero PWM prescaler 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 Fpwy 20000 1025 1 PWMPrescalerr kHz 8DCrane Users Manual 2D This parameter sets the frequency of all PWM control signals The parameter may vary from 0 to 63 It causes the changes of the frequency of the PWM control signals from 19 55kHz to 305Hz X Y and Z positions The frame presents data related to the X Y and Z axis positions The X position is the rail position The Y position is related to the position of the cart The position of the load 1s 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 the position expressed in meters The value read from the encoder counter is multiplied by the corresponding scal
45. he temperature of a power amplifier is too high the appropriate flag is set to x See ThermFlag 9 12 ThermFlag Purpose Control an automatic power down of the power amplifiers Synopsis ThermFlag get cr3 ThermFlag set cr3 ThermFlag NewThermFlag 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 1s overheated See Therm 3DCrane User s Manual 79 9 13 Time Purpose Return time information Synopsis T get cr3 Time Description The Crane3D object contains the time counter When a Crane3D 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 9 14 Quick reference table Property Name Read the version of the logic design for the RT DAC PCI board PWM 3DCrane User s Manual 80 10 How to fulfil the compilation settings page In Fig 10 1 and Fig 10 2 the different Simulation Parameters pages are shown Having the MATLAB version and the compiler version the user has to choose the appropriate Simulation Parameters page version 2 Simulation Parameters Crane3D_PID_all Solver Workspace vo Diagnostics Advanced RealTime Warkshar Category Target configuration Configuration System target file rt
46. ifications of equations 14 17 but assuming that the length of the lift line R is constant and there is no control force Fr Putting formulas 9 11 into 4 8 we obtain x ssinasin B 42 y scos gt s 43 cos amp Z ssinadcos P g 44 x u T su sinasin B 45 y u T su cosa 46 The position of the payload is given by 1 3 Its acceleration satisfies x x R acosasin B Bsinacos f l 47 a B sinasin B 2aB cos cos B y y R asin a cos d 48 z R amp cos cos B Bsin asin D 49 a B sin acos D 20 8 cos asin D After the elimination of s that 1s the substitution of 32 into equations 33 36 we get a set of four equations x y teasin B 50 Ze y tgacos B 8 51 X u T LL y tg sin D 52 y My T 44 53 Using equations 47 49 in 50 53 we arrive at a system of four equations with four unknowns X y amp and 5 The solution of this system with respect to the second derivatives and the introduction of new variables gives the final description in the form of nonlinear state equations We introduce the notations Xp yy X53 a id B X X5 0 X3 X Xx P X47 Xy X iyu 8DCrane Users Manual 7 SINX C COSX A 1 4405 1135557 B 1 44 V 44 Res x6 5538 My 8C555C7 V us Rss 55X8 S5X6 415855757 V Bgcsc BR
47. ion from the pull down menu The cart and the rail start to move and stop afterwards This short in time motion gives an impulse to the payload to swing The system collects angles data 5 crane3D_CSAngleExc E DIETE File Edit View Simulation Format Tools Help A E cct mis amp A fExema Angle Excitation x Position XY Control Position YOontal Position 1j x Position l lll Control AA Excitation De s ILL Control E Y Angle x witch ee p Y Switch e uem i ESNIE act Hoo fd o ag Fig 6 13 3DCrane Angle Excitation window The results of the experiment are presented in Fig 6 14 3DCrane User s Manual 54 E Scope io 2 0 Alta Sl ime offset 0 Fig 6 14 Collected data visible in the scope figure Step 7 Having collected data of angles trajectories you can start the identification of Z displacement Click on the Identify Z Displacement button The angle data are displayed see Fig 6 15 E Figure No 1 File Edit Tools Window Help ID FH S RAASL 522 AY Angles 0 0s 0 08 f e MN ENJ 1 M e PNE E ead A pd pad ety D DB r J tH p 4 0 08 i G 5 10 15 Time sec Press a key Fig 6 15 The real data measurements of X Y angles 3DCrane User s Manual 55 Figure No 1 File Edit Tools Window Help ID S HS KAAY SPER Period 1 8267 Length 0 32913 Autocorrelatio
48. irst I Jal x File Edit wiew Simulation Format Tools Help DG EB amp 5m8 c Bet r y Etma X axis PID Controller x reference X position middle af position 3 angle LA Sitch of the payload middle of zz 4 unm it j Y position Ou T position t Y Switch E s 5 Z Switch Signal Ed rt Y reference Enable Y angle of the payoad AE Z position of the payload unm oo Signal 2 referente middle of Z position 100 indes Fig 5 1 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 We define a source of a desired x position signal as the X reference Generator from the Simulink library see Fig 5 2 8DCrane Users Manual 8D Signal Generator o utputwarlous wave farms Parameters Wave fam Amplitude E Frequency 0 075 limite Hertz Fig 5 2 Signal Generator set to become the square wave signal source As usual after performing the GO HOME and GO TO CENTER actions we start an experiment from the middle of the x y rails Therefore 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 5 3
49. king 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 Encoder property should be converted into physical units See ResetEncoder RailLimit RailLimitFlag ResetSwitchFlag 9 4 PWM Purpose Set the parameters of the PWM waves Synopsis PWM get cr3 PWM set cr3 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 is not generated 1f 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 cr3 PWM 0 3 0 0 1 0 9 5 PWMPrescaler Purpose Determine the frequency of the PWM waves Synopsis Prescaler get c
50. l option and next click the Signal Triggering button The window presented in Fig 7 4 opens Select XT Scope set Source as manual set Duration equal to the number of samples you intend to collect and close the window 3DCrane User s Manual 64 Crane3D Pxyz External Signal 4 Triggering L x Signal selection Block Path Select all Clear all on C off Trigger signal El Go to block Trigger Source manual Mode normal Tre signali Pate 1 Element any i Crane3D_Pxyz Scope Duration 3000 Delay 0 M Arm when connectto target Direction frisin g Level 0 4 Hald an 0 Revert Help Apply Close Fig 7 4 External Signal amp Triggering window 7 2 Code generation and the build process Once a model of the system has been designed the code for 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 Simulation parameters dialog box The RTW page appears when you select the RTW tab Fig 7 5 The RTW page allows you to set the real time build options and then to start the building process of the RTW DLL executable file Simulation Parameters Crane3D Relay I i
51. lag NewLimitFlag Description The RailLimitFlags is a 1x3 vector The first two elements control the operating range of the cart The last element controls the maximum length of the lift line If the flag 1s set to 1 and the encoder register exceeds the range the DC motor corresponding to it stops If the flag is set to O the motion continues in spite of the range limit exceeded in the encoder register 3DCrane User s Manual 78 See RailLimit RailLimitSwitch 9 9 RailLimitSwitch Purpose Read the state of limit switches Synopsis LimitSwitch get cr3 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 9 10 ResetSwitchFlag Purpose Control the auto reset of the encoder registers Synopsis ResetSwitchFlag get cr3 ResetSwitchtFlag set cr3 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 1s pressed See ResetEncoder RailLimitSwitch 9 11 Therm Purpose Read thermal flags of the power amplifiers Synopsis Therm get cr3 Therm Description Returns three thermal flags of three power amplifiers When t
52. located in the BIN WIN32 directory Matlab 6 x of 7 0 4 version For this purpose click the Browse button You will see the dialogue box with drives and directory list displayed see Fig 2 4 Crane3D Installation Wizard E B Matlab location Detected operating system Microsoft Windows 2000 Choose Matlab version you wish to install for i Browse lt Back Next gt 3DCrane User s Manual 10 Fig 2 3 Browse your system directories and select the appropriate directory The program automatically detects the presence of the matlab exe file and closes the dialogue window The selected location will be displayed in the Installation setting window Ed accessible ml util exe P neato exe Ez mbuildopts MATLAB exe Ipkadata exe mexopks Imec exe PrintImage exe E cpucount exe Al meditor exe ltwopi exe I dot exe relint exe unzipsFx exe ad genrb exe Imwregsvr exe mili zip exe Nazwa pliku Fliki typu Executables Ala Fig 2 4 If you have completed installation settings click the Next button to start the installation procedure You will see the progress window containing information about installation progress and names of files currently being copied For the Windows NT 2000 XP version the program will install the Windows NT kernel mode device driver This action is performed only 1f the driver does not exist in the system The application will copy the driver to your system and mo
53. m The window Fig 3 6 opens You can interrupt the motion clicking the OK button 9 BasicTestFunction Step 3 System moves tothe Y axis home position Press OF button ta stop immediately DE Fig 3 6 Go Home Y axis window After performing tests along three directions the system 1s stopped at the zero position The encoders of X Y and Z axes are automatically reset to zero value If motion in a given direction is not observed check wires and plugs related to that direction The next three steps perform the change of the system position from the initial position to the initial 0 3 m position along a selected direction e Double click the X axis Y axis and Z axis Movement button The window Fig 3 7 opens where you can stop the motion clicking the OK button 8DCrane Users Manual BasicTestFunction Step 5 System moves ta the anis D 3 m position Press OR button to stop immediately Fig 3 7 X axis movement window Click the OK button and the plot of the movements appears Fig 3 8 4 Figure No 1 i Oo xj File Edit Tools Window Help JO MSlRAALI PER X position movement 0 6 A position m 0 35 E 0 5 1 15 2 2 9 Time sec Fig 3 8 Plot of the X axis test movement e In the next step double click the Go To Center button The system moves to position in the center of the physical system workspace Workspace boundaries are limited by sizes of the laborator
54. misation Toolbox is required to perform step 4 8DCrane Users Manual AZ Step 4 Click the Identify XYZ Model button The optimisation procedure starts The plot illustrated in Fig 6 5 appears The following simple linear model of the crane dynamics in the X axis is assumed G s um s T s 1 The Identify XYZ Model button calls the CaseStudy_XYZIdent m file This routine calls the Crane3D_CSPenaltyXY function The function invokes simulation of the Crane3D CSModelXY Simulink model see Fig 6 6 If you wish to build your own optimisation procedure all source codes are available The optimisation procedure called inside CaseStudy XYZlIdent uses the fmincon procedure from the MATLAB optimisation library which finds the constrained minimum of the Crane3D_CSPenaltyXY function The iterative procedure based on fminunc results in matching real system time responses to the simple model responses Jajxi File Edit View simulation Format Tools Help i E amp Bs E esa lh El L de External 3DOF Relay Controller Position Y Position Control Position L3 Scope veni ZPosition x Angle Y Angle x witch Y witch z wWtch 100 odes F Fig 6 2 Motion controllers in the X Y Z directions 3DCrane User s Manual 48 Dutputthe specified an or off value by comparing the inputto the specified thresholds The on off state of the relay is not affected by input between the upper
55. mulink model window The pop up menus provide a choice between predefined items Choose the RTW Build item A successful compilation and linking process 1s finished with the following message Model Crane3D_Relay rtd successfully created Successful completion of Real Time Workshop build procedure for model Crane3D_Relay If any error occurs then the message corresponding to the error is displayed in the MATLAB command window e Next click the Tools External Mode Control Panel item and next click the Signal Triggering button The window presented in Fig 4 9 opens e Select XT Scope set Source as the manual option mark 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 8DCrane Users Manual a Crane3D Relay External Signal Triggering signal selection Block Path Crane3D Relay Scope select all Clear all f on of Trigger signal x Goto block Trigger Source manual Mode normal Imegersianel Ean I Element any Danei Relay scope Duration S000 Delay 0 Le iY Am when connect to target c J Em jc Revert Help Apply Close Fig 4 9 External Signal amp Triggering window recien rising e Observe the plots in the scope and click Stop Simulation after some time Results of the example are presented in Fig 4 10 l0l x S
56. n 20 2 4 6 3 Time sec Press a key Fig 6 16 The calculated period and length of the pendulum The mathematical pendulum model is assumed The period of oscillations T is calculated from the formula gt 8 where is the mathematical pendulum length and g is the gravity constant You obtain the values for the period and the length of the pendulum They are 1 826 s and 0 822 m in the presented example Step 8 We click on the PID Optimisation button to invoke the iterative procedure This procedure tunes the parameters of the PI controller for each axis using the model given in Fig 6 17 The performance index 1s equal to the sum of squares of the differences between the reference signal and the response of the system The penalty function is also used see CaseStudy penaltyPID m file for details 3DCrane User s Manual 56 Crane3D_CSMPID File Edit View Simulation Format Tools Help BEBO ee rk noma d Model for PID Optimisation DesSim To Workspace DesSim Ctrl Ctrl i To Workspace PosSim sim Tsim 71 FID Controller Saturation Dead Zone Velocity Position 100 Podes P Fig 6 17 Model for optimisation of the PID parameters The optimisation runs The temporary system responses to the iterative parameters K and K values are displayed in the consecutive three figures The final results are visible in Fig l 6 18 Fig 6 19 and Fig 6 20 and displayed in the MATLA
57. of the 3DCrane Device Driver and other blocks chosen from the Simulink library e build the executable file under RTWT see the pop up menus in Fig 5 1 7 Crane3D_DevDriv File Edit View Simulation Format Tools Help a El eb de E i ithe debunget Estemal Data explorer Coverage settings Model differences Profiles te Driver Linear analysis Report generator i f A Position H Real Time Workshop Options Constant Build Model Ctrl B Buld subsystem ip External mode control panel vo Fixed Paiht Benere SE TSDITGH GTI Constanti P 7 E X Switch we Y Switch Z PM E IF x Z Switch Constant tj 1 Patol UT TOC TT Crane 3D Default BaseAddress 528 DEC TO 0 01 Generate ATW cade Fig 7 1 Creating the executable file under RTWT 3DCrane User s Manual 62 e start the real time code to run from the Simulation Start real time code pull down menus 7 1 Creating a model The simplest way to create a Simulink model of the control system is to use one of the models included in the Main Control Window as a template For example click on the Pxyz button and save it as MySystem mdl name The MySystem Simulink model is shown in Fig Za mysystem i E E LIT EX File Edit View simulation Format Tools Help i p Hs b Es E Ea in tse p Estemal 3DOF P Controller Position Position z Position TM z Position
58. om 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 is 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 in the downright position Status and flags The frame presents status data and flags related to the X Y and Z axis There are seven fields associated with each axis Rail limit 64 bit The RT DACA PCI board is able to automatically turn off the control signal if the 3D 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 RT DAC4 PCI board is able to stop the generation of the DC control signals moving the system outside the operating range Rail limit m The field defines the maximum accessible position expressed in meters If the system reaches this position the RT DAC4 PCI board is able to stop the generation of the DC control signals moving the system outside the operating range Th
59. on of angles are compared T T T T T 0 8 T T T T T Y controls 0 5 X controls 4 d A m stabilisation of Y angle 04 YA 0 6 l without stabiligation amp f X angle v E M 0 3 N 1 4 0 4 ithout stabiligation of Y angle 0 2 0 2 0 1 L 0 0 0 1 F with stabilisgtion of X angle 4 0 2 0 2 B 0 4 c 0 3 N 0 6 0 4 A P Aj l v L l l V l 0 8 i 0 5 10 15 20 25 0 5 10 15 20 25 Fig 5 25 The controls normalised units Fig 5 26 The controls normalised units in the X direction vs time seconds in the Y direction vs time seconds 3DCrane User s Manual 45 Notice that the controls related to the case of angles stabilisation thick lines in the figures share their actions between two tasks tracking a desired position of the cart and stabilising the payload in its down position 3DCrane User s Manual 46 6 CASE STUDY This section describes nine steps to be performed by the user for collecting data from the real 3DCrane system identifying a simple crane model and identifying the z displacement Finally the optimisation of the 5 DOF PID controller based on the collected data yields an appropriate set of the PID controller s parameters All steps are described in detail below After clicking on the Simple Model button the following window opens see Fig 6 1 f 4 Crane3Db_simpleModel E nix Step 1 and Step 2 have been described in
60. ongly 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 model3ddm 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 3DCrane User s Manual 41 AE le 2 9 all el A I A LL LII O A IL O A O O A AN ee ee A E A Po PP y IA nee ene MEX nets ups peg messi utes l AA 1 desired x sci yet A mue Al E x angle O 0 5 05 angle E 2 ontrol e 2 ala peso al bonoi oo i 0 5 10 15 20 25 3C 0 5 10 15 20 25 3C P of the cart position set to 5 P of the cart position set to 5 P of the payload angle set to 0 P of the payload angle set to 4 Only one controller is active the desired x Two controllers the desired x position of position of the cart is tracked the cart is tracked and the x angle of the payload is stabilised Fig 5 16 Simulation results 8DCrane Users Manual 4D 5 3 PID control of load position In our experiment the cart 1s following a Lissajous curve We invoke the Crane3D_impres model from the MATLAB command window see Fig 5 17 We put the cart into motion in two directions The desired cart positions are generated as two sinusoidal signals The
61. ormancelndex 267 3001 3 152049e 007 4553914 0 8 0 5 10 15 20 Position and desired position vs time 05 0 10 15 20 Control vs time Fig 6 20 The optimisation run window the final result for the Z direction When the optimisation is finished click 5DOF Experiment button invoke the Crane3D_CSPID model see Fig 6 21 and manually introduce the set of new parameters for the X PID and Y PID controllers The PID controllers of the X an Y angles have the default K values equal to 20 You may change and enlarge these values up to your requirements However do remember that this 1s a trade off between tracking the desired cart trajectory and the payload stabilisation Too high K values may result in an unstable behaviour of the crane 3DCrane User s Manual 59 5 crane3D_CSPID olx File Edit View Simulation Format Tools Help Dic E es5m cmt e Extena 5DOF PI Controller States x Reference png Y Angle YAng gt A Y Reference Value v Y Reference Y PID Y Angle PID Y Switch zam Z Reference ZPID Crane 3D x Reference value il Controls 100 lode5 Ai Ready Fig 6 21 The Case Study 5DOF PID controller window Rebuild the model then open two scopes and start the real time experiment The results of the experiment are visible in the scopes see Fig 6 22 and Fig 6 23 The cart 1s tracking the reference signals in the
62. r3 PWMPrescaler set cr3 PWMPrescaler NewPrescaler 8DCrane Users Manual TT Description The prescaler value can vary from O to 63 The O value generates the maximum PWM frequency The value 63 generates the minimum frequency See PWM 9 6 ResetEncoder Purpose Reset the encoder counters Synopsis set cr3 ResetEncoder ResetFlags Description The property is used to reset the encoder registers The ResetFlags is a 1x5 vector Each element of this vector 1s responsible for one encoder register If the element is equal to 1 the appropriate register 1s set to zero If the element is equal to O the appropriate register remains unchanged See Encoder Example To reset the first and fourth encoder registers execute the command set cr3 ResetEncoder 10010 9 7 RailLimit Purpose Control the operating range of the 3D crane system Synopsis Limit get cr3 RailLimit set cr3 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 See RailLimitFlag 9 8 RailLimitFlag Purpose Set range of limit flags Synopsis LimitFlag get cr3 RailLimitFlag set cr3 RailLimitF
63. re are two generators identical in amplitudes equal to 0 2 m and different in frequencies The X motion frequency 1s 0 4 rad s Fig 5 18 and the Y motion frequency is 0 8 rad s i7 Crane3D impres ol x File Edit View Simulation Format Tools Help Ulead S i SE 2 Ree Sl gt y External y Crane3D 5DOF Pl Controller 0000 oo x Switch 0000 00 y sen nonu oo Controls pu Ready 10095 lodes A Fig 5 17 The controller built for the cart to follow a Lissajous curve We perform the experiment twice first time without the P angle controllers and second time with the P angle controllers set to 20 see Fig 5 19 Block Parameters Signal Generatorb Block Parameters X Angle PID F Signal Generator PID Controller mask Enter expressions for proportional integral and derivative terms Output various wave Forms v Ratatiietets m Parameters Wave form IBRGMERR Amplitude ai 02 Integral Frequency n E o 4 Derivative fo Units rad sec cue bone Iv Interpret vector parameters as 1 D jon 3DCrane User s Manual 43 Fig 5 18 Generator of the desired X Fig 5 19 X angle PID controller position signal The cart motion is shown in Fig 5 20 The thick line represents the cart position in the X Y plane there is no movement in the Z direction The respective controls and the payload angles are shown in Fig 5 21 and Fig 5 22 AL Y vs X cart positions
64. t follows the desired square wave signal controlled by the P regulator The payload oscillates freely being uncontrolled After 30 seconds the experiment stops The history of the EX variable is visible in the Scope see Fig 5 9 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 1n the saturation of the control signal 3DCrane User s Manual 36 PALA Aja e Fig 5 9 Data visible in the scope during the experiment 5 1 1 Data processing The results are saved to the workspace as a structure variable EX7 If you write the variable name in the MATLAB command window then you obtain the answer EX time 301x1 double signals 1x1 struct blockName Crane3D_pid_all Scope This data can be plotted in many ways For example use the following command gt gt plot EX1 time EX1 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 5 1 Table 5 1 Parameters for the experiments 8DCrane Users Manual 87 The results of five experiments are presen
65. ted in Fig 5 10 and Fig 5 11 P set to 2 5 i P set to 5 Fig 5 10 Only one controller is active desired x position of the cart 1s tracked 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 3DCrane User s Manual 38 e P of the cart position set to 3 P of the payload angle set to 4 Fig 5 11 Two controllers desired x position of the cart and x angle of the payload are tracked The left hand side of Fig 5 10 shows that the P value set to 2 5 1s too small for a proper x position tracking The static error of x position 1s large A higher gain P equal to 5 the right hand side of Fig 5 10 reduces the static error but results in the saturation of control In Fig 5 11 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 1s well visible in the upper left hand picture of Fig 5 11 One control signal serves for two control purposes follow the desired value of the cart x position and simultaneously stabilises the payload in its hanging down position 5 2 Simulation We can repeat the real time experiment from the previous section in a purely simulated form We invoke the Crane3D first model window Notice two differences The Crane3D real time driver block has been replaced
66. the horizontal 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 1s 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 Crane3D class The object of the Crane3D class is created by the command object name crane3d The get method is called to read a value of the property of the object
67. ual 17 Al BasicTestFunction Step 11 E x ry Move the load and observe the results an the screen Co you want ta start Yes Na Cancel Fig 3 12 Angle measurement observation window l Figure No 1 m n x File Edit Tools Window Help JO MS KAAY 9252 Close this figure to terminate the test Fig 3 13 Plot of the angles trajectory 3 3 Stopping procedure The system is 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 menus in the model window 8DCrane Users Manual 18 4 Main Control Window The user has a rapid access to all basic functions of the 3DCrane control system from the Main Control Window It includes tests drivers models and application examples The Main Control Window presented in Fig 3 1 contains four groups of the menu items Tools Drivers Demo Controllers Experiments 4 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 is frequently used before starting an experiment When the Go Home procedure is finished we can be sure that the values of all measured signals have been
68. utton 4 x 3D Crane Getting Started ZRS 3D Crane Toolbox Uninstallation 2 InTeLoPraducts Fig 2 1 Click the SETUP button to start the installation program or EXIT to quit During the installation process you can cancel the installation by clicking the Exit button In this case you will be asked to confirm your choice If you select Yes the installation process stops otherwise the program will return to the previous step If you select the SETUP option Fig 2 1 you will see the licence information Read the licence agreement carefully If you accept the licence terms click the Next button The window which follows asks you for your name and the name of your company Fig 2 2 If you want to install the software for your company you must check the My Company radio button 3DCrane User s Manual 9 Crane3D Installation Wizard E User information This product is purchased by User name G alswarthu Company name Company Fig 2 2 If you click the Next button the information you entered before will be displayed Check it 1f there are any mistakes click the Back button to correct them otherwise click Next to continue You will see an important dialogue window containing your current MATLAB settings Fig 2 3 You will be informed about the version of your Windows system You must select the appropriate version of the MATLAB software installed Next point out the location of the matlab exe file that is
69. wer interface board 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 is configured in the Xilinx chip of the RT DAC PCI board All functions of the board are accessed from the 3DCrane Toolbox which operates directly in the MATLAB Simulink environment 3DCrane User s Manual 6 KEY FEATURES Three dimensional laboratory model of industrial crane The model can be tailored according to user s size requirements A highly nonlinear MIMO system The system can be easily installed There are high resolution sensors unique 2D angle measuring unit The set up 1s fully integrated with MATLAB Simulink and operates in real time in MS Windows 98 NT 2000 XP e Real time control algorithms can be rapidly prototyped No C code programming is required e The software includes complete dynamic models e The User s Manual library of basic controllers and a number of pre programmed experiments familiarise the user with the system in a fast way e 3DCrane is ideal for illustrating complex nonlinear control algorithms 1 1 Product overview The crane 1s delivered in partially mounted form The mounting frame makes a support and a flexible construction of the system If it is fixed to the walls and the floor then the crane becomes a rigid construction The construction is available in user defined sizes The dimensions are from the range length from 0 9
70. win tlc Browse Template makefile cranedd win vc tmf Make command make riw Generate cade only Stateflow options OK Cancel Help Fig 10 1 Simulation parameters page for the MATLAB ver 6 x and Visual C 6 0 compiler In the case when Matlab version 7 0 4 is used the Open Watcom compiler is applied This compiler is placed on Matlab installation CD and is installed automatically The appropriate Configuration Parameters page is shown in Fig 10 2 3DCrane User s Manual 81 je Configuration Parameters Lrane3D PID all Configuration A Data Import Export Optimization E Diagnostics Sample Time Data Integrity i Conversion Connectivity E RE MEET Compatibility E Alison pil tion Completes Model Referencing mentation Custom Code Debug i Real Time window Fig 10 2 Configuration Parameters page for the MATLAB ver 7 0 4 3DCrane User s Manual 82
71. witch z witch Rate Limiter Crane 30 Anne EA 100 odes Z Fig 4 7 Control system with the relay controllers Notice that this 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 Real Time Windows Target RTWT to create the executable library which runs in the real time mode The goal of the model 1s 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 4 8 Note that the control generated by the controller has two values 0 5 and 0 5 The On 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 Main Control Window and click the Go to Center button 8DCrane Users Manual 28 Block Parameters Relay Relay Output the specified on or off value by comparing the input to the specified thresholds The on off state ofthe relay is not affected by input between the upper and lower limits Parameters Switch on point os Switch off point 0 2 Output when on A Outputwhen off 0 5 cora mp Fig 4 8 X PWM controller parameters e Then choose the Tools pull down menus in the Si
72. y set and fixed in the program The window presented in Fig 3 9 opens BasieTestFunction Ste System moves ta the center position Press OK button to stop immediately DK Fig 3 9 Go to Center window After clicking the OK button the plot of the movement is displayed Fig 3 10 3DCrane User s Manual 16 l Figure No 1 i a n x File Edit Tools Window Help JDS ESRAAL PER AY position movement Bt T to AY position m Time sec Fig 3 10 Plot of the movement to the center Notice that the center point was not exactly reached This is due to the open loop control mode The control signal 1s switched off when the system exceeds the center point Two next check steps are related to angle measurements e Doubleclick the Reset Angle Encoders button The window shown in Fig 3 11 opens E BasicTestFunction Step 10 E x r Set the load motionless Do you want to set the origin angles of the load YES Mo Cancel Fig 3 11 Reset Angle Encoders window Now you must set the load motionless and click Yes The angle encoders are reset and the Zero position is memorised by the system e To check if angle measurements are correct double clicks the Check Angles button The window presented in Fig 3 12 opens Then manually move the load to a non zero position and push it After that click OK button and observe the motion on the screen Fig 3 13 3DCrane User s Man
Download Pdf Manuals
Related Search
3DCrane 3d crane lift plan 3d crane 3d crane and rigging 3d crane model 3d crane planner 3d crane san angelo 3d crane lift 3d crane drawing 3d crane lift plan for free 3d crane lift plan software 3d crane services 3d crane model free download 3d crane pendant 3d crane company
Related Contents
Reliance 4 - Development Environment bula reposições 2 WARNING IMPORTANT Cisco Systems 7401ASR Network Router User Manual Echo PPT-265S Pole Saw User Manual Rod Desyne WP4018 Installation Guide CLIMATISEUR CASSETTE INVERTEC V310-T AC/DC - Lincoln Electric Sony XM-460GTX Marketing Specifications Copyright © All rights reserved.
Failed to retrieve file