Home

3DCrane User`s Manual

image

Contents

1. Y angle vs X angle 0 0 005 0 01 Fig 5 26 Stabilised deviations of the payload The controls in the X and Y directions are shown in Fig 5 27 and Fig 5 28 Two cases of control with and without stabilisation of angles are compared 3DCrane User s Manual in the X Y plane in meters 45 0 8 0 5 1 X controls J controls A with gtabilisation of Y angle 0 4 v 0 6 l without stabiligation Yf X angle v i f uU ui 0 3 N 4 0 4 ithout stabiligation of Y angle 0 2 0 2 0 1 l 0 0 0 1 with stabilisgtion of X angle 0 2 0 2 M 7 0 4 0 3 j y 0 6 0 4 A uo P A 3 Y i V 0 8 l l 0 5 10 15 20 25 0 5 10 15 20 25 Fig 5 27 The controls normalised units Fig 5 28 The controls normalised units in in the X direction vs time seconds the Y direction vs time seconds 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 collect
2. Simulation Parameters Crane3D identl Solver Workspace o Diagnostics Real Time Workshop Simulation time Start time 0 0 Stop time 999999 Solver options Type Fixed step ode5 Dormand Prince Fixed step size 0 01 Mode SingleTasking Output options 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 is 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
3. pr Custom Code OJO Generate code only Build Interface Fig 10 2 Configuration Parameters page for the MATLAB 7 Notice that system target file RTCON tlc is chosen Also note that template makefile responsible for compilation and linking process is RTCON_VC tmf It means the MS VC compiler is used in this case Interface page responsible for connection with external target system 1s shown in Fig 10 3 To fulfil it properly a user must select External mode in Interface edit window After that the user have to set RT CON tcpip in the Transport layer edit window 3DCrane User s Manual 82 L Configuration Parameters MySystem Configuration YAA ES Solves i lata Import Export Optimization E Diagnostics i pe Sample Time Data ntegritu H Conversion bos Connectivity Hr Compatibility Ms i Model Referencing Interface External mode B Real Time Workshop Tr er RT CUN tepip Comments Symbols Custom Code Einterface io Fig 10 3 External mode configuration page 3DCrane User s Manual 83
4. 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 EX Figure No 1 File Edit Tools Window Help ID S HS KAAY SPER Period 1 8267 Length 0 32913 Autocorrelation 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 is 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 c ee rk x una d Model for PID Optimisation DesSim To Workspace DesSim Ctrl Ctrl i To Workspace Passim sim Tsim 71 FID Controller Saturation Dead Zone Velocity Position 100 ode5 P Fig 6 17 Model for optimisation of the PID para
5. L N u S The position of the payload is described by the equalities x X Rsinasin p 1 Y Y HFRCOSQ 2 z Rsinacos p 3 The dynamics of the crane 1s given by the equations Fig 8 1 m x S 4 m y S 5 M Z m g 6 m m x F T 4 S 7 m y F T 8 where S S and S are the components of the vector S S SsinQsin P 9 S S cos 10 S S sin amp cos p 11 It is assumed that the lift line is always stretched that is 3DCrane User s Manual 69 DuC oc T SV ED e oes 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 Fp Tp 13 8 2 Simplified model with three control forces Assume that the deviation of the payload from the z axis is small Then cosar cos 40 AQ 14 l _ a sin Y o AQ 1 15 cos p 1 16 sin D AD 17 Equations 9 11 take the form S SAB 18 S SAar 19 S S 20 Substituting 18 20 and 13 in 4 8 we obtain x u T AB 21 y u T Aa 22 Ze U T4 g 23 X u T u T fb AB 24 y U T uz T AQ 25 With the simplification 14 17 the position of the payload satisfies x xX RAD 26 y y RAQ 27 z R 28 The acceleration of the payload is given by Y x RAB 2RAB RAB 29 3DCrane User s Manual 70 y 2
6. 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 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 USB 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 DAC4 USB board frame presents the main parameters of the USB 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 Ht 3D Crane Manual Setup P i al xj RT DACA PCEI RT DACALISB board x Y and positions e Y Ed No of detected boards USB A
7. Crane Driver 100 lodes oe Fig 6 2 Motion controllers in the X Y Z directions 3DCrane User s Manual 48 Output the specified an ar off value by comparing the inputto the specified thresholds The on off state of the relay is not affected by input between the upper 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 alga 8 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 s 10 ls K 0 173511 Ts 0 074388 Fig 6 7 The
8. 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 e Double click the Basic Tests button The following window appears Fig 3 3 Fig 3 3 The Basic Tests window 3DCrane User s Manual 14 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 if the cart or the rail approaches the limits e Double click the Test limit switches button The window presented in Fig 3 4 opens 4 BasicTestFunction x 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 car
9. Target configuration Build Configuration Sustem target file rtv dil tlc Browse Template makefile Lrane3D win ve usb tmf Make command tw make Generate code only Statetlow options OE Cancel Help Am J Simulation Parameters MySystem Salver Werkspace 1 0 Diagnostios Advanced Real Time Workshop Category RT CON code generation options bi Build Options MAT file variable name modifier rt Y External made T Display start up message OK Cancel Help Appl Fig 10 1 Simulation parameters pages for the MATLAB 6 5 and Visual C 6 0 compiler 3DCrane User s Manual 81 In the case when Matlab version 7 0 4 1s used the Configuration Parameters page 1s shown in Fig 10 2 and Fig 10 3 L7 Configuration Parameters MySystem Configuration l E x Select Target selection pe Solver System target fle RT CON tle Browse Data Import Export i Optimization Language C E Diagnostics Description RT CON AT DACZUSB Visual C C ee Sample Time Data Integrity Documentation Conversion Generate HTML report ee Connectivity l Compatibility Launchrrepart after code generation completes Model Referencing Hardware Implementation Build process z Model Referencing TLE options l El Haal Time Workshop i El RH ii Make command make rw o Lomments Symbols Template makefile JATCO M YO_USB tmt
10. 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 23 and Fig 5 24 0 7 0 65 0 6 0 55 0 58 Y vs X cart positions Y vs X desired cart position 0 45 0 4 0 35 Fig 5 22 The desired cart positions thin line and the cart positions thick line in meters 8DCrane Users Manual 44 0 8 0 6 0 4 0 2 Y control vs X control Y angle vs X P di 0 5 Y control vs X control gle vs X angle 4 0 4 0 2 0 0 2 0 4 Fig 5 23 The controls normalised units and Fig 5 24 The controls normalised units and the payload angles rad on the X Y plane the angles without control angles with control the payload angles rad on the X Y plane the 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 25 and Fig 5 26 please notice the scales of deviations 0 08 0 06 0 04 0 02 0 0 02 ty ivi Y lU p Fig 5 25 Unstabilised deviations of 0 04 0 02 0 02 0 04 the payload in the X Y plane in meters 0 015 F 0 01 0 005 0 005 0 01
11. 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 RS The Matlab Optimisation Toolbox is required to perform step 4 8DCrane Users Manual AT Step 4 Click the dentify 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 USB_Crane3D_CSRelay s ET lal x File Edit view Simulation Format Tools Help Ci coe Hal Se 3DOF Relay Controller Position Y Position YOontal L3 4 Scope AA Eb y Position ata Lene m H y um UL RT DACUSH 3D
12. denotes the angle between the y axis and the lift line e D denotes the angle between the negative direction 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 n Me 4h qu m m m F F F Lii E RS mM m m m T T T VM y Xx SEES n T Qn m m m m N su i N u
13. get method is called to read a value of the property of the object property value get object name property_name The set method is called to set new value of the given property set object name property name new property value The display method is applied to 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 USB board Synopsis BaseAddress get cr3 BaseAddress Description The base address of RT DAC USB 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 USB board plugged into the USB 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 g
14. limit flag is set it disables the movement outside the defined working range rail limit When a reset switch flag is set the encoder register is 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 Setthe 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 if e arail limit flag is set and the cart or lift line are going to operate outside the working range e atherm flag is set and the power amplifier is overheated See RailLimit RailLimitFlag Therm ThermFlag Example set cr3 PWM 0 3 0 0 1 0 9 5 PWMPrescaler Purpose Determ
15. maximum value of the corresponding encoder determining the maximum accessible position If the encoder reaches this position the board is able to stop the generation of 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 board is able to stop the generation of the DC control signals moving the system outside the operating range The maximum position expressed in meters is 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 is selected the board turns off the control when the system is going to move outside the operating range It is recommended to keep this checkboxes selected all the time 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 8DCrane Users Manual BA Therm state The signal that presents the state of the thermal flag of the power interface The system contains three power amplifiers for the DC drives If the pow
16. 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 is assumed G 2 yet s T s 1 Results obtained for the 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 No 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 Ox Eile Edit 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 mo
17. position In our experiment the cart is following a Lissajous curve We invoke the Crane3D impres model from the MATLAB command window see Fig 5 19 We put the cart into motion in two directions The desired cart positions are generated as two sinusoidal signals There are two generators identical in amplitudes equal to 0 2 m and different in frequencies The X motion frequency is 0 4 rad s Fig 5 20 and the Y motion frequency is 0 8 rad s USB Crane3D Impres inlxi File Edit View Simulation Format Tools Help 3DCrane Impression USB 2 ha Position oB O n O Y Position a rn Position ao O pg RT DACUSB 3D Crane Driver Fig 5 19 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 21 3DCrane User s Manual 43 Block Parameters Signal Generatorb Block Parameters X Angle PID Signal Generator Output various wave Forms D Controller mask Enter expressions for proportional integral and derivative terms Pss o dn M l Parameters p ERE Wave form Pee Amplitude ja 0 2 Integral Frequency jo E ot o o o o f Derivative o I Interpret vector parameters as 1 1 jon Fig 5 20 Generator of the desired X position Fig 5 21 X angle PID controller signal The cart motion is shown in Fig 5 22
18. related to the experiments 2 and 5 from Table 5 1 The results are visible in Fig 5 18 They are similar to the results of the real time experiments The model reflects characteristic features of the laboratory crane The model compatibility to the real crane strongly depends on such parameters as the payload lift line length the static cart friction the belt tension etc These and other parameters are written into the C source code of the 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 RENE 1 desired x sci yet A mue Al E x angle 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 18 Simulation results 3DCrane User s Manual 4D 5 3 PID control of load
19. 0 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 build 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 Successful completion of Real Time Workshop build procedure for model Crane3D first 3DCrane User s Manual 35 Crane3D pid all External Signal amp Triggering signal selection Block Path CUR PRI TT A E E em TUUM Clear all i on C off Trigger signal irl Go to black Trigger A Trh ape 2 Iri o rni Source manual Mode normal Menea nal OTE i Element any Duration 10000 Delas 0 zl W Arm when connectto target T Revert Help Apply Close Fig 5 10 Setting triggering of signals reci rising x 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 f
20. 2RB RB sinacos p Ye Y R R amp cos 2R amp R sing p R Ra RB sin a cos B 2R f cos asin D 2Ra Ra cosacos f 2RB RB sin sin p We denote X Vw X5 X Vy X4 X X47 X4 Xy Xs Q sin x C amp COS X B 9 Vs C5S5Xg Xo 2X19Xg 8C5C7 Vs 2x5 C5X6Xg 5X19 57 EE oco 2 Vi S5 Xg Xo 8S5C7 t X6 Xo ad x P EEE Xy R Xo 7 X9 R Finally we obtain ten equations describing the dynamics of the crane with varying pendulum length Y EU 67 x N uc N 68 X3 X4 69 x N Jsss N3 70 X X6 71 Xs s N C554 N 44 455 c555N V5 Xo 72 X4 Xg 73 Xg 2 cN My ssc 5 N4 V 55 9 74 neun 75 Xio 5 C4N 5554N 1 c 45 5252 IN 4 V 76 The denominator in equation 74 includes sin x5 When the crane operates in its real range then sin x 0 3DCrane User s Manual 74 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 USB board equipped with the logic for the 3DCrane model The RT DAC USB 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 identica
21. 3DCrane User s Manual RT CON with USB board version AA Al www inteco com pl COPYRIGHT NOTICE O Inteco Limited All rights reserved No part of this publication may be reproduced stored in a retrieval system or transmitted in any form or by any means electronic mechanical photocopying recording or otherwise without the prior permission of Inteco Ltd ACKNOWLEDGEMENTS Inteco Ltd acknowledges all trademarks IBM IBM PC are registered trademarks of International Business Machines MICROSOFT WINDOWS 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 eee eee ee eee ee ee ee ee eee eee ee ese see ees eseeseesee soe 5 IN EX vari iue Morem LOW TD TEE 7 12 Reun e MEN erosi T T arnt vid dara TN 8 2 INSTALLATION OF THE SOFTWARE iieeieis eee oes sor coe ees o eoe oe ope EP corro ga po One pop oe eoe epe CO aos co rore pe eDs eese 9 2 1 Installation for Windows 2000 X BP 16 es e o leo eiie teeth ee teeta ato di 9 2 2 Un anstallation for Windows 2000 XDP siii ii dee ess les dido ies e DPI cago iei 11 3 STARTING TESTING AND STOPPING PROCEDURES 0 0 ccccossscccsscccsccccsccccscscccsccccsscccseccess 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 co
22. 4 86553C7 V t5 Rs S538 S5X6 415855757 V Bgcsc BResssxs 4 555 Res55X V 45 Ress Qs 55Xg B b 355 Jes 2RACsXeXs Finally we obtain eight state equations describing the dynamics of the crane with constant pendulum length iue 54 x 2 1 t55252 N 105555 N V A 55 i mw 56 x 7 C 4sesss5 N 1 c2 N V A 57 o 58 x 5D s N Bess N V IA 59 NA 60 Xg uscsssess Na B 14 55 Je N V RASs 61 The expressions A R and sin x5 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 u T sinasin B 62 y u4 T cos amp 63 Zz uz T sin cos B g 64 X u T 1 u T sinasin B 65 y u T 4 uz T cosa 66 The equations 1 3 are differentiated twice with taking into account that the length of the lift line A 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 2RAB cos acos P 2Ra Ra cosasin f
23. 6 92e Bis ie AIAN er STO eec cotone spate ares saa A cs aD Ded 76 OC OU A 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 A A IEA A A a tient ee T1 OTe o e os ges he asthe tea AE IIA IA A 71 DG Rese ENC OO AN A A AA AA a Aue a 78 A AAA A IIA IA a a 78 A A O adu NI II tenerae av patet ou nd 78 9go E A a a aaa a aa a aa a a aa 79 9 I0 AR Ge CS WUC MAS a A A A 79 o AA I oe Me E E AA A A AEE M A E MM LL MM TE 79 912 Ther mE IS ana On PP A a A 79 PS A A A A TE 80 914 Omek reference tablilla 80 10 HOW TO FULFIL THE COMPILATION SETTINGS PAGE eesesecsesecsesesecsesecccseseoccsesecceseocesesesee 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 3DCrane is a nonlinear electromechanical system having a complex dynamic behaviour and creating challenging control problems It 1s controlled from a PC Therefore it 1s delivered with hardware and software which can be easily mounted and installed in a laboratory You obtain the mechanical unit together with the power supply and interface to the PC and the dedicated digital board configured in the Xilinx technology The software operates under MS Windows 2000 XP using MATLAB and RTW toolbox package Besides the hardware and the related software you obtain User s Manual The manual e shows step by step how to design and ge
24. BIN WIN32 directory For this purpose click the Browse button You see the dialogue box with drives and directory list being displayed see Fig 2 4 Crane3D Installation Wizard Matlab location Detected operating system Microsoft Windows 2000 Choose M atlab version you wish to install far MATLAB v 6 5 MALAE vr U4 i Browse x Back Nest gt Cancel Fig 2 3 The third installation window 3DCrane User s Manual 10 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 Otwieranie a 3 x Szukaj wr 3 win32 de t E Ef LJ accessible ml util exe Pl neato exe A mbuildopts ad MATLAB exe Ipkadata exe E mexopks rice exe Printimage exe m cpucount exe Lal meditor exe twopi exe dot exe ml rolint exe 1 unzipsFx exe I Taenrb exe Imwregsvr exe 7 zip exe Nazwa pliku Pliki typu Executablez Anuluj Fig 2 4 Dialogue box If you have completed installation settings click the Next button to start the installation procedure You can see the progress window containing information about the progress of installation and names of files currently being copied For the Windows NT 2000 XP version the program installs the Windows NT kernel mode device driver This action is perf
25. 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 6 USB _Crane3D Relay i E jolx File Edit wiew Simulation Format Tools Help Rate Limiter Z maine i l RT DACUSB pes 3D Crane Driver 1 100 odes A Fig 4 6 Control system with the relay controllers MATLAB 6 5 This real time model and others in MATLAB 7 version has no three 35 control buttons Start STOP and REMOVE These buttons there are in the MATLAB 6 5 version only 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 RT CON to create the executable library which runs in the real time mode The goal of the model is the relay control in the X axis only Therefore GainY and GainZ are set to zero e Look at the mask of the Relay block conne
26. LimitFlag get cr3 RailLimitFlag set cr3 RailLimitFlag 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 is set to 1 and the encoder register exceeds the range the DC motor corresponding to it stops If the flag is set to 0 the motion continues in spite of the range limit exceeded in the encoder register 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 is pressed See ResetEncoder RailLimitSwitch 9 11 Therm Purpose Read thermal flags of the power amplifiers Synopsis Therm get cr3 Therm Descrip
27. 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 laboratory set and fixed in the program The window presented in Fig 3 9 opens 3 E ETE estFunction 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 Double click the Reset Angle Encoders button The window shown in Fig 3 11 opens EA 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 th
28. 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 scale 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 incre
29. Y RAa 2RAG RAG 30 Z R 31 After the substitution of equalities 29 31 to 21 25 five equations with five unknowns AQ AB x Vy and R are obtained The solution of this set of equations with Ww respect to the second derivatives and the introduction of new variables a Rom ho X X Yy BER X3 Xy X 2 AB oc eue Xy R xs AQ Xy X R leads to the final simplified system of state equations for the 3D crane x E 32 x N ux Ns 33 TEM 34 x N 4I x Na 35 A 36 Xg N 4h x5N 3 gxs 2xg3o x 57 X3 Xg 38 Xy Ny dx N3 gx 2xg 49 xs 59 en 40 Xy N3 8 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 7 8 3 Complete nonlinear model with constant p
30. ace 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 USB 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 e 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 is fully integrated with MATLAB Simulink and operates in real time in MS Windows 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 User s Manual contains the library of basic controllers and a number of pre programmed experiments which familiarise the user with the system in a fast way e 3DCrane is ideal for illustrating complex nonlinear control algorithms 1 1 Product overview The crane is 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 l
31. al time experiment The results of the experiment are visible in the scopes see Fig 6 22 and Fig 6 23 The cart is tracking the reference signals in the 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 4 Controls A AAA o AA ime affset 1 Fig 6 22 The X Y and Z controls visible in the Controls scope 3DCrane User s Manual 60 lime offset 0 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 real time environment In this section the process of building your own control system is described The RTW toolbox of MathWorks and RT CON toolbox of INTECO are used An example how to use the Crane3D software 1s shown later in section 5 3 In this section we give indications how to proceed in the real time environment Before starting test your MATLAB configuration and compiler installation by building and running an example of a real time application RT CON toolbox includes the model of IBM PC speaker Build and run this real time model For details refer to the RT CON User s Manual in 4 1 section IBM PC speaker control model Only correct configuration of the MATLAB Simulink RTW and C compiler guaranties the proper operation of the 3DCrane system To build the system that operates in the re
32. al time mode the user has to e create a Simulink model of the control system which consists of the 3DCrane Device Driver and other blocks chosen from the Simulink library e build the executable file under RTW and RT CON see the pop up menus in Fig 7 1 Ini xi usb trane3D Relay Fie Edit View Simulation Format Tools Help DE b ee o5 e Pinto i999 extemal E 2 amp Eb m Fixed Point Settings Model Advisor i Model Reference Graph Controller Lookup Table Editor Data Class Designer Bus Editor Profiler Coverage Settings Requirements k m o Signal amp Scope Manager x Put Wi m Real Time Workshop Options E Relay Rate Limite External Mode Control Panel Build Model PU Build Subsysten Y Puli Bed Control Design b T f z l N a A Generate aF anci Relay Rate Limite Data Object Wizard BI E zma 15 E Rel aya Rate Limiter Z ainz cuti asl EI 1 g Ap RT DAC USB 3D Crane Driver Generate RTW code 100 odes A Fig 7 1 Creating the executable file using RTW and RT CON e start the real time code using Start button placed in each real time model 3DCrane User s Manual 6D 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 MySyst
33. arameters within the frame If more then one RT DAC4 USB board is detected the selection at the list must point to the board applied to control the 3D crane system Otherwise the program is not able to operate in a proper way 8DCrane Users Manual OT Bus number The number of the PCI bus 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 and the computer system contains more then a single PCI bus This parameter is only active if the RT DACA PCI boards are applied 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 This parameter is only active if the RT DACA PCI boards are applied Base address The base address of the current RT DACA 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 be different among computers This parameter is only active if the RT DACA PCI boards are applied The base address is given in the decimal and hexadecimal forms Logic version The number of the configuration logic of the on board FPGA chip A logic version corresponds to the configuration of the RT DAC board defined by this logic and depends on the version of the 3D
34. asks 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 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 381
35. ata history iue m 7 Limit data points to last 3000 Humber of axes floating scope Tirne ranae 3 Save data to workspace Tick labels bottom axis only m Variable mame EXD Sampling Format Structure with time mr 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 or in Fig 5 5 See also detailed description in section 10 3DCrane User s Manual 8D 4 Simulation Parameters Crane3b_ first F i alol xl 7 Simulation Parameters Crane3D first Salyer Bie nicus Salver Workspace 1 0 Diagnostics Advanced Real Time Workshop Category Target configuration Build Workspace 5 Diagnostics Advanced Simulation time Start time 0 0 Stop time 30 Solver options Type Fined step x adeb Dormand Prince Fixed step size 0 01 Mode SingleT asking Configuration System target file rus dil tle Browse Template makefile Lrane3D win vc tmf Make command Iw make Generate cade only Stateflow options Output options Hene tacia 1 OK Cancel Help Analy OK Cancel Help SpE Fig 5 4 The Simula
36. 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 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 is 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 8DCrane Users Manual 22 Fpwm 20000 1025 1 PWMPrescalerr kHz This parameter sets the frequency of all PWM control signals The parameter may vary from O to 63 It causes the changes of the frequency of the PWM control signals from 19 55kHz to 305Hz
37. cted to the X PWM input Fig 4 7 Note that the control generated by the controller has two values 40 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 8DCrane Users Manual 28 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 e Then choose the Tools pull down menus in the Simulink model window The pop up menus provide a choice between predefined items Choose the RTW Build item A successful compilation and linking process 1s finished with the following message Block Parameters Relay Relay Output the specified on or off value by comparing the input to the specified thresholds The on off state of the relay is not affected by input between the upper and lower limits Parameters Switch on point os Switch off point 0 2 Output when on 0 5 Outputwhen off 0 5 omes Bee Fig 4 7 X PWM controller parameters 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 8 opens e Sel
38. del results unmatched to the real data measurements in the Z axis 3DCrane User s Manual 52 After optimisation the following picture is 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 real 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 1s 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 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 ode23b 4 Fig 6 12 Simple Dynamics in the Z direction 3DCrane User s Manual 53 Step 5 Perform the Go To Center action Set the payload motionless After that it is necessary to reset the angle encoders Go to the Main Cont
39. e 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 Manual 17 Al BasicTestFunction Step 11 E x ry Move the load and observe the results an the screen Do 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 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 t
40. e e OSEE a E Board Boad1 y Position bit one Bus number Fasition m oom oo oo Slot number Beset I T fe Base address sy Pace Versio 27 psu Angle 7 Angler 0 driver status ok SEAE praticien 0 001834 0 001534 Angle bit ss en Comto Angle rad Foo oom control 0 400 Reset Iv Iv _A 234 Status and tage Aaa Y control 0 400 5 Y Z Rail limit 4 bit 7360 10432 24758 Fail limit m 0 428 0 607 0 549 control 0 800 Mas rail limit flag Iv iv lv Home rail liri swatch T E e v A Thermal state B pa FPM prescaler 1 Thermal flag Iv v iv Fig 4 2 The Manual Setup window RT DAC4 PCI RTDAC4 USB board The frame contains the parameters of the RT DAC4 PCI or RT DAC USB boards detected by the computer With respect to the interface board applied to control the system the program operates with RT DAC4 PCI or RT DAC USB boards No of detected boards The number of detected RT DAC4 boards If the number is equal to zero it means that the software has not detect any board When more then one board is detected the Board list must be used to select the board that communicates with the program Board The list applied to select the board currently used by the program The list contains a single entry for each RT DAC4 PCI or RT DAC4 USB board installed in the computer A new selection executed at the list automatically changes values of the remaining p
41. ect 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 amp Triggering Signal selection Block Path Crane3D Relay Scope Select all Clear all on C off Trigger signal El Go to block Trigger px manuel Z mpap normal zl eie signed Bar fi Element any Duration 3000 Delay jo ene z Level 0 4 Hod an 0 Beven Hele Apply Goss Iv Arm when connectto target Fig 4 8 External Signal amp Triggering window e Observe the plots in the scope and click Stop Simulation after some time Results of the example are presented in Fig 4 9 Ble P aja ore es s ccc e e co do wie sc sd a 5 bie 0 0 weg Obie o o sd e o wie o c sca 95 o n o s s n d o Obie s c 5 0 0 5 wis oc s n e o wie scc sia spl Qe e c o a e o pio c co e o bis oe oa e obec 1 xXx Fig 4 9 Results of the relay controller demo experiment The X position starts from 0 54 and changes between 0 2 and 0 6 The control red line is 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 3DC
42. ed 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 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
43. elp Enpi Fig 5 7 Setting of the PID controllers Mark Simulation External item in the Crane3D first model window see Fig 5 8 3DCrane User s Manual 34 crane3D first EF jol x lel Crane3D_first File Edit View Simulation Format Tools Help File Edit View Simulation Format Tools Help a Stark real time E p Gh Se ee m Li Start real time code cere 3 cae E amp x Ea gs a Data explorer Connect to target Simulink Geiger Simulation parameters ctrl E Look up table editor Data class designer Normal Model discretizer wv External Real Time Workshop External mode control panel Fixed Point settings Linear analysis middle af middle of position position unu F 20 Pe gt 4 d 4 Show the simulat 100 odes Open external m 100 odes P Fig 5 8 External control mode Next invoke the Tools External mode control panel item The External Mode Control Panel window opens see Fig 5 9 Lrane3D pid all External Mode Control Panel Connect Sta Teale cone Am Manel Parameter tuning 23 Iv Batch download Download Lo Configuration ooo Target interface Signal amp triggering Data archiving Fig 5 9 Setting data acquisition options MATLAB 6 5 By clicking on the Signal amp Triggering button invoke the window shown in Fig 5 1
44. em Simulink model is shown in Fig d LI MySystem AA lol x File Edit View Simulation Format Tools Help Position 3DOF PID Controller TETTE zPositian E Scope Position Y Position LL d j x Position AB mnl t zi Position Suma FID axis m n T FE i TE iare Y Position A j mum LL x Angle Y Angle EB E RT DACAISB 3D Crane Driver 1 100 lodes E 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 3DCrane driver model and three control buttons Start Stop Disconnect and REMOVE External The tasks referred to each button are as follows Start the real time code is loaded into memory and execution starts Stop Disconnect stops real time code Real time code leave in memory REMOVE External real time code 1s removed from memory iS These buttons there are in the MATLAB 6 5 version only Real time models in MATLAB 7 version have no these control buttons Though it is not obligatory we recommend you to leave 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 in the Crane 3D driver block They limit currents to DC motors for safety reasons Howe
45. endulum length and two control forces We will now derive the crane equations without the simplifications 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 scosQ s 7 43 cos X z ssinacos D g 44 x u T S sinasin B 45 y u T s44 cosa 46 The position of the payload is given by 1 3 Its acceleration satisfies x x R acosasin B Bsinacos B 47 a B sinasin B 2 amp cosacos f y y R asin a Q cos Q 48 z R acosacos B Bsin asin D 49 a B sin acos D 20 8 cos asin B After the elimination of s that 1s the substitution of 32 into equations 33 36 we get a set of four equations x y tg sin B 50 Ze y tg cos B g 51 x u T LL y tg sin D 52 y T 44 53 Using equations 47 49 in 50 53 we arrive at a system of four equations with four unknowns x y Q 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 X Yyy Xs Q DE X X A X3 Xy x P X4 Xy X GE 8DCrane Users Manual 72 S ESIN x C E COS X A 14 4405 455557 B 1 44 V 44 Res x6 5538 4
46. ength from 0 9 m to 2 5 m width from 0 9 m to 2 5 m SETUP COMPONENTS 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 USB board the PWM control logic is stored in a XILINX chip software e 3DCrane Control Simulation Toolbox operating in MATLAB Simulink environment manuals e Installation Manual e User s Manual 1 2 Requirements Pentium or AMD based PC MATLAB 6 5 R13 or MATLAB 7 R14 SP2 SP3 Simulink 5 x 6 x Real Time Workshop toolbox Optimisation Toolbox needed only for one demo experiment RT CON toolbox from INTECO 32 bit compiler MS Visual C or Open Watcom 1 3 3 The 3DCrane toolbox RT CON version 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 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 F x Select an appropriate item and click the Start button 4 x 3D Crane G
47. er 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 open next Manual Setup button You will see the changes of measured positions Note that the X position Y position and Z position have changed their values and become the center positions in the crane workspace 3DCrane User s Manual 25 4 2 Drivers The main driver is located in the RT Device Driver column The driver is a software go between for the real crane MATLAB environment and the RT DAC USB acquisition board This driver serves to the control and measurement signals Click the 3Dcrane Device Drivers button and the driver window opens Fig 4 3 7 USB Crane3D DevDriv jaj File Edit View Simulation Format Tools Help Position Y Position Position Angle Y Angle RT DACUSB 3D Crane Driver 1 100 odes 2 Fig 4 3 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 progra
48. es PS el ES General Data history Tip try night clicking on axes General Cata history Tip try right clicking on ases Axes v Limit data paints ta last 3000 Save data to workspace Variable name Ex Pama Structure with time m Number of axes 1 floating scope Time range 30 Tick labels bottom axis only sampling Decimation 10 DE Cancel Help Apply Fig 7 3 Setting the parameters of the Scope block D Cancel Help Apply When the Simulink model is ready click the Tools External Mode Control Panel option and next click the Signal Triggering button The window presented in Fig 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 amp Triggering A Signal selection Block Path Select all Clear all on C off Trigger signal El Go to block Trigger Source manual Mode normal mager erat any Crane3D_Pxyz Scope Duration 3000 Delay fo i I fammen Genes f targat rection rising Y Level 0 4 aodan 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 gene
49. etting Started fee 3D Crane Toolbox Uninstallation ae nT eCo Products Fig 2 1 INTECO Software Manager 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 You are asked 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 This product is purchased by User name Galsworthy Company name Company Fig 2 2 The second installation window If you click the Next button the information you entered before will be displayed Check it if 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 It is located in the
50. i Data Impart Export 5 m Optimization Utility Function generation At a E Diagnostics Verification E Sample Time p oe MAT file variable name modifier LU Type Conversion endis E Connectivity Aa Compatibility B Model Referencing Interface EX Hardware Implementation re x Host Target interface H Model Referencing trara E eal Time Workshop ransport layer tepip file name ON ext comm Real Time Worksh T AT CON ME fil ATCON P Comments MEX file arguments ee Symbols Custom Code CD Memory management P E ug Static memory allocation Fig 5 6 External mode settings for MATLAB 7 The next step 1s 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 7 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 PID Controller mask Enter expressions for proportional integral and derivative terms Pass o auras Black Parameters position of the cart Black Parameters X angle of the payload PID Controller mask Enter expressions for proportional integral and derivative terms oes es Parameters Parameters Proportional Proportional E Integral Integral Derivative Derivative Cancel Help inel Cancel H
51. igure 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 cart 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 11 Notice the harmonic uncontrolled angle signal of the payload the square wave generated by Signal Generator followed by the cart x position signal The static error is due to the inadequate P control action The control has the highest magnitude among other signals visible in the figure When an abrupt change in the wave signal occurs then it results in the saturation of the control signal 3DCrane User s Manual 36 PALA Aja e Fig 5 11 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 EX1 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
52. ine the frequency of the PWM waves Synopsis Prescaler get cr3 PWMPrescaler set cr3 PWMPrescaler NewPrescaler 8DCrane Users Manual 77 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
53. ive 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 3DCrane User s Manual 31 Signal Generator o utputwarlous wave farms Parameters Wave fam Amplitude peg _ ___ Frequency 0 075 nits 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 1s 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 This window opens after the selection of the Scope Properties tab Mark the Save data to workspace checkbox define the Variable name as EXI and the data format as structure This means the collected data within 30 seconds time range are saved to the workspace in the structure EX7 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 EX7 is equal to 30s 0 01 s x 10 12 301 9 Scope properties PIS ES 3 5cope properties Tip tty right clicking on axes Beneral D
54. l encoders measuring five state quantities two cart positions at 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 is reached e PWM generation block generates three sets of signals Each set contains the PWM output signal the direction signal and the brake signal The PWM prescaler determines the frequency of all the PWM waves The PWM block logic can prevent the cart from motion outside the rail limits and the lift line angles from lying outside the operating range The operating ranges are detected twofold by the limit switches and by three limit registers e power interface thermal flags when the temperature of the power interface for the DC motors is too high the thermal flags can be used to disable the operation of the corresponding overheated DC motor All the parameters and measured variables from the RT DAC USB 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
55. m of the RT DAC USB 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 1s identical as the model given in the 5Dcrane Device Drivers except the lack of the safety switches see Fig 4 4 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 ES Fille Edit View Simulation Format Tools lsm rrej cer e Crane 3D Simulation Model x position Y Position Z Position Crane3d model e e I Fig 4 4 3DCrane Simulation Model In the mask presented in Fig 4 5 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 t 050000000 050 1 Se Help Appl Fig 4 5 Mask of the simulation model The simulation model is running in the normal simulation mode i gt Set solver options to
56. mental 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 Gand 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 is multiplied by the corresponding scale coefficient to obtain the angle in radians 3DCrane User s Manual 23 Angle bit The value read from the corresponding encoder counter Angle rad The angle expressed in radians The value read from the encoder counter is multiplied by the corresponding scale coefficient to obtain the position in radians Reset The checkbox applied to reset the corresponding encoder counter If the box 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 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
57. meters 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 MATLAB command window In the presented example the PI optimisation results in Kpx Kix Kpy Kiy Kpz Kiz L 224 9529 O4024200 00 7 L 19 0999 d TAL LSe 000 207 2002 3 41 4063e 007 1 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 Edt Tools Window Help Densa kary par Ko Ki Performancelndex 19 0999 5 99252e 006 28 5961 0 8 0 D 10 la 20 Po
58. nerate your own real time controller in the MATLAB Simulink environment e contains the library of ready to use real time controllers e includes the set of preprogrammed experiments 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 dimensions 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 USB multipurpose digital I O board communicates with the power interf
59. ormed only if the driver does not exist in the system The application will copy the driver to your system and modify system settings Next you will be asked to restart your system Click the Yes button to restart your system 2 2 Un installation for Windows 2000 XP Ey The system administrator who has full access to all drivers and system settings must start the application To start the un 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 Uninstallation In the opened window click the UNINSTALL button to start the uninstallation program or choose EXIT to quit 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 3DCrane User s Manual 11 Crane3D Uninstallation Wizard Software to uninstall Fig 2 5 Un installation window Click the Next button 3DCrane User s Manual 12 3 Starting testing and stopping procedures 3 1 Starting procedure Combine the acquisition board Control Interface and 3DCrane toge
60. 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 divider The Configuration parameters page for MATLAB 7 04 is different than for MATLAB 6 5 and is shown in Fig 7 6 Notice that RTCON VC USB tmf template makefile is used This file is default one for RT CON building process see also section 10 3DCrane User s Manual 66 E Configuration Parameters MySystem Configuration 4 i x Target selection System target file FTEDN tic Browse Data Import Export l Optimization Language E m E Diagnostics Description RT CON AT DAC USB Visual C C Sample Time i Data Integrity Documentation Conversion Generate HTML report p Lonnectivity i n Compatibility Launch report after code generation completes Model Referencing i Hardware Implementation Build process Model Referencing TLE options e ES EP eal Time w orksho cut nan Make command make rw i Comments pu Symbols Template makefile RTCO M vr LISB tmf pr Custom Code Generate code only Build te Interface i Fig 7 6 Configuration parameters page for MATLAB 7 04 The Start time has to be set to 0 The solver has to be selected In our example the fifth order integration method ode5 is chosen
61. rane User s Manual 30 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 is 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 IIT RENE o B 0 x File Edit View Simulation Format Tools Help X axis PID Controller x reference position middle of position Position X reference E T EM Y Position T A angle af the payload Z Position middle of 0000 Y position Y position OO x Angle Signal Y referente Y angle C Z position fte paloi Shia advo E RT DACIUSB 3D Crane Driver 1 0000 Oo Signal Z reference middle of position Fig 5 1 Two PID controllers applied in a real time experiment The first step PID of X position of the cart 1s act
62. rated by the use of Target Language Compiler TLC see description of the Simulink Target Language The make file 1s 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 see also section 10 3DCrane User s Manual 65 J Simulation Parameters MySystem d qe o x Salver Workspace 0 Diagnostics Advanced Real Time Workshop Category Target configuration Build Configuration System target file rtv dil tlc Browse Template makefile Lrane3D win vc usb tmt Make command tw make Generate code only Stateflow options LIF Cancel Help Appi Fig 7 5 RTW page of the Simulation parameters dialog box MATLAB 6 5 The system target file name is rtw_dll tlc It manages the code generation process The crane3d win vc usb tmf template makefile is responsible for C code generation using the Visual C C compiler 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 is set to 0 01 this is the sampling
63. rol Window and reset the angle encoders Step 6 Click on the Collect X Y Data button The corresponding controller denoted by 5D Crane 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 simulation 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 USB trane3D tSAngleExc Eu n x File Edit wiew Simulation Format Tools Help Da E em Angle Excitation Y Position dl x Position Y Gontal E Sahni m E Excitation um at Y Position Krone i 1 ZControl f AD x Angle x SA o LU T Y Angle RT DACAISB 3D Crane Driver 1 100 odes E 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 2 Somme 1 M e PNE E ead A pd pad ety D DB r J tH p
64. 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 presented in Fig 5 12 and Fig 5 13 P set to 2 5 i P set to 5 Fig 5 12 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 5 P of the payload angle set to 4 Fig 5 13 Two controllers desired x position of the cart and x angle of the payload are tracked The left hand side of Fig 5 12 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 12 reduces the static error but results in the saturation of control In Fig 5 13 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 13 One control signal serves for two control purposes follow the desired value of the cart x position and simultaneousl
65. sition 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 DeaHSlkA2 7 9227 Kp Ki Pertormancelndex 267 3001 3 152048e 007 45 53914 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 DOF 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 is 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 lolx Mic NE File Edit View Simulation Format Tools Help gt _ La X Reference a se X Angle PID ime e T Y Reference Y Angle PID ZReference value 1 g 3D Crane Driver 1 BM Controls Z Reference 100 odes Z Fig 6 21 The Case Study 5DOF PID controller window Rebuild the model then open two scopes and start the re
66. t rail and payload move in the right direction and if the system stops at the desired limit position The system 1s moved in the chosen direction until 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 system The window Fig 3 6 opens You can interrupt the motion clicking the OK button 9 BasicTestFunction Step 3 system moves to the Y axis home position Press OK 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 3DCrane User s Manual 15 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
67. t Encoder 65479 7661 20032 65533 65534 bit gt gt 0 0022207 m 0 29847 m 0 38411 m 0 004602 rad 0 003068 rad gt gt Z displacement 0 32 m gt gt PWM 0 062561 0 031281 1 gt gt PWMPrescaler 60 gt gt RailLimit 361 381 815 64 bit lt gt 23104 24384 52160 bit gt gt 0 90013 0 95 1 0002 m gt gt RailLimitFlag 1 1 1 gt gt RailLimitSwitch 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 USB board Synopsis Version get cr3 BitstreamVersion Description This property determines the version of the logic design of the RT DAC USB 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 65535 16 bit counters When a register is reset the value is set to zero When a rail
68. ta be bU dv QweE Pe paiptv mn vetus eens 13 215 SLOPPING 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 cccccsscssceccccccccccccccccccccccscccccccccees 31 dela Reale tire EX qae Ui 36 Su LoData PEO COSSA ARA cR od Kast deu em a ca Matai E Ma EM EUR CENE 37 E EE IM DE DU E EE Mr a A UD tacts A N 39 35 9 PID Control Of load POSO A A 43 CASES TUD cest eboieeces ret eteesbwdescst Ede seaetodeecue vede deos uter cetus coste bodvesue se cot eb udedes t rue DUE 47 7 PROTOTYPING YOUR OWN CONTROLLER IN REAL TIME ENVIRONMENT 62 To C reatinb a modes 63 7 26 0de seneration and the DULG DEOCOSS tesi eau dsd 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 7
69. ther In the MS WINDOWS environment invoke MATLAB by double clicking on the MATLAB icon The MATLAB command window opens Then simply 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 El crane3D_Main File Edit View Simulation Format Tools Help Fig 3 1 Main Control Window of the 3DCrane system Main Control Window contains testing tools drivers models and demo applications Also a case study is included You can see a number of pushbuttons ready to use In the case if the RT DAC4 USB I O board is used only one software 35 module can communicate with USB board Remember do not open more than one Simulink model at time 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 8DCrane Users Manual 18 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 Zero position
70. tion Returns three thermal flags of three power amplifiers When the temperature of a power amplifier is too high the appropriate flag is set to x See ThermFlag 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 is 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 USB 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 J Simulation Parameters MySystem Salver Workspace 1 0 Diagnostics Advanced Real Time Workshop Category
71. tion Parameters window MATLAB 6 5 version Refine nutpul Configuration Parameters USB Crane3D_ first Configuration Select Target selection prame System target file TR T CIN the Browse Data Impart E part Optimization Language C E Diagnostics Description RT CON AT DAC USB visual C C 5 Sample Time Data Validity Documentation Type Conversion Generate HTML report ine Connectivity ee papsesti e qo adco E Cir ET z L Compatibility Launchreport after code generation completes Model Referencing Hardware Implementation Buld process pu Model Referencing TLC options El Real Time Wworksh a PES Make command make tw P Lomments je Symbols Template makefile ATCO M vr LISB tmf a Custom Code 2 Generate code only Build Interface Fig 5 5 The Simulation Parameters wndow MATLAB 7 version If the MATLAB 7 version 1s used the Interface with external mode and transport layer has to be set Interface page responsible for connection with external target system 1s shown in Fig 5 6 To fulfil it properly a user must select External mode in Interface edit window After that the user have to set RT CON tcpip in the Transport layer edit window 3DCrane User s Manual 33 Configuration Parameters USB Crane3D first Configuration E X Software environment dn Target floating point math environment ANSI C m
72. ur 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 f set to 1 Setting t to 1 denotes that the source of time is the RT CON clock Block Parameters Crane3d model E Subsystern mask Parameters Initial condition 4 x v y alfa alte beta beta z z t 0500080080050 Fig 5 15 Mask of Crane5D model 3DCrane User s Manual 40 If you look under the Crane3D model mask you can see its interior Fig 5 16 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 1 Y Position scale1 model3dddm SU scale2 model inteco X angle scale3 Z Position lt Ul z lt gt 3 A 6 D Fig 5 16 The interior of Crane3D_model In opposite to the real time model it is not necessary to rebuild the model before running Open Simulation parameters from the menu bar Notice the solver options Fixed step and Fixed step size set to 0 001 in the editable text box You can start a simulation from the menu bar When the simulation is running you can watch the results in the scope see Fig 5 17 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 17 1s produced by gt gt plot EX1 time EXI signals values We perform simulations
73. ver 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 3DCrane User s Manual 63 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 You can apply most of the blocks from the Simulink library However some of them cannot be used see MathWorks 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 3 Scope properties a fel ES 3 Scope properti
74. y 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 by the Crane3D model simulation model block The External mode of operation has been replaced by the Normal mode of operation see Fig 5 14 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 eo Y Position position Signal of the cart Z Position middle af re unu Y position ES a pde X angle af the payload Y reference Enable Y angle of the payload Cranesd model Ce position of the payload middle of Z position unu o Signal reference Fig 5 14 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 15 opens You can set the initial values of 10 variables You can mark the constant or varying pendulum length In o

Download Pdf Manuals

image

Related Search

Related Contents

取扱説明書ダウンロード  Manual del Usuario del Equipo Auricular Estéreo Nokia Bluetooth  TDM フェノバルビタール  Biostar P4M900-M7 FE Quick Start Manual  取扱説明書補足版 シャワートイレ PASSO    ControlLogix Operations Manual  BLANCO ZIA 6 S  

Copyright © All rights reserved.
Failed to retrieve file