Modeling, Identification and Control, Vol. 31, No. 2, 2010, pp. 67–77, ISSN 1890–1328

Control of a -Based Pilot Underwater Lifting Body

Finn Haugen

Telemark University College, Kjoelnes Ring 56, N-3918 Porsgrunn, Norway. E-mail: fi[email protected]

Abstract

This paper is about position control of a specific small-scale pilot underwater lifting body where the lifting stems from buoyancy adjusted with an air pocket in the lifting body. A mathematical model is developed to get a basis for a simulator which is used for testing and for designing the control system, including tuning controller parameters. A number of different position controller were tried both on a simulator and on the physical system. Successful control on both the simulator and the physical system was obtained with cascade control based on feedback from measured position and height of the air pocket in the lifting body. The primary and the secondary controllers of the cascade control system were tuned using Skogestad’s model-based PID tuning rules. Feedforward from estimated load force was implemented in combination with the cascade control system, giving a substantial improvement of the position control system, both with varying position reference and varying disturbance (load mass).

Keywords: Underwater, buoyancy, air lift, position control, cascade control, feedforward control, distur- bance, estimation, Skogestad model-based controller tuning

1 Introduction ancy. Several control functions were tried both on a simulator and on the physical system. The only Underwater lifting operations is a common task in e.g. method which worked well on the physical system was the offshore oil and gas production industry. This pa- standard cascade control with positional control as the per is about control of a small-scale physical pilot un- primary (master) control loop and air mass in the lift- derwater lifting system.1 The lifting principle is ad- ing body as the secondary (slave) control loop. The justment of the buoyancy by controlling the amount of selected control strategy has certain similarities with air in the air pocket of the lifting body. Buoyancy can the control structure described in a US patent by Ot- provide a large lifting force with little energy, but it terblad and Dovertie(1985) where the inner loop is requires a control system. A position control system is based on a measurement of the lifting force.2 The sim- designed and implemented to keep the body with load ulator and the control system are implemented in a at a reference position. A mathematical model is de- LabVIEW program running with cycle time 0.02 sec veloped to get a basis for a simulator which is used for on a PC. testing and for designing the control system, including The paper is organized as follows: The system is de- tuning controller parameters. scribed in Section2. A mathematical model is derived Fossen(1994) and others, describe position control of in Section3. This model is the basis of a simulator of underwater vehicles, but there is not much research re- the system, and it is also used for design and tuning ported about stabilizing underwater bodies using buoy- of the controllers and the observer (estimator). Con-

1This project was initiated and funded by the company Miko 2Actually, in the patent the secondary loop is based on the Marine, Oslo, Norway. time-derivative of the force measurement.

doi:10.4173/mic.2010.2.3 c 2010 Norwegian Society of Automatic Control Modeling, Identification and Control trol system design, including state observer design, is described in Section4. Experimental results are pre- sented in Section5. Conclusions are given in Section 6.

2 System Description

Fig.1 shows schematically the lifting body, including the position control system. Fig.2 (left) shows a photo of the lifting body inside a water tank used for testing the position control system. Fig.2 (right) shows the actuator which is a pneumatic control valve which ad- justs the air flow into the air pocket of the lifting body. The air flows out of the air pocket via a valve with Figure 2: Left: Water tank with lifting body. Right: fixed (manually adjustable) opening. Pneumatic control valve (Samson, Type 3241, Series 250) for controlling the air flow

PC with to the cylinder. LabVIEW u [V] in this sense, but to design and implement a proper Air Ps [bar] Fin [kg/s] position control system for the selected configuration, supply patm [bar] Surface assuming that the principal results are transferable to a different configuration. Fout [kg/s] La [m] y [m] Air Sensor La [m] Air 3 Mathematical Modeling mcyl [kg] (Ultrasound) pocket

ma [kg] pa [bar] La [m] 3.1 Variables and parameters Va [m3] rho a [kg/m3] Variables and parameters with values are given below. y [m] Water Sensor mb [kg] • y [m] is position of lift body. Position is zero at the y [m] Vb [m3] () water surface, and positive direction is downwards.

• flift [N] is buoyancy lifting force. Load ml [kg]

• fh [N] is hydrodynamic drag or damping (friction) force acting on the lifting body from the water. Figure 1: The lifting body with load.

• fg [N] is gravity force on the system. The lifting body position y is measured with a pres- sure sensor. The position is calculated from the pres- • fd [N] is any independent environmental force in sure measurement, since the position is proportional to addition to the defined above. the hydrostatic pressure. The height of the air pocket in the lifting body is measured with an ultrasound level • mtot [kg] is total (resulting) mass to be lifted by sensor.3 the lifting body. It is certainly an open question whether the con- figuration shown in Fig.1 represents optimal design. • mb [kg] is mass of the ballast water. Alternative configurations are controlling the outlow, • m [kg] is mass of air in air pocket and controlling both inflow and outflow simultaneously air with split-range control. However, it was not a purpose • madd = 2.0 [kg] is added (virtual) mass related of the present project to find the optimal configuration to the forced motion of water as the lifting body 3It was important that the cap of the lifting body where the moves. sensor was mounted was isolated (we used foam plastic), to avoid disturbing sound reflections. • mcyl = 6.0 [kg] is mass of the body.

68 Haugen, “Control of a buoyancy-based pilot underwater lifting body”

• mcyllift = 2.0 [kg] is mass of the water correspond- 3.2 Mathematical modelling ing to volume taken up by the lifting body in the A mathematical model describing the motion of the water (causing buoyance force). lifting body was developed from the following modeling • ml = 5.0 [kg] (default value) is mass of load at- principles: tached to the lifting body. • Equation of motion of the lifting body with load 3 • Vb [m ] is volume of ballast. • Mass balance of the air in the air pocket of the • V [m3] is volume of lifting body. cyl lifting body 3 • Va [m ] is volume of air pocket in lifting body. Modeling details are given in the following sections. 2 • Acyl [m ] is cross-sectional area of lifting body. 2 • Ap [m ] is a cross-sectional area parameter used 3.2.1 Equation of motion to calculate f . d Applying Newton’s Second Law gives • Lcyl = 0.6 [m] is length of lifting body. mtoty¨ = −flift − fh + fg + fd (1) • d = 0.2 [m] is lifting body diameter.

mtot in eq. (1) is described in detail below. • La [m] is height of air pocket in lifting body. 3 • ρa [kg/m ] is density of air in air pocket (at the mtot = mb + madd + mcyl + ml (2) present depth). where 3 • ρaatm = 1.2 [kg/m ] is density of air at the surface (). mb = ρwVb (3) 3 • ρw = 1025 [kg/m ] is water density. Vb = Vcyl − Va (4) m V = a (5) • Fin [kg/s] is air mass flow into lifting body from a ρa the compressor, through the control valve. m is given by the mass balance of the air in the lifting • F [kg/s] is air mass flow out from lifting body a out body, cf. eq. (20) below. Now, eq. (1) becomes through outlet valve.   • K = 0.004 [N/(m/s)2] is hydrodynamic drag or ma h mtot = ρw Vcyl − + madd + mcyl + ml (6) damping (friction) force. ρa

• Kv = 250 [kg/s] is valve constant of inlet (control) where valve. Vcyl = AcylLcyl (7)

• Kvout is valve constant of outlet (manual) valve. In eq. (6), ρa is a function of depth y given by the Gas Law: • patm [Pa] is atmospheric air pressure. p(y) ρa(y) = (8) • ps [Pa] is the pressure of the air out from air com- RT pressor (air supply). R is the specific gas constant, and T is the . Assuming constant T , eq. (8) gives • ∆pin [Pa] is pressure drop across air inlet valve. ρ (y) ρ (0) ρ • ∆pout [Pa] is pressure drop across air outlet valve. a = a ≡ aatm (9) pa(y) pa(0) patm • ∆patm = 101000 [Pa] is atmospheric pressure. Here, • u [V or %] is valve control signal. pa(y) = patm + ρwg (La + y) (10) • g = 9.81 [m/s2] is gravity constant. Now eq. (9) gives

The parameters Kh and Kvout were adjusted manu- ally in a simulator until the simulated position showed pa(y) ρa(y) = ρaatm (11) the similar response as the measured position. The patm   parameter madd was given an assumably reasonable ρwg (La + y) = ρaatm 1 + (12) value. patm

69 Modeling, Identification and Control

Here we will make the assumption that ∆pin is the pressure drop across the valve:

y  La (13) ∆pin = ps − pa (22)

which will hold when the lifting body is at relatively Typically, large depths. This implies ps  pa (23)   Hence, ρwgy r ρ (y) ≈ ρ 1 + (14) ps a aatm F ≈ K f (u) (24) patm in v v1 patm which is used in eq. (6). Each of the terms at the right fv1 (u) is the valve flow characteristic function normal- side of eq. (1) are now described: In eq. (1), the lifting ized with values between 0 and 1. The valve used in force flift is given by this project has an equal percentage valve characteris- tic function. However, since we have an air flow meter flift = ρwVag (15) installed in the rig, we have decided to model the valve with experimental relation between control signal and where flow. Fig.3 shows the air flow Fin [kg/s] as a function of the valve control signal u [%]. The supply pressure Va = AcylLa (16) was ps = 1 bar. The circles are experimental data, and πd2 the lines are just linear interpolations. Acyl = (17) −3 4 x 10 2 In eq. (1), 1.8 dy dy fh = Kh (18) dt dt 1.6

1.4 where Kh is adjusted manually during experiments. In eq. (1), 1.2

 1 fg = ml + mcyl − mcyllift g (19) Flow [kg/s] 0.8 where the term mcyllift g is the buoyance force due to the lifting body itself being submerse. 0.6

0.4

3.2.2 Mass balance of air in air pocket 0.2

0 The mass ma of the air in the air pocket of the lifting 0 10 20 30 40 50 60 Valve control signal, u [percent] body is varying. A mathematical model of ma is given by the following mass balance of the air in the lifting body: Figure 3: Air flow Fin [kg/s] as a function of the valve control signal.

m˙ a = Fin − Fout (20) In the project we inverted this valve function by us- The air mass inflow Fin and the air mass outflow Fout ing table-lookup based on linear interpolation between are described in detail in the following. the tabular data. Hence, for any specified flow Fin, the table-lookup give the valve control signal u needed Modeling the air inflow to obtain that flow. One convenient consequence of Fin is assumed to be a controllable (adjustable) in- this is that the nonlinear valve can be represented by put variable. In practice the specified Fin is obtained a linear valve with flow Fin as the control signal (or by manipulating the control signal u to the inlet con- manipulating variable). trol valve. u is a voltage in the range of [0 – 5V] which will be represented with a percent value in the range of Modeling the air outflow [0 – 100%], with a linear relation between the ranges. In eq. (20) the air mass outflow Fout through the Fin is ideally given by the valve equation: valve, which has fixed opening, is modelled as s s ∆pin |∆pout| Fin = Kvfv1 (u) (21) Fout = Kvout · sign(∆pout) (25) patm patm

70 Haugen, “Control of a buoyancy-based pilot underwater lifting body”

where ∆pout is the pressure drop across the valve. lifting force may cause problems for stabilization sign(∆pout) is the sign function, which has value 1 if of the body position. the argument (∆pout) is positive, and −1 if the argu- ment is negative. ∆p is given by • Linear feedback control with pole-design in out combination with a Kalman filter which es-

∆pout = ρwgLa (26) timates the state variables. This controller is based on a simplified process model being valid close to a certain operating point, which was se- 4 Control System Design lected as the “static” operating point, where the body is at rest (this is the most critical operating 4.1 Introduction point regarding stability). This controller worked well on the simulated system, but not on the real Several controllers were designed and tried out both on system, probably because of the same reasons as the simulator (based on the model described in Section for Feedback linearization (see above). 3) and the real system. The application of these con- trollers is described briefly below. All of the controllers • PID controller with lead element in series worked on a simulator, but the only method which with the PID controller. Ordinary PID con- worked well and without problems on the physical sys- trol could not stabilize the system at all due to tem was cascade control, which also was enhanced with the dynamic properties of the process which is feedforward from estimated load force. (Section 4.2 roughly a triple integrator (three integrators in describes details of the cascade control system.) One series), at least at a static operating point where practical problem with the physical system is that the damping hydrodynamic drag force (as modeled in height of the water tank is relatively small as the height this project) is zero. Position is integral of velocity is about 1.5 m. Therefore, the lifting body with load which is integral of acceleration which is propor- mass easily reached physical constraints during exper- tional to mass of air in air pocket, and this mass is iments. Some of the other controllers might work well roughly the integral of air inflow. A PID controller too under different physical conditions. can stabilize a double integrator, but not a triple Certainly, it is benefical if the control task is satis- integrator because a phase lead of more than 90 factorily solved with a “standard” controller and this degrees provided by the controller is needed, and turned out to be the case in the present application the PID controller can not add more positive phase (with cascade control). (lead action) than 90 degrees (ideally) to the con- Below is a short description of the application of the trol loop. Therefore, a lead-lag element with dom- various controllers: inant lead action providing the additional phase lead was included in the controller, succeeding the • Feedback linearization in combination with PID controller. Actually, this controller was able a Kalman filter which estimates the state to stabilize the real system, but it became unsta- variables. The state variables are the lifting ble after small disturbances (perturbations), so it body position and velocity and the mass of air was concluded that the controller was not suffi- in the air pocket. Basically, with this controller, ciently robust. Also, the control signal was very nonlinear (and linear) terms of the process model noisy, due to the derivative action corresponding are cancelled out. The resulting process model to the phase lead action. This noise makes the is linear and simple (three integrators in series). stabilization difficult. A linear pole-placement controller for this model, augmented with an integrator in the controller to • PID controller together with body acceler- obtain integral control action, was designed. Al- ation feedback, where the acceleration was though the controller worked excellently with the estimated with a state observer. The purpose simulated system (with no model errors assumed), of acceleration feedback is similar to the lead-lag it was not able to stabilize the real system. This is element mentioned above, i.e. to add sufficient probably because of too large sensitivity to model positive phase in the control loop. The observer, errors. Model errors are particularly apparent which is designed from specified oberver poles, es- when the system reaches physical constraints, but timates the lifting bag position, velocity, and ac- this was not analyzed in detail. Furthermore, the celeration using only position measurement. The sensitivity to an erroneous estimate of mass of air experiences with this controller are similar with in the air pocket in the lifting body is probably the experiences with PID controller with lead el- large. The mass of air is closely related to the ement. An alternative to estimating the accelera- lifting force. Intuitively, an erroneously calculated tion is, of course, to measure it, but this was not

71 Modeling, Identification and Control

implemented in this project. (So, it is unclear if height La of the air pocket. Thus, two sensors were control using acceleration measurement works bet- implemented. ter than using acceleration estimate.) Since a mathematical model exists, it was tempting to try feedback from estimated La as an alternative • Cascade control, with feedforward from es- to feedback from measured La. However, this did not timated load force. The primary (master) loop work well on the physical system as the control sys- of the cascade control system realizes position con- tem became unstable. The system relies on accurate trol, and the secondary (slave) loop realizes con- knowledge about La, and an estimate can not replace trol of air height in the air pocket of the lifting the measurement in this case. body. Cascade control is “industry standard”, and One practical benefit of cascade control compared it worked successfully without problems in this with more complex control structures is that the user project. In the controller design, the clue is to can manipulate the amount of air (the secondary or identify the secondary process variable to be mea- internal process variable) directly during testing etc. sured. The process model was a great help to this This is done by setting the primary controller into man- end as the model revealed that the state variables ual mode, and manipulating the manual control signal are lifting body position and velocity and mass of the primary controller which is the setpoint of the of air in the air pocket. The primary controller secondary controller. is of course based on the lifting body position, and indirectly on velocity which is calculated by the derivative action of the PID controller. The 4.2.2 Signal filters secondary controller is based on the third process Lowpass (time-constant) filters were implemented in state variable - the air mass. (The cascade con- LabVIEW to smooth the y measurement – this is filter troller resembles state-variable feedback, which is F in Fig.4 – and the L measurement – this is filter known to be able to stabilize “any” process.) How- 1 a F2 in Fig.4. Also, a lowpass filter was implemented to ever, this mass is not measured directly. Instead, a smooth the control signal, u = F – this is filter F in closely related variable, namely the height of the in 3 Fig.4. In the experiments the F 1 filter was used with air pocket, is measured. The cascade controller time-constant of 0.1 s because that measurement was was enhanced with feedforward from estimated somewhat noisy. The F3 filter was used with a time- load force. Details about the cascade controller constant of 0.1 s to get a smooth control signal to the and is given in Section 4.2, and details about es- valve. The F2 filter was actually not used (i.e. its time- timation of load force and feedforward from the constant was set to zero) because the measurement of force estimate is given in Sections 4.3 and 4.4, re- L contained little noise. spectively. a

4.2.3 Controller tuning 4.2 Cascade control The master PID controller and the slave PI controller 4.2.1 Control system structure were both tuned using the mathematical model of the 4 Disturbance system. Both controllers were tuned from specifica- Secondary (environmental output tions of the response-time (time-constants) of the re- Primary Secondary force) Controller controller Primary spective control loops using Skogestad’s method of PID Reference Process fe (PID) (PI) u= output controller tuning Skogestad(2003). r e La,ref Fin La y C1 C2 F3 P2 P1 Filter Tuning of the primary controller (PID) The primary F S Secondary 2 2 control variable is La, which is used as the setpoint of loop Filter Sensor (ultrasound) the secondary loop. It is assumed that the dynamics of

F1 S1 the secondary loop which controls La is so fast relative Primary loop Filter Sensor to the dynamics of the primary loop that the setpoint of (pressure) La is obtained approximately immediately. Thus, the Figure 4: Cascade control system. process model used as the basis for tuning the primary loop is as follows: Fig.4 shows a block diagram of the cascade control m y¨ = −f − f + f + f (27) system based on feedback from measured underwater tot lift h g d lifting body position y (this feedback is of course oblig- 4And there was actually no need to retune the controllers when atory in a positional control system) and measured air the system was online (i.e. connected to the physical system)!

72 Haugen, “Control of a buoyancy-based pilot underwater lifting body” where was a good value on the simulator and on the real sys- tem. mtot = mb + madd + mcyl + ml (28) Skogestad’s tuning rule assumes a serial PID con- mb = ρw (Vcyl − AcylLa) (29) troller function, which has the following transfer func- tion (assuming u is the control signal and e is the con- flift = ρwAcylgLa (30) trol error): fh = Khy˙ |y˙| (31)  fg = ml + mcyl − mcyllift g (32) (Tis s + 1) (Tds s + 1) u(s) = La(s) = Kps e(s) (40) Tis s To tune the primary PID controller, a transfer func- tion model with La as input and y as output is useful. where Kps , Tis , and Tds are the controller parameters This model can be derived by rigorous linearization of a given by eqs. (36)–(38). However, the PID con- nonlinear state-space model corresponding to eq. (27). troller used in this project actually implementes a par- Alternatively, it can be derived as follows: Since the allel PID controller, which has the following transfer hydrodynamic damping force fh given by eq. (31) has function: its minimum value of zero when the speedy ˙ is zero, the  K  most critical operating point – which should be used u(s) = L (s) = K + pp + K T s e(s) (41) a pp T s pp dp for controller tuning – is aty ˙ = 0. From the model ip eqs. (27)–(32), the relation between L and y at this a To transform the serial PID settings to parallell PID operating point is settings, we apply the following serial-to-parallel trans- formations Skogestad(2003): mtoty¨(t) = −ρwAcylgLa(t) (33)     Td 1 4TC From eq. (33) the transfer function from La to y is K = K 1 + s = 1 + 1 pp ps T 2 4T found as is 4K (TC1 ) C1 y(s) K1 1 = P1(s) = 2 (34) = = Kp (42) La(s) s 2 2K1 (TC1 ) where the gain K1 is ρ A g     w cyl Tds 4TC1 K1 = − (35) T = T 1 + = 4T 1 + m ip is C1 tot Tis 4TC1 = 8TC = Ti (43) P1(s), which is a “double integrator”, can be con- 1 trolled with a PID controller. To tune the con- troller parameters, Skogestad’s method, also denoted 1 1 5 the SIMC method , Skogestad(2003) is used: Tdp = Tds T = 4TC1 4T 1 + ds 1 + C1 Tis 4TC 1 1 = 2T = T (44) Kp = 2 (36) C1 d 4K1 (TC1 )

Ti = 4TC1 (37) Tuning of the secondary controller (PI) The sec-

Td = 4TC1 (38) ondary control loop controls La. The setpoint is Laref which is equal to the output of the primary controller. where TC1 is the user-specified time-constant of the The control variable calculated by the secondary con- control system (the primary loop). In general for the troller is Fin, which is applied to the control valve. double-integrator being tuned with Skogestad’s for- The mathematical model of the process that the sec- mulas, it turns out that the actual (simulated) time- ondary controller controls, is given by eq. (20) which constant is about three times larger than the specified is repeated here:

TC1 . But since TC1 has to be manually adjusted on the real system, this inaccuracy is not important. TC1 is m˙ a = Fin − Fout (45) the only tuning parameter of the PID controller. TC1 can be selected by trial-and-error on a simulator, and The relation between La and ma is given by should be further tuned on the real control system. It was found that ma = ρaVa = ρaAcylLa (46)

TC1 = 2.5 s (39) Above, the air density ρa is given by eq. (14). Be- 5 SIMC = Simple Internal Model Control cause y is known at any instant of time, ρa can be

73 Modeling, Identification and Control calculated by eq. (14) and is therefore known. Fur- It is assumed that all variables and parameters except thermore, we can assume that the outflow Fout is a fe are known. In particular, La is known from its mea- disturbance. Then, the model of the process that the surement. In applications where the mtot varies sub- secondary controller controls, is stantially, it may be necessary to estimate it, but this has not been done in the present project. ˙ ρaAcylLa = Fin − Fout (47) fe will be estimated with an observer, which is a state-estimator designed from pole (or eigenvalues) The transfer function from control variable Fin to pro- specifications. (An observer has the same structure as cess output variable La becomes the Kalman filter.) It is the difference between the measured and the estimated position, e = y −y , L (s) K meas est a = P (s) = 2 (48) that updated the estimates, including the estimate of F (s) 2 s in fe. To design the observer, we need to write the model in eqs. (54)-(55) as a state-space model (v is velocity): which is an integrator. The gain K2 is 1 1 y˙ = v (56) K = = (49) 2   ρwAcylg Khy˙ |y˙| 1 ρaAcyl ρwgy v˙ = − L − + f (57) ρaatm 1 + p Acyl a e atm mtot mtot mtot ˙ To tune the secondary controller for a process given fe = 0 (58) by eq. (48), we use Skogestad’s method Skogestad The observer is given by (2003): 1 K = (50) y˙est = vest + K1e (59) p K T 2 C2 ρwAcylg Khvest |vest| v˙est = − La − mtot mtot Ti = 1.5TC (51) 2 1 + feest + K2e (60) Td = 0 (52) mtot ˙ feest = K3e (61) where TC2 is the user-specified time-constant of the secondary control system. It was found that K1, K2 and K3 are observer gains. Fig.5 shows a block diagram of the observer. TC2 = 1.0 s (53) Process La ymeas is a good value on the simulator and on the real system. (bag) with sensor

4.3 Estimation of load force _

An estimator of the load force was implemented. The K3 K2 K1 force estimate was used in feedforward control as ex- plained in Section 4.4. The estimator was designed as an observer with specified dynamics, see Goodwin 1/s Closed (feedback) et al.(2001). The design is described in the following. fe,est loop The mathematical model which is the basis of the estimator is 1/mtot

-(rho wAcyl gL a)/mtot vest yest mtoty¨ = −ρwAcylgLa − Khy˙ |y˙| + fe (54) 1/s 1/s | {z } | {z } flift fh

-(Khvest |vest |)/mtot where fe is the environmental or disturbance force to be estimated. fe will actually represent any force that is not included in the model, or that is not modelled Figure 5: The observer which is used to estimate the environmental force f .(1/s is the transfer correctly. It is assumed that fe is unknown without e any information about its variation. An appropriate function of an integrator.) model which describes fe is therefore The observer gains are calculated from specified dy- ˙ fe = 0 (55) namics in terms of poles of the closed (feedback) loop

74 Haugen, “Control of a buoyancy-based pilot underwater lifting body” of the observer. It can be shown that the characteristic 4.4 Feedforward from estimated load force polynomial of this loop is From eq. (54) we get the following feedforward con- 3 2 K3 troller function: cobs(s) = s + K1s + K2s + (62) mtot 1 The observer poles were selected as Butterworth poles Laff = feest (74) ρ A g Franklin and Powell(1980). Butterworth poles give a w cyl step response with a slight overshoot and good damp- which is added to the control output from the primary ing. (Of course, other poles configurations are possi- controller, Laprim , so that the total reference to the ble.) Butterworth poles of a normalized third order secondary controller becomes system correspond to the following characteristic poly- nomial: Laref = Laprim + Laff (75) 3 2 cbutternorm (s) = c3s + c2s + c1s + c0 (63) Fig.6 shows the structure of the cascade control sys- where tem including estimator (observer) and feedforward c3 = 1; c2 = 2; c1 = 2; c0 = 1 (64) model. 6 If we specify that the system has response-time Tr ap- y Estimator proximately equal to 3T , the Butterworth polynomial (observer) for load force f becomes Haugen(2010) La e fe,est 3 2 Feedforward cbutter1 (s) = c3 (T s) + c2 (T s) + c1 (T s) + c0 (65) Secondary Disturbance output (environmental Primary Secondary force) which has the same roots as Controller controller Primary Reference La,ff Process fe (PID) (PI) u= output L c 1 c 1 c 1 r e a,ref Fin La y 3 2 2 1 0 C1 C2 F3 P2 P1 cbutter(s) = s + s + 2 s + 3 (66) c3 T c3 T c3 T Filter

F S Comparing cobs(s) and cbutter(s) gives the following Secondary 2 2 loop Filter Sensor formulas for the observer gains: (ultrasound)

F1 S1 c2 1 Primary loop Filter Sensor K1 = (67) (pressure) c3 T c 1 K = 1 (68) 2 c T 2 3 Figure 6: The structure of the cascade control system c 1 0 including estimator (observer) and feedfor- K3 = 3 mtot (69) c3 T ward model. The algorithm of the observer ready for progamming is derived by discretizing the observer formulas in eqs. (59)–(61) using Forward differentiation approxima- tion. The resulting observer formulas are as follows: 5 Experimental Results yest(tk+1) = yest(tk) + h [vest(tk) + K1e(tk)] (70)

vest(tk+1) = vest(tk) 5.1 Introduction

" ρwAcylg Khvest(tk)|vest(tk)| # − La(tk) − mtot mtot Experiments were run with cascade control with feed- +h 1 (71) + fe (tk) + K2e(tk) mtot est forward from estimated load force. Fig.7 shows the available parameters of the control system. The exper- fe (tk+1) = fe (tk) + hK3e(tk) (72) est est iments reported in the next sections are about where e(tk) = ymeas(tk) − yest(tk) (73) • position reference tracking, where the reference h is the time-step (0.02 s). The observer response-time was changed as a ramp, and Tr was set to 0.8 s. • disturbance (load) compensation, where the load 6Here, response-time means time to reach 63% of steady-state value, similar to the definition of time-constant for first order was suddenly changes by adding a mass of 0.5 kg. systems. The reference was then constant at 0.3 m.

75 Modeling, Identification and Control

Figure 7: Controller settings of the cascade control sys- tem in LabVIEW. Figure 8: Cascade control with feedforward from esti- mated load force: Ramped changes of the po- sition reference. 5.2 Position reference tracking 5.3 Disturbance (load) compensation Fig.8 shows the lifting body position reference (set- Fig.9 shows the responses as a mass load of 0.5 kg was point) r and measurement y, together with air body suddenly added to the body at time 360 s, and then height reference L and measurement L . Also the aref a suddenly removed from the body at time 410 s. The control signal F applied to the control valve is shown. in maximum response in the lifting body after the load The position reference was initially 0.3 m, and then was added was 0.08 m, while the maximum response changed as a ramp downwards with slope 0.005 m/s, after the load was removed was 0.12 m – an average and then upwards with the same slope. When the of 0.10 m. It took about 15 sec until the position was reference was constant (before the ramping started), back at the reference. the maximum position control error was approximately In another similar experiment without feedforward 0.02 m, due to various sources of noise in the system the maximum response in the lifting body was 0.23 (the error is zero in an ideal, noise-free system). During m, and position was back at the reference after 250 the ramping, the maximum steady-state error was ap- sec. Thus, disturbance compensation was substantially proximately 0.03 m. In an earlier experiment, cascade improved with feedforward. control without feedforward from estimated force was run. The control error was substantially larger than with feedforward. (No plots are shown here.) The 6 Conclusions superior control at using feedforward from estimated load was somewhat surprising, because the load was A mathematical model has been derived from physical not changed during these experiments. It seems that principles. The state variables are lifting body posi- the load estimate encapsulates the effects of various tion and speed, and mass of air in the air pocket of sources causing the control error to become different the lifting body. Successful stabilizing position control from zero. of the lifting body was obtained with cascade control.

76 Haugen, “Control of a buoyancy-based pilot underwater lifting body”

Acknowledgments

I want to express my thanks to Eivind Fjelddalen at Telemark University College who constructed the test rig, and to Claus Christian Apneseth at Miko Marine who initated the project and gave valuable inputs and comments as the project evolved.

References

Fossen, T. Guidance and Control of Ocean Vehicles. John Wiley & Sons Ltd., 1994.

Franklin, G. and Powell, J. Digital Control of Dynamic Systems. Addison-Wesley, 1980. Goodwin, C., Graebe, S., and Salgado, M. Control System Design. Prentice-Hall, 2001. Haugen, F. Advanced Dynamics and Control. TeachTech, 2010. Otterblad, S. and Dovertie, R. Lifting body for diving. 1985. US Patent number 4,498,408. Skogestad, S. Simple analytic rules for model reduc- tion and pid controller tuning. Journal of Process Control, 2003. 13(4):291–309. doi:10.1016/S0959- Figure 9: Cascade control with feedforward from esti- 1524(02)00062-8. mated load force: A load mass of 0.5 kg was added at time 360 s, and then removed at time 410 s.

The cascade control system is based on feedback from both measured lifting body position and measured air height in the lifting body. Thus, two sensors were im- plemented. Both the master PID controller and the slave PI controller were tuned using Skogestad’s model- based PID tuning rules. The only specifications for Skogestad’s tuning is the time-constant of the control loop. The tunings were tried on the simulator before being applied to the real system, and there was hardly any need to retune the controllers. Feedforward from estimated load force was implemented with the cas- cade control system. At constant position reference the maximum control error was 0.02 m. At ramping posi- tion reference of slope 0.005 m/s the maximum control error was 0.03 m. At constant reference but with a suddenly added load mass of 0.5 kg the maximum con- trol error was 0.10 m in average (0.08 m after the load was added, and 0.12 m after the load was removed), and the position was back at the reference after 15 s. Experiments with cascade control but without feedfor- ward gave a control error that was substantially (many times) larger, both at changing reference and at chang- ing disturbance (load mass).

77