Home

fulltext01 - DiVA Portal

image

Contents

1. TR T T Calculation time limit Calculation time ilb M 4 5 Elapsed time s 6 7 8 9 Figure 9 2 Calculation time with 25 ms fundamental sampling time Fundamental sampling time 50 ms T T 80 70r 60 Calculation time ms A a o o T T I L e o T 20r 4 Hl LL mmm T T Calculation time limit Calculation time o E o Elapsed time s Figure 9 3 Calculation time with 50 ms fundamental sampling time 121 Chapter 9 Implementation Initial valuesstorage measured with NMEAmesages gt C eS IDparameteri mat eminato To File hitial values gainscheduler Rate Transition RoUp dder idder d Voltage S Fundion Pl controller Waypoint and heading set point generator Rudder S Function Realtime subsytem Desred heading Set Rudder Manual on 1 off 0 Heading autopilot Figure 9 4 Sampling time in the MATLAB Simulink model 0 05ms red 0 25ms green constant magneta Used calculation time 50ms fundamental sampling time Figure 9 5 The two different fundamental sampling times with a calculation time of 80ms 25ms fundamental sampling time t s 122 1 2 3 Chapter 9 Implementation in the follo
2. 162 C 15 Input output data 20 knots Rudder pump experiments 163 C 16 Model output 20 knots Rudder pump experiments 164 C 17 Frequency response 20 knots Rudder pump experiments 164 C 18 Step response 20 knots Rudder pump experiments 165 C 19 Residuals 20 knots Rudder pump experiments 165 C 20 Bode plot 20 knots Rudder pump experiments 166 xi C 21 Pole Zero plot 20 knots Rudder pump experiments C 22 Slope R and deadtime L4 of the Ziegler Nichols step response method at ORDOS oo aA sit Ana HE A mur an Een Tee ole Tes fe ae Mok le BOA uns al ad S C 23 Slope R and deadtime Lg of the Ziegler Nichols step response method at 12 knotsra irte eet OF Aw 2nd Ger tn te Poh ROI Won ce osten C 24 Slope R and deadtime L4 of the Ziegler Nichols step response method at Jk PM ts Boke Boe e ee ee a a a a ae aA C 25 Ultimate gain Ku and period Ty of the Ziegler Nichols ultimate sensitivity method at b knGts 2o Geena ee A ERREUR YE es C 26 Ultimate gain K and period T of the Ziegler Nichols ultimate sensitivity method at 12 knots sa s 222634 BES GB rog RE RR Y dogs C 27 Ultimate gain Ku and period Ty of the Ziegler Nichols ultimate sensitivity method at 20 knots na cerea a dae Ro uox uk E SR RR os C 28 ZN ultimate sensitivity vs step response at 5 knots C 29 ZN ultimate sensitivity vs step response at 12 knots
3. ROT derived from heading 20r so LOU 60 180 1 60 80 100 120 140 Time s 40 20 Measured ROT vs ROT derived from the heading at 20 knots 8 Figure B Measured ROT shifted 34 samples vs ROT derived from the heading at 12 knots Measured ROT ROT derived from the heading 20 sf Low Time s Shifted ROT vs ROT derived from the heading at 20 knots Figure B 9 154 Appendix C Analysis plots C 1 5 knots Rudder pump experiments Input and output signals 20 T T T T T Validation data Estimation data 10r 0 20 L 1 1 i 1 0 20 40 60 80 100 120 140 Actual rudder angle deg 3 L N o o T L A o T L l L 1 1 20 40 60 80 100 120 140 Time s Commanded rudder angle deg o I N o o Figure C 1 Input output data 5 knots Rudder pump experiments 155 Chapter C Analysis plots Measured and simulated model output T T T T T T T 1 T i 16 4 14r 12r el J i i 10 i 4 o A 8 S 5 o 3 3 6r a 4r f c ree te 1st order ARX model 86 fit Measured data 1 1 f 1 L i 1557 4Hth order ARX model 92 7 fit 45 80 85 90 95 100 105 110 115 120 125 130 Time s Figure C 2 Model output 5 knots Rudder pump experiments Frequency
4. C 30 ZN ultimate sensitivity vs step response at 20 knots xii List of Tables 1 1 1 2 1 3 3 1 3 2 7 1 7 2 7 3 7 4 7 5 7 6 8 1 8 2 8 3 8 4 8 5 8 6 8 7 8 8 8 9 Kaasbgll 19 specifications e 6 Evinrude 50 E tec specifications 2 6 Seapath 20 specifications 2 22 9 Froude number as a planning indicator 24 Froude number and regime at 5 12 and 20 knots 25 PIDsparameterss 322 0 9m Ru ee put sm Rogero Echt s goto qiu qt 68 PID parameters obtained from the Ziegler Nichols step response method 69 P parameters obtained from the Ziegler Nichols step response method 69 PID controller parameters obtained from the Ziegler Nichols ultimate sensitivity method aoaaa 70 PI controller parameters obtained from the Ziegler Nichols ultimate sensitivity method ato idee Pues ge ethos Qr OC ath ein al dete ee a 72 P controller parameters obtained from the Ziegler Nichols ultimate sensitivity Method ne hes Ron ew GOS code usce vac Gah al Peu im poe Bad diat 72 PID parameters calculated from the Ziegler Nichols step response method 86 PID parameters calculated from the Ziegler Nichols ultimate sensitivity Method oncle Ye oan BM adhe AA A A Oe ea E 89 Controller parameters at 20 knots 22e 102 Controller parameters at 12 and 5 knots o 102 Input signal properties
5. ee 20 Part of a PRBS sequence with a length of 255 21 Frequency spectrum of a PRBS with period length 255 and sampled at TS e e oi oh haa cr un eh heheh Sk oh ied ng ep on S RUNE Wet Penk a ah Bee de dn de hee tele ti eS 22 Frequency content of a PRBS input sequence updated at 0 33 Hz 23 Systems to identify oaoa a 26 System identification of steering hydraulics 28 Rudder pump behaviour with Simrad P controllr 29 Rudder pump range for estimation and validation at 20 knots 30 Rudder pump model output at 20 knots 31 Pole zero plot of the rudder pump model at 20 knots 32 vi 4 7 Bode plot of the rudder pump model at 20 knots 4 8 Model output of the rudder pump model at 20 knots with different speed modelen A us fue igh eret rtt agb qat pe ene Hoa dv dos yar oh un es 4 9 System identification of vessel dynamics css 4 10 ROT and actual rudder angle plotted together 4 11 ROT derived from heading and actual rudder angle plotted together 4 12 Measured and calculated ROT plotted together 4 13 The measured ROT shifted 23 samples and plotted together ROT derived fromthe heading 4 42 shpat ue bee xev RAS UE Vus e Xue ed 4 14 Filtered and unfiltered ROT o e 4 15 Model input and outputs at 5 knots less 4 16 Model outputs at 5 knots e 4 17 Residuals
6. 0 0 88 Simulink model of the controller 88 Ultimate gain K and period T of the Ziegler Nichols ultimate sensitivity method t 20 knots s ccedna oo o moo mo Rob Oe dnd 89 Kp Ti and Td parameters for all speeds derived from ZN ultimate sensitivity 90 Step response using the ultimate sensitivity and step response parameters At20 knobs n5 as e eo Eom eue Nero x pU ee fe Ro Ua ae us 90 Bode plots of the unlimited and limited derivative action in addition to the low pass Miter a0 mo nete eb NOR Me Exe Dep Wer Hoe Be dul 91 Bode plot of the model transfer functions in discrete continuous time with without Pad approximation 222 40404 da eee ee eS 94 Placement of the transfer function during root locus tuning 94 Pole Zero plot and step response of the original Ziegler Nichols parameter 95 Pole Zero plot and step response of the open loop with increased gains 96 Step on a model with no time delay with root locus tuned parameters Kp 0 5334 Ti 2 1 Td 0 96 2l 97 Unstable simulation on the real model with the controller parameters from root locus tuning without time delay 98 Different proportional set point weighting for controller at 20 knots 99 Integral windup for a step from zero to 359 at 20 knots 99 Simulink model of the controller with antiwindup 100 Antiwindup with different tracking times for a step from zero to 359 a
7. Finally it should be noted that this discussion have focused on the weaknesses of our control system The controller which have been implemented have been tested and found successful in that it manage to keep a heading set point and follow a route consisting of way points Further work A list of suggestions for further work is given this list is based on the above discussion begin e Development of a standardised communication interface for communication with sensors and actuators e Implementation of the controller using MATLAB Real Time Workshop e Initialisation of the controller e Implement Gain scheduling of the reference model e Extensive testing and tuning of the controller e Improvement of PID parameters between 5 and 12 knots parameters e Reducing the cross tracking error by improving the LOS algorithm e Improved handling of GPS fall out 139 Chapter 11 Conclusion A heading autopilot and a way point navigation system has been developed using a rapid prototyping environment in Matlab and Simulink The autopilot and the navigation sys tem has successfully been implemented and tested on board a test vessel This controller provides a good basis for further development of the heading controller and way point navigation system for this vessel Maritime Robotics have indicated that they want to continue working on the controller which we have developed M ethodology for rapid identification and modelling of vessels hav
8. J i 1 7 ES SE bam 1 20 30 40 Time s 171 T 50 60 PX f A 1 i f t i i J i H Y 4 Y 7 H Y T1 50 60 ultimate sensitivity Chapter C Analysis plots C 6 Ziegler Nichols step response vs ultimate sensitivity analysis 140 T T ZNattmateSens 120r Heading deg e o T o o T 40r li 30 40 50 60 Time s Figure C 28 ZN ultimate sensitivity vs step response at 5 knots 172 Chapter C Analysis plots 12 knots ZN 140 T T ZNstep ZNultimateSens 120 Heading deg o o 40 20 i 30 40 50 60 Time s Figure C 29 ZN ultimate sensitivity vs step response at 12 knots 120 T T T T ZNstep N ZNultimateSens 100r 80 4 Heading deg o o T I 40 4 20r 4 0 10 20 30 40 50 60 Time s Figure C 30 ZN ultimate sensitivity vs step response at 20 knots 173 Appendix D Table of Contents CD Matlab code e if loops m e import data m e NEconversion m e NMEAserread sfun m e parseLabViewLog m e PRBS spectrum m e read serialconf m e readNMEA serialconf m e robnet m e run m e serread sfun m e serwrite sfun m e setparam m e USVsimulationGui m e VariableTuning m e write serialconf m e ZNstepResponse m e ZNultimateSensitivity m e USVSimulation mdl e USVsimulation
9. Step Response 15 T T T T T T T I I 1st order ARX model 4th order ARX model et 2 5 P di 3 ae 2 y o 4 E rd LJ d 3 5 E a ES 05r i 4 7 7 y 7 0 1 1 1 fi 1 fi i l L 0 1 2 3 4 5 6 7 8 9 10 Time s Figure C 18 Step response 20 knots Rudder pump experiments Autocorrelation of residuals for output 05 T 04r 0 3 0 2 01r 0 4 T T T T T T 0 l 04 025 III EUA 4 1st order ARX model 4th order ARX model Figure C 19 10 5 0 5 10 15 20 Samples Residuals 20 knots Rudder pump experiments 165 Chapter C Analysis plots Gm 16 1 C Bode Diagram dB at 0 722 Hz Pm 172 deg at 0 0115 Hz ommanded rudder to actual rudder angle T T a T x a T Magnitude dB a T Cut off frequency 0 11Hz T 945 360 Phase deg E o T Frequency Hz Figure C 20 Bode plot 20 knots Rudder pump experiments Pole Zero Map 0 8 0 6 Imaginary Axis o T 05 Real Axis 0 5 Figure C 21 Pole Zero plot 20 knots Rudder pump experiments 166 Chapter C Analysis plots C 4 Ziegler Nichols step response analysis Heading 200 T T T Heading deg 3 o T Slope 6 7153 deg s 50 Deadtime 3 9534 s I I 0 5 10 15 20 25 30 Time s Rud
10. Boat CG Fuel tank CG Total CG Enghhe EG A i Figure 1 6 CAD drawing of the boat with CG sideview 11 Chapter 1 Vessel and Equipment Configuration Boot CG Total CG Fuel tank CG Engine CG 575cm Figure 1 7 CAD drawing of the boat with CG overview Changing the load on the boat will change its dynamics and CG Our project has been performed with 2 persons in the boat resulting in a total weight change of 2 x 80kg 160kg or an increase of nm 25 The corresponding CG with the per sons loacted close to the centre console is given as 1 X 1 25 m x 75 kg 2 32 m x 109 kg 109 75 450 160 kg 29 eee 5v 1 00 m x 160 kg 0 64 m 1 3 Az 64 55 1 6 14 length 5 75 i Vd This change is significant in change of total weight but just a small change in CG If we change the configuration even more by adding 2 more persons including 50 kg of equipment to the boat 1 m in front of the CG an even larger change of dynamics will be noted as shown 12 Chapter 1 Vessel and Equipment Configuration 1 x 1 25 m x 75 kg 2 32 m x 109 kg O Kg 1 00 m x 160 kg 1 00 m x 210 kg 0 64 m 1 5 Ar 30 55 E 44 16 length 5 75 n 1 6 These changes of 4 496
11. a 111 Output to Simulink sz x pce a A et pou XE Bee 111 Operating modes oaoa a 112 States y ete Rohe Sots ae Se Se Ge ee 113 State nerarehy ori scm o wok bann UE Peon Gi son A ee ee Dee 113 9 1 Syntax for setting channel 1 and 2 of the AX1500 I O card xiv Nomenclature N Sl up t Proportional set point weighting complement b 1 b The Z transform operator Model output Total mass of the system for calculation of CG X position of the mass for calculation of CG Laplace operator Proportional set point weighting Error value e t Yres t y t Proportional gain Particle masses for calculation of CG Particle position for calculation of CG Laplace variable Derivative time Integral time Controller output value Proportional reset term Derivative part of controller Integral part of controller Proportional part of controller Measured output value XV Yref t Reference value set point value Inverse Laplace operator Wo 36 Discontinuous heading measurement from zero to 359 Weont Continuous heading measurement T Integral variable A Amplitude of the input step c The derivative set point weighting variable Cpia s Continuous transfer function of the controller model E s Laplace transform of the error es Tracking error Fn Froude number g Gravity h The sampling period Ho 360 s Delay due to the discontinuous measurements H7 s Continuous transfer function of the
12. Chapter 4 System Identification 4 1 Rudder Pump System Identification In this section we will present the system identification process of the steering hydraulics and the built in Simrad P controller see Figure 4 2 This model is used for designing the heading controller in Simulink An advantage with this solution is that it offers flexibility to try out different methods off line and later implement them using a rapid prototyping environment Since the dynamics of the pump are not very complicated we chose a simple first order model structure to represent its behaviour We will give a detailed report on the 20 knots model identification and just give the results and deviations for the 5 and 12 knots model since the procedure is the same For a more detailed presentation on the system identification please consult Beinset and Blomhoff 2006 and Ljung 1999 Headhg 40 0 189670 01659 22 17 1243 000031 536240 31172 Vessel model Integrator Headlig Figure 4 2 System identification of steering hydraulics A square input experiment done on the boat was used as basis for this system identi fication The results of this experiments are shown in Figure 4 3 and gives us the pump behaviour with the integrated Simrad P controller It is important to note that this model which represent both the pump and the integrated Simrad P controller will be replaced by an analog voltage out card with a new controller design during the imple
13. Some testing and tuning have been performed at sea but far from enough It should be mentioned that most of these tests were performed under rough conditions with wave heights up to 1 m The ideal condition for testing would be an indoor facility but this is not realistic Implementation was performed during the last weeks before the delivery of the master thesis This did not leave much time for testing and we learned a hard lesson Implementation takes time and that we should have reserved more time for this Despite the short time for testing we did get some results which should be noted Gain scheduling is used in the heading controller so that the parameters of the con troller tuned to the dynamics of the vessel The parameters are filtered when they are changed so that a smooth transition is obtained Even so instability is experienced as the parameters changes from 5 knots to 12 knots parameters This instability causes the vessel to deviate from the desired heading for some seconds before returning to the desired heading This effect is not observed at any of the other transitions It is believed that the cause of this instability is the large changes in dynamics from 5 to 12 knots 137 Chapter 10 Discussion At 5 knots the vessel is acting as a displacement vessel while at 12 knots it is acting more as a planning vessel From our testing it seems that both sets of parameters have problems controlling the vessel from approxima
14. Triggering the chart o e e 8 4 Way Point Navigation le 9 Implementation 9 1 Communication hardware and Real Time Constraints 9 1 1 9 1 2 9 1 3 9 1 4 Sampling times es Read NMEA messages 22e Read rudder angle ee ee Voltage Out to Rudder Pump 04 9 2 Rudder angle controller ee 9 3 Navigation System and Heading Controller 9 3 1 9 3 2 9 3 3 Heading Autopilot without Gain Scheduling Heading Controller with Gain Scheduling Way point Navigation System 2 2 2 9 4 Graphical User Interface GUI cud y i xU A xus 10 Discussion 11 Conclusion Appendices iv 119 119 119 120 124 125 126 129 129 129 131 134 136 140 142 A MATLAB Code AL PRBS spectru ii aac eo c0 E ORR RS Bae OES Rex A a AX import datam cima i Edu xs a SES Pe ay A 3 parseLabViewLog m 2l A 4 setparam values duos e be kx i EXE RR esu A 5 ZNstepResponse m 2 22 2 e less A 6 ZNultimateSensitivity m 2 2 AT Variable Tuning sca a da RUE ug A 8 USVsimulationGui m 2 222A ALIC N BEG BR ee OE A EY A 10 Serial configuration 2A A 11 NMEAserread_sfun m aa A 12 serread_sfun m 22A A 13 serwritesfun m A B Measurement pre treatment plot B S HOS NA Ba ERR uL nM Eus B 2 TAMOS see nein A alu e dee ceca es B 3 20 EnOb8 te
15. is a Matlab script which configures the serial communication with the Seapath 20 system 2007 Output serobj3 handle for the serial port Author Jarle Saga Blomhoff and Geir Beinset serobj3 serial COM1 Set connection properties serobj3 Baudrate value serobj3 serobj3 serobj3 serobj3 serobj3 serobj3 512 set set set set set set 4800 Parity none Databits 8 StopBits 1 Terminator LE Timeout 1 InputBufferSize 512 fopen serobj3 get serobj3 Status read serialconf m is a Matlab script which configures the serial communication with the Simrad ROBNET system o oP o o o oe oe oe oe o oe oe oe 2 creating serial port object set set set set set 9 buffer for read operation the baud rate at the specific parity as even the number of data bits number of stop bits as 1 the terminator value to CR default is gets the status of connection 2007 Output serobj2 handle for the serial port Author Jarle Saga Blomhoff and Geir Beinset serobj2 serial COM7 Set connection properties serobj2 Baudrate value set serobj2 set serobj2 set serobj2 set serobj2 set serobj2 set serobj2 512 19200 Parity none Databits 8 StopBits 1 Terminator LE Timeout 1 InputBufferSize 39 fopen serobj2 get serobj2 Stetus write_serialc
16. k 1 92 771q 1 3 0099 1 539973 0 311794 q i Where r k is the ROT and Kk is the rudder angle k is the sample number The output of the models response to the validation data is plotted together with the vessels response in in Figure 4 18 where it can be seen that the model gives a realistic output Most of the deviation between the model and the real output is believed to be caused by disturbance in the measurement for instance wave motion 40 Chapter 4 System Identification ROT s 10 Autocorrelation of residuals for output y at 5 knots T 05 i A X x Ofte A pow k N gt t gem ial d AAN LON A FE x een ud Y 1 10th order ARX model 4th order state space model j 4th order ARX model 7 i 1 L A 1 03 15 10 5 0 5 10 Cross correlation for input u and output y residuals at 5 knots 0 20 o ab Samples Figure 4 17 Residuals of the 4th order ARX model at 5 knots Measured and simulated model output at 5 knots Measured ROT PUR 4th order ARX model FIT 68 9 1900 450 Figure 4 18 1 1 1 600 650 700 750 Time s 1 500 550 Model output of 4th order ARX model at 5 knots Al 800 Chapter 4 System Identif
17. NTNU Innovation and Creativity Controller design for an unmanned surface vessel Design of a heading autopilot and way point navigation system for an underactuated USV Geir Beinset Jarle Saga Blomhoff Master of Science in Engineering Cybernetics Submission date June 2007 Supervisor Amund Skavhaug ITK Co supervisor Tristan Perez CeSOS Norwegian University of Science and Technology Department of Engineering Cybernetics Problem Description 1 Obtain a vessel model for control system design based on system identification The data for the identification will be obtained from experiments performed on the full scale vessel Compare the response of the model to that of the real vessel 2 Perform design of a heading autopilot in Simulink using the vessel model obtained by system identification 3 Design a guidance system that can follow a route consisting of multiple way points 4 Implement the heading autopilot and the way point navigation system on the full scale vessel 5 Present your findings and results in the report Assignment given 10 January 2007 Supervisor Amund Skavhaug ITK Design of a heading autopilot for a small unmanned surface vehicle Jarle Saga Blomhoff and Geir Beinset Department of Engineering Cybernetics Norwegian University of Science and Technology NTNU June 7 2007 Abstract This report is written as a part of a development programme performed by Maritime Robotics AS The goal o
18. Time s Figure 8 17 The effects of measurement discontinuity on a step from 50 to 270 Delay3 z O psi d in ps_d_out ps in Delay gt gt E gt Compare To Constant Compare To Constant 360 Constant Figure 8 18 Simulink block removing the discontinuity in measurement and set point 85 Chapter 8 Design in Simulink Desired heading pet psi out headingRef 0 360 to int inf wi shortest direction psidin psi d out psi d in psi d out Rudder angel set point Heading Reference m odel usy Heading autopilot w manual m ode Figure 8 19 Placement of the block to handle the 0 360 discontinuity A detailed description of the tuning and controller design will be presented for the 20 knots model For the 5 and 12 knots controllers only the final parameters and its performance will be given 8 2 2 Ziegler Nichols experiments A step response Ziegler Nichols experiment was performed on the vessel model in Simulink for 5 12 and 20 knots as explained in Section 7 1 8 A MATLAB script ZNstepRe sponse m was designed and used for simulation and calculation of the step response parameters It can be found in Appendix A 5 The results of the 20 knots experiment can be seen in Figure 8 20 By using the equations given in Table 7 2 the PID parameters are given as Parameter 5 knots value 12 knots value 20 knots value K 0 36161 0 41795 0 3773 Ti 1 9068 5 7833 5 6342 Ta
19. o T after 15s 7 100 4 50 0 i 1 1 1 1 1 0 2 4 6 8 10 12 14 16 18 20 Time s Figure 8 2 Heading response for 5 12 and 20 knot models with a rudder angle of 25 76 Chapter 8 Design in Simulink Using Equation 7 33 and setting t 15 and y t 0 95 which corresponds to reaching 9596 of the stationary value of a step in 15 s it can be seen from Figure 8 3 that chosing T 2 5 would yield a satisfying performance Determining T 0 07 F i i e 9T 0089 L 0 05T 15 T Figure 8 3 Plot for finding T The resulting filter is given as y t EEN This filter is then discretized in MATLAB using the function c2d system sampling time where system is the continuous filter and the sampling time is equal to 0 25 s When discretizing the filter the stationary gain is changed from 1 to 1 041 Therefore the gain is divided by 1 041 so that the stationary gain becomes 1 The resulting discrete filter is given as 0 004495z 0 004205 z2 1 81z 0 8187 8 1 The step response of this filter is plotted in Figure 8 4 Step response fora step of 180 degrees T T 15 Time s Figure 8 4 Step response for the reference model filter TT Chapter 8 Design in Simulink In Figure 8 5 the ROT of the system in Figure 8 1 is plotted for the three models at 5 12 and 20 knots The limiting factor here is the 5 knot model which have a maximum ROT of app
20. 8296 5 E T o a 5 10 zl 45 1 L l L 1 L 400 450 500 550 600 650 700 Time s Figure 4 23 4 order ARX model output vs measured ROT at 12 knots is still stable despite it being non minimum phase as its poles are inside the unit circle Figure 4 25 displays the Bode plot of the 4 order ARX model the gain margin and phase margin is also marked together with the cut off frequency The model has a gain margin of 3 8 dB at 0 48 Hz and a phase margin of 112 at 0 186 Hz 45 Chapter 4 System Identification Pole Zero Map o 2 E 4 a 4t lt i D OF xO 4 c 5 At 1 2L J o 3 i 1 0 5 0 0 5 1 1 5 Real Axis Figure 4 24 Poles and zeros for 4 order ARX model at 12 knots Bode Diagram Gm 3 8 dB at 0 48 Hz Pm 112 deg at 0 186 Hz rom ul To yl 5 T Cut off frequency 0 15Hz Magnitude dB Phase deg E n L L L n TT 1 1 i n L 4 10 10 10 Frequency Hz Figure 4 25 Bode plot for the 4 order ARX model at 12 knots 46 Chapter 4 System Identification 4 2 6 20 knots model identification As for the 5 and 12 knots models the sampling time is 0 25 s and the set point is changed every third second The first 7 5 min are used for calculation while the rest is used for validation Total length of the input output sequence is approximately 12 5 min this sequence can be found in Appendix B 3 Time delay at 20 knots was found to be
21. Where k defines the sampling instants k 0 1 2 and kh the total time The integral part can be discretised in several ways but the most common one as given in str m and H gglund 1996b and str m and Wittenmark 1997 is the for ward difference approximation S f i ear O E a kh 7 24 i Moreover the derivative part is approximated by taking the backward differences Ta dup t dy t 2d SUI LATA Sam 7 25 N di up t doa up kh 7 25 nonumber 7 26 T KT N poet 2 Tt WA eph h Tt wj coke e kh h 7 27 67 Chapter 7 Theory Where c is the derivative set point weighting variable T he above approximation has the advantage that it is always stable and gives good results for all values of Ty Forward approximation on the other hand can become unstable for small values of 74 due to the mapping explained in Figure 7 12 Tustin s approximation is also always stable but can give undesirable oscillations for small values of Ty We can then summarise the above discretisation procedure for the PID controller using the shift operator q x kh kh h in the following equation Kh q uprp kh K bush we 1 KEN tg Ty Nh raed yreg kh y kh e kh 7 28 7 1 8 Manual parameter tuning and the Ziegler Nichols methods The PID controller has a range of free variables given in Table 7 1 These have to be tuned properly to have a well performing contro
22. o V o o o o o o oe o oe o oe oe oe oe serwrite sfun m is a Matlab S function which writes the desired voltage in the correct syntax to the AX1500 voltage out card The desired voltage is recieved at the input of the S function in the USVsimulation mdl Simulink model every 250ms Message format Mnn where M Channel A B and direction a A nn Hexadecimal value 00 7f gt 0 12V Inputs serobj a handle to the robnet serial port stime sample time of the S function u desired voltage Author Jarle Saga Blomhoff and Geir Beinset 2007 For more details see the complete file on the CD 148 Appendix B Measurement pre treatment plot B 1 5 knots Input and output signals at 5 knots T T T T T 5 gt 7 1 l 1 l L 1 100 200 300 400 500 600 700 800 Validation data Calculation data 1 1 l 1 1 1 100 200 300 400 500 600 700 800 Time s Figure B 1 Input output sequence at 5 knots 149 Chapter B Measurement pre treatment plot Measured ROT vs ROT derived from the heading at 5 knots T T T T T I I 10 Measured ROT en ROT derived from heading i xses v 005152 H 2X 5145 d EY 1 345 ROT s 10 1 1 l 1 1 1 460 470 480 490 500 510 520 530 540 Time s Figure B 2 Measured ROT vs ROT derived from the heading at 5 knots Measured ROT sh
23. s 16 14r T 12r E o g 10 unos A H AD y ar V Ww 6 E L l i 1 L l L l 180 200 220 240 260 280 300 320 Time s Figure 9 14 Gain scheduling with a step in desired heading 132 Chapter 9 Implementation I I Measured position Waypoints 1200 1000r North position m eo eo eo T o e e T 400 200 1 1 L L 1 1 1 400 200 0 200 400 600 800 1000 1200 East position m Figure 9 15 Way point navigation around Munkholmen Trondheim Measured position Waypoints 1200 1000F eo o o T North position m o eo o T 200 L 1 500 0 500 1000 East position m Figure 9 16 Way point navigation with missed waypoint 133 Chapter 9 Implementation 9 4 Graphical User Interface GUI A GUI was created to be the interface to both the simulations and later the implemented version in the boat This interface needs to be able to start and stop the autopilot In addition it must be able to choose between manual and automatic mode and set the desired rudder angle and desired heading respectively All this is done by the GUI given in Figure 9 17 The program is started by running the run m MATLAB script found in Appendix A 9 This script loads the initial parameters into the MATLAB workspace and presents the GUI U SV simulationGui m contains the setup and the callback functions of the G
24. sensitivity method since there are plans to perform auto tuning using the relay feedback in the future Figures from the two methods used on the 5 and 12 knots model are found in Appendix C 6 89 Chapter 8 Design in Simulink PID parameters from ZN ultimate sensitivity method o T T T T T T T T 1 V Td 5 knots O Ti 5 knots x Kp 5 knots 6r 5 V Td 12 knots H Ti 12 knots X Kp 12 knots V Td 20 knots 5r Ti 20 knots H X Kp 20 knots 3 s J gt S o E d s 3 a 2 v v v 1 4 m x x 0 i i i i i fi i i i 4 6 8 10 12 14 16 18 20 22 24 Velocity knots Figure 8 25 Kp Ti and Td parameters for all speeds derived from ZN ultimate sensi tivity 120 T T T T gt ZNstep 5 ZNultimateSens 100 Heading deg o o T l 40 4 20r El 0 10 20 30 40 50 60 Time s Figure 8 26 Step response using the ultimate sensitivity and step response parameters at 20 knots 90 Chapter 8 Design in Simulink 8 2 35 Limited Derivative Action Because high frequent noise will have a large amplification if the derivative action is not limited we pass it through a low pass filter as explained in Section 7 1 3 We choose N 10 which corresponds to a low pass filter with a cut off frequency of 1 Hz when using the Ty from the Ziegler Nichols experiments Our models have a maximum bandwidth of approximately 0 7 Hz as shown in
25. 0dB 20 x logyg 0 6 dB 4 4370dB 7 30 The derivative T4 and the integral T parameters adjust the phase margin by changing the frequency where respectively the derivative and integral action are applied Parameter Tuned value K 0 6 x Ky T Ta 3 Table 7 4 PID controller parameters obtained from the Ziegler Nichols ultimate sensitivity method 70 Chapter 7 Theory Figure 7 14 N Im Gw Gao Ultimate point yquist curve and the Ziegler Nichols ultimate sensitivity method Ultimate sensitivity method 140 80r Heading deg o o 40 20 ae Ultimate period Tu 11 75 s a Rudder angel set point Heading gt Step Ultimate Gain USV Scope L L L 10 20 30 40 50 60 Time s Figure 7 15 Ultimate gain K and period T of the Ziegler Nichols ultimate sensitivity method 71 Chapter 7 Theory Parameter Tuned value K 0 45 x Ky T te Table 7 5 PI controller parameters obtained from the Ziegler Nichols ultimate sensitivity method Parameter Tuned value K 0 5 x Ku Table 7 6 P controller parameters obtained from the Ziegler Nichols ultimate sensitivity method 7 2 Reference model Heading set points should consist of feasible set points for the vessel A step in the desired heading would generate a set point to the vessel which is not achievable therefore a reference
26. 1 9767 1 4458 1 4086 Table 8 1 PID parameters calculated from the Ziegler Nichols step response method As seen from the table above the parameters for the 12 and 20 knots controller are similar This is also showed in Figure 8 21 where Kp Ti and Td are plotted together for all speeds Therefore it might be possible to use the same parameters at 12 and 20 knots In addition it might be useful to do more models in the range 5 to 12 knots in the future When tuning systems according to the Ziegler Nichols method we have two possibil ities They are the step response method performed above and the ultimate sensitivity method Both approaches are explained in Section 7 1 8 86 Chapter 8 Design in Simulink Heading 200 T T T T Slope 9 032 deg s Heading deg 3 o T Deadtime 50r 2 8171 s 7 0 L fi L l J 0 5 10 15 20 25 30 Time s Rudderangle Setpoint 10 T T T 5 3 8r uc AA E AROS E Pe o 241 4 J c l S S 2b S 2 l 0 ed 74 L 1 L 1 L 0 5 10 15 20 25 30 Time s Figure 8 20 Slope R and deadtime Lg of the Ziegler Nichols step response method at 20 knots PID parameter values for 20 12 and 5 knots 8 2 Kp 5 knots O Ti 5 knots Y Td 5 knots TF Xx Kp 12 knots Ti 12 knots V Td 12 knots eb X Kp 20 knots o O Ti 20 knots O v Td 20knots 5 o 3 4 gt a E S a 3 E 2r 7 y v 1 Lo x x x 0 i
27. 50 Etec llle 6 13 Measurement Equipment ees 7 1 3 1 DGPS Compass Seatex Seapath 20 7 1 3 2 Simrad RPU80 Rudder pump and LF3000 Rudder Sensor 9 1 4 Equipment mounting and calculation of CG 9 Rapid Control Prototyping 14 23 Simulator wos rapa Ab ge genns ub Hopes oth pc ae yee ats Sh Poo e nu des 15 2 2 Real time constraints ee ee 15 Modelling 18 Experiments 19 3 1 Input design for open loop experiments o 19 3 2 Binary Rudder Manoeuvre 222222 21 3 2 1 Pseudo Random Binary Signal properties 21 System Identification 26 4 1 Rudder Pump System Identification 0 28 41 20 knots model s o aaa dee Ow A RO ee Bw 30 4 1 2 5 axidi12 knots models nr 2 HERR RR Se ee a 31 4 2 Vessel System Identification 22s 34 4 2 1 4 2 2 4 2 3 4 2 4 4 2 5 4 2 6 4 2 7 5 Discussion 6 Conclusion Data pre treatment a 5 knots model identification 22e Best model at 5 knots o 02000000 ee eee 12 knots model identification Best model at 12 knots lees 20 knots model identification llle Best model at 20 knots 00000000808 III Control Design 7 Theory EAL PIDscontrol tite acte uo TELS ES An eek gh etie estate AES ag 7 1 1 Proportional Control 22e T 1 2 Integral Control tira ue he a a Gos dU ue 7 1 3 Derivative C
28. 8 30 As seen the open loop contains com plex conjugate poles close to the imaginary axis If these poles become dominant we will have oscillations on the output By increasing the gain less overshoot is obtained But with a gain of Kp 0 52 we get oscillations at the output and the overshoot is still over 5 9 on a step from to 180 as seen in Figure 8 31 Extensive tuning was performed both with regards to integral time and derivative time Unfortunately no feasible parameters where found to remove the overshoot An acceptable overshoot was only obtained by increasing the proportional or integral gain so much that the real system would saturate hence the parameters would not be feasible To test how much influence the time delay has on the system a root locus tuning was performed on the model ignoring time delay give as V s 0 034355 0 17698 1 2955 23 635 37 1 Oref 0 134656 1 58355 7 48754 28 9153 44 925 33 055 8 13 93 Chapter 8 Design in Simulink Bode Diagram T 40 T a az o o a o c z 100r Continuous USV model with time delay 120H Continuous USV model with pad approximated time delay Discrete USV model T T T D o Y o ao 4 a 1080 A oy I 1 it aya rit 10 107 10 10 10 Frequency Hz Figure 8 28 Bode plot of the model transfer functions in discrete continuous time with
29. 8 5 s hence the ROT measurement sequence was shifted 34 samples so that sample 34 became the first sample The 34 last samples was also deleted from the input Adjustment of the ROT measurement at 20 knots can be found in Appendix B 3 Figure 4 26 shows the performance of the State Space model and the ARX model which was found by Quick Start in the System Identification toolbox This figure reveals that the models at 20 knots produces an output which is almost identical to the output of the vessel when they are subject to the same input It is believed that the difference to a great extent is created by waves and measurement noise This behaviour was found to be so good that it was not put any effort in finding better models The state space approach and the ARX yields almost identical results where the State Space model have a fit of 90 6 and the ARX model has a fit of 89 6 Measured and simulated model output at 20 knots 15 T T T T I State space model FIT 90 6 Measured ROT pase 4th order ARX model FIT 89 6 10 E uM i L A N a RA y AA E n A fl 5 v T 0 J o a 5 al Y Uu 10 4 l 1 350 500 550 600 650 700 750 Time s Figure 4 26 Model outputs at 20 knots The residuals of the two models are also similar as seen in Figure 4 27 As for the 12 knots model it is difficult to use the residuals to discriminate between the two models The ARX model was chosen due to its simp
30. Autocorrelation of residuals for output y at 12 knots T T T Oth order ARX model 4th order state space model 05 4th order ARX model 0 l l j l l l l 36 15 10 5 0 5 10 15 20 Cross correlation for input u and output y residuals at 12 knots 0 2 T T T T T 0 1r 4 OF ee edict te in T are tp T 0 l l l l fi 30 15 10 5 0 5 10 15 20 Samples Figure 4 22 Residuals at 12 knots for the 4 order ARX model Due to the simplicity of the ARX model and because the performance of the State Space model is only 3 696 better we chose to continue using the ARX model More details on this model is presented below 4 2 5 Best model at 12 knots The ARX model is given as r k 0 0233 0 0875q 0 2585q 0 1752q 4 8 k 1 2 613q 2 7329 1 391973 0 2914q 4 l Figure 4 23 shows the output of the ARX model compared to the measured behaviour of the vessel Investigating the poles and zeros of the system reveals that the system is a non minimum phase system as two of its zeros are placed outside the unit circle The system 44 Chapter 4 System Identification Measured and simulated model output at 12 knots T T T I Measured ROT 10 4th order ARX model FIT
31. Chapter 4 hence all the frequencies included in the bandwidth of the vessel will be compensated and high frequency noise will be limited Bode plots of the unlimited and limited derivative action in addition to the low pass filter is seen in Figure 8 27 Bode Diagram 60 T Low pass filter Limited derivative 40H Unlimited derivative 4 a e ne imas ds EC OO EA o v a 5 0 zr 20 40 1 L 1 fi 90 SSS FSIS 45 DN 4 a a ee Sens a o 0 AAA A 17 e a 45L 4 90L y jd p A 1 _ 10 10 10 10 Frequency Hz Figure 8 27 Bode plots of the unlimited and limited derivative action in addition to the low pass filter 8 2 4 Root Locus tuning of the parameters In this section we will use the obtained Ziegler Nichols parameters and improve the tuning of the controller using the root locus method A goal would be to reduce overshoot and maintain a fast response without saturating the actuator Since we are more used to analysis in continuous time all transfer functions will be converted using the d2c function in MATLAB with the zero order hold method Unfortunately non linearities are not included in the analysis so great care should be taken not to saturate the actuator and make the system unstable Therefore all controller will be converted to discrete time by 91 Chapter 8 Design in Simulink the c2d function of MATLAB and tested on the
32. Frequency Hz Figure C 13 Bode plot 12 knots Rudder pump experiments Pole Zero Map 0 8r 0 6 Imaginary Axis o T 0 5 Real Axis 0 5 Figure C 14 Pole Zero plot 12 knots Rudder pump experiments 162 Chapter C Analysis plots C 3 20 knots Rudder pump experiments Input and output signals 151 T T T T T J 10F m Actual rudder angle deg o 1 5 4 10 Validation data Estimation data IS 1 1 1 L l J 0 20 40 60 80 100 120 15 o 10r 7 Commanded rudder angle deg o L BL 4 10r 4 15E 1 1 1 l J 0 20 40 60 80 100 120 Time s Figure C 15 Input output data 20 knots Rudder pump experiments 163 Chapter C Analysis plots 16 Measured and simulated model output 14r 10 Rudder angle deg 4th order ARX model 90 fit 1st order ARX model 85 5 fit Measured output 70 75 80 85 90 95 100 105 110 Time s Figure C 16 Model output 20 knots Rudder pump experiments Frequency response Amplitude dB 1st order ARX model 4th order ARX model f patil J ail E o E o ES E E o 100r Phase deg Y eo o T 300 400 1 107 10 10 Frequency Hz Figure C 17 Frequency response 20 knots Rudder pump experiments 164 Chapter C Analysis plots
33. In Figure 4 14 the unfiltered ROT and the filtered ROT is plotted Most of the dis turbance is believed to be caused by waves with frequencies in the same area as the vessel dynamics Therefore pre filtering done on the dataset is very limited and only the highest frequencies have been filtered The plot also displays the time delay which is introduced due to the filtering 37 Chapter 4 System Identification Measured ROT shifted 23 samples vs ROT derived from the heading at 5 knots T T T T T 10r Measured ROT T sp ROT derived from the heading ROT s o T 10 1 1 1 1 1 460 470 480 490 500 510 520 530 540 Time s Figure 4 13 The measured ROT shifted 23 samples and plotted together ROT derived from the heading Unfiltered vs filtered measurement of ROT T T T T T T ME Ds Unfiltered ROT Filtered ROT 104 4 1 l L f f f 460 470 480 490 500 510 520 530 540 Time s Figure 4 14 Filtered and unfiltered ROT 38 Chapter 4 System Identification 4 2 2 5 knots model identification The input output data at 5 knots consist of a sequence of approximately 13 mins The set point is changed every third second and data is logged at a frequency of 4 Hz The first 7 5 mins are used for model calculation while the rest of the signal is used for validation see Figure 4 15 The time delay in the ROT measurement was 5 7 ss so this measur
34. Simulink model with saturation Some parts of the system was designed in continuous time and we will use these given as Reference Model 1 1 2 58 PID controller with limited derivative action Crate XU rni 8 4 Integrator from rate of turn to heading Hip s 8 3 1 Hr s a 8 5 Delay due to discontinuous measurement Ho 360 s e 9 8 6 The identified model of the pump desired rudder to actual rudder and vessel actual rudder to rate of turn are converted Pump model discrete k 0 15629 UE 1 8 7 Ore p k 1 0 8447q7 t Pump model continuous 1 s xe 0424 8 8 Ore f S 1 0 1346s Vessel rudder angle to rate of turn model discrete r k 0 0233 0 0875q 0 2585q 0 175294 8 9 k 1 2 613q 1 2 7329 1 391973 0 2914q 4 t Vessel rudder angle to rate of turn model continuous r s 0 03435s 0 1769s 1 295s 23 635 37 1 8 10 ds st 4 32953 23 465 40 475 33 05 The complete plant to be controlled will then be the a combination of the pump vessel measurement discontinuity delay and integrator transfer function given as V s 0 034355 0 17695 1 2955 23 63s 37 1 xe 4 8 11 ref s 0 134656 1 5835 7 48754 28 9153 44 925 33 058 92 Chapter 8 Design in Simulink Root locus tuning will be performed in the sisotool application in MATLAB Control System toolbox Since the root locus
35. The GUI offers 3 modes automatic waypoint automatic heading and manual Manual mode provides the user with the option to set the rudder manually either by entering a number in the correct field or by using a slider Automatic Heading provides the user with a heading autopilot The desired heading can be set either by entering a number in the correct field or by using a slider Automatic Waypoint provides the user with a waypoint autopilot The autopilot reads the desired waypoints from the waypoint variable in the MATLAB workspace and leads the boat through this path Author Jarle Saga Blomhoff and Geir Beinset 2007 o o o o o o o o o o o o o oe o o o o o oe oe oe oe For more details s the complete file on the CD A 9 run m run m is a Matlab script which initialise the autopilot It first loads the correct inital parameters from SimParameter5 mat and waypoint m Second it opens the serial ports and checks if there is any readings Finally it opens the GUI which allows the user to interface with the autopilot Author Jarle Saga Blomhoff and Geir Beinset 2007 o o o o o o o oe oe oe oe For more details see the complete file on the CD A 10 Serial configuration readNMEA_serialconf m 145 e N e OO WAN Da RO NY O nr Q UA 20 21 22 23 Q Ne O O AN DoT Rot e Oo 0o 90 0 6 20 21 22 Chapter A MATLAB Code o oe oe o9 oe oe oe
36. actual rudder to rate of turn Adding an integrator we have a complete model from desired rudder angle to heading for the controller design in Simulink as shown in Figure 8 7 The first order model will be replaced by the pump and an analog voltage out card with our own controller when implemented in the vessel Design in this section are based on the identified models and not our pump controller to save time in the development process For more information on the obtained models please consult Chapter 4 Commanded Actual T rudder angle 9 1562 rudder angle R 0 03435z4 0 112423 0 3695z2 0 2131z Rate of turn p KTs Heading 5 z2 0 8447z 24 2 32823 2 41322 1 3542 0 3388 2 1 Step Rudder Pump Vessel dynamics Discrete Scope w Simrad controller Integrator Figure 8 7 The model from commanded rudder angle to heading in MATLAB Simulink We have chosen the PID controller design for our heading controller This design is a well known and by far the most used hence it suits our needs in this project where time is of an essence Furthermore it has a simple structure and good robustness to a large number of common control problems by implementing different extensions This simple structure also suits the needs of Maritime Robotics which have requested an intuitive basis for further development The PID controller was also originally developed on the basis of watching the helmsman ste
37. controller with dead zone non linearities However as the system is a fairly simple and it is believed that the new controller design will behave in a similar way this model is used to simulate the steering hydraulics Measured and simulated model output IM L Rudder angle deg 12 knots model 85 24 fit 5 knots model 83 84 fit 20 knots measured data 20 knots model 85 32 fit i Qo 65 70 75 80 85 90 95 100 105 110 Time s Figure 4 8 Model output of the rudder pump model at 20 knots with different speed models 33 Chapter 4 System Identification 4 2 Vessel System Identification In this section we will present the system identification process of the vessel dynamics from actual rudder to ROT as seen in Figure 4 9 This model is implemented as a part of the vessel simulator that is created in Simulink for design and tuning of the heading controller As the dynamics of the vessel changes with speed three models are developed to capture the dynamics The first section presents pre treatment of the acquired data to prepare it for analysis The rest of this chapter presents the analysis at 5 12 and 20 knots Headlig USV model 40 0 18962 0 01659 22 17 1243 000031 536240 31172 zl Vessel model Integrator Headhg Figure 4 9 System identification of vessel dynamics 4 2 1 Data pre treatment Before the data acquired during the experiments c
38. dB 1st order ARX model 4th order ARX model 100 100r 200r 300r amp 400r 500 600 ase deg P 700 10 107 10 Frequency Hz Figure C 10 Frequency response 12 knots Rudder pump experiments 160 Chapter C Analysis plots Step Response 1 5 T T T T T T T I 1st order ARX model 4th order ARX model 1h M IS J 2 rd 2 y o 3 i pa P4 7 he j 5 a 0 5 4 7 1 i y 7 7 o 1 1 fi 1 fi l L 0 1 2 4 5 6 8 9 10 Time s Figure C 11 Step response 12 knots Rudder pump experiments Autocorrelation of residuals for output y1 0 5 T T T T T T T A E A P a UCM x n S e d X l am m odi m y m der Losas a is xi AS ob x y al 0 1 1 l 1 L L 1 30 15 10 5 0 5 10 15 20 Cross corr for input u1 and output y1 resids 05 J T T T T T T Sammie oceans a aceite pedem T TEE nu EN es A RR 0 f 1st order ARX model 4th order ARX model 05 1 1 L 1 1 1 20 15 10 5 0 5 10 15 20 Samples Figure C 12 Residuals 12 knots Rudder pump experiments 161 Chapter C Analysis plots Magnitude dB Phase deg 3151 360L Bode Diagram Gm 16 2 dB at 0 722 Hz Pm 171 deg at 0 0136 Hz Commanded rudder to actual rudder angle T Cut off frequency a 0 11 Hz
39. do not accept time delays it will be approxi mated by a second order Pad approximation in MATLAB with the function pade This method approximates the exponential transfer function of a time delay by rational trans fer function For more information on Pad approximation please consult Golub and Loan 1989 The Pad approximated transfer function is given as V s 0 03435s9 0 48275 1 1875 30 495 207 55 Srep S 0 134658 2 78157 25 1356 137 455 50051 1197534 293 65 979 9 1481s 873s 8 12 If we compare the bode plots of the continuous transfer function with time delay its Pad approximation and the discrete transfer function given in Equation 6 5 In Figure 8 28 it can be seen that the gain is equal for both the continuous model with and without Pad approximation A difference can be seen in the phase and it is probable that the real model will manage a smaller gain than one found with the Pad approximated transfer function in sisotool The discrete model follows the same phase as the continuous transfer function with time delay until the nyquist frequency at 2 Hz In magnitude the discrete model follows the continuous ones until about 0 1 Hz before it starts to have a very low gain The root locus tuning is performed with the above mentioned blocks placed as indi cated in Figure 8 29 Initial parameters from Ziegler Nichols experiments gave us the pole zero and the step plots seen in Figure
40. i i j 0 5 10 15 20 25 Velocity knots Figure 8 21 Kp Ti and Td parameters for all speeds derived from ZN step response 87 Chapter 8 Design in Simulink For the ultimate sensitivity method the parameters were implemented in Simulink models given in Figure 8 22 8 23 In addition the derivative and integral action was turned of by setting respectively D and I to zero si To Workspace si Heading Ec tm Rudder angel set point Heading i i Rate of tum Set heading Heading autopilot x gt Heading5 Figure 8 22 Simulink model of the USV simulation ay gt _ gt psiin psi_out gt psi d in psi d out 0 360 to inf inf w shortest direction Kp Delay Proportional 4 on off gt rfc 0 gt 0 gt delta r c ntegral on off z 4 9 ie v z Td T d4N h Kp T d N T d N h Discrete TF Derivative on off Figure 8 23 Simulink model of the controller The MATLAB script ZNultimateSensitivity m was created to do simulations and calculations to find the PID parameters of the Ziegler Nichols ultimate sensitivity method This script can be found in Appendix A 6 and runs multiple simulations and adjusting the gain of the controller n great advantage with our simulator is that it allows for fast identification of these variables If these experiments were to be do
41. integrator H s Continuous transfer function of the reference model k The sampling instants k 0 1 2 L Overall submerged length of the vessel La Deadtime of Ziegler Nichols step response method N Gain limiter for derivative action q The shift operator R Steepest slope of Ziegler Nichols step response method Ti Tracking reset time U Vessel speed Up s Laplace transform of the derivative action Ur s Laplace transform of the integral action Up s Laplace transform of the proportional action z The complex variable of the Z transform xvi Acronyms ASCII CG DGPS DP GPS GUI IALA ITTC LSE LOS MIMO NMEA PD PI PID PRBS RBS RCP RMS ROT American Standard Code for Information Interchange Centre of Gravity Differential Global Positioning System Dynamic Positioning Global Positioning System Graphical User Interface International Association of Marine Aids to Navigation and Lighthouse Authorities The International Towing Tank Conference Least Square Estimate Line Of Sight Multiple Input Multiple Output National Marine Electronics Association Proportional Derivative Proportional Integral Proportional Integral Derivative Pseudo Random Binary Signal Random Binary Signal Rapid Control Prototyping Root Mean Square Rate Of Turn xvii SISO SNR USV ARX FFT Single Input Single Output Signal to Noise Ratio Unmanned Surface Vehicle Autoregressive eXtra input Fast Fourier Tr
42. is well chosen for the 5 and 12 knots model while they are not optimal for the 20 knots model With the present system this is the best alternative as the experiments where limited by the steering dynamics and the sampling rate A possible improvement of the experiments at 20 knots would be to implement a larger pump with faster dynamics Then it would be possible to change the input signal at a higher rate and the bandwidth could be increased Then the sampling rate would become the limitation and it should be increased as well to further increase the bandwidth to improve the experiments at 20 knots The introduction to the system identification mentioned that the vessel is subject to environment disturbances The data from different trials are influenced differently as they are performed at different points in time This means that the conditions might change from one experiment to another The speed of the vessel also influences the impact of the environmental disturbances When the vessel is at low speed its motion will be strongly influenced by waves and wind Increasing the speed of the vessel will increase the relative frequency of incoming waves and the dynamics of the vessel will not be able to follow the fast motion of small waves hitting the hull T he result is that the motion of the vessel will be less influenced by waves Therefore increasing the speed has the effect of moving the wave spectrum towards higher frequency area The result of
43. latitude 1024 054 latitudeRad latitude pi 18000 Longitude measurment Latitude measurment Degrees to radians conversion one degree is given as 1000 123 4 5 Chapter 9 Implementation n position latitudex1110 North postion m e position longitudex 1113 2 3 73 sin latitudeRad 2 cos latitudeRad East position m The values are then stored in the S function and outputted to the controllers and gain scheduling block as shown in Figure 9 1 9 1 3 Read rudder angle It was also necessary to read the LF3000 rudder feedback device due to limited time in this project it was decided to utilise the interface of the AP20 auto pilot to acquire this signal Rudder measurement is provided by the NI300X connection box in the AP20 autopilot system NI300X provides these measurements on a RS232 serial port using the ROBNET protocol In this protocol the messages from different devices are provided as hexadecimal strings The ROBNET proprietary protocol is not openly available and we will therefore here only give the syntax of the specific message 142A004DE9 Where Variable Description 14 Address for the AC20 unit 2A Rudder measurement identifier 00 Unknown 4D Rudder measurement least significant bytes E9 Rudder measurement most significant bytes C6 Unknown The ROBNET serial communication is configured by running the MATLAB script read serialconf m found in Appendix A 10 A handle to the s
44. mentation on the vessel But nevertheless this model will aid us in the first controller design phase done in Simulink 28 Chapter 4 System Identification Rudder angle deg Commanded vs actual rudder angle 20 T T T T T Actual rudder angle deg Commanded rudder angle deg 15 10 a i 10 15 n L l l 1 0 50 100 150 200 250 300 350 400 450 Time s Figure 4 3 Rudder pump behaviour with Simrad P controller 29 Chapter 4 System Identification 4 1 1 20 knots model We use the MATLAB System Identification toolbox and divides the measured data into an estimation part and a validation part as shown in Figure 4 4 The identification are performed and suitable ARX models are calculated as shown in Figure 4 5 For residuals frequency response and step response figures please consult Appendix C Our goal was to find a simple and suitable model The 1 order ARX model gives about 85 fit and the 4 order ARX model gives almost 90 96 fit We decide to use the simple 1 order because of its simple structure and satisfactory behaviour Input and output signals T T T T T 10 Validation data _ Estimation data Actual rudder angle deg o 0 20 40 60 80 100 120 Commanded rudder angle deg o 1 0 20 40 60 80 100 120 Time s Figure 4 4 Rudde
45. models with a bandwidth which is less than 0 4 Hz Figure 3 5 shows that the frequencies up to approximately 0 3 Hz are well exited So the input signal is the limiting factor in this experiment and it is limited by the steering hydraulics 23 Chapter 3 Experiments Since the dynamics of the vessel changes with the speed it was decided to do models at different speeds to account for these changes It is normal to define three different regions for the dynamic of a vessel moving in water with respect to the speed These regions are displacement semi displacement and planning In this report we will define them as a function of the Froude number For a comprehensive discussion on this subject see Beinset and Blomhoff 2006 Chapter 2 1 The Froude number is defined as U Fn 3 1 an 3 1 Where U is the vessel speed L overall submerged length of the vessel and g is gravity Table 3 1 gives the three regimes as a function of the Froude number Region Froude number Diplacement Fn lt 0 4 Semi displacement 0 4 lt Fn lt 1 0 1 2 Planning Fn gt 1 0 1 2 Table 3 1 Froude number as a planning indicator 24 Chapter 3 Experiments The Binary Rudder Manoeuvre was performed at 5 12 and 20 knots these velocities are chosen so that the experiments covers displacement semi displacement and planning motion see Table 3 2 Speed Froude number Operating area 5 0 34 Displacement 12 0 82 Se
46. never is above 0 dB Bode Diagram 20 HH H 20 Pee uM 40 L4 AE i oe System Closed Loop r to y 1 i Gain Margin dB 56 4 80 ES AE i Ts O P At frequency Hz 0 475 Closed Loop Stable Yes 100 bebe pp peMR Magnitude dB 120 138 360 180 180 Phase deg 360 540 720 900 10 Figure 8 49 Bode plot of the input sensitivity and the closed loop with proportional set point weighting 8 3 Gain Scheduler The gain scheduling algorithm is implemented in Simulink as a state machine using the Stateflow toolbox this state machine changes the parameters of our model as a function of the speed of the vessel As the parameters are changed there might be discontinuities in the output To avoid this a bumpless transfer scheme is implemented as described in Section 7 1 6 where the gain is moved outside the integral Stateflow charts appears as a block in a Simulink model and interacts with other blocks in the Simulink model by input output signals Through these signals data and events can be passed between the Stateflow chart and other Simulink blocks making it possible to change the model Figure 8 50 shows the Stateflow chart block in our Simulink model 109 Chapter 8 Design in Simulink 5 gt Drift Drift simout Disturbance I gt on off To Workspace psi Heading 7 Heading headingRef psi d delta r c Aider gt Rudder
47. of the 4th order ARX model at 5 knots 2 4 18 Model output of 4th order ARX model at 5 knots 4 19 Poles and zeros of the 4th order ARX model at 5 knots 4 20 Bode plot for the 4th order ARX model at 5 knots 4 21 Bode plot for the 4th order ARX model at 5 knots 4 22 Residuals at 12 knots for the 4 order ARX model 4 23 4 order ARX model output vs measured ROT at 12 knots 4 24 Poles and zeros for 4 order ARX model at 12 knots 4 25 Bode plot for the 4 order ARX model at 12 knots 4 26 Model outputs at 20 knots 22e 4 27 Residuals at 20 knots for the 4 order ARX model 4 28 4 order ARX model output vs measured ROT at 20 knots 4 29 Poles and zeros of the 4 order ARX model at 20 knots 4 30 Bode plot of the 4 order ARX model at 20 knots 5 1 Deviation between measured ROT and model predicted ROT at 15 rud derangle 23 4x Si E Wette yu INR RCDWO hs 7 1 General types of control systems sn 7 2 Parallel representation of the PID controller 7 3 Controller with integral action automatic reset 60 7 4 Derivative action interpreted as prediction str m and H gglund 1996b 60 vil 7 5 7 6 YT 7 8 7 9 7 10 7 11 7 12 7 13 7 14 7 15 7 16 7 17 8 1 8 2 8 3 8 4 8 5 8 6 8 7 8 8 8 9 8 10 8 1
48. of these effects can be seen in Figure 7 7 62 Chapter 7 Theory Measured output y t and set point Yrer t 0 5 10 15 20 Figure 7 7 The usefulness of set point weighting str m and H gglund 1996b 7 1 5 Integrator Windup The integral part of a PID controller is stable in a closed loop but turns unstable when it is opened This is due to the integrator element which would tend to infinity in an open loop with a constant at its input All real actuators have physical limitations and when they are saturated the feedback loop will be broken The unstable mode in the controller will then drift to a very large value Later as the integrator desaturates this can cause damped oscillations or even unstable systems Several ways to avoid this windup have been developed and we will in this section focus on tracking because of its easy implementation Tracking is an antiwindup scheme which makes sure the integrator does not exceed the limits of the actuator by measuring the error es between the actuator output u and the control output v This error is feed back to the integrator resetting it so that the controller output is at the saturation limit and keeping the loop closed as seen in Figure 7 8 Here the tracking time constant T is used to define the time it takes before the integrator is reset As a rule of thumb str m suggested to choose the tracking time constant Td lt Tt lt Ti Another widely used simple alte
49. re duced the proportional gain of the controller due to the oscillations shown earlier in this section The result of this test can be seen in Figure 9 15 As seen the USV follows the trajectory given by the way points even though there are cross tracking error due to the simple LOS algorithm which is implemented We can also see that current disturbance affects the cross track error A modified LOS would solve this problem Another effect which were experienced during our test was that the vessel missed a way point at high speed such that it made one circle as seen in Figure 9 16 The circle of acceptance when the way point was missed was 20 m When we increased the circle of acceptance to 30 m the vessel hit all way points even at high speed with large waves The modified LOS algorithm would also allow us to use smaller circle of acceptance since it reduces cross track errors 131 Chapter 9 Implementation 250r 200 Heading deg Measured heading Desired heading N a L 1 l 100 120 140 Time s L 160 N o T e T o T Speed knots o 60 80 I 100 120 140 Time s 1 160 L 1 180 200 L 1 220 240 Figure 9 13 Gain scheduling with constant desired heading Heading deg Measured heading 200 j j j i i i Desired heading 180 200 220 240 260 280 300 320 Time
50. response 10 T T q 1st order ARX model P 4th order ARX model bud 0 gi p eee eo o eese T 3 z i a E 0L S 4 lt 10 Es i x gU J amp Y 1 pa 10 1 1 PT iial 1 1 oe cee er 1 dd L 1 1 10 10 10 10 10 0 eL AAA E T T Saig 100 Ss 4 5 E o jen 3 lE o 200 moa 7 J 2 N x a 300r 4 1 1 P 34 doa cud 1 4 As 1 pk ae fer tal 1 1 i 1 BTE 107 10 10 10 Frequency Hz Figure C 3 Frequency response 5 knots Rudder pump experiments 156 Chapter C Analysis plots Rudder angle deg Step Response 1 5 T Y T T T T T I T 1st order ARX model 4th order ARX model 1 E a 2 EEEIEE A PAARA RC NEE rt E ti 4 A 2 fa t 4 f L 4 0 5 j 7 rd f f 0 1 1 1 L fi L L 1 0 1 2 3 4 5 6 7 8 9 10 Time s Figure C 4 Step response 5 knots Rudder pump experiments Autocorrelation of residuals for output y1 1 T T T T T T T 05r 4 I iy E FA A A EF OM y 4 POM Q S FON T b i T US va tak ge PREFERITI REET 4 SU S nd WENT SS iow oc m 0 L 1 l 1 L 1 30 15 10 5 0 5 10 15 20 0 5 T T T T T I 1st order ARX model data2 Saar d TOTEM EE LISSE Sai ERT NC or NEED M sine 4 0 1 1 L 1 1 1 1 o 15 10 5 0 5 10 15 20 Samples Figure C 5 Residuals 5 knots Rudder pump exper
51. sequence had the same length The Delay at 5 knots was as mentioned 5 7 s at 12 knots the delay was 36 Chapter 4 System Identification 35 5 s and at 20 knots it was 8 5 s There is no buffer between the GPS sensor and the COM port on our laptop hence there should be no delay in the hardware It is also unexplained why the delay is different at different speeds although it seems to be constant for each experiment even though the speed changes during the experiment LabView is believed to be the most likely source of the delay but this have not been proved Measured ROT vs ROT derived from the heading at 5 knots 10r Measured ROT sieht ng ROT derived from heading lo y o051s2 LI 2X5145 i EY 1 345 L L L 1 1 1 j 460 470 480 490 500 510 520 530 540 Time s Figure 4 12 Measured and calculated ROT plotted together The output signal contains some noise due to wave disturbance to reduce the influence of waves it was decided to filter the signal before the analysis Filtering the signal introduces a phase shift therefore it is important to filter both the input and the output signal so that they have the same phase shift A 1 order Butterworth filter was used to filter the input and output signal the filter was created with the Matlab function butter order wn The filter is described by the following equation 0 22q 0 22 L 4 056 4 6
52. the error is zero the controller only provides the steady state control action for the original steady state which could be different from the new set point To get the system to operate near the new steady state the controller gain K must be very large so the controller will produce the re quired output Having large gains can lead to system instability or can require physical impossibilities like infinitely large valves 7 1 2 Integral Control A manually adjustable reset term was added to the control signal to remove the steady state error of the proportional controller Integral action was a result of trying to develop automatic tuning of this reset term The idea was to filter out the low frequency part of the error signal and add it to the control output as shown in Figure 7 3 and the following equations u t up t u t 7 4 Piet 7 5 U s K E s Up s 7 6 ue m Kae SE 7 7 pc m 7 8 uU es A s f due 7 9 u t up t ur t 7 10 59 Chapter 7 Theory Figure 7 3 Controller with integral action automatic reset This shows us that the automatic reset with a low pass filter on a proportional controller is the same as a Proportional Integral PI controller 7 1 3 Derivative Control A negative effect of the integral control is that it introduce a phase lag of 90 This means that some systems might turn unstable due to integral action Derivative control on the other hand gives us a 90 phase l
53. the justification for using this as an input signal First some general information on PRBS are provided then the properties of the actual PRBS sequence used in this experiment is analysed A PRBS is a periodic deterministic signal with white noise like properties The signal can attain two values U Here U is the value of the signal The PRBS sequence was created off line using the idinput length prbs function in Matlab Here length gives the sequence length and prbs sets the signal type to a PRBS The PRBS changes between two values 1 The sequence is scaled so that it provides the correct rudder set point before it is imposed A part of the PRBS sequence can be seen in Figure 3 3 the complete sequence is to long to be plotted on a page By creating the signal off line it is possible to investigate it in advance to ensure its properties Part of a Pseudo Random Binary Signal 10 T T T T T Bb Em E E T os ROT e s o T 8H U U d Lu Li UUUU UU UU U U U u tu 5 1 L 1 L 1 L f 1 L 1 60 70 80 90 100 110 120 130 140 150 Time s Figure 3 3 Part of a PRBS sequence with a length of 255 21 Chapter 3 Experiments The spectrum of an ideal PRBS has a very flat frequency spectrum that is it contains almost
54. the same amount of energy at all frequencies Figure 3 4 shows the spectrum of a PRBS with a period length of 255 which is sampled at 1 Hz it can be seen that the frequency content is more or less equally distributed up to the Nyquist frequency The spectrum was calculated in MATLAB using the Fast Fourier Transform FFT and the methods of Periodograms and Welch A periodogram is a power spectral density estimate while Welch is averaged periodograms of overlapped windowed signal sections Welch tends to give a smoother PSD when plotted The spectrum is calculated by PRBS_spectrum m and the usage of this script can be found in Appendix A 1 Power Spectral Density Estimate via Periodogram and Welch 25 T T T T T PSD via periodogram PSD via Welch P ANA a T Power frequency dB Hz E t Frequency H2 Figure 3 4 Frequency spectrum of a PRBS with period length 255 and sampled at 1 Hz The maximum period length of a PRBS is M 2 1 where n is the number of previous inputs When the period is finished the signal will repeat itself The second order properties mean and variance of a PRBS will be good as long as the signal is evaluated over an integer number of periods By averaging the output over the periods from such a signal one will improve the signal to noise ratio by a factor of i where i is the number of periods At the same time the data to handle in the analy
55. two data points correspond to the same point in time and it can be seen that the measured ROT is delayed by approximately 36 s The derivative of the heading measurement was then derived and it was compared to the rudder angle measurement see Figure 4 11 The derivative was implemented as S S 4 5 TS 1 0 5s 1 4 5 Here 7 determines the upper frequency included in the derivative equals 0 5 and this value was chosen based on the Nyquist frequency which is 2 Hz The derivative of the heading can be used in the identification procedure but the derivative contains a high level of noise as can be seen in Figure 4 11 Instead of using the derivative for system identification it was used to adjust the time delay in the ROT measurements which have a lower noise level than the derivative 35 Chapter 4 System Identification Actul rudder angle and ROT derived from the heading T T T T T I r 10 x Actual rudder angle ROT derived from the heading 1 fi E l 120 130 140 150 160 170 180 190 200 Time s fi 100 110 Figure 4 11 ROT derived from heading and actual rudder angle plotted together The heading sensor is providing heading data in the range 0 360 and the signal will not be continuous when the heading goes from 360 to 0 or the other way around This will result in a very large derivative as the heading goes from the maximum to the minimum value in t
56. we mean experiments that excites all relevant dynamics of the system and enables us to chose the best model candidate This is called a rich signal Ljung 1999 defines an informative experiment as An open loop expreiment is informative if the input is persistently exciting The mathematical definition of a persistently exciting signal can be found in Definition 13 1 in Ljung 1999 A signal A t is persistently exciting of order n if its spectrum is different from zero on at least n points in the interval 7 lt w lt T In order to use Matlab and Simulink in the development of the heading controller we need an accurate model of the vessel Based on the experience gained in Beinset and Blomhoff 2006 the experiments have been updated and improved in order to develop a satisfying model Analysis in Beinset and Blomhoff 2006 suggested that the Binary Rudder manoeuvre provided the best data set for the system identification procedure and that this manoeuvre should be used for system identification Figure 3 1 outlines the experiment set up with the vessel and the computer for set point control and logging A LabView interface enabling computer control of the input and logging was developed to remove the human operator and improve the logging see Figure 3 2 Set points 19 Chapter 3 Experiments Logging by generated Vessel variables computer set point Figure 3 1 Set up for system identification experiments are rea
57. without Pad approximation Desired heading Controller Reference model Figure 8 29 Placement of the transfer function during root locus tuning 94 Chapter 8 Design in Simulink Figure 8 30 Pole Zero plot and step response of the original Ziegler Nichols parameter 95 Chapter 8 Design in Simulink Figure 8 31 Pole Zero plot and step response of the open loop with increased gains 96 Chapter 8 Design in Simulink With this model a step response without overshoot was obtained see Figure 8 32 but on implementation in the simulations the output of the controller was saturated and the system turned unstable as shown in Figure 8 33 Root locus tuning in discrete time was also performed but still it was not possible to remove the large overtshoot Step Response T 0 8r Amplitude 0 6 04r 02r 0 5 10 15 20 25 30 Time sec Figure 8 32 Step on a model with no time delay with root locus tuned parameters Kp 0 5334 Ti 2 1 Td 0 96 From Figure 8 32 8 33 and the tuning in the root locus tool of MATLAB it was decided to implement proportional set point weighting to remove overshoot Unfortu nately proportional set point weighting can not be tuned in the root locus application in MATLAB This is due to the fact that the proportional set point weighting is a kind of feed forward term and that the sisotool does not allow us to split the controller in two blocks T he con
58. 0 0 01898q 0 016594 _ amp k 1 2 771g 1 3 0099 1 5399 3 0 311794 9 2 Here r k is the ROT and K is the rudder angle at sample k 12 knots model which yields a fit of 82 r k 0 0233 0 0875q 1 0 2585q 0 17524 6 3 k 1 2 613q 2 732q 1 391973 0 2914q 4 20 knots which yields a fit of 89 696 r k 0 03435 0 112401 0 3695q 0 21319 6 4 k 1 2 328q 1 2 413q 1 354q 3 0 3388q 4 54 Chapter 6 Conclusion The complete system from desired rudder angle to heading yields the following z transform to be used in simulations wk 0 1562 0 03435 0 112427 0 36952 0 213127 2K xTs ref k 1 0 8447z 1 1 2 32827 2 413272 1 354273 0 338824 z 1 6 5 Here Eos is the discrete integrator from ROT to heading 55 Part III Control Design Chapter 7 Theory The following chapter will give an introduction to control theory and explain the Proportional Integral Derivative PID controller with its extensions This is done to give the neces sary overview in addition to explaining the more advanced concepts used in the design and implementation later on in this report Control systems are in general designed to make dynamic systems behave in a desired manner There are two main types of control systems feed forward controllers and feedback controllers Another name is respectively open loop controll
59. 0 B 3 Shifted ROT vs ROT derived from the heading at 5 knots 150 B 4 Input output sequence at 12 knots 151 B 5 Measured ROT vs ROT derived from the heading at 12 knots 152 B 6 Shifted ROT vs ROT derived from the heading at 12 knots 152 B 7 Input output sequence at 12 knots 153 B 8 Measured ROT vs ROT derived from the heading at 20 knots 154 B 9 Shifted ROT vs ROT derived from the heading at 20 knots 154 C 1 Input output data 5 knots Rudder pump experiments 155 C 2 Model output 5 knots Rudder pump experiments 156 C 3 Frequency response 5 knots Rudder pump experiments 156 C 4 Step response 5 knots Rudder pump experiments 157 C 5 Residuals 5 knots Rudder pump experiments 157 C 6 Bode plot 5 knots Rudder pump experiments 158 C 7 Pole Zero plot 5 knots Rudder pump experiments 158 C 8 Input output data 12 knots Rudder pump experiments 159 C 9 Model output 12 knots Rudder pump experiments 160 C 10 Frequency response 12 knots Rudder pump experiments 160 C 11 Step response 12 knots Rudder pump experiments 161 C 12 Residuals 12 knots Rudder pump experiments 161 C 13 Bode plot 12 knots Rudder pump experiments 162 C 14 Pole Zero plot 12 knots Rudder pump experiments
60. 1 8 12 8 13 8 14 90 phase lead of the derivative action 00000008 61 Bode plot of the unlimited and limited derivative action 62 The usefulness of set point weighting str m and H gglund 1996b 63 A PID controller with tracking antiwindup str m and Wittenmark A DEUM TP vr 64 Effects of a PID controller with and without antiwindup str m and Wittemnark L997 2 A AAA a eae 64 A system switching from manual to automatic mode without bumpless transfer Graebe and Ahl n 1996 llle 65 PID controller with bumpless switching between manual and automatic mode str m and Wittenmark 1997 00005 66 Mapping of the stability region in the s plane to the z plane Astr m and Wittenmark 1997 ii SA Seat eS BARES OS 67 Slope R and deadtime Lg of the Ziegler Nichols step response method 70 Nyquist curve and the Ziegler Nichols ultimate sensitivity method 71 Ultimate gain K and period Ti of the Ziegler Nichols ultimate sensitivity nudo M I rU T1 Determination of Tzu A he eS Suec ht 73 Line Of Sight Navigation 2 74 Desired rudder angle to heading simulation 76 Heading response for 5 12 and 20 knot models with a rudder angle of 25 76 Plot for finding D 2x ecc be ee dox o REOR RE 77 Step response for the reference model filter 77 Model response at 5 12 and 20 knots to a step in rudder angle of 25 degrees 78 F
61. 4 System Identification Measured and simulated model output at 5 knots 10 i mE 10th order ARX model FIT 73 296 BS Statespace model FIT 70 4 Measured ROT eats _L7774th order ARX model FIT 68 9 Li AM yt f H oa fw A ad d T A af un u P A Pd aa fi 7 i i 1 R 5 un 1 ji VIA wit 2 th i i f i 4 i itd T E Or T 7 9 1 a i T 2r i Wi 7 y H Fl MEE 1 i T 3 H EOM SN ala 6r n f AY i a g 4 4 1 1 fi i fi fi 950 500 550 600 650 700 750 800 Time s Figure 4 16 Model outputs at 5 knots order ARX are similar with the 10 order residuals being slightly smaller than the 4 order ARX model As the fourth order ARX models have a simple structure and are found to perform almost as well as higher order models and more complicated models they are chosen as the preferred models In this section it is seen that fit of the three models presented differ by 4 3 this is not a significant difference This information combined with information from the residuals indicate that one of the ARX models should be chosen The 4 order model is chosen due to its simplicity and because this results in the same model structure for the models at 5 12 and 20 knots The details for the 4 order model is presented below 4 2 3 Best model at 5 knots The ARX model with time delay is given as r k _ 0 04955 0 04301q 0 01898q 0 01659q 4 7
62. 5 T T T r 1 sain 4th order ARX model FIT 89 9 Measured ROT 10 I 4 5 Ka 0 7 o o 5 10 4A l fi l 1 d5o 500 550 600 650 700 750 Time s Figure 4 28 4 order ARX model output vs measured ROT at 20 knots 4 Pole Zero Map l o 2 A 1 J x E x go e x Eat 2L J o 3 1 1 1 1 1 0 5 0 0 5 1 is Real Axis Figure 4 29 Poles and zeros of the 4 order ARX model at 20 knots 49 Chapter 4 System Identification Bode Diagram Gm 0 873 dB at 0 46 Hz Pm 56 4 deg at 0 305 Hz Magnitude dB 3 o N o T Cut off frequency at 0 71 Hz Qu ox co 180 Phase deg 180 M A gos goa esu ur 10 10 Frequency Hz 10 11111 PE E a acad 10 Figure 4 30 Bode plot of the 4 order ARX model at 20 knots 50 Chapter 5 Discussion To simplify the reading of the report this part will end with a discussion of the modelling and the results obtained The discussion is presented below while the conclusion of the modelling process is presented in the next chapter During the experiment design in Chapter 3 it was found that we should be able to identify models with a bandwidth up to 0 3 Hz The analysis of Chapter 4 resulted with a bandwidth of the 5 and 12 knots which are less than 0 15 Hz while the bandwidth of the 20 knots model was found be 0 71 Hz This indicates that the input signal and the sampling frequency
63. Elbit Systems 2006 and Aeronautics Defense Systems 2006 as well as rescue vessels International Submarine Engineering 2006 and research projects on planning vessel dynamics Ueno et al 2006 At present time there are several commercial autopilots on the market from different producers Commercial auto pilots are usually delivered with limited information about the internal aspects of the controllers as this is considered to be business sensitive infor mation It is important for Maritime Robotics AS to have full access to the details of the autopilot system as this is one of the foundation of the vessel control system Therefore development of their own system is needed Problem specification The work in this project thesis have two purposes The first is aimed at developing and implementing a heading autopilot for a particular test vessel This autopilot should be capable of controlling the heading over the whole range of operating speeds for the vessel that is from 0 to 20 knots The heading autopilot should be easy to tune and have a small overshoot no more than 3 in calm water The autopilot should not experience oscillatory behaviour Gain scheduling will be implemented so that the controller can operate at different speed regimes despite the changing dynamic of the vessel As an addition to the heading autopilot a way point guidance system will be added when the implementation of the heading autopilot is finished The s
64. Gui fig System identification analysis Sessions 174 Chapter D Table of Contents CD e sysID PRBS5kts sid e sysID_PRBS12kts sid e sysID PRBS20kts sid 175 References Aeronautics Defense Systems 2006 Protector USV http www israeli weapons com weapons naval protector Protector html str m K J H gglund T 1996a Automatic tuning of pid controllers In The Control Handbook CRC press pp 817 826 Astrom K J Hagglund T 1996b Pid control In The Control Handbook CRC press pp 198 209 str m K J H gglund T 2006 Advanced PID Control ISA Instrumentation Systems and Automation Society str m K J Wittenmark B 1997 Computer Controlled Systems Theory and Design Third edition New Jersey Prentice Hall Balchen J G Andresen T Foss B A 2003 Reguleringsteknikk Department of Engineering Cybernetics NTNU Beinset G Blomhoff J December 2006 Modelling and identification of a small fast monohull vessel for the development of an unmanned surface vessel USV Tech rep NTNU Daga L 2007 Rt blockset http digilander libero it LeoDaga Simulink RTBlockset htm Ebken J Bruch M Lum J March 2005 Applying UGV technologies to unmanned surface vessel s Tech rep Unmanned Ground Vehicle Technology VII Orlando FL Elbit Systems 2006 Stingray USV http www defense update com products s stingray htm Fossen T I 2002 Marine Contro
65. LU M og po 1 M EM i 1 i M UR CR y t TEN Lift 1 H Ve a E i 1 Halt I i TET y o E 5 I l I MEI h N e IEEE Ug A LY Lo Jur qu H 1 I SO n I n Io Wi Mi i p 11 og pov h I NE A TUN EE FN Wy y i i i i 1 og i ly wy f Wi i f un i i 1 W 1 AM n W Ir xy M y ums Ww l i 15 L 1 1 1 1 1 1 100 120 140 160 180 200 220 240 260 Time s Figure B 5 Measured ROT vs ROT derived from the heading at 12 knots Measured ROT shifted 142 samples vs ROT derived from the heading at 12 knots 15 T T T T T T T Measured ROT ROT derived from the heading 10r i m 1 1 ys ah i n TAA i Lu 1 h 5 E 4 7 E OF O a 5 Ll j 1 Md Im i Ay d Wai mm il nnn i y 1o pn i Y M i T i a 4 1 i 1 1 1 L l 00 120 140 160 180 200 220 240 260 Time s Figure B 6 Shifted ROT vs ROT derived from the heading at 12 knots 152 Chapter B Measurement pre treatment plot B 3 20 knots Input and output signals at 20 knots 15 T T T T T T T 1 L 1 100 200 300 400 500 600 700 800 Validation data Calculation data 10 T T T T T L I 1 i Ui 0 100 200 300 400 500 600 700 800 Time s Figure B 7 Input output sequence at 12 knots 153 Chapter B Measurement pre treatment plot Measured ROT vs ROT derived from the heading at 20 knots Measured ROT
66. O ref en gt an Voltage e Gain Saturation Dead zone Figure 9 7 Actuator control loop with P controller It can be seen from Figure 9 7 that the controller also includes a saturation element and a dead zone element The saturation element is introduced to reflect the physical limitation in rudder angle The pump needs a certain minimum voltage to operate the minimum voltage is 0 5 V To avoid setting a voltage which does not produce any work but can cause wear and tear a dead zone between 0 5 V and 0 5 V was introduced The steering hydraulic model suggest that it is a simple system and the proportional controller to be implemented is also easy to tune Therefore it was decided to do the tuning of this controller on board the vessel using the methods of Ziegler Nichols For details on the methods of Ziegler Nichols please consult Section 7 1 8 The step response of the pump actuator system was found by setting a step of 12 V on the rudder pump and recording the rudder angle The response can be seen in Figure 9 8 where the dead time L and the slope R is indicated The gain for the P controller is found in Table 7 3 The gain found for the proportional controller is K 4 2 Using the Ziegler Nichols gain resulted in an overshoot which is a normal effect of tuning with these rules The gain was decreased to reduce the overshoot The response of the closed loop system with the controller and the steering hydraulics
67. PID controller consists of a proportional part an integral part and a derivative part These different components each provides important features and we will in the rest of this chapter have a detailed look at them and their posssible extensions The following equation u t up t ur t up t 7 1 and Figure 7 2 presents one configuration of the PID controller the parallel repersenta tion and it clearly shows the three different parts of the system Here u t is the control output up t the propartional part ur t the integral part up t the derivative part and e t the error e t yref t y t P Proportional control Integral control D Derivative control Figure 7 2 Parallel representation of the PID controller 58 Chapter 7 Theory 7 1 1 Proportional Control The proportional control is a simple feedback given as up t Ke t 7 2 where e t yreg t y t 7 3 Here K is a proportional gain and e t is the error which is defined to be the difference between the desired reference value yre f t and the measured output value y t The toilet bowl floating proportioning valve is an example of a pure proportional controller As the water in the tank rise the floating element also rise and gradually close the valve filling up the tank A problem with the proportional controller is that it tends to have a steady state error This steady state error appears because when
68. UI and is found in Appendix A 8 The Simulink model is also opened by the last mentioned m script B Automatic mode Ae Start Stop panel c Desired heading deg Heading set point 0 Start D Automatic Manual selector E Manual On Off F Manual mode Wawypoint Headind Desired rudder angle deg Rudder set point 0 i Automatic Waypoint EE i K J Figure 9 17 Graphical User Interface GUI for the autopilot The program initializes and sets the correct values for heading speed and position when Start button is pushed By using these initial settings both the stateflow scheme of the gain scheduling and the memory element of the continuous measurement block will work correctly When presented the GUI gives you the choice of starting using manual or automatic mode This is done by pushing the Manual On Off button indicated by an E in Figure 9 17 A button marked Waypoint Heading indicated by F allows you to choose between the waypoint autopilot and the heading autopilot The current state is shown by the panels Manual Automatic Waypoint and Automatic Heading indicated by G H and T respectively Now the autopilot can be started by pushing the Start button indicated by a C which turns green when the model starts If the autopilot is in automatic waypoint mode the programs reads a vector of coordinates and moves the vessel through thi
69. V at a sufficiently high current The AX1500 I O card from RoboteQ Inc 2005 passed all requirements and it was decided to use this card in the implementation Figure 9 6 shows a picture of the analog out card taken while the interface to MATLAB Simulink was tested The AX1500 card communicates via a RS232 serial cable and the voltage at its output ports can be set by an text string containing a hexadecimal set point Moreover the card has two different channels but we will only use one channel at the moment Syntax for controlling the card is IMnn where Channel 1 negative polarity Channel 1 positive polarity Channel 2 negative polarity Channel 2 positive polarity Determines the voltage value in 2 Hexadecimal digits from 00 to 7F where 00 is 096 and 7F is 10096 ERARAS Il TW gt Table 9 1 Syntax for setting channel 1 and 2 of the AX1500 I O card The voltage out is as mentioned set in the range 00 to 7F This corresponds to a 7 bit command giving the values 0 127 in addition to the first bit which sets the direction We use a 12 V source and therefore have the possibility to output 12 V with the smallest step of Ax 0 0945V If a larger than 7F hexadecimal value is sent to the AX1500 125 Chapter 9 Implementation Figure 9 6 AX1500 I O card from RoboteQ it only outputs 0 V such that the pump is protected against voltage higher than the 12 V it is made for The serial co
70. a hs SIDA ERR demie ER ea aa ia C Analysis plots C 1 5 knots Rudder pump experiments C 2 12 knots Rudder pump experiments C 3 20 knots Rudder pump experiments C 4 Ziegler Nichols step response analysis C 5 Ziegler Nichols ultimate sensitivity analysis C 6 Ziegler Nichols step response vs ultimate sensitivity analysis D Table of Contents CD 142 142 142 142 143 143 144 144 145 145 145 147 148 148 149 149 151 153 155 155 159 163 167 170 172 174 List of Figures 1 1 1 2 1 3 1 4 1 5 1 6 1 7 2 1 2 2 2 3 3 1 3 2 3 3 3 4 3 5 4 1 4 2 4 3 4 4 4 5 4 6 Work flow from problem specification to implementation 3 Kaasbgll 19 feet centre console boat Kaasbell Boats AS 5 Outboard engine Evinrude 50 E tec Kaasbell Boats AS 7 Measurment Segur 8 Seapath 20 DGPS sensor www km kongsberg com 9 Hydraulic steering system www simradyachting com 10 CAD drawing of the boat with CG sideview 11 CAD drawing of the boat with CG overview 12 Traditional vs rapid prototyping design of a controller 14 The flow of a rapid prototyping process 00200008 16 Structure of our rapid prototyping environment 17 Set up for system identification experiments 0 20 LabView application interface
71. alculation time with 25 ms fundamental sampling time 121 Calculation time with 50 ms fundamental sampling time 121 Sampling time in the MATLAB Simulink model 0 05ms red 0 25ms green const nt magnet sb 296 lasses Sy ele we Sie Bie aa SG whe Ge de eU 122 The two different fundamental sampling times with a calculation time of SOMS ihe gig Bait eed A PS eee Be we eee kee eee 122 AX1500 I O card from RoboteQ 126 Actuator control loop with P controller 127 Step response for a step from 10 5 to 10 o o 128 Step response for a step from 10 5 to 10 o 128 Implemented heading controller behaviour at 5 knots 130 Implemented heading controller behaviour at 12 knots 130 Implemented heading controller behaviour at 20 knots 131 Gain scheduling with constant desired heading 132 Gain scheduling with a step in desired heading 132 Way point navigation around Munkholmen Trondheim 133 Way point navigation with missed waypoint 133 Graphical User Interface GUI for the autopilot 134 11 1 Experiments on a snowy early November morning 14 11 2 uone tiders e fades ea AE EIE neuve xe d 141 B 1 Input output sequence at 5 knots 149 B 2 Measured ROT vs ROT derived from the heading at 5 knots 15
72. an be used for system identification they need to be inspected The data should be checked for high frequency disturbances outliers missing data non continuous data records drift offset and low frequency dis turbances The data is logged to a text file with one line for each sample and a visual inspection of the text file was performed to check for missing data The inspection revealed that there was some missing GPS data namely the course on ground and the speed informa tion ROT and the actual rudder signal did not experience this kind of fall out Only measurement of actual rudder angle and ROT are used for system identification hence the data can still be used for system identification After inspection of the raw text file 34 Chapter 4 System Identification containing the logged data it is imported into Matlab with the script import data m see Appendix A 2 for usage of this script Visual inspection of the ROT reveals that the measured ROT is having a time de lay This was first seen when the rudder angle and the ROT was plotted together see Figure 4 10 Actual rudder angle and measured ROT at 12 knots T T T T T T T I T 10 Actual rudder angle nidi Measured ROT X1413 E xam Es 3 ww Pa JR a A vv ET Pug wA E fi fi l 100 110 120 130 140 150 160 170 180 190 200 Time s Figure 4 10 ROT and actual rudder angle plotted together In Figure 4 10 the
73. angel set point Heading Rate of turn ROT Set heading Heading autopilot ney Ad i Sine Wave Wave Disturbance on offt E L gt Heading20 Speed Speed p Speed measurement gainscheduler Figure 8 50 The complete Simulink model with state machine When building a Stateflow chart the following workflow is proposed 1 Define the interface to Simulink 2 Define the states for modelling the mode of operation 3 Define state actions and variables 4 Define the transitions between states 5 Decide how to trigger the chart 6 Simulate the chart 7 Debug the chart 8 3 1 Interface between Stateflow and Simulink The interface between Stateflow and Simulink is determined by the information from Simulink needed by the Stateflow chart and which outputs Simulink requires from the Stateflow chart Our Stateflow chart is designed to control the parameters of the PID controller as the speed and dynamics of the the vessel changes The Stateflow chart needs to check the speed of the vessel to perform this task This is the only input needed and this input has the following properties The PID controller have four components which needs to be changed as the speed varies These are the gain of the proportional part the integral part and the derivative part In 110 Chapter 8 Design in Simulink Pproperty Value Name Speed Scope Input
74. ansform xviii Introduction Maritime operations have a long and rich history in Norway Traditionally fishery was the driving force With the introduction off shore oil production the vessel demands changed and today the off shore industry is the driving force Increased complexity though environments and expensive operations have lead to an increasing demand for small cost effective autonomous vessels This master thesis is part of a programme conducted by Maritime Robotics AS to develop a rapid prototyping platform for USVs The long term goal of the programme is to develop a fleet of USVss for various operations including formation control These vehicles are envisaged to have significant application in commercial and naval marine operations in the future Areas of interest for naval application includes deployment and pick up of equipment mine sweeping force multiplication surveys and hazardous operations Common is the benefit of removing the human crew and hence reducing human risk Introduction of Unmanned Surface Vehicle USV s also offer lower life cycle costs and scale benefits in scaling low cost USV systems For commercial use some areas of interest are deployment and pick up of equipment rescue operation surveys inspection of offshore installations and seismic surveys Formation control can reduce the time needed to perform search and survey operations Earlier work in the field of USVss includes the American and Israeli navy
75. arallel with the Five Twelve and Twenty states sub states of State selector Table 8 9 State hierarchy The resulting Stateflow chart diagram can be seen in Figure 8 51 8 3 3 State actions and variables The gain parameters of the PID controller is determined by the speed of the vessel and whether the speed is decreasing or increasing The threshold values needs to be defined 113 Chapter 8 Design in Simulink z Model state N Five Twenty entry an 24 entry E entry TE an 2 setparam 12 setparam 20 eM ron Up_th 100 setparam values NUUS E Down th 7 5 gt Down th 15 param j 7 State selector Speed Up th Speed lt Down th Up Down Speed gt D th opera Down thi Speed lt Up_th Figure 8 51 State machine for the gain scheduling algoritm 114 Chapter 8 Design in Simulink as local variables in our Stateflow chart as they are the variables determining whether one should change the sub state in Model state These variables are defined as e Down th e Up th Doun th and Up th depends on which state the system is in therefore the sub states of Model state needs to update these variables as they become active This is referred to as an state action State actions can be performed on entry during or when exiting the state Since all parameters are to be constant during execution of a state in our system only entry actions
76. are plotted in Figure 9 9 It can be seen that there is a small overshoot and a small steady state deviation The steady state deviation is caused by the non linearities that is introduced by the dead zone in the pump The overshoot is approximately 0 6 and the steady state 127 Chapter 9 Implementation Rudder angle 20 T T T T E 10r pu 4 2 eae Sloper s OF TT 5 71 deg s 4 3 Dead time S 10 05s J a L L L L L 20 2 3 6 7 8 Time s Rudder angle set point T T T T T pe gia eee AS A cce 10 4 i o 1 2 5 4 a e gr 4 L L L 1 L 1 1 2 3 5 6 7 8 Time s Figure 9 8 Step response for a step from 10 5 to 10 deviation approximately 0 2 These deviations are so small that they are ignored as the heading error effect of these deviations will be eliminated by the PID controller which controls the heading The dip effect which can be observed in Figure 9 9 is believed to be measurement noise as we observed the movement of the engine during the step response and the motion was smooth Step response for pump controller with a step in rudder angle at t 0 T T T I Step response Set point 10r 5 4 2 o c o 0p 4 S v 3 a BL al 10 E L 1 1 1 0 2 4 6 8 10 12 Time s Figure 9 9 Step response for a step from 10 5 to 10 128 Chapter 9 Implementation 9 3 Navigation System and Heading Controller In
77. are used to minimize the need for computer power Our Stateflow chart have three entry actions e setparam values e Up th new threshold e Down_th new threshold setparam values calls the embedded function which updates the parameters of the PID controller The Up_th and Down th action sets the new threshold which is used in State selector to control which state that should be active in Model state The PID gains are filtered trough a second order filter to obtain a smooth transition when switching gains to avoid large steps in the PID controller which might make the system unstable When designing this filter it was decided that the transition between the gains of two different models should be completed before the vessel can go to a higher speed model That is the gain transition from 5 knots parameters to 12 knots parameters should be complete when the transition from 12 to 20 knots occurs Experience from the vessel indicates that advancing from 12 to 20 knots at full throttle takes 5 to 10 s Based on this it was decided that the step response of the filter should obtain more than 95 of its final value within 4 s A second order filter was chosen as they have a lower gradient compared to first order filters see Figure 8 52 The second order filter have the following structure Param_new 1 8 17 Param old 1 Ts EO T was found using the method explained in Section 7 2 please see this section for de tails on how to pe
78. ased clock period The new input was updated with a frequency of 0 33 Hz and the sequence length was 255 The length of 255 was chosen to get a full sequence the next full PRBS sequence has a length of 511 which is to long at 20 knots It will take approximately 13 min to complete a sequence with 255 values At 20 knots this corresponds to a maximum travelled distance of approximately 8 km This signal will be persistently exciting of order M 1 254 Ljung 1999 Page 421 A possible threat to the experiment is other vessels which might lead to an aborted experiment to avoid a possible collision The first half of the resulting data is to be used for model calculation while the second half is to be used for validation From Figure 3 5 it can be seen how the increased clock period changes the spectrum compare Figure 3 5 to Figure 3 4 40 T Power Spectral Density Estimate via Periodogram and Welch T T T T PSD via periodogram PSD via Welch e o T A M o o o o T T T i i L Power frequency dB Hz N o T e o T L IN t T i a o o 0 8 1 Frequency Hz Figure 3 5 Frequency content of a PRBS input sequence updated at 0 33 Hz This effect is described in Ljung 1999 on page 422 Ljung 1999 suggest sampling the system about 10 times faster than the bandwidth of the system to be modelled With a sampling time of 4 Hz it implies that we should have
79. cation of the 5 and 12 knots models follow the same procedure as given above and detailed plots can be found in Appendix C Equations for the models are given as k 0 1485 a 108530711 5 knots model 4 3 AD ERN 12 knots model 4 4 Both of these models are stable In addition we can see that the models performs very similar as seen in Figure 4 8 This leads us to conclude that the rudder pump system 31 Chapter 4 System Identification Pole Zero Map Imaginary Axis o T X 1 0 5 Real Axis 0 5 Figure 4 6 Pole zero plot of the rudder pump model at 20 knots Magnitude dB Phase deg Bode Diagram Gm 16 1 dB at 0 722 Hz Pm 172 deg at 0 0115 Hz Commanded rudder to actual rudder angle 5 T T BL Cut off frequency 7 0 11Hz Ns T 315 360 f p ie gea Figure 4 7 Bode plot of the rudder pump model at 20 knots 32 10 10 Frequency Hz 10 Chapter 4 System Identification is more or less independent of the velocity of the boat From the same figure we see that the 20 knots model performs best on the 20 knots data This is also the case for 12 and 5 knots data We therefore conclude that the 20 knots model should be used on all velocities since it gives the best performance Finally it should be noted that this model includes a closed loop controller in addition to the hydraulic system The closed loop controller is a rate limited p
80. d LF3000 provides us with rudder angle measurements The laptop is used to give desired control input to the actuator and to run the control algorithms A schematic of the measurement setup is given in Figure 1 3 1 3 1 DGPS Compass Seatex Seapath 20 The vessel is equipped with a Seatex Seapath 20 GPS Compass Figure 1 4 which give heading position velocity and rate of turn Further the sensor is fitted with an Inter national Association of Marine Aids to Navigation and Lighthouse Authorities IALA beacon receiver to ensure improved position accuracy with DGPS signals As shown in Figure 1 4 the Seapath provides RS232 interface to communicate NMEA0183 messages with the laptop Both the Global Positioning System GPS signals and data from the gyrocompass is used to calculate heading This combination provides the heading even when there is no GPS coverage In addition we obtain a more accurate heading during and after turns GPS measurements can be taken at a maximum frequency of 1 Hz For The RS232 interface is a standard for serial binary data interconnection between a DTE Data terminal equipment and a DCE Data Circuit terminating Equipment NMEA 0183 protocol is combined electrical and data protocol for communication between marine electronics It is defined and controlled by National Marine Electronics Association NMEA Chapter 1 Vessel and Equipment Configuration LF 3000 Rudder feedback sensor RPU8O Rudde
81. d from a file by Labview and imposed as input to the system using the zero order hold principle between the updates The maximum sampling frequency with the current hardware was found to be 4 Hz during previous experiments At higher sampling frequencies the hardware is having problems providing reliable data as the temperature drops below 0 With a sampling frequency of 4 Hz the Nyquist frequency becomes 2 Hz see for example str m and Wittenmark 1997 for more information on the Nyquist frequency It is worth noting that the vessel and steering dynamics of the vessel will act as a low pass filter and a Nyquist frequency of 2 Hz should be enough to capture the most essential dynamics of the vessel Jo NaN Figure 3 2 LabView application interface 20 Chapter 3 Experiments 3 2 Binary Rudder Manoeuvre The Binary Rudder Manoeuvre consists of using a Pseudo Random Binary Signal PRBS as set point for the rudder angle of the vessel and then logging the Rate Of Turn ROT and the input signal This input output relationship is used to identify the dynamics between the input and the output as explained in detail in Chapter 4 The input signal and its properties are important when performing experiments to do system identifica tion In the next section we will elaborate the properties of the Pseudo Random Binary Signal PRBS 3 2 1 Pseudo Random Binary Signal properties This section describes the properties of a PRBS and
82. d tuning of the controllers still needs improvements But we have even before the Master thesis is delivered received indications that Maritime Robotics will use our design during further work and implement it on other vessels Preface This report is written as a part of the master thesis during the 10 semester at the Norwegian University of Science and Technology department of Engineering Cybernet ics This master thesis is a continuation of our project work in the 9 semester The work was proposed by Maritime Robotics AS as a support to their development of an unmanned surface vehicle It has been a a challenging and interesting project where we have gained valuable insight into system identification and project work We have been two students working on this task and the cooperation has worked surprisingly well Both fruitful discussions and constructive critics have resulted in the report you now hold in your hands We would also like to thank both Tristan Perez at the Centre for Ships and Ocean Structures at NTNU and Amund Skavhaug at the department of Engineeing Cybernetics for valuable professional guidance and constructive suggestions Moreover we would like to thank Maritime Robotics AS for allowing us to work on their project and trusting us with their valuable vessel and equipment Contents II Background 4 Vessel and Equipment Configuration 5 11 The Vessel Kaasbgll 19 aaa 5 1 2 The Outboard Engine Evinrude
83. del 4 order ARX model and a state space model Figure 4 21 shows the performance of the different initial models 42 Chapter 4 System Identification Phase deg Magnitude dB Bode Diagram Gm 9 09 dB at 0 395 Hz Pm Inf From u1 To y1 Ip T T AT oT o T N o T a T Cut off frequency 0 075 Hz 1 a oo oe eee ae 1 AA ee eee ee S 49 45l 90 135 180 225 270 315 360 405 RC 10 107 10 Frequency Hz Figure 4 20 Bode plot for the 4th order ARX model at 5 knots Measured and simulated model output at 12 knots ROT s o T 15 Hee 10th order ARX model FIT 82 296 State space model FIT 85 6 Measured ROT 4th order ARX model FIT 82 7 Ma MAT nim 1 400 L 450 l 1 L 500 550 600 650 700 Time s Figure 4 21 Bode plot for the 4th order ARX model at 5 knots 43 Chapter 4 System Identification The initial analysis gave a fit of 85 6 for the State Space model while the ARX model obtained a fit of 82 Figure 4 21 also displays the performance of an 10 order ARX model which was calculated to see how much it was possible to improve the model The improvement compared to the 4 order model is very small Figure 4 22 shows the residuals of the three models and these residuals are fairly similar and does not provide information to discriminate between the models
84. derangle Setpoint 10 T T T T T 5 3 8r jeer pala ea een Aa AS E 8 9r v l d el 4 cz I s I a E l x o i 1 1 1 1 0 5 10 15 20 25 30 Time s Figure C 22 Slope R and deadtime Lg of the Ziegler Nichols step response method at 5 knots 167 Chapter C Analysis plots Heading 200 T T T Slope 7 9432 deg s Deadtime 2 8917 s Heading deg 3 o T 50 0 1 1 1 0 5 10 15 20 25 30 Time s Rudderangle Setpoint 10 T T T T T 5 3 8r ee E eee ee eee ee ee E 8 6 3 D abl 4 1 c s I gar 1 3 a 0 haa j a 1 1 1 0 5 10 15 20 25 30 Time s Figure C 23 Slope R and deadtime Lg of the Ziegler Nichols step response method at 12 knots 168 Chapter C Analysis plots Heading 200 T T T Slope 9 032 deg s Deadtime 2 8171 s Heading deg 3 o T 50 0 1 1 1 1 0 5 10 15 20 25 30 Time s Rudderangle Setpoint 10 T T T T T 5 3 8r Coduxss M CM A CC E E ie D l abl 4 J c S iv 1 3 a 0 La j a 1 1 1 0 5 10 15 20 25 30 Time s Figure C 24 Slope R and deadtime Lg of the Ziegler Nichols step response method at 20 knots 169 Chapter C Analysis plots C 5 Ziegler Nichols ultimate sensitivity analysis 200 USVsimulation5 knots Heading deg 3 o T bw yl S N as N aA A 50r 4 Ultimate period 15 s Ult
85. e environment like MATLABs Real Time Workshop Unfortunately we did not have the time to do this in the master thesis The heading controller which were designed in Simulink was successfully implemented in the vessel However as this was the first implementation there are several issues which should be addressed The initialisation of our controller is not done properly therefore the vessel uses some time in the beginning to find the right heading The source of this initialisation problem has been identified as the reference model l here was not enough time to implement this initialisation in the vessel but this should be a fairly simple task and it would improve the performance of the controller The reference model also have another weakness In the present solution one reference model is used at all speeds even though the dynamics are changing The reference model should be a function of the speed so that it reflects these changes This could be done using gain scheduling for the reference model The controller was tuned in Simulink using both root locus and Ziegler Nichols It was difficult to tune the controller and we were not able to remove overshoot using root locus or Ziegler Nichols T he solution was to introduce proportional set point weighting and the overshoot was successfully removed using this method Set point weighting does not influence on the stability of the system as it only changes the zeros of the closed loop system
86. e atan2 function from 77 to 0 360 as mentioned in Section 7 4 117 Chapter 8 Design in Simulink E meas CT wa ypoint_stun Figure 8 53 Way Point Navigation block in Simulink 118 Chapter 9 Implementation This chapter will focus on implementing the controller designed and tuned in Chapter 8 Furthermore a simple controller will be designed and implemented to set the correct rudder angle This controller was not designed in Simulink since we did not have access to the new hardware to control the rudder before the implementation During the simulations a Simrad rudder controller was used and approximated with a first order model as explained in Section 4 1 and Chapter 8 In addition we will start this chapter by giving an overview of the communication between the controller and the measurement equipment and how the sampling rates coincide 9 1 Communication hardware and Real Time Constraints The communication used during our Simulink simulations were just internal in the Simulink model Now when we implement the controller this communication needs to be performed via serial cables to the actuator and the measurement equipment Communi cation are now performed by MATLAB S functions and the built in MATLAB functions for serial communication For the implementation the Simulink model will therefore be as shown in Figure 9 1 9 1 1 Sampling times Since our simulations are performed in almost real time w
87. e been developed in the rapid prototyping environment The methodology developed and the experience gained are valuable for later use either when designing new controllers for the vessel identified in this master thesis or in other vessels The methodology and experience gained has been transferred to Maritime Robotics and they are currently ready to test our methodology on a larger vessel Managing a project from problem specification to implementation and testing have been very rewarding for us personally Facing challenges overcoming them getting things done and practical engineering work has left us with a priceless experience 140 Epilogue Doing experiments outdoor during the winter in Trondheim is not only fun but that is compensated during the summer Figure 11 1 Experiments on a snowy early November morning Figure 11 2 Lone rider 141 c o JO Oc RB uN O o naw PR wow M n2 Appendix A MATLAB Code A 1 PRBS spectrum m PRBS spectrum m Usage run PRBS spectrum m Calculates the spectrum of the PRBS signal used in the System ID The spectrum is first calculated using the Fast Fourier Transform finally it is calculated using Welch and Periodogram The user is given the choise of resampling the signal from 1 Hz to 12 Hz This is the same as having a signal that is constant for 3 second and sampled at 4 Hz Resampling changes the spectrum of the signal o o o oe o A oe oe A 2 import da
88. e master thesis and proposals for further work is given in Chapter 11 Figure 1 presents the work flow in our master thesis The initial step is to state the problem specification before the modelling is commenced Modelling starts by specifying and running identification experiments The results of the experiments are investigated to see if they provide enough information for the system identification procedure If they do not provide enough information they either have to be repeated or re designed Based on the final experiment data system identification is performed and the resulting system is analysed to find its performance and limitations The identified system is later used to build a simulator in Simulink Then the controller is designed and tested in the simulator before it is implemented and tested in the vessel If necessary the controller will be tuned after implementation Problem specification Modelling Experiments Testing Validation Analysis of performance and limitations Controller design and implementation Design Testing teo Implemetation Final testing Figure 1 Work flow from problem specification to implementation Part I Background Chapter 1 Vessel and Equipment Configuration 1 1 The Vessel Kaasboll 19 The test boat Kaasbgll 19 Figure 1 1 is a 19 feet planning centre console boat from a local manufacturer close t
89. e same time There are several different solutions when it comes to modelling the behaviour of our state machine we have chosen to represent each of the three dynamical regions as a state and governing the transitions between these states by using a parallel state This solution is based on the analysis performed below 111 Chapter 8 Design in Simulink Operating mode Description Dependencies Five knots model Twelve knots model Twenty knots model Keep PID para meters constant Change to a model at higher speed Change to a model at lower speed 5 knots PID parameters are valid Constant PID parameters 5 knots PID parameters are valid Constant PID parameters 5 knots PID parameters are valid Constant PID parameters Vessel speed corresponds to the PID parameters currently active The speed has increased and it is necessary to change the PID parameters The speed has decreased and it is necessary to change the PID parameters Only one speed model can be active at any time Only one speed model can be active at any time Only one speed model can be active at any time Runs in parallel with the speed model only one active control states at any time Runs in parallel with the speed model only one active control states at any time Runs in parallel with the speed model only one active control states at any time Table 8 7 Operating modes 112 Chapter 8 Design in Simul
90. ead Derivative action can therefore be seen as a prediction A Proportional Derivative PD controller can be presented as u t up t up t 7 11 de t dt TS Ww I K e t Ta 7 12 Equation 7 12 shows that derivative control is actually a Ty time units linear look ahead predictor for the error e t Figure 7 4 gives a informative visual interpretation of the derivative action e t 0 1 2 3 Figure 7 4 Derivative action interpreted as prediction Astr m and H gglund 1996b Because of its phase lead of 90 as shown in Figure 7 5 derivative control is often used to increase the gain or gain margin of the proportional control However caution must 60 Chapter 7 Theory be taken when using derivative action on systems with have piecewise constant set point or significant measurement noise The derivative part of the controller will then give infinite output according to the following equations de t dYre y t dy t up t KT KT 7 13 p t 4 gt Cm a Mey 35 Bode Disgrem 30 3 25 4 8 20 i 4 FECI 4 S 0r 7 5L 4 oL 4 188 135 J 90 i 45 4 do i i i ET 10 Frequency Hz Figure 7 5 90 phase lead of the derivative action Limited derivative action To counteract this effect the derivative gain is often limited by filtering it through a low pass filter In practice this means it is only limited to a gain of N at high frequencies N
91. econd objective of this thesis is to develop a rapid prototyping environment for development of USV control systems at Maritime Robotics This rapid prototyping environment includes modelling of the vessel and building a vessel simulator in MAT LAB Simulink where new controllers can be developed and tuned before they are imple mented in the USVs This will ease the development of new controllers in projects with other vessels The heading controller and way point guidance system will be developed in this rapid prototyping environment to gain experience and improve the environment Implementation and validation will be done in the test vessel Outline of the report The rest of this report is structured as follows Part 1 presents necessary background information Vessel and equipment configuration is presented in Chapter 1 and some basic background information on Rapid Prototyping is given in Chapter 2 Part 2 con sists of the modelling where experiment setup is presented in Chapter 3 and system identification is performed in Chapter 4 The control design and implementation is pre sented in Part 3 Necessary background on control theory is provided in Chapter 7 while Chapter 8 presents the controller design in Simulink and finally the implementation is described in Chapter 9 The results of the previous chapters are discussed in Chapter 10 after the discussion a proposal for further work is given based on the discussion Finally the conclusion of th
92. ed the bilinear method Their approximations are given as t ae as T1o t Za X 2 Forward difference 7 20 dx t EU N Sa Es EX Backward difference 7 21 dt qh zh dx t 2q 1 t Zs 22 di Tustin t 7 22 4a Rat herr stin s approximation 7 22 Here q is the shift operator defined as qx t x t h and h is the sampling period Z defines the Z transform as given in Proakis and Manolakis 1996 A mapping of the stability region in the s plane to the z plane for the three approximations are given in 66 Chapter 7 Theory Figure 7 12 With the forward difference it is then possible to map a stable continuous time system to an unstable discrete time system For the backward difference method on the other hand every mapping of a stable continuous time system will also give a stable discrete time system Tustin s approximation has the advantage that it maps a stable continuous time system exactly onto the unit disc but often also gives a more complex expression Care must therefore be taken when choosing the correct method for discretisation Forward differences Backward differences Tustin Figure 7 12 Mapping of the stability region in the s plane to the z plane Astr m and Wittenmark 1997 The proportional part of the controller can easily be discretised by replacing the continuous variables with the sampled ones as given by up t K byeeg t y t up kh K byreg eh y kh 7 23
93. ement was shifted 23 samples and 23 samples was deleted from the end of the input sequence to obtain equal length for the two sequences Input and output signals at 5 knots 1 0 T T T T T T T 5 j sad 0 gt 5 7 10 4 15 3 20 1 1 1 L l 100 200 300 400 500 600 700 800 Validation data Calculation data 10 T T T T T 5 Es 3 OF BL 4 10 1 1 fi fi l 0 100 200 300 400 500 600 700 800 Time s Figure 4 15 Model input and outputs at 5 knots An impulse response model frequency response model 4 order Autoregressive eXtra input ARX model with time delay and a state space model was calculated in the system identification toolbox using the Quick Start option After calculating the models they are validated against input output data from the vessel The model is then subject to the same input as the one used in the vessel and the output of the model is compared with the behaviour of the real vessel The initial analysis gave a fit of 70 496 for the State Space model while the ARX model obtained a fit of 68 996 see Figure 4 16 Further analysis led to a 10 order ARX model which yield a fit of 73 2 Investigating the residuals of three models in Figure 4 17 it can be seen that the autocorrelation of the residuals are smaller for the two ARX models are small than for the 4 order state space model It should be noted that the residuals of the 4 and 10 39 Chapter
94. er performs well when it is not 129 Chapter 9 Implementation Heading controller at 5 knots Measured heading Desired heading 300 400 350 300 250 L o o N Gap BupesH 150 100r Time s Figure 9 10 Implemented heading controller behaviour at 5 knots Heading controller at 12 knots Measured heading Desired heading 400 350r 300 250r i o e N s BupesH 150r 100 40 60 80 100 120 140 160 Time s 20 Figure 9 11 Implemented heading controller behaviour at 12 knots 130 Chapter 9 Implementation Heading controller at 20 knots 350 E 300 TY Measured heading Desired heading Heading deg N Q o T 50r 0 LEAN f i 0 20 40 60 80 100 120 140 Time s Figure 9 12 Implemented heading controller behaviour at 20 knots changing parameters at for example 10 knots in Figure 9 14 T he gain scheduling algo rithm should therefore be improved either by more models or by continuously changing the parameters according to speed 9 3 3 Way point Navigation System The way point navigation system was tested by recording GPS positions around Munkhol men in Trondheim Afterwards the way points were given as a vector to our Simulink model where it was used to navigate the vessel around the island on its own We
95. erial port serobj2 is given to the S function serread_sfun m found in Appendix A 12 This S function reads the serial port buffer every 50 ms and checks if it has received the correct measurement Then the least significant and the most significant bytes of the rudder measurement are switched and the correct value are calculated according to if length streng gt 10 amp amp strcmp streng 1 4 142A Check for correct message temp streng 9 10 streng 7 8 SSwitch LSB and MSB temp hex2dec temp SConvert hexadecimal to decimal temp temp 180 042 Simrad defined calculation 124 O o N o Chapter 9 Implementation if temp gt 180 180 to 0 360 conversion temp temp 360 end rudder temp 2 SBias correction end The seemingly complicated calculation are according to Simrad specifications and the reasons for doing it are unknown to us 9 1 4 Voltage Out to Rudder Pump In Section 4 1 we identified a model of the steering hydraulic including the pump con troller of the AP20 auto pilot This was done to save time while developing and tuning the heading controller in Simulink The Simrad rudder control is a closed system which allows only minor modifications A part of our task was therefore to implement a new rudder controller and the necessary new hardware The pump uses a voltage signal with a range 12 V as mentioned in Section 1 3 For this reason we had to find an I O card which could provide at least 12
96. ering a ship taking both oscillatory and constant disturbances as waves currents and wind into account The reason that we have to include integral action in the controller and not only implement a simple P or PD controller even though the plant contains integral action is that some disturbance enter the plant before the integration as shown in Figure 8 8 This constant disturbance which affects the boats rate of turn can for example be wind or non linearities in the boat When we apply a desired heading of 100 Figure 8 9 shows the steady state error created by the disturbance 79 Chapter 8 Design in Simulink Desired heading nmmr Actual Rate oftum s 0 1562 udder angle 0 0343523 0 11242740 369527 0 21312 heading Ref P controller INNUIT Tan m ARAS DONE 220 84472 2423282342 41322 1 35402 0 3388 Heading Rudder Pump Vesel dynamics Discrete wi Simrad controller Integrator p Drift Drift Disturbance on off Figure 8 8 Simulink model of the system with a P controller and rate of turn disturbance Comparing P controller with and with out disturbance 140 T T T T T Heading deg Measured heading without disturbance Measured heading with rate of turn disturbance Desired heading angle L 30 40 50 60 Time s Figure 8 9 Steady state error with and without disturbance for a P controller 80 Chapter 8 Design in Simulink 8 2 1 Disconti
97. ers and closed loop controllers as can be seen in Figure 7 1 A combination of the two is also possible and is called a hybrid system We will in the rest of this chapter only focus on the feedback configuration since the PID controller is of this type For more information on basic control theory please consult Balchen et al 2003 Closed loop Feedback system Controller Process Plant Yrer t Open loop Feed forward system yrer t u t Process Y t Controller Plant Figure 7 1 General types of control systems 57 Chapter 7 Theory Here y t is the measured output yes t is the desired reference value e t is the error e t yrer t y t and u t is the controller output The process is here also assumed to include both the actuator which applies u t on the system and the sensors which measure y t 7 1 PID control The PID controller is by far the most known and used controller According to str m and H gglund 1996b about 90 to 95 of all control problems are solved by this controller A reason for its widespread use is its simple structure and robustness to a large number of common control problems In the early days of the PID controller it was implemented using relays electric motors or pneumatic or hydraulic systems Later the systems were replaced by electronics and nowadays integrated ciruits are used to implement flexible and powerful digital solutions As stated by its name the
98. ete assembly for a vessel with a seperate rudder can be seen in Figure 1 5 1 4 Equipment mounting and calculation of CG We made a some simplifications when calculating the Centre of Gravity CG First of all we omitted the equipment and personnel in the boat because this is variable Second Chapter 1 Vessel and Equipment Configuration PUMP UNIT STEERING UNIT win EXPANSION TANK Cylinder REOUCING UNIONS f REGUIRED LF3000 unit RETURN LINE FLUDOBLE HOSES Figure 1 5 Hydraulic steering system www simradyachting com 10 Chapter 1 Vessel and Equipment Configuration we calculated the CG with both the outboard engine and the 75 kg gasoline tank as particle masses Finally we placed CG from the different components on the same y and z axes This simplifies the calculations to only include displacement in the x axis The centre of mass R of a system of particles is defined as the average of their positions ri weighted by their masses mj 1 R ae Mir 1 1 1 100 4 75 4 450 gl m x 75 kg 2 32 m x 109 kg 0 55 m 1 2 where M is the total mass of the system equal to the sum of the particle masses The CG of the boat alone the engine and the fuel tank are shown in Figure 1 6 and Figure 1 7 Using 1 1 we find the CG of the complete assembly also shown in the above mentioned figures which are CAD drawings obtained from the manufacturer and modified with their permission
99. etermination of T 7 3 Gain Scheduling The vessel dynamics are dependent of the speed of the vessel and changes with the speed Due to these changes it is necessary with different tuning of the controller at different speeds This is solved by gain scheduling where the parameters are adjusted as the speed of the vessel reaches threshold values for parameter changes In situations where the operating point of the vessel is close to a threshold for parameter change one might experience oscillation between the parameters Hysteresis is introduced when switching parameters to prevent such oscillation Finally to avoid steps in the controller when the parameters are updated filtering of the parameters are needed so that smooth changes are obtained 7 4 Way Point Navigation System The route of a ship can be defined by a set of way points These way points defines points that the boat should pass on its route The way point navigation system provides the heading autopilot with the desired heading Line Of Sight Guidance Line Of Sight LOS is a popular method for creating the desired path between different way points The most basic realisation of this method sets the LOS vector as the vector between the vessel position N t E t and the next way point N E Set point for the heading autopilot can then be found as see also Figure 7 17 ba atan2 E E t Nu N t 7 34 73 Chapter 7 Theory The function atan2 yields val
100. f the programme is to develop an Unmanned Surface Vehicle USV to be used as support for oil search vessels and other offshore activities Our con tribution to this development has been to create an environment for rapid development and implementation of new controllers for the USV A way point navigation system and a heading autopilot have been designed and implemented using this environment The Rapid Control Prototyping RCP environment consists of different phases In the first step experiments are designed and performed to capture the dynamics of the vessel Data from these manouvers are then used during the system identification phase This phase creates a mathematical model of the vessel to be used as the real vessel during simulations Controller design is then performed in Simulink using the identified model as the plant When the controller design has reached a satisfactory level the implemen tation phase begins During implementation the vessel model in Simulink is replaced by blocks to communicate with the actuators and sensors of the USV Real time constraints are put on the system to be used during implementation The results of our Master thesis is a successfully developed and implemented way point navigation system and a heading autopilot for the USV These controllers in addition to the RCP environment we have created provides Maritime Robotics with a solid base for further development of their project The RCP environment an
101. from Simulink Size Inherited from Simulink Data type Inherited from Simulink Port 1 Watch in debugger Enable Table 8 5 Input signal properties Name Scope Data type Kp Output to Simulink Simulink constant KTi Output to Simulink Simulink constant KTd Output to Simulink Simulink constant Discrete TF Output to Simulink Discrete transfer function in Simulink Table 8 6 Output to Simulink addition the derivative action is realized as discrete transfer function which needs to be updated as the parameters changes These components have the following properties While it was natural to provide the speed as a input signal to the Stateflow chart it is complicated to output the gain changes as output signals directly to the Simulink model Instead it was decided to write an embedded MATLAB function setparam values in the Stateflow chart which sets the gains and the discrete transfer function directly in the Simulink model values is a number that tells the function which parameter set it should apply This function calls the set param function which allows us to change the parameters in the Simulink model see Appendix A 4 for the code of setparam values For more information please consult the MATLAB documentation 8 3 2 States In Stateflow a state can have sub states and a state might be either exclusive or parallel The system may not be in more than one exclusive state at each level while parallel states are active at th
102. hen switching from automatic mode to manual mode no modifications are needed since the output contains an integrator and will contain no sudden changes even though the commanded rudder angle has a step This can be seen in Figure 8 41 When switching from manual mode to automatic mode in the vicinity of the desired heading the bumpless transfer gives a smooth transition between the two modes This is a common situation when the vessel is initialised manually to the desired heading and the controller is thereafter activated Figure 8 42 shows the transfer between manual to automatic mode without and with bumpless transfer As we can see the bumpless transfer reduces the overshoot from 47 to 8 when switching from manual to automatic mode at 12s A smoother transition is obtained 250 i 4 Heading deg a o T 1 0 5 10 15 20 25 30 35 Time s 20 T T T El di 3 15 LI potas es ee it 8 210b x 4 9 f A l 4 I sL amp i P 8 cee d 3 a 5 i i j j i 0 5 10 15 20 25 30 35 Time s Figure 8 41 Transition from automatic to manual mode at 20 knots 8 2 9 Disturbances We will in this section test the robustness of our controller by simulating disturbances In the real world the vessel is influenced among other factors by wind waves and currents For heading wind can be modelled as a constant influencing the rate of turn Waves on the other hand can be approximated by a sine wave wi
103. ication Poles and zeros of this model is plotted in Figure 4 19 The model has 6 roots marked with an x inside the unit circle two at origo and three zeros marked with an o hence the model is stable but it is a non minimum phase system because of the time delay Pole Zero Map 0 5 Imaginary Axis 1 0 5 0 0 5 1 Real Axis Figure 4 19 Poles and zeros of the 4th order ARX model at 5 knots Figure 4 20 displays the bode plot of the ARX model The model has a gain margin of 9 09 dB at 0 395 Hz while the phase margin is infinite as the model is damped for all frequencies and does not cross the 0 dB line 4 2 4 12 knots model identification The same set up is used for the 12 knot model as for the 5 knot model that is sampling time of 0 25 s and the set point is changed every 3 second The first 4 6 min are used for calculation while the rest is used for validation The total length of the input output sequence is approximately 12 min The sequence can be found in Appendix B 2 As for the 5 knots data this data set also suffered of a time delay in the ROT measurement The data at 12 knots had a delay of 35 5 s which is a very large delay The ROT measurement had to be shifted 142 samples and the last 142 samples of the input had to be deleted Adjustment of the ROT measurement at 12 knots can be found in Appendix B 2 As for the 5 knot model Quick Start was used to identify an impulse response model frequency response mo
104. ifted 23 samples vs ROT derived from the heading at 5 knots T T T T T T I 10 Measured ROT Min ROT derived from the heading ROT e s eo T 1 1 L f 1 L 1 460 470 480 490 500 510 520 530 540 Time s Figure B 3 Shifted ROT vs ROT derived from the heading at 5 knots 150 Chapter B Measurement pre treatment plot B 2 12 knots Input and output signals 10 T T T T T T T 1 l l L 1 100 200 300 400 500 600 700 800 Validation data Calculation data 10 T T T T T ik L 1 l 0 100 200 300 400 500 600 700 800 Time s Figure B 4 Input output sequence at 12 knots 151 Chapter B Measurement pre treatment plot Measured ROT vs ROT derived from the heading at 5 knots T T 15 T T T T I Measured ROT ROT derived from heading 10 n 4 ing i 1 TRAITE D l 1 I i M ih fis iH ji i d 1 ui ik ery wl wey M n X i V on i Ny il i Us 1 pur o DN a if AU Wu Ay A fe NI y s n nd uu NE pr ik FOL HOT OG Nou H h IT og lg IS f n H 1 fl IM Ma T i i ii I l a i Ei H 4 j E l T z IT i TER i Cet cip 9 Hd TNI A E id bx c E E A boo lg i l ror pagg ul PA 1 od dy i ie nie i H pi mE I ETE p l i ij TEE j o e iad hi i24 Eh Ca E pp br p A m Lad if PI rod 1 I 0 AI NE a p l Fg i T M
105. imate gain 0 74 0 fi 1 0 10 20 30 40 50 60 Time s Rudderangle Setpoint sr EGLI T P5 T Pe T emm g 20 E Y 7 S z f 10 j J E 1 8 1 2 or H 1l 1 I i S 10 i i4 o I 3 f S 20 A E x i X oy ee 3 30 jen 1 1 ee ENS 0 10 20 30 40 50 60 Time s Figure C 25 Ultimate gain K and period T of the Ziegler Nichols ultimate sensitivity method at 5 knots 170 Chapter C Analysis plots USVsimulation12 knots T T T T 150 A 3 3 100r o E o Lj o I 850r gt 4 Ultimate period 11 75 s Ultimate gain 0 65 0 1 1 1 L 1 0 10 20 30 40 50 60 Time s Rudderangle Setpoint E reum T m T T Y PR 1 Y 8 T a T a T Rudderangle Setpoint deg T a 8 20 30 Time s Figure C 26 Ultimate gain Ku and period T of the Ziegler Nichols ultimate sensitivity method at 12 knots 150 USVsimulation20 knots 100r 50r Heading deg T T T p N 30 20r Rudderangle Setpoint deg o T Figure C 27 Ultimate gain Ku and period T of the Ziegler Nichols method at 20 knots LES Ultimate period 11 25 s Ultimate gain 0 64 L fi 1 20 30 40 Time s Rudderangle Setpoint T T T x P i f p POS js A Low I f 1 1 1 l i 1 Y 1 j Y I H I i i I f i Y l l i 1 1 Y 1 1 1 1 if 1 i n i ji i 1 j j t l i 1 1 i i I I i Y i
106. iments 157 Chapter C Analysis plots Bode Diagram Gm 16 6 dB at 0 719 Hz Pm 170 deg at 0 0145 Hz Commanded rudder to actual rudder angle 5 T T Cut off frequency SP 0 11Hz Magnitude dB S T Phase deg E o T 945r 360 f E eer 10 10 Frequency Hz Figure C 6 Bode plot 5 knots Rudder pump experiments Pole Zero Map T 0 8 0 6 04r Imaginary Axis 4 L L i 1 0 5 0 Real Axis 0 5 Figure C 7 Pole Zero plot 5 knots Rudder pump experiments 158 Chapter C Analysis plots C 2 12 knots Rudder pump experiments Input and output signals 10r 10 Actual rudder angle deg o 15r T T T Validation data Estimation data 20 40 60 80 100 120 15r 10r Commanded rudder angle deg o 15 Figure C 8 20 40 Input output data L 60 80 100 120 Time s 12 knots Rudder pump experiments 159 Chapter C Analysis plots 16 Measured and simulated model output 14r 12r 10 Rudder angle deg T T T T T T 1st order ARX model 87 fit Measurement data 4th order ARX model 92 5 fit L 75 80 85 90 95 100 Time s 105 110 115 120 Figure C 9 Model output 12 knots Rudder pump experiments Frequency response Amplitude
107. in CG and 370kg 58 in total weight compared to an empty boat are significant and the controller should be tuned according to load or be designed very robust 13 Chapter 2 Rapid Control Prototyping We will in this chapter give a short overview of the concept of Rapid Control Prototyping RCP and how we have used it in this master thesis The goal of RCP is to rapidly develop and implement new designs and concept in controller design Traditional and rapid prototyping approach to solving a control problem is illustrated in Figure 2 1 The traditional approach needs a large team of engineers in multiple disciplines First the control algorithm is designed Secondly the software team creates the software needed to run the program Then the requested hardware is designed by another team before finally the implementation is performed by a last group Rapid Prototyping is a different way of solving the problem The main idea is to let the computer software automatically transfer high level code to a real time program using built in compilers and communication libraries Rapid Prototyping Traditional Approach UAE Algorithm lii Algorithm design and prototyping Rapid iterations Manual Iteration development Hardware and software design Implementation of production system Implementation of production system Figure 2 1 Traditional vs rapid prototyping design of a controller 14 Chapter 2 Rapid Control Pro
108. inal reference model for the heading set point 78 The model from commanded rudder angle to heading in MATLAB Simulink 79 Simulink model of the system with a P controller and rate of turn distur b nc x iva RB UA RA Roe NR B ae ed o eee 80 Steady state error with and without disturbance for a P controller 80 Discontinuous heading output 0 388590 o ooo 81 USV model with discontinuous heading output 0 359 81 Upper level of the Simulink if block to choose the shortest direction 82 Lower level of the first Simulink if block 83 Lower level of the first Simulink if block 83 viii 8 15 8 16 8 17 8 18 8 19 8 20 8 21 8 22 8 23 8 24 8 25 8 26 8 27 8 28 8 29 8 30 8 31 8 32 8 33 8 34 8 35 8 36 8 37 8 38 8 39 8 40 8 41 Lower level of the first Simulink if block 83 The effects of measurement discontinuity on a step from 50 to 340 84 The effects of measurement discontinuity on a step from 50 to 270 85 Simulink block removing the discontinuity in measurement and set point 85 Placement of the block to handle the 0 360 discontinuity 86 Slope R and deadtime Lg of the Ziegler Nichols step response method at ZOVKNOUS v edd o Ap Net te me ATE edi aem 87 Kp Ti and Td parameters for all speeds derived from ZN step response 87 Simulink model of the USV simulation
109. indup the overshoot is reduced from 115 to 10 a 91 reduction and the settling time from approximately 50 s Figure 8 35 to approximately 32 s a 36 reduction on a step to 180 Settling time is here defined as the elapsed time from the input step until the target value is reached with a tolerance of 4 196 The current controller has an overshoot of 0 which meets our requirements A general demand for a heading autopilot is to have close to zero or no overshoot Figure 8 38 shows us the final performance of the Simulink controller at 20 knots Here we have no overshoot and a settling time of approximately 16 s The final values for the 20 knots controller are given in Table 8 3 80 60 Heading deg 40F 20r 0 i 0 10 20 30 40 50 60 Time s 20 T T T E f D 15r je 4 2 j o j s 10r X a i A S sr X 4 o 1 N 2 i S El 0 H n D t a 5 i i i 0 10 20 30 40 50 60 Time s Figure 8 38 Controller performance at 20 knots 8 2 7 5and 12 knots controller The 5 and 12 knots controllers are tuned as the 20 knots controller given above Table 8 4 summarizes the parameters for the two controllers Thorough tuning were performed both for the 5 and 12 knots controller using the Ziegler Nichols as basis The VariableT uning m cosntructed earlier and given in Appendix A 7 was later used Proportional and integral 101 Chapte
110. ink Based on the analysis in Table 8 7 we need 8 states controlling the gain scheduling algorithm These states and their argument are presented in Table 8 8 State Decomposition Argument Model state State selector Five Twelve Twenty Default Down Up Parallel AND state Parallel AND state Exclusive OR state Exclusive OR state Exclusive OR state Exclusive OR state Exclusive OR state Exclusive OR state The vessel is in a state or switching between two states Runs in parallel with State_selector This is a controlling state which tells Model state which of its sub states the system should be in Only one speed model can active at any time Only one speed model can active at any time Only one speed model can active at any time The system can both keep the PID parameters constant and change them at the same time The system can both keep the PID parameters constant and change them at the same time The system can both keep the PID parameters constant and change them at the same time Table 8 8 States The hierarchy between these states are found in the following analysis Dependency Implied hierarchy Five twelve and twenty are exclusive states but need to run Five twelve and twenty should at the same time as the State selector be sub states of Model state Default Down and Up are exclusive states but need to run in Default Down and Up should be p
111. int where the Nyquist curve of the open loop system intersects with the negative real axis see Figure 7 14 This point describes where the process has a phase lag of 180 wig9 and the corresponding process gain Kiso G iw Kiso and wiso can be found by applying pure proportional control on the process and increase the controller gain until we have standing oscillations on the output of the system with the ultimate gain Ku Because of the closed loop we 69 Chapter 7 Theory y t Slope R Figure 7 13 Slope R and deadtime Lg of the Ziegler Nichols step response method have the relation K The ultimate period T is then given by T Kiso W180 Figure 7 15 gives us an illustration of the ultimate gain and period Another point is marked by arrows indicating P I and D in Figure 7 14 It describes the effects when we increase respectively the proportional P integral I and derivative D gain This coincides with theory for example by an increase in gain margin with more derivative gain and a decrease with more integral or proportional gain For more information on the ultimate sensitivity method please consult Ziegler and Nichols 1942 Astr m and H gglund 1996a and str m and H gglund 2006 K T and Ty are found from Table 7 4 The parameters are calculated according to desired gain and phase margin For instance multiplying the ultimate gain Ku by 0 6 gives a gain margin of Kau x 0 6
112. is normally chosen to be in the range 3 to 20 This realization is given as Ule r a aes m EG 7 14 N This can also be illustrated by plotting the bode plot of the derivative part with and without limitation as seen in Figure 7 6 Here we see that the gain is very low at low frequencies for the unlimited version but that the gain keeps rising as the frequency increases For steps this will result in an infinite gain When limiting the gain by setting N 10 we get the green line labelled Limited derivative action The gain is now limited to 20dB which correspond to 10 as given in the following 61 Chapter 7 Theory 20 x logio value decibel value 7 15 q Decibel to absolute value 1020 10 7 16 60 Bode Diagram 50r 7 40 m i 5 E 1 E 5 20 z 10 4 OF DUI rt E HE Derivative action Limited derivative action Phase deg Frequency Hz Figure 7 6 Bode plot of the unlimited and limited derivative action 7 1 4 Set Point Weighting An issue with the proportional part in Equation 7 2 is that it very often has a large overshoot This effect can be reduced by introducing set point weighting up t K bYres t y t 7 17 The weighting variable b has a positive influence on the process and can provide less overshoot and less delay to reach steady state Another effect is that the control variable is smaller hence reducing power usage An example
113. it is possible to use the same reference model over the whole range of operating speeds To find the limitations of the vessel a rudder angle of 25 was set as input to the rudder pump model in series with the vessel model as seen in Figure 8 1 It is also noticed that the largest change in set point that can be experienced is a step of 180 as the autopilot always chooses the shortest path when the heading is changed Plotting the time response of the heading as in Figure 8 2 it is seen that the 5 knot model is the slowest model and hence this model is the one limiting the reference model It is also seen that it takes the 5 knot model approximately 15 s to perform a 180 turn Based on this observation the time constant is chosen as 15 s 79 Chapter 8 Design in Simulink m y 0 1562 Actual nidder angie 0 03435z4 0 1124z3 0 3695z2 0 2131z ROT KTs EE 22 0 8447z 24 2 32823 2 41322 1 35402 0 3388 2 1 Desired rudder angle Rudder Pump Vessel dynamics 20 knots Discrete Time w Simrad controller Integrator Figure 8 1 Desired rudder angle to heading simulation Change in heading with a step in rudder angle of 25 degrees att 0 500 T T T T T T T 5 knots model rudder angle of 25 degrees 450 12 knots model rudder angle of 25 degrees 20 knots model rudder angle of 25 degrees 400 Heading f s N oa o o o T T N e o T N M Crossing 180 a
114. ith the help of the rtblockset by Daga 2007 described in Chapter 2 the sampling times have to be chosen to fit the capacity of the computer The ROBNET signal from the Simrad system needs to be sampled every 50 ms to get the rudder measurement correctly Furthermore the two NMEA signals needs to be sampled every 250 ms These measurements are given on the same serial cable such that it needs to be read every 125 ms The rest of the system including the writing of voltage output is calculated every 250 ms Smallest common sampling for the system is therefore every 25 ms This was to fast for our computer 119 Chapter 9 Implementation Initial valuesstorage measured with NMEAmesages ct P IDparameter mat LB Ed ages Terminator To File Speed Y gainscheduler hitial values E meas Waypoint and heading set point generator Rudder S Function Ee pe pudder idder d Rate Transition o Realtime subsytem Desired heading ditage serurite sfun D Voltage Function Pl controller Set Rudder Manual on 1 off 0 Heading autopilot Figure 9 1 The MATLAB Simulink model for the implementation hence the calculated output had a large delay and the system turned unstable Figure 9 2 shows the calculation time and it can be seen that the calculation time limit is crossed 14 times in only 9 seconds Our solution to this problem was to increase
115. ithout increasing the reaction time In fact the overshoot is reduced from 18 to 0 8 2 6 Integrator anti windup As explained in Section 7 1 5 the integral part of the controller may break the closed loop because the actuator is limited to 25 The maximum step applied to the vessel is 180 This step does not saturate the actuator but extreme cases may appear due to disturbance An example of this would be strong wind coming from the side We try to simulate this by applying a constant disturbance of 15 s on the rate of turn In addition this effect can be seen most clearly when the step is large In Figure 8 35 a step from zero to 180 is applied and we can see the controller saturating and a large overshoot appear due to integrator windup Even though the heading crosses the desired heading at 180 after 20 s it takes another 6 s before the controller output goes below the saturation limit l his is due to the integrated error By implementing the tracking scheme explained in Section 7 1 5 and shown in Figure 8 36 the overshoot is reduced Figure 8 37 shows us the performance of the controller with an antiwindup scheme and tracking time in the suggested range Td lt Tt lt Ti 98 Chapter 8 Design in Simulink Heading deg o o 0 i i i i i j 0 10 20 30 40 50 60 Time s 20 a Rudder angle deg 3 e j 0 10 20 30 40 50 60 Time s Figure 8 34 Different proportiona
116. l Systems Guidance Navigation and Control of Ships Rigs and Underwater Vehicles Trondheim Tapir Print Golub G H Loan C F V 1989 Matrix Computations Johns Hopkins University Press Baltimore Graebe S F Ahl n A 1996 Bumpless transfer In The Control Handbook CRC press pp 381 388 176 REFERENCES REFERENCES Inc R 2005 AX1500 User s Manual RoboteQ Inc International Submarine Engineering 2006 Usv unmanned service vessels http www ise bc ca USV html Kongsberg Seatex AS 2003 Seatex Seapath 20 User s Manual Kongsberg Seatex AS Ljung L 1999 System Identification Theory for the user Second edition New Jersey Prentice Hall Prashanti G Chidambaram M 2000 Set point weighted pid controllers for unstable systems Journal of the Franklin Institute 337 201 215 Proakis J G Manolakis D G 1996 Digital Signal Processing Principles Algorithms and Applications Third edition New Jersey Prentice Hall Ueno M Nimura T Tsukada Y Miyazaki H Eds September 2006 Experimental study on the manoeuvring motion of a planning boat National Maritime Research In stitute 7th IFAC Conference on Manoeuvring and Control of Marine Vessels MCMC Portugal Ziegler J G Nichols N B 1942 Optimum settings for automatic controllers Trans actions of A S M E 177
117. l set point weighting for controller at 20 knots e o o DS o ow o o 150 100 Heading deg 50 0 50 i i j 1 0 10 20 30 40 50 60 Time s E 3 y 27 i P aol s 20r sana Sees t zl 3 i d 15r i EAS a 7 3 1 i P TP 3 iol i i oO 23 5r A i 2 0 fs y 4 g a 2 5H eem 1 2 N_ 40 i i i 1 5 0 10 20 30 40 50 60 o Time s Figure 8 35 Integral windup for a step from zero to 359 at 20 knots 99 Chapter 8 Design in Simulink Proportional on off psi d Integral delta 1 c on off z TdXTd N h Ky Te WCT neh Discrete TF Derivative on off Figure 8 36 Simulink model of the controller with antiwindup Tt 5 5 2207 Tt 45 see Tt 3 5 sg 200 Tt 2 5 j Te15 2180F o I 160 140 L L i i i 0 10 20 30 40 50 A Time s 25 520 D 15 E oO 310 nol S c 5 0 0 10 20 30 40 50 A Time s Figure 8 37 Antiwindup with different tracking times for a step from zero to 359 at 20 knots 100 Chapter 8 Design in Simulink The shorter tracking time gives best performance according to Figure 8 37 We there fore choose the lower limit of the recommended range 7 Ty gt T 1 5 This tracking time only gives an overshoot of 10 which is much better than the overshoot of almost 30 at T T 5 5 Moreover compared to the situation without antiw
118. lating wind by adding a constant disturbance of 5 s in rate of turn The effect of this have been plotted in Figure 8 44 and it can be seen that the integral removes the this disturbance Only a constant rudder deflection 4 4 is needed and no steady state error is observed Problems may occur if the constant disturbance is extremely large and saturates the actuator But that would be a constant disturbance of more than 28 s which is very unlikely 105 Chapter 8 Design in Simulink 400 T T T T Without disturbance With wind disturbance i I 300 l l i Heading deg N eo o 100 fF 7 0 ae j i j j 0 10 20 30 40 50 60 Time s 25 E 3 20 amp 1 3 o 1 D c Ej S GL IEIUNII A DUI UOTE E CAE EEE CC EES eC EE S e o 3 a 5 i i i i j 0 10 20 30 40 50 60 Time s Figure 8 44 The effect of a constant disturbance in rate of turn Oscillating disturbance Waves Waves are simulated by adding a sine wave with an amplitude of 5 s with various frequencies to the rate of turn The result of adding waves of frequencies 10 1 0 1 and 0 01 Hz can be seen in Figure 8 45 It can be seen from the figure that waves at a much higher or lower frequency than the motion of the boat are damped to a satisfactory level At 10 Hz the disturbance is not possible to see and at at 1 Hz the movement only has an amplitude of 0 5 But the disturbance at 0 1 Hz
119. led that they are non minimum phase systems Non minimum phase systems are generally harder to control than minimum phase system In a non minimum phase system the inverse of the system will not be stable as the zeros of the system then becomes its poles therefore it will not be possible to use it in a feed forward loop 52 Chapter 5 Discussion Different models where identified at all three speeds and three ARX models where chosen even though other models gave a marginal improvement in some cases The ARX models was chosen as they have a simple structure and are easy to implement in a computer It is also a advantage that all three models have the same structure 53 Chapter 6 Conclusion A vessel model and Steering hydraulics including a feedback controller has been iden tified and modelled The steering hydraulic model is given as a first order model with time delay k 0 1562 Oref k 1 0 8447q 14 16 0 where 6 k is the rudder angle and 6 k is the desired rudder angle at sample number k The vessel identified is a planning monohull vessel Dynamics of the vessel was divided into three regimes displacement semi displacement and planning Three models was identified at 5 12 and 20 knots Corresponding to the displacement semi displacement and planning regimes respectively The three models are ARX models with the following structure 5 knots model which yields a fit of 68 9 r k 0 04955 0 04301
120. ler in Simulink the shortest direction is always chosen But when crossing the boundary discontinuities ap pear in the heading measurement which makes sudden changes in the controller output This can be seen in Figure 8 16 where the discontinuity makes the system unstable on a step from 50 to 340 If we run the simulation again now with a set point further away from the boundary we see that an oscillation is introduced by the crossing Figure 8 17 82 Chapter 8 Design in Simulink Action L Ho Action Port Selector Constant 320 ps in psi out ps d in psi d out Figure 8 13 Lower level of the first Simulink if block Selector Consant1 Action Port ps in ps out ps d in Constant Figure 8 14 Lower level of the first Simulink if block Action Condanti Selector Action Port psi in psi out psi d in Constant Figure 8 15 Lower level of the first Simulink if block 83 Chapter 8 Design in Simulink shows this oscillation together with the proportional integral and derivative controller output As seen the especially the derivative action has a large step due to the sudden change in heading measurement 400 heading desired heading 4 350 300 Heading deg N N eo e o o T T a o T 1007 BO o 0 5 10 15 20 25 Time s Figure 8 16 The effects of measurement discontinuity on a step from 50 to 340 To avoid this disco
121. licity and to obtain a unified model structure for the models at 5 12 and 20 knots 47 Chapter 4 System Identification Autocorrelation of residuals for output y at 20 knots 0 5 T T T T T T T 4th order state space model 4th order ARX model J 0 E 0 1 1 1 1 l l 1 So 15 10 5 0 5 10 15 20 Cross correlation for input u and output y residuals at 20 knots 0 2 T T T T T T T xl 1 1 1 1 1 1 1 026 15 10 5 0 5 10 15 20 Samples Figure 4 27 Residuals at 20 knots for the 4 order ARX model 4 2 7 Best model at 20 knots The ARX model is given as r k 0 03435 0 1124g 0 3695q 0 2131q7 T k 1 2 328q 1 2 413q 2 1 354q3 0 3388q 4 ven Where r k is the ROT and 6 k is the rudder angle k is the sample number Figure 4 28 shows the performance of the ARX model at 20 knots as it can be seen this model perform better than the models at 5 and 12 knots This is in accordance with the discussion in Section 4 2 3 From the plot in Figure 4 29 it is clear that the model is a stable but non minimum phase system It is also clear that the models at 12 and 20 knots are similar The Bode plot in Figure 4 30 shows that the 4 order ARX model at 20 knots have a phase margin of 56 4 at 0 305 Hz The cut off frequency is 0 71 Hz 48 Chapter 4 System Identification Measured and simulated model output at 20 knots 1
122. lize sensors and actuators already present in the vessel It was also decided to communicate with these through existing communication interfaces This was done to save time so that we could implement our system We had to adjust our solutions to the signal types and data formats of the existing solutions This was challenging as the information we needed was not openly available Therefore some time have been spent on finding necessary information and reverse engineering Despite these problems we managed to utilise these sensors and actuators and we could implement our controller in the vessel within one week Development of a standardised communication interface for communication with sensors and actuators could be a future improvement of our solution Due to limited time for implementation it was decided to use Simulink and a real time block set in the implementation This gives soft real time performance where timing errors can occur Timing errors have been observed when testing In an attempt to reduce the timing errors we reduced the fundamental sampling time in Simulink This reduced the number of timing errors but they stil occur The effect of these 136 Chapter 10 Discussion errors are not clear to us but it seems reasonable that they degrade the performance of the controller They might also introduce instability but this have not been verified The best solution to the timing errors would be to run the controller in a real tim
123. ller Variable Description K Proportional gain T Integration time Ta Derivative time Ti Tracking time b Set point weighting N High frequency limiter of derivative action Umin Lower actuator saturation level Umax Upper actuator saturation level h Sample period time Table 7 1 PID parameters The high frequency limiter of the derivative action N can be fixed and is typically set in the range 3 20 Moreover the saturation limits umn and Umax should be set close to the true saturation limits b the proportional set point weighting is set to a value in the interval 0 1 depending on the desired performance as given in Figure 7 7 The tracking time T is in many implementations chosen to be equal to T If allowed it can also be tuned to allow for optimal antiwindup performance Further for the PID controllers the sampling time h must be chosen so short that the phase lead is not adversely affected by the sampling A recommendation given by str m and Wittenmark 1997 is 68 Chapter 7 Theory AN 0 2 to 0 6 7 29 d The parameters K T4 and T are strongly affected by each others and should be tuned together Two classical heuristic methods to decide these parameters were defined by Ziegler and Nichols 1942 They are known as the Ziegler Nichols methods and consists of the ultimate sensitivity method and the step response method Originally they were developed for continuous controllers but they can a
124. lso be applied to digital controllers The step response method is a method where a unit step is applied on the system This is an open loop experiment which can often be performed on line Especially in the industry where a shut down may cause big financial losses this is the preferred method It is also used much when security measures makes it dangerous to push the system to its stability limits as demanded from the ultimate sensitivity method for example in weapons and nuclear plants The plants need to have a step response which is essentially monotone except from an initial non minimum phase characteristic K T and Ty are then found in Table 7 2 for the PID controller and in Table 7 3 for the P controller R here denotes the tangent of the steepest slope of the step response A the amplitude of the input step and L4 the apparent deadtime as shown in Figure 7 13 Parameter Tuned value I 2xA K Fa T 2x La Ta 0 5 x La Table 7 2 PID parameters obtained from the Ziegler Nichols step response method Parameter Tuned value IxA K Rx La Table 7 3 P parameters obtained from the Ziegler Nichols step response method The ultimate sensitivity method or the frequency response method which it is also called is based on simple characteristics of the process dynamics These characteristics can be found and the PID parameters can be calculated according to desired gain and phase margin The key idea is to find the po
125. mi displacement 20 1 37 Planning Table 3 2 Froude number and regime at 5 12 and 20 knots 25 Chapter 4 System Identification The ideal conditions for running experiments for the system identification would be an indoor facility where the current waves and wind could have been controlled and set to zero As our vessel is a full scale vessel this is not a realistic alternative and the experiments have therefore been performed in Trondheimsfjorden As a consequence of this the test results contains wave wind and current disturbances Experiments were performed in Trondheimsfjorden on the 21 March 2007 the weather was sunny with a wind speed of approximately 1 m s Wave height was approximately 0 cm to 30 cm As both the commanded rudder angle and the actual rudder angle is logged we can choose between two different approaches when identifying see Figure 4 1 Actual rudder I Commanded rudder Heading Vessel dynamics Steering hydraulics Vessel dynamics Steering hydraulic identification identfication Steering hydraulic vessel dynamics identification Figure 4 1 Systems to identify The first possibility is to identify the dynamics from actual rudder angle to ROT this will identify the dynamics of the vessel By identifying the system between the commanded rudder angle and the actual rudder angle one will identify the dynamics of the steering 26 Chapter 4 S
126. mmunication with the AX1500 is configured by running the MATLAB script write serialcon f m found in Appendix A 10 A handle to the serial port serobj is given to the S function serwrite_sfun m found in Appendix A 13 This S function takes the value from Simulink at its input and converts it to the proper syntax before it is sent to the AX1500 card every 250 ms 9 2 Rudder angle controller The rudder angle is controlled by a hydraulic actuator system which consists of a pump and a cylindrical actuator The actuator system can be controlled by the helm and the AP20 auto pilot system The helm is connected to the system via an expansion tank Figure 1 5 displays the hydraulic system This chapter describes the rudder angle control approach The input to the pump controls the flow and the direction of the flow at the outlet of the pump This flow controls the expansion retraction speed of the actuator which again determines the rate of change for the rudder angle As the actuator cylinder act 126 Chapter 9 Implementation as an integrator from the steering hydraulics to the rudder angle it is sufficient with only a proportional controller The input to the controller is the error in rudder angle where the rudder angle set point is generated by the heading autopilot and the rudder angle is measured by the LF3000 unit A block diagram of the control loop can be seen in Figure 9 7 voltage flow e Integrator P controller RPUSO g
127. model is introduced to ensure feasible heading set points The reference model is realised as a second order low pass filter which is designed based on the vessel dynamics A second order filter with two common poles have the following structure 1 ue 5 1 TTP E Here T denotes the poles i gives the stationary value of the filter and is set to 1 The time response of a second order filter with two real and common poles T exposed to a step can be expressed as follows y t id Gre 7 32 If we set y t equal to a desired percentage of the final value of a unit step and rearrange Equation 7 32 it is possible to design the filter where one can decide the time constant at which the filter should output the desired percentage of the final value The time constant t should be based on the vessel dynamics and should reflect how fast the vessel can change its heading Setting i equal to 1 Equation 7 32 in yields l y xT 4 Ti Tug T 7 33 The desired value of y t and t are set Then the functions of the inequality in Equation 7 33 can be plotted as functions of T From this plot T can be found graphically see Figure 7 16 The value of T should be chosen close to the point where the two graphs intersects if not the system will be faster than specified 72 Chapter 7 Theory Determining T 0 07 f i z p ST 0 06 0 0 05TA15 T 0 05 0 04 0 03 Feasible area for T 0 02 0 01 Figure 7 16 D
128. ne on the real vessel it would be both time consuming and chances of equipment breakdowns The actuator in our simulations is saturated at 25 degrees and will never be unstable hence we have to identify the gain when the system goes from standing oscillations to decreasing oscillations The results of the 20 knots experiment can be seen in Figure 8 24 88 Chapter 8 Design in Simulink USVsimulation20 knots VN o o Heading deg Ultimate period 11 25 s Ultimate gain 0 64 0 10 20 30 40 50 60 Time s Rudderangle Setpoint Y en FA ES Rudderangle Setpoint deg o T 5 0 10 20 30 40 50 60 Time s Figure 8 24 Ultimate gain K and period T of the Ziegler Nichols ultimate sensitivity method at 20 knots By using the equations given in Table 7 4 the PID parameters are given as Parameter 5 knots value 12 knots value 20 knots value K 0 444 0 390 0 384 Ti 7 500 5 875 5 625 Ta 1 875 1 4688 1 4063 Table 8 2 PID parameters calculated from the Ziegler Nichols ultimate sensitivity method Also here the parameters for the 12 and 20 knots controllers are similar Figure 8 25 plots Kp Ti and Td for all speeds Figure 8 26 gives us the performance when applying a step for the two different meth ods at 20 knots and they seem to perform similar Similar parameters is a validation that the parameters found are correct We choose to use the results for the ultimate
129. ngine serves it purpose but it is very likely that another boat and or engine will be used in the final product It can be seen in other articles that a wide range of boat and engine types have been tried in similar projects Ebken et al 2005 International Submarine Engineering 2006 Elbit Systems 2006 and Aeronautics Defense Systems 2006 The specifications for the Evinrude 50 are given in Table 1 2 A change A of 30 in rudder angle takes 2 3 seconds based on information from Maritime Robotics This quantity has not been confirmed by measurement but it is assumed that it is valid for all operating speeds The maximum and minimum rudder angle of the vessel is 30 and the operating range has been defined by Maritime Robotics to be limited to 25 Assuming a linear relation in the rate of change for the rudder angle over the whole range from 25 to 25 it is possible to obtain the time delay for changes between different rudder angles Model E50DPL Unit Mass 109 kg Propshaft force 5750 rpm 37 kW Gear Ratio 2 67 1 Displacement 863 cn Table 1 2 Evinrude 50 E tec specifications Chapter 1 Vessel and Equipment Configuration Figure 1 2 Outboard engine Evinrude 50 E tec Kaasbgll Boats AS 1 9 Measurement Equipment The measurement equipment consists of a Differential Global Positioning System DGPS sensor The sensor gives measurements to a laptop via the RS232 interface In addition the Simra
130. ns if the controller keeps old measurements for a long time To avoid this a timer should be included to abort the operation if the controller does not receive GPS data within a certain time after GPS fall out The tuning that we have performed yields a compromise between a fast controller and a robust controller A fast controller also gets more influenced by disturbances while a robust controller tends to give slower dynamics Sea trials have revealed that our con troller is sensitive for large waves that comes in from behind with low frequency In such cases the controller actually turns unstable and starts oscillating Our closed loop anal ysis indicated that our system is sensitive for waves with frequencies of approximately 0 1 Hz This can help explain why we experienced instability in the above mentioned situation Introducing a wave filter could potentially improve the performance of the controller in waves and allow for a faster and more robust controller Step response tests which were performed at 5 12 and 20 knots showed that the overshoot of the controller was approximately 5 for the 5 and 12 knots models while it reached a maximum of 20 at 20 knots Oscillations was also experienced and we recommend to reduce the gain of the controller However these effects should be fur ther investigated as they do not meet the requirements from Maritime Robotics no oscillations and no more than 3 overshoot 138 Chapter 10 Discussion
131. ntinuity we decided to add a block between the heading output and the controller which detects discontinuities and remember how many times the boundary has been crossed This number is multiplied by 360 and added to both the set point and measurement as shown in Figure 8 18 The block which does this transfer from discontinuous to continuous output has one sample time delay in its memory element hence one sample time delay must be added to the measurement and set point entering into the controller A small degradation of performance is the result of the delay but this can be removed by tuning the PID parameters The block which detects the discontinuities needs to be initialised with the correct value This is to avoid having the memory element detect a false step when we start the autopilot at a heading larger than 180 With an initial value of 0 the if loops in Section 8 2 1 will falsely detect a crossing To avoid this measurements are taken before the simulations are started and given to the simulation as shown in the Start Button Callback function of U SV simulationGui m given in Appendix A 8 Finally the complete assembly to handle the 0 360 discontinuity is placed as shown in Figure 8 19 84 Chapter 8 Design in Simulink laction Daction Paction Desired heading Heading a o EA S us o a a T o 3 o 5 Ld o 100 200 l 1 I fi l 1 0 5 10 15 20 25 30 35 40
132. nuous heading measurement 0 359 The Simulink model in Figure 8 7 consists of a model which give a continuous heading output This is not the case for the real vessel We therefore need to modify the output of the model to give a heading reading from zero to 359 Figure 8 10 shows how this discontinuous output are calculated This block is placed in the block representing the USV system as shown in Figure 8 11 The equation of the calculations performed in above mentioned block are V ont Vo 360 floor x 360 8 2 360 heading 0 inf heading 0 360 360 Rounding Function Figure 8 10 Discontinuous heading output 0 359 Commanded Actual i 3 7 A 0 1562 dd 0 03435z 0 1124z7 0 3695z 0 2131z ate of turn KTs leading T mdder angle Dee eng y 3 2 gt heading 0 inf heading 0 360 __ gt F iddarangel 22 0 84472 23 2 3282342 41322 1 3540240 3388 z4 Hosdinp set point Rudder Pump Vessel dynamics Discrete Output w Simrad controller Integrator 0 360 degrees Y Rate of turn Figure 8 11 USV model with discontinuous heading output 0 359 We now have a heading measurement from 0 359 which creates new problems to be handled First of all it is natural that the controller chooses the fastest way to reach its set point even when this implies crossing the boundary between zero and 359 Logic to detect which turning direction is the shortest was crea
133. o Trondheim This size is well suited because it provides the capability to carry personnel on board for testing hence eliminating the need for a support vessel It also provides enough space to mount the necessary equipment for a wide range of tasks and allows for a large fuel tank providing greater range of operation The hull of the boat is constructed in aluminum which is robust and maintance free Finally the boat has a size which permits it to operate in a wide range of sea states The specifications for the boat is given in Table 1 1 Figure 1 1 Kaasbgll 19 feet centre console boat Kaasbgll Boats AS Chapter 1 Vessel and Equipment Configuration Hull Unit Length 5 75 m Width 2 12 m Mass 450 kg Displaced volume 0 45 m Table 1 1 Kaasbgll 19 specifications 1 2 The Outboard Engine Evinrude 50 Etec The propulsion system used on the USV is an off the shelf outboard engine Evinrude 50 E tec shown in Figure 1 2 Evinrude 50 E tec is a light weight robust and fuel efficient out board engine This engine gives the boat a maximum speed of 25 knots with one person on board which is enough to meet the desired operating range of 10 to 20 knots However care should be taken when increasing the load since this will require a more powerful engine If the USV is planned to be used in shallow water or in the vicinity of divers it would be wise to change to a water jet engine Since this is only a prototype the Evin rude e
134. onf m oo o A o9 oe oe creating serial port object o set set set set buffer for read operation set the baud rate at the specific parity as even the number of data bits number of stop bits as 1 the terminator value to CR default is gets the status of connection 146 ome 10 OC 5 Q Nb L O oO WANDA R WwW NM 20 21 22 JO OC RR WN FPF O Qd WAN DOA RR WN N N NNN e WN FP O Chapter A MATLAB Code o oe oe o oe oe oe is a Matlab script which configures the serial communication with the AX1500 voltage out card Output serobj handle for the serial port Author Jarle Saga Blomhoff and Geir Beinset 2007 serobj serial COM6 creating serial port object 2 6 Set connection properties serobj Baudrate 9600 set serobj Parity even set serobj Databits 7 set serobj StopBits 1 set set the baud rate at the specific value Set parity as even set the number of data bits set number of stop bits as 1 set the terminator value to CR o A oe oe oe serobj Terminator LF set serobj Timeout 1 set serobj InputBufferSize 39 512 oe buffer for read operation default is fopen serobj get serobj Status oe gets the status of connection A 11 NMEAserread sfun m o o o o o o o o o o AL o AL o AL o o o o oe AP oe oe oe A 5 EAserread sfun m is a Matlab S function which reads the NMEA mes
135. ontrol 2A 7 1 4 Set Point Weighting le 7 1 5 Integrator Windup 22A 7 1 6 Bumpless transfer sgart socius aoo e 020202 pee eens 7 1 7 Digital Implementation lee 7 1 8 Manual parameter tuning and the Ziegler Nichols methods 7 2 Reference model e T 3 Quam Scheduling srs mos mara ete Aca e ema ADYOC SL eruta 7 4 Way Point Navigation System oaoa a 8 Design in Simulink 81 Reference model ii rar ee Are a li kW uai go AO au 8 2 Heading Controller 22A 8 2 1 Discontinuous heading measurement 09 359 8 2 2 Ziegler Nichols experiments 0 0000004 8 2 3 Limited Derivative Action 2 2 ii 51 54 56 57 58 59 59 60 62 63 64 66 68 72 73 73 8 2 4 8 2 5 8 2 6 8 2 7 8 2 8 8 2 9 8 2 10 Root Locus tuning of the parameters 2 Proportional set point weighting Integrator anti windup 2 000002 eae 5 and 12 knots controller llle Manual mode and Bumpless transfer Dist rbances masna Rer XR BAS eS BE eres BAe EEL Stability and sensitivity analysis 8 3 Gain Scheduler sa 24 xS ECL beset gender x UR EG ACH EIE Rd 8 3 1 8 3 2 8 3 3 8 3 4 8 3 5 Interface between Stateflow and Simulink DUALS e S etur LIA AS df Te aereis A E State actions and variables ll State transitions ui ek ege Be ge es eure e
136. pter 8 Figure 9 10 9 12 shows the performance of our controller when applying steps on the desired heading As seen the 5 knots model seems to perform best with maximum overshoot of only 5 and sometimes as little as 1 Some oscillations are observed but they may also have been caused by waves Since this is unclear further experiments should be done at calm sea state The step at 12 knots seems to have larger oscillations but the overshoot is still only maximum 5 For the 20 knots controller the oscillations seems to be even worse And there is also cases where the overshoot is almost 20 Also for the 12 and 20 knots model the influence of waves should be investigated To remove the oscillations which appear we suggest to reduce the proportional gain 9 3 2 Heading Controller with Gain Scheduling To allow the USV to operate at different speeds gain scheduling is included in the heading controller The parameters are changed according to the transitions given in Section 8 3 As seen from Figure 9 13 9 14 varying the speed changes the dynamics of the vessel and the parameters does not seem to fit When the speed crosses the magenta line during the transition from 5 to 12 knots parameters the model are changed to a higher speed and we get oscillations on the heading output If the speed crosses the cyan dotted line the model parameters are changed down and the oscillations are fur ther prolonged But it can also be seen that the controll
137. r Actuator Seapath 20 Displa DGPS sensor S Processing unit Figure 1 3 Measurment set up Chapter 1 Vessel and Equipment Configuration higher frequencies an interpolated value using the course and speed are calculated A short summary of the most important features of the Seapath are given in Table 1 3 For more details please consult Kongsberg Seatex AS 2003 Seapath 20 User s Manual Figure 1 4 Seapath 20 DGPS sensor www km kongsberg com Seapath 20 GPS compass Unit Heading accuracy 0 4 RMS Rate of turn accuracy 0 5 5 s Position accuracy with DGPS 1 5 m RMS Velocity accuracy with DGPS 0 05 m s RMS Table 1 3 Seapath 20 specifications 1 3 2 Simrad RPU80 Rudder pump and LF3000 Rudder Sensor A Simrad RPU80 rudder pump is used to move the outboard engine This pump is reversible to provide turning in both direction and has a capacity of 0 8 l min The direction of the pump is controlled by the polarity of the voltage and the flow rate is controlled by the voltage level maximum at 12 V The maximum power consumption is 6 A with an average of 2 4 A 4096 of maximum Moreover the pump is part of a hydraulic steering system which in addition to the pump consists of a tiller which translate the linear motion of the cylinder to a rotary motion of the outboard engine A Simrad LF3000 feedback unit is used to measure the cylinder expansion and consequently the rudder angle The compl
138. r 8 Design in Simulink Parameter 20 knots K 0 384 T 5 625 Ta 1 406 b 0 6 Tt 1 5 N 10 Table 8 3 Controller parameters at 20 knots gain was reduced to avoid and overshoot In Figure 8 39 8 40 you can see the perfor mance of the two controllers for a step from zero to 100 Their performance meets the general demand of close to zero overshoot 0 and 1 and a low settling time 23 s and 15 s for respectively the 5 and 12 knots controller Parameter 5 knots 12 knots K T Ta b Tt N 0 4 9 1 875 0 6 2 10 0 390 5 875 1 4688 0 6 1 5 10 Table 8 4 Controller parameters at 12 and 5 knots 102 Chapter 8 Design in Simulink Heading deg o O T 40 E 20 0 1 I L 1 L 0 10 20 30 40 50 60 Time s 25 T T T T Fi 20 ty 4 3 FOX E 15H 5 4 o N 1 X 10r 1 N 4 o I N 9 5r NG 4 S y s oF p T PCR A A RR RR RR m 10 i i j i i 0 10 20 30 40 50 60 Time s Figure 8 39 Controller performance at 5 knots 120 T T T T T 100 S so 3 60 1 o 053 40r 20 0 1 I L 1 L 0 10 20 30 40 50 60 Time s 20 T T T T 5 FA v RT 4 E E i 10h t 4 ae E 5ri x x s X 5 i tia 8 of E A A A 3 c 5 i i fi i j 0 10 20 30 40 50 60 Time s Figure 8 40 Controller performance at 12 knots 103 Chapter 8 Design in Simulink 8 2 8 Manual mode and Bumpless transfer W
139. r pump range for estimation and validation at 20 knots The obtained 1 order ARX model with time delay has the structure given as k 0 1562 _ E 43 Srep k 1 08474 14 52 where 0 k is the rudder angle and ref k is the desired rudder angle at sample k The obtained model for 20 knots has a pole zero plot as seen in Figure 4 6 and the Bode plot with phase and gain margins can be found in Figure 4 7 Poles can be found 30 Chapter 4 System Identification Measured and simulated model output 1 6 T T T T T T T T T 14r 4 12r 4 10 xl E 3 9r 7 o ce 6 E E 3 x 4 E E 2 L 4 or 4th order ARX model 90 fit 1st order ARX model 85 5 fit A i i i r Measured output 8o 65 70 75 80 85 90 95 100 105 110 Time s Figure 4 5 Rudder pump model output at 20 knots in z 0 and z 0 8447 and since they have an absolute value of less than one we can conclude that the model is stable Moreover we see that the phase margin is equal to 172 and the gain margin 16 1 dB which confirms our conclusions of a steady model from the pole zero plots The cut off frequency at 0 108 Hz is lower and gives slower dynamics than the actual system as can be seen from Figure 4 5 but this only results in a more robust system We therefore conclude that the model is good enough for the relatively slow dynamics of the pump 4 1 2 5 and 12 knots models The identifi
140. rform the computations It was found that T 3 gave the desired performance The resulting filter became ETE this filter is the second order filter plotted in Figure 8 52 The discrete version of this filter is 0 2835 8 18 z 0 7165 115 Chapter 8 Design in Simulink Step Response MM LL V Second order filter 1 2 First order filter Amplitude o co o D o T 0 2 Time sec Figure 8 52 First order filter vs second order filter 8 3 4 State transitions Model state and State selector are parallel states and runs without transitions In Model state we have three exclusive states and we have four possible transitions be tween these states e Five to Twelve e Twelve to Five e Twelve to Twenty e Twenty to Five The default state is Five which is natural since the autopilot is most likely to start at low speed The transitions between the states Five Twelve and Twenty are triggered by two different events sent by State selector These events are named Up and Down and indicates whether Model state should move up or down from the active state State selector also have three sub states which are all exclusive Here the default state is named Default and we have four possible transitions e Default to Down 116 Chapter 8 Design in Simulink e Down to default e Default to Up e Up to Default When the system is in the default State and the speed drops belo
141. rnative is to choose Tt T i The advantage of tracking is that it can be applied on any actuator as long as the actuator output measurement is available An illustration of integrator windup effect 63 Chapter 7 Theory Figure 7 8 A PID controller with tracking antiwindup str m and Wittenmark 1997 and the system with windup protection is given in Figure 7 9 Measured output y t and set point yrer t Set point Without antiwindup With antiwindup Figure 7 9 Effects of PID controller with and without antiwindup str m and Wittenmark 1997 7 1 6 Bumpless transfer Bumpless transfer describes the objective of avoiding transients when changing the prop erties of the controller These changes can be switching from manual to automatic con 64 Chapter 7 Theory trol parameter changes and testing of new controllers An example taken from Graebe and Ahl n 1996 in Figure 7 10 shows the behaviour of a plant which at start up is controlled manually and later switched to automatic mode without bumpless transfer Measured output y t and set point y 4 f E EE ee S Y di ee P d Z 2 tis 5 10 15 20 Control variable u t 1 0 5 0 tis 0 5 10 15 20 Figure 7 10 A system switching from manual to automatic mode without bumpless transfer Graebe and Ahl n 1996 The solution to the switching problem would be to implement positive feedback aro
142. roximately 20 s Therefore a rate limiter which limits the ROT to 20 s is introduced after the filter to limit the derivative so that the desired ROT is feasible The complete system in Simulink can be seen in Figure 8 6 ROT at 25 rudder angle 30 T ROT at 5 knot with rudder angle of 25 ROT at 12 knot with rudder angle of 25 ROT at 20 knot with rudder angle of 25 L L 15 20 25 30 Time S Figure 8 5 Model response at 5 12 and 20 knots to a step in rudder angle of 25 degrees 0 0044957 0 004205 q 22 1 812 0 8187 psi_setpoint psi_d Rate Limiter1 Discrete 2 order filter Figure 8 6 Final reference model for the heading set point 8 2 Heading Controller In Beinset and Blomhoff 2006 a scheme for doing experiments and system identification on asmall USV was created These experiments were further improved in Chapter 3 We 78 Chapter 8 Design in Simulink will in this section use the obtained models from the system identification of Chapter 4 to design and tune a heading autopilot for the USV The models were validated and tested to be stable and in coherence with the behaviour of the real vessel in the above mentioned chapter These models give us the USVs behaviour from commanded rudder angle to rate of turn The two models are divided into a first order model representing commanded to actual rudder angel and a fourth order model giving the behaviour from
143. s path In automatic heading mode the desired heading angle can be applied by moving the heading slider indicated by an A or by entering a set point in the text box indicated by the B If the entered heading lies outside the 134 Chapter 9 Implementation valid range 0 359 the new set point is rejected Finally if the program is in manual mode the rudder angle can be chosen by moving the slider indicated by K or entering a number in the range 25 in the field marked by J 135 Chapter 10 Discussion Modelling with the purpose of simulating the real vessel was started in our project thesis Due to problems with logging and computer based control we did not obtain models that were good enough to be used as a model for the real system Based on experience gained in the project new experiments were designed and new models were found during this master thesis The control design in this part has been based on this modelling and proves that the modelling have been sufficiently accurate to be used for design purposes Especially it should be noted that dynamics of the rudder actuator system model including the closed loop controller from Simrad was almost equal to the one we implemented in the vessel A detailed discussion of the modelling work was presented in Chapter 5 and we will not focus more on the modelling in the rest of this discussion When our system was implemented in the vessel we chose to uti
144. sages from a serial port from the Seatex Seapath system The read values are delivered to the USVsimulation mdl Simulink model In addition the S function is initialized by the correct values to avoid steps and discontinuities A checksum data validation is also performed to make sure no corrupted measurements are accepted The checksum calculation are perfomred by a function created by Steve Dodds 2003 Inputs serobj a handle to the robnet serial port stime sample time of the S function Outputs speed Speed on ground knots heading Heading degrees n_postion North postion m e postion East postion m Author Jarle Saga Blomhoff and Geir Beinset 2007 For more details see the complete file on the CD 147 Oo 0 JO NM fF wow NBE PoP ee eB a e Ne o 0o JO OC A OU NBEO o 0o 10 0 R ONB Chapter A MATLAB Code A 12 Sserread sfun m o o9 o o o o o o o AP oe o o oe oe NMEAserread sfun m is a Matlab S function which reads the ROBNET from a serial port from the NI300X connection box The read values are delivered to the USVsimulation mdl Simulink model every 250ms Inputs serobj a handle to the robnet serial port stime sample time of the S function Outputs ruddder rudder angl degrees Author Jarle Saga Blomhoff and Geir Beinset 2007 For more details s the complete file on the CD A 13 serwrite_sfun m o o o
145. seems to be amplified by the controller The last frequency at 0 01 Hz appears to be damped by our controller and has a maximum amplitude of 2 This will be verified by looking at the bode plot of the input sensitivity later in this section 8 2 10 Stability and sensitivity analysis To analyse our controller with set point weighting in MATLAB we need to express the transfer functions so they are on the form given in Figure 8 29 We first have to change the proportional set point weighting 106 Chapter 8 Design in Simulink E 100r me No disturbance 5 50L Wave disturbance 10Hz aii Suo a Wave disturbance 1Hz I Wave disturbance 0 1Hz Wave disturbance 0 01Hz i 5 10 15 20 25 30 35 Time s Rudder angle set point deg T 5 10 15 20 25 30 35 Time s Figure 8 45 The effect of an oscillating disturbance in rate of turn b 1 b 8 14 P t Kp b x Yres t y t Kp 1 bures t y t gt Kp Yres t m y t s Kpb x Yref t 8 15 Kp x e t Kp x bx Yref 8 16 The second term in Equation 8 16 gives us the term from the set point weighting It can be seen that this term corresponds to feed forward and only changes the zeroes of the open loop A block diagram with the feed forward term separated is shown in Figure 8 46 To modify Figure 8 46 to fit the diagram in Figure 8 29 we need to move the feed forward term so
146. sis will be reduced by the same factor A drawback with periodic signals in general is that they can at most contain M different frequencies A PRBS is persistently exciting of order M 1 see Ljung 1999 Page 421 A signal which is persistently exciting of order n can be used to identify a model with n parameters It is desirable to create a PRBS sequence that is as long as possible but as the experiments are performed in Trondheimsfjorden at high speeds the need of obstacle free surroundings limits the length of the sequence At the first run of the experiments the signal described above was used as input with a update frequency of 1 Hz and an amplitude of 15 in rudder angle This sequence had a length of 1023 The experience 22 Chapter 3 Experiments gained from this run was that the steering hydraulics and the vessel dynamics were to slow to react to the changes in the input and the frequency of update should be reduced As the rudder machinery is able to make rudder changes at a maximum rate of 6 s it was decided to update the input every third second and reduce the amplitude to 8 This ensures that the actual rudder angle set point can be imposed before another set point is given It is assumed that the change in ROT is linear with the change in rudder angle Decreasing the update frequency is the same as increasing the clock period see Ljung 1999 page 422 and the sequence length had to be reduced due to the incre
147. t ZOO e eco uie ap tae Bou tum del ols BO ee a toe ure Ee 3 100 Controller performance at 20 knots 22e 101 Controller performance at 5 knots ees 103 Controller performance at 12 knots 22s 103 Transition from automatic to manual mode at 20 knots 104 ix 8 42 8 43 8 44 8 45 8 46 8 47 8 48 8 49 8 50 8 51 8 52 8 53 9 1 9 2 9 3 9 4 9 5 9 6 9 7 9 8 9 9 9 10 9 11 9 12 9 13 9 14 9 15 9 16 9 17 Transition from manual to automatic mode at 20 knots with and without bumpless transfer sss fe ig has ey eye Goes koc ee e ed 105 How disturbances are simulated and added to the model 105 The effect of a constant disturbance in rate of turn 106 The effect of an oscillating disturbance in rate of turn 107 The set point feed forward term in the block diagram 108 Feed forward term is multiplied by the inverse of the controller 108 Model with feed forward term ready to be analysed 108 Bode plot of the input sensitivity and the closed loop with proportional set point weighting 2l llle 109 The complete Simulink model with state machine 110 State machine for the gain scheduling algoritm 114 First order filter vs second order filter o 116 Way Point Navigation block in Simulink 118 The MATLAB Simulink model for the implementation 120 C
148. ta m import data m This script loads measurements data from the GPS and an input sequence and use parseLabViewLog m to parse the data into MATLAB format The script also provides an option to filter the input ouput sequence to remov unwanted disturbances Author Jarle Saga Blomhoff and Geir Beinset 2007 For more details s the complete file on the CD o o o oP o o oe oe A 3 parseLabViewLog m function time heading heading2 act rudder cmd rudder ROT course speed parseLabViewLog path file knot parseLabViewLog Parse log file from LabView into matlab 142 O o JO 0 RR w 11 12 13 14 15 om 10 Ct RR WN FPF O o WAN DOH FF ONB N y o O o JO Oc fF QM n2 Chapter A MATLAB Code Converts an text log file with time heading rudder angle commanded rudder angle ROT course and speed to matlabformat Outputs time s heading deg 0 360 deg heading2 degrees continous actual rudder angle degrees commanded rudder angle degrees ROT degrees s course degrees and speed knots path is the path for the log file file is the file you want to import txt knot The speed at which the measurement has been done Author Jarle Saga Blomhoff and Geir Beinset 2007 For more details see the complete file on the CD o oe oe o o AP AP o o o oe o oe A 4 setparam values setparam values Usage Embedded MATLAB function called from the Gainscheduler Stateflo
149. ted and implemented in Simulink as a series of if expressions given in Figure 8 12 8 15 These blocks can be interpreted as follows 8l 0 NTN Oak WN RF O KO WBN DA BR WN FB Y o Chapter 8 Design in Simulink psi_ref desired heading psi measured heading if abs psi ref psi lt 180 no need to cross the boundary psi and psi ref are passed through the Simulink block psi psi psi_ref psi ref oe oe elseif psi_ref psi gt 180 the controller should cross the boundary from 0 to 359 and the desired heading should be subtracted 360 psi psi psi_ref psi ref 360 elseif psi_ref psi lt 180 the controller should cross the boundary from 359 to 0 and the desired heading should be added 360 psi psi psi_ref psi ref 360 o end if u1 lt 180 elseif u2 gt 180 u2 elseif u2 lt 180 ul If l x psi out Fr Ipsi in 3 psi d out gt x mnes psi d in Selector E P If Action Y pisi Subsysem POT Action i psi_out peH I seca i A 2 gt si d in Selector jd psi d out If Action Multiport Switch Sabat Action psi_out psi in psi d out Me psi d in Selector If Action Subsysem2 Figure 8 12 Upper level of the Simulink if block to choose the shortest direction With these if loops implemented in front of the heading control
150. tely 7 to 10 knots A first approach to this problem could be to change the threshold that decides when the parameter switch ing occurs Another approach could be to do more system identification in the region between 5 and 12 knots to obtain a model for this region A third solution could be to use interpolation to create continuously changing parameters with regard to speed The Line Of Sight algorithm which is used in our implementation gives the desired heading as the heading to the next way point This will produce large cross track errors when there is current and wind disturbances At high speed large cross track errors might even cause the vessel to miss a way point this is not acceptable T he cross track error can be reduced by modifying the LOS algorithm so that it points on the vector between the the previous way point and the next way point This solution is described in Fossen 2002 At high speed and rough sea GPS fall out was experienced The GPS sensor has been identified as the source of this problem and Maritime Robotics are currently working to solve this problem Our controller includes logic to handle loss of GPS information In such cases it keeps the last valid measurement until a new valid measurement is acquired It should be noted that in case of GPS fall out the control loop is broken and the system becomes an open loop system with respect to heading control and way point navigation This might lead to dangerous situatio
151. tem such as VxWorks QNX or MATLAB xPC During this development both the desired operating system and final hardware was undecided So because of limited time a almost real time solution was used Our solution uses a windows PC and MATLAB with Simulink To control the time of the simulations a free ware block designed by Daga 2007 The information given below is a summary of the description found on the homepage of Daga 2007 The RT Blockset for Simulink consists of a block using a S function written in C language It can not be compared to running the simulations on a real time operating system since it does not use a separate OS or runs a real time kernel This blockset is based on the simple concept that to make the Simulink run with a real time approxima tion the calculation time neded by Simulink should be lower then the desired simulation step If this assumption is not valid no real time simulation is possible whichever is the applied scheduling method This assumption is not completely valid since windows is not a real time OS and has other processes running on the same time If another process with higher priority takes up all the calculation time of the system we will have error in the calculated values of Simulink 15 Chapter 2 Rapid Control Prototyping Problem specification Build model in Simulink Run simulations and Anlyse results Run simulations and Anlyse results Run simulations and Anlyse resul
152. th different frequencies working on the rate of turn Current disturbance has more effect on tracking error when running a waypoint autopilot and we will in our thesis not counteract it but this can be done in 104 Chapter 8 Design in Simulink 150 T T I I i With bumpless transfer a Without bumpless transfer 3 100r age pum o x15 X2 X v 5528 Y 928 a Nee z D 50 Ma T 0 i 0 10 20 30 40 50 60 Time s 3 20 i i 5 10 7 g 5 rq erre A ETS 7 E 5 10 J c 3 20 J me EES li 1 i a s05 10 20 30 40 50 60 Time s Figure 8 42 Transition from manual to automatic mode at 20 knots with and without bumpless transfer the future by implementing a modified line of sight algorithm The waves and currents are applied on the model as shown in Figure 8 43 Sine Wave Wave Disturbance on off Commanded Actual rudder angle 0 1562 rudder angle Rudder angel z2 0 8447z set point Rudder Pump w Simrad controller 0 034357 0 112473 0 369522 0 2131z Rate of tum 24 2 32823 2 41322 1 3540z 0 3388 Vessel dynamics heading inf heading 0 260 Heading Discrete Integrator Output 0 360 degrees Wind Disturbance on off Rate of tum Drift Figure 8 43 How disturbances are simulated and added to the model Constant disturbance Wind We start by simu
153. that it can be included in the the Reference Model By moving the second summation block to the left we only needs to multiply the feed forward term with the inverse of our controller as shown in Figure 8 47 Then we have a loop containing only the set point weighting part and it can be reduced to a block which is to be multiplied by the reference model Figure 8 48 To analyse our systems sensitivity to input disturbances on the plant model we have plotted the bode plot for the complete system from desired heading to measured heading 107 Chapter 8 Design in Simulink Desired heading Reference model Controller Figure 8 46 The set point feed forward term in the block diagram Proportional set point weighting desired heading Reference model Figure 8 47 Feed forward term is multiplied by the inverse of the controller m F 1 FPinv C Qu Reference model Desired heading Scope Controller Figure 8 48 Model with feed forward term ready to be analysed 108 Chapter 8 Design in Simulink blue and from disturbance input on the system to measured heading This plot can be found in Figure 8 49 and confirms our assumptions from the analysis of the wave disturbance in Figure 8 45 that the vessel is vulnerable for disturbances around 0 1 Hz Moreover it can be seen that the closed loop is stable and that the gain margin is 56 4 dB at 0 475 Hz The phase margin is infinite since the closed loop gain
154. the sampling time of the NMEA messages This is set to 500 ms and the two messages comes 250 ms apart We can now double the fundamental sampling time to 50 ms This gives us the performance shown in Figure 9 3 Here the calculation limit is crossed 5 times in 9 seconds But more importantly the crossings do not come after each other and the consequence will not be so serious Figure 9 5 shows an example when the first sample takes 80 ms With 25 ms funda mental sampling time two samples are passed and only the first and fourth samples can be calculated For the case with 25 ms fundamental sampling time the first sample uses 80 ms and 20 ms are left for the second sample Average calculation time in Figure 9 3 is less than 10 seconds so no sample loss should be experinced A better solution would be to reduce the sampling of the ROBNET signal but that configuration was not available to us The sampling time of the different blocks in our program is shown in Figure 9 4 9 1 2 Read NMEA messages Heading position and speed measurements are provided to us as NMEA messages ac cording to the NMEA 0183 protocol over a serial cable Because an error in the Seapath hardware the heading have to be read from a separated message The messages comes 120 Chapter 9 Implementation Fundamental sampling time 25 ms 80 70 60 Calculation time ms E a eo o T T w o T 20
155. this is that more of the wave motion will be filtered out by the dynamics of the vessel 51 Chapter 5 Discussion which is acting as a low pass filter This effect is believed to cause most of the observed improvement in the model accuracy with respect to real output data from the vessel which increases from 68 996 at 5 knots to 89 696 at 20 knots When the experiments were designed it was assumed that the relationship between ROT and rudder angle is linear In Figure 5 1 it can be seen that this is not the case The figure plots the real rate of turn and the model predicted ROT when rudder angles of 15 are applied The model gives a lower steady state ROT than the real system and the result is a steady state error As the steady state error occurs in the ROT it will not affect the heading but the real system will be faster than the model When tuning the controller based on this model it might result in a larger gain than the optimal Therefore it might be necessary to reduce the gain of the controller when it is implemented in the vessel Measured and simulated model output at 20 knot with rudder angle of 4 15 degrees 20 T T T T T T T T I Measured data Model output ROT deg s Deviation of 6 degrees 5 10 15 20 25 30 35 40 45 50 55 Time s Figure 5 1 Deviation between measured ROT and model predicted ROT at 15 rudder angle The analysis of the three models also revea
156. this section we will go through the implementation of the heading controller Hardware and communication issues regarding the implementation are given in Section 9 1 We only had the two last weeks of the Master thesis to implement the controller and tune it This is reflected in our implementation where the main focus is to get the autopilot up and running and not on having perfect performance Even though the controller was tuned thoroughly in Simulink using our Rapid Control Prototyping RCP environment tuning in the boat is very time consuming Companies which design autopilots have a long and strict test run and use a great amount of resources and time Unfortunately we did not have this time at our disposal Sea trails were performed and navigation data was logged but little or no tuning was performed We will therefore show the result of our experiments and suggest further improvements Moreover it was hard to find a day with little wind and waves so our implementation was done with disturbances Actual wave height was observed to be more than 1 m during some of our trials Nevertheless this section will also show that both our navigation system and heading controller works and bring the vessel to the desired position or heading 9 3 1 Heading Autopilot without Gain Scheduling Our first goal was to implement a heading autopilot with constant parameters which fol low the desired heading We did this with the controller parameters found in Cha
157. totyping A wide variety of programs have been used for rapid prototyping We have in this thesis used MATLAB Simulink models with extensions to StateFlow block diagrams Theses tools provides us with an easy to use and intuitive interface for designing and tuning the controller An example of this could be the task of extending the controller to include anti windup In Simulink this is simply done by adding some blocks to our model Traditional approach on the other hand would demand changes to the C code of the program and maybe also implementation of new drivers and measurement routines A possible flow of the rapid prototyping process can be found in Figure 2 2 2 1 Simulator When testing out a new design it is very convenient to not work directly on the plant both with regards to cost and time consumption If the computer simulates the process to be controlled fast simulation which could take ten times as much time on the real process can be performed in a few minutes To be able to do these simulations we need to make a model of the process to be controlled This is done in Chapter 4 A mathematical model is then used to represent the real process It is never possible to exactly identify all the dynamics of the process but nevertheless the simulations will give us a good starting point 2 2 Real time constraints Normally when performing rapid prototyping a real time system is provided Often running on a real time operating sys
158. troller with proportional set point weighting will therefore be tuned manually by running simulations with different parameters 8 2 5 Proportional set point weighting To reduce the large overshoot introduced by the Ziegler Nichols method we use set point weighting as explained in Section 7 1 4 Prashanti and Chidambaram 2000 shows the usefulness off set point weighting and states that the weighting does not change stability of the closed loop since it only changes the zeros of the open loop A MATLAB script for parameter tuning VariableT uning m was created and Figure 8 34 shows the weighting 97 Chapter 8 Design in Simulink EN o o T T T T ps _ 300 4 g N N 3 N N oo ES N 2 200 ET Es N71 3 ig pl o JN E S I E S 100 3 N N N E Y y i is 0 i 1 A 1 1 N 0 10 20 30 40 50 60 Time s 30 T T T jode 77 A 20 A i 4 5 Es r 1 2 10r x I 4 2 7 2 ok 4 f i M 5 1 j 1 M 1 1 3 10 J 3 i l J a ji 20 j 1 j 7 bobman j ieee aise A AA nm Be 30 1 L 1 L 1 0 10 20 30 40 50 60 Time s Figure 8 33 Unstable simulation on the real model with the controller parameters from root locus tuning without time delay b ranging from 0 1 to 1 Choosing the right weighting is a compromise between too much overshoot and a system reacting slower to set point changes A value of b 0 6 is chosen since it considerably reduce the overshoot w
159. ts Run simulations and Anlyse results Figure 2 2 The flow of a rapid prototyping process 16 Chapter 2 Rapid Control Prototyping This block simply holds the execution of the Simulink simulation attached to the time flow leaving whatever remaining CPU time to other windows processes that need it The concept is very simple but effective Another approach would be to use the MATLAB real time workshop and the real time windows target kernel But these toolboxes are a relatively large cost for a small company so at the moment they were not available to us Figure 2 3 shows the structure of our rapid prototyping environment MATLAB Simulink StatFlow With Real time blockset Serial communication Vessel Actuators and Sensors Figure 2 3 Structure of our rapid prototyping environment 17 Part II Modelling Chapter 3 Experiments This chapter will introduce important concepts for design of system identification exper iments and design of experiments to identify models of a small USV will be performed These models will be implemented in a computer simulator where they will be used in the design of a heading controller and in analysis of the control system 3 1 Input design for open loop experiments Performing experiments on physical systems are costly and time consuming therefore it is important to design experiments which are as informative as possible to reduce these factors By informative experiments
160. ty m is a Matlab script which runs a Simulink simulation to calculate the PID parameters according to the Ziegler Nichols ultimate sensitivity method USVsimulationXX mdl is the name of the Simlink model where XX defines the speed The speed is chosen from an input box Outputs Kp Proportional gain Ti Integral time Td Derivative time Plots Heading deg rate of turn deg s plots are optional Author Jarle Saga Blomhoff and Geir Beinset 2007 For more details s the complete file on the CD A 7 VariableTuning m o o9 al oe oe o oe oe o oe oe oe VariableTuning m is a Matlab script which runs a Simulink simulation to tune the controller parameters USVsimulationXX mdl is the name of the Simlink model where XX defines the speed The speed is chosen from an input box SimParameter mat stores the current controller variables Plots Heading deg 144 13 14 15 O 0 NN OT FF Q Mj O oq AN DH R Oo MN Be N N N N W Ne O c o N QOU RR Qo M nc hor o Chapter A MATLAB Code Author Jarle Saga Blomhoff and Geir Beinset 2007 o oe oe For more details see the complete file on the CD A 8 USVsimulationGui m USVsimulationGui m is a Matlab script which starts the GUI to control the autopilot and handles its calls It also opens the model to be run if it is not open In addition it initilazies the autopilot by getting the inital values from the GPS
161. ues from 7 to 7 and this values have to be mapped into the range 0 to 360 as this is the input to the heading autopilot The desired heading set point is then filtered through the reference model see Section 8 1 before it is applied as set point to the autopilot Nwp3 Ewp3 Nwp2 Ewp2 Nwp1 Ewp1 Figure 7 17 Line Of Sight Navigation 74 Chapter 8 Design in Simulink One of the goals in this report was to design and implement a heading controller on an Unmanned Surface Vehicle USV This design was performed in two steps First the controller was developed in the MATLAB Simulink environment Second the required adjustments were done during the implementation In addition a reference model was designed to provide the controller with feasible set points for the vessel The Rapid Control Prototyping RCP tools of the Simulink environment provided us with great flexibility when trying out new solutions and possibilities Moreover this environment saves time and is one of the main reason we managed to do everything form system iden tification to design and implementation in only one Master assignment The environment will also offer a base for further development by Maritime Robotics AS 8 1 Reference model Based on theory presented in Section 7 2 a second order low pass filter is designed for the reference model The reference model presented in this section is a simple reference model which is designed so that
162. und a first order filter for both the manual and automatic mode Please see Figure 7 11 and consult str m and Wittenmark 1997 for more information To avoid drastic changes in the output when the error is zero and we are changing parameters it is necessary to implement the controller in a specific way Since we are at the desired set point and the error is equal to zero the active part of the controller is the integral action The two different implementations used to describe the problem are given as f e r dr 7 18 K r i T t r dr 7 19 l etes ded PN ae Chapter 7 Theory Uman t Y rer t Figure 7 11 PID controller with bumpless switching between manual and automatic mode str m and Wittenmark 1997 Equation 7 18 will here give a sudden jump or bump in the integral action when there are changes in K T Equation 7 19 on the other hand will give a smooth bumpless change in the controller output because the changes are added to the integrator and not multiplied 7 1 7 Digital Implementation All PID controllers to be implemented on digital computers need to be discretised due to the fact that all computers are inherently sampled systems Since the PID controller originally was an analog invention a discrete approximation is used The three basic methods for approximation are the forward difference or Euler method the backward difference method and the Tustin s method also call
163. w Chart Value is either 5 12 or 20 and determines the parameters of the PID controller The parameters are calculated as follows example for 5 knots model Kp 0 6 Ti 6 875 Td 1 7188 KTi Kpx h Ti Kp Td N Td Nxh A a i The parameters are updated using set param tuning of the PID controller can be performed by altering Kp Ti and Td in setparam values Author Jarle Saga Blomhoff and Geir Beinset 2007 o o o o o9 o o o o o o o AL oe o oe o oe oe oe For more details see the complete file on the CD A 5 ZNstepResponse m ZNstepResponse m is a Matlab script which runs a Simulink simulation to calculate the PID parameters according to the Ziegler Nichols step response method PlantXX mdl is the name of the Simlink model where XX defines the speed The speed is chosen from an input box Outputs Kp Proportional gain o oe oe o9 AP AP AP oe oe 143 oman aw fF WN KF Oo 0 JO C amp UNBE OF OD ODN DD a ROO e co o N Q 11 12 Chapter A MATLAB Code o o Ne A o A o oe oe oe Ti Integral time Td Derivative time Plots Heading deg rate of turn deg s and commanded rudder angle are plotted Author Jarle Saga Blomhoff and Geir Beinset 2007 For more details s the complete file on the CD A 6 ZNultimateSensitivity m o oe oe oe oe o o9 o9 o o o o o o AP oe oe oe ZNultimateSensitivi
164. w the Down th threshold the Default state becomes inactive and the Down state becomes active As this transition is executed a Doun event is fired When the system enters the state Down there is no criteria for the transition back to default so the system returns to the Default state as soon as the Down state has become active The transitions between Default and Up are based on the same logic when the speed is higher than the Up th the transition from Default to Up is activated and the the Up event is fired When the Up state is active the system returns from Up to the Default state again 8 3 5 Triggering the chart The Stateflow chart can be activated by sampling it using a trigger signal or by using another Stateflow chart Our system is sampled and the sampling rate is inherited from the Simulink model which is sampled at 4 Hz 8 4 Way Point Navigation Way Point Navigation is implemented as a block in Simulink This block contains a s function which reads the vector waypoint_sfun containing the way points The s function calculates the distance to the next way point when the distance is less than 20 m it checks whether there are more set points or not and changes the set point if there is another set point The function can be found on the enclosed CD please consult Appendix D Figure 8 53 shows the complete Way Point Navigation System including the LOS block It can be seen that the LOS block contains logic for mapping the output of th
165. wing two formats GPRMC 123519 A 4807 038 N 01131 000 E 022 4 084 4 230394 003 1 W 6A Where Variable Description RMC Recommended Minimum sentence C 123519 Fix taken at 12 35 19 UTC A Status A active or V Void 4807 038 N Latitude 48 deg 07 038 N 01131 000 E Longitude 11 deg 31 000 E 022 4 Speed over the ground in knots 084 4 Track angle in degrees True 230394 Date 23rd of March 1994 003 1 W Magnetic Variation 6A The checksum data always begins with GPHDT 53 22 T 33 Where Variable Description HDT Heading 53 22 T True heading in degrees 3d The checksum data always begins with The NMEA serial communication is configured by running the MATLAB script read NMEA serialconf m found in Appendix A 10 A handle to the serial port is given to the S function NMEAserread_sfun m found in Appendix A 11 This S function reads the serial port buffer and does a checksum test for the NMEA message The implemented checksum calculation function is originally created by Steve Dodds 2003 and can be found in the end of NMEAserread_sfun m When the message pass the checksum test it is identified as heading or speed and position measurement The speed measurements are given in knots and the heading in degrees Position measurements are read as longi tude latitude but converted and stored as distance in meter from the zero meridians These conversions are done according to longitude 6033 002
166. wo samples Therefore it was necessary to convert the ROT measurement to a signal in the range inf this conversion makes the heading measure ment continuous The conversion is done by parseLab ViewLog m as the data is loaded in MATLAB Usage of this function can be found in Appendix A 3 parseLab ViewLog m is called by import data m This section provides a comprehensive presentation of the data adjustment at 5 knots while the adjustment at 12 and 20 knots is given in Appendix B The procedure for the adjustment is the same at all three speeds Figure 4 12 shows the ROT derived from the heading and the measured ROT at 5 knot plotted together This Figure clearly show the delay of the measured ROT The delay was found after identifying a distinct shape which both the calculated and the measured ROT contained this is where the data cursors are placed in the plot of Figure 4 12 The time delay was found to be 5 7 s which corresponds to 23 samples as the sampling rate is 4 Hz Based on these results the sequence containing the measured ROT was shifted 23 samples so that the 23 7 sample became the first sample The shifted sequence is plotted again together with the ROT derived from the heading in Figure 4 13 The figure shows that the measured and calculated ROT is very similar The figure clearly shows that the calculated ROT contains more noise than the measured ROT The measurement of the actual rudder had to be cut at the end so that the two data
167. ystem Identification hydraulics The second possibility is to identify the system from commanded rudder angle to ROT resulting in a system which covers both the dynamics of the vessel and the steering hydraulics These experiments uses the AC20 autopilot interface and the rudder machinery is controlled by AC20 This means that the steering hydraulic is a closed loop system including dead band non linearities introduced by the controller from Simrad The intention is to replace the AC20 controller therefore it is preferable to do the system identification for the vessel and the steering hydraulic separately First the steering hydraulic system identification will be presented then the system identification of the vessel dynamics Throughout this chapter models are tested and validated against real data from sea trials with the USV The percentage of fit is defined as lly l lly mean y Here y is the output of the vessel j is the model output and mean y is the average of the vessel output The fit tells us how much of the vessels behaviour that can be explained by the model Fit 1 x 100 4 1 The scripts used for data treatment and analysis can be found on the CD enclosed at the end of this report and the content of this CD is listed in Appendix D Also the system identification sessions are present these can be loaded into MATLAB system identification toolbox The usage of these scripts can be found in Appendix A 27

Download Pdf Manuals

image

Related Search

Related Contents

Conseils sur l`élaboration d`une documentation de travail  Samsung WF1704WSE2 1400rpm ecobubble VRT Washing Machine User Manual  Electrolux ZDF 501 User's Manual  Bedienungsanleitung    Model BC1712G Deluxe Portable LP Gas grill  Tandberg Data DAT72 and DAT160 SCSI tape drives user guide  RHUB User Manual - Rhub Web Conferencing and Remote Support  manual  Kenroy Home HDP11962 Installation Guide  

Copyright © All rights reserved.
Failed to retrieve file