Development of a Depth Controller for the SEAL Carrier
HANNES CARLSSON
KTH
SKOLAN FÖR ELEKTRO- OCH SYSTEMTEKNIK
Abstract
The SEAL Carrier is a hybrid marine vessel capable of traveling both fast on the water surface and completely submerged. Due to the craft’s hydrodynamical properties it is taxing on the pilots to keep the SEAL Carrier at a certain depth for longer periods of time, therefore it is desirable to have a depth controller.
A model was developed to describe the forces from the actuators and the depth, pitch and speed controlled through a PI controller using a backstepping approach. The resulting controller was implemented and validated in Simulink and, as there exist a Simulink model of the craft, also tested and tuned. The Simulink implementation was turned into C++ code in order to be implemented on board the SEAL Carrier.
The simulations provide promising results, though further tests should be
performed to ensure the robustness of the controller, as the Simulink model has
difficulties capturing all of the dynamics of the craft.
Acknowledgement
I would like to thank Antonio Adaldo and Karl Henrik Johansson for all their support throughout this thesis, Johan Pettersson for his help with the modeling of the actuators and of course JFD for the great opportunity of undertaking this interesting task.
ii
2.3.2 Actuators . . . . 5
2.3.3 Total force and torque . . . . 6
3 Controller 7 3.1 Approach . . . . 7
3.2 Force Controller . . . . 8
3.3 Actuator Input . . . . 10
3.3.1 Base change . . . . 10
3.4 Implementation . . . . 14
4 Result 15 4.1 Actuator Input . . . . 15
4.2 Simulations . . . . 15
5 Discussion 21 5.1 Conclusions . . . . 21
5.2 Future development . . . . 21
iii
Chapter 1
Introduction
This introduction contains a motivation of the thesis in Section 1.1, a literary review in Section 1.2 and a thesis outline in Section 1.3.
1.1 Motivation
In recent years, many new marine vehicles have been developed as described in [11]. In order to optimize and analyze these structures, it has become more common to make hydrodynamical models of the crafts. With the existence of these models, along with the common inclusion of computers on-board, it is a short step to also develop controllers for the vessels, which range from unmanned autonomous and range controlled vehicles or as an autopilot on a manned craft.
These vehicles are often characterized by highly nonlinear dynamics. The area of nonlinear control is not nearly as well developed as he area of linear control, but there exists several methods that treat nonlinearities in control problems, as presented in [6].
The SEAL Carrier is a hybrid marine vehicle developed by James Fis- cher Defense (JFD), capable of traveling both fast on the surface, submerged under water and in an half-submerged mode, leaving the topmost part above the surface. In order to achieve these hydrodynamic properties the craft has an unusual shape for a submarine, as illustrated in Figure 1.1. However, this shape is problematic in the submerged state and makes it harder to predict the craft’s behavior and therefore also to steer it. Because of this, JFD decided to investigate the possibility of automatically controlling some aspects of the steer- ing, specifically the depth. The goal of this thesis is to develop an automatic controller to regulate the depth of the SEAL Carrier.
1.2 Literary review
In [3], Thor Fossen use the notation of marine vehicles to model vehicles and describe common control concepts in these terms. He also dives deeper into the control aspects in [4] including some nonlinear methods of motion control.
Approaching the subject from a different direction [1] jumps off from the field of robotics, focusing on control and interaction strategies of Underwater Vehicle Manipulator Systems(UVMS). An example of a recently developed UVMS can
1
Figure 1.1: The SEAL Carrier in its surface mode. Photo taken by Johan Pettersson. Curtesy of JFD.
be found in the case study [9] using an UVMS with a 7-DOF robotic arm for object recovery.
Ships usually lack actuators in the sway direction while underwater vehicles typically lack actuation in both the sway and the heave directions. These type of vehicles are known as underactuated vehicles; that is, that is, they have fewer independent inputs than degrees of freedom. In [10] it has been proven that underactuated vehicles are not asymptotically stabilizable by a continuous linear feedback to a single equilibrium. Based on that conclusion and the initial assumptions about the systems, [2] continues to explore the control properties and describing non continuous strategies for the ships and underwater vessels respectively.
1.3 Thesis outline
This thesis outlines a modular controller design based on a physical model of
the SEAL Carrier consisting of an observator, a PI controller for the forces
and torque and a mapping from desired force to acuator input. The remainder
of this thesis is organized as follows. In Chapter 2 the model of the SEAL
Carrier used to develop the controller is outlined. Chapter 3 describes the
controller and the result from the simulations can be found in Chapter 4. In
Chapter 5 the results are discussed and future work is proposed.
Chapter 2
Model
In this chapter the model used for the design of the depth controller is presented.
Section 2.1 outlines the coordinate system used and Section 2.2 the equations of motion. In Section 2.3 the forces acting of the SEAL Carrier are discussed.
2.1 Coordinate system
Following the standard notation of marine systems from [3] let X
E, Y
E, Z
Ebe an external inertial coordinate system and X
B, Y
B, Z
Bbe a coordinate system with origin in the center of mass of the boat according to Figure 2.1. The positions along X
B, Y
B, Z
Bare called Surge, Sway and Heave; the speeds along the same axis are denoted u, v, w; the forces are denoted X, Y, Z; the rotations are denoted ϕ, θ, ψ and called roll, pitch and yaw, the rotational speeds are denoted p, q, r and the torques are denoted K, M, N all relative to the external coordinate system.
2.2 Equations of motion
Using the notation described in Section 2.1, with m denoting the mass and the inertial tensor
I =
I
xxI
xyI
xZI
xyI
yyI
yzI
xzI
yzI
zz
, (2.1)
[3] finds the general equations of force and torque for an object with six degrees of freedom and a coordinate system with its origin in the center of mass to be:
m ( ˙ u − vr + wq) = X, (2.2) m ( ˙v − wp + ur) = Y, (2.3) m ( ˙ w − uq + vp) = Z, (2.4) I
xxp + (I ˙
zz− I
yy)qr − ( ˙r + pq)I
zx+ (r
2− q
2)I
yz+ (pr − ˙q)I
xy= K, (2.5) I
yyq + (I ˙
xx− I
zz)rp − ( ˙p + qr)I
xy+ (p
2− r
2)I
zx+ (qp − ˙r)I
yz= M, (2.6) I
zz˙r + (I
yy− I
xx)pq − ( ˙q + rp)I
yz+ (q
2− p
2)I
xy+ (rq − ˙p)I
zx= N. (2.7) However, the depth controller will mainly be used when the vehicle is moving straight forward. For this case, v and yaw will be comparatively small, or next
3
Figure 2.1: Coordinate system for the SEAL Carrier. Figure made by Johan Pettersson
to zero. Furthermore a big roll would make the vehicle unwieldy and unpractical for human passengers and according to the test pilots, roll is generally small, unless the vehicle is turning. It can therefore be assumed that yaw and roll can be kept constant and v = 0, and in effect setting p = r = ˙v = ˙ p = ˙r = 0.
Substituting p = r = ˙v = ˙ p = ˙r = 0 into equations (2.2)-(2.7) leads us to the much simpler planar model (2.8)-(2.10) which will be further investigated throughout this thesis:
m ( ˙ u + wq) = X, (2.8)
m ( ˙ w − uq) = Z, (2.9)
I
yyq = M. ˙ (2.10)
2.3 Forces and torque acting on the craft
In this section we describe the controlled and the uncontrolled forces and torque acting on the center of mass of the vessel. Together these forces sum up to the X, Z and M of system (2.8)-(2.10).
2.3.1 External Forces
First, there are hydrostatic forces that act upon all mass in a fluid. Gravity causes a force that can be described along the X
Band Z
Bby
f
g= ( f
gxf
gz)
=
( −mg sin(q) mg cos(q)
)
, (2.11)
where m is the mass of the object and g is the gravitational constant at surface
of earth. Then, there is buoyancy from the displaced water, counteracting the
5 DEPTH CONTROLLER FOR THE SEAL CARRIER
pull of gravity and computed as f
b=
( V ρg sin(q)
−V ρg cos(q) )
, (2.12)
where V is the volume and ρ is the density of the water.
Then, there are hydrodynamic forces affecting all objects moving through a fluid. One of these forces is called added mass, is the result of harmonic oscillations of water particles induced by the movement of a body. According to [7] for some geometries the added mass can be described by (2.13)-(2.15), which, according to [8 ], are applicable in the case of the SEAL Carrier.
X
(added mass)= −C
Xuuu |u|, (2.13)
Z
(added mass)= −C
Zwww |w|, (2.14)
M
(added mass)= −C
Mqqq |q| − C
M www |w|. (2.15) Depending on the shape of an object, a lift, L and drag, D force can be induced as it moves. The drag D acts along with the flow of the surrounding fluid and the lift is perpendicular to the drag. This force is calculated using equation (2.16) and (2.17), where C
Land C
Dare empirically determined values for different shapes and are heavily dependent on the angle of the incoming flow.
L = Av
2infρ
2 C
L, (2.16)
D = Av
2infρ
2 C
D, (2.17)
where A is a shape dependent parameter, ρ is the density of the fluid and v
infis norm of the velocity of the incoming flow.
For the SEAL Carrier a Simulink model by [ 8] exists, which uses the equations above to calculate the forces and torques of the vessel. The external forces will therefore not explicitly be described; instead the blocks calculating the external forces for the Simulink model will be used as a black box to calculate the uncontrolled force, f
UCand and torque M
UC, denoted with the subscript UC for uncontrolled.
2.3.2 Actuators
The SEAL Carrier has two depth rudders (elevators) in the front of the craft, two thrusters in the back and a pair of rudders behind each thruster. The rotational speeds of the thrusters can be controlled; as can their angle around the Y
Baxis, δ
3thus adjusting their contribution in the XZ plane. The angles of the elevators can be controlled too. However, to avoid leaving the area where the two dimensional approximation holds, we control both elevator angles together, δ
1as well as the thruster rotational speeds. The angles δ
1and δ
3have physical saturation limits of δ
1 min≤ δ
1≤ δ
1 maxand δ
3 min≤ δ
3≤ δ
3max.
In the Simulink model the thrusters are simplified to an applied force at the thruster positions, with size δ
2and angle relative the boat coordinate system δ
3around the Y
Baxis. With the forces in X
Band Z
Bas
f
δ2=
( δ
2cos δ
3−δ
2sin δ
3. )
(2.18)
According to [8] the drag force parameter C
Dcan be estimated by C
D= 0.008 − 0.003C
L+
(
0.01 + 1 eARπ
)
C
L2, (2.21) and the parameter values for the SEAL Carriers elevators is gathered by [ 8].
The total force along the X
Band Z
Baxis is f
δ1= Av
inf2ρ
2
( −C
Lsin(α) − C
Dcos(α)
−C
Lcos(α) + C
Dsin(α) )
. (2.22)
The lift and drag forces are applied along the flow of the fluid, causing a need to rotate the forces to the boats system.
Leaving us with three actuator inputs which can be controlled δ
1, δ
2and δ
3.
2.3.3 Total force and torque
To calculate X, Z and M all forces needs to be moved to the center of mass resulting in a torque, the force at the center of mass along the X
Band Z
Baxis
is (
X Z )
= f
UC+ f
δ1+ f
δ2, (2.23) where f
UCis the uncontrollable force and f
δ1and f
δ2correspond to the forces applied by the elevators and the thrusters respectively. The torque is calculated from the cross products
M = M
UC+ (r
δ1× f
δ1+ r
δ2× f
δ2)
0 1 0
, (2.24)
where r
δ1and r
δ2are vectors from the center of mass to the elevators and the
thrusters respectively.
Chapter 3
Controller
In this chapter a controller design for the SEAL Carrier will be presented.
In Section 3.1 the overall approach is presented and necessary notation defined.
Section 3.2 and Section 3.3 describe the controller. Lastly, Section 3.4 discusses the implementation of the controller.
3.1 Approach
We first design a controller assuming that we can directly control the forces and torque. Then, we calculate what input values for the actuators result in the desired forces and torque, as illustrated by the block diagram in Figure 3.1.
The overall goal is to control the depth, but in order to do so it is important that the rest of the system is stable. To that end the pitch angle and speed are also going to be controlled. Assuming that we can view the forces and torque as inputs to the system, u ≡ [X, Z, M]
Tintroduce the state vector x ≡ [Z
E, θ, u, w, q]
T. ≡ is used to convey that a new variable is defined. This vector contains the depth, pitch and velocities of the craft. The depth, x
1is the integral of the speed in Z
Edirection and the pitch, x
2is the integral of the pitch rate. Then, using system (2.8)-(2.10) for the remaining states, the state space representation becomes
˙x =
x
4cos x
2− x
3sin x
2x
5−x
4x
5x
3x
50
+
0 0 0
0 0 0
1
m
0 0
0
m10 0 0
I1yy
u. (3.1)
We want to be able to control the depth, speed and pitch of the craft. Given the reference r = [x
∗1, u
∗E, x
∗2]
T, with depth x
∗1, speed in the external coordinate system u
∗Eand pitch x
∗2, we can introduce the error states e = [e
1, e
2, e
3]
Tas
e
1= x
∗1− x
1, (3.2)
e
2= u
∗E− x
3cos x
2− x
4sin x
2, (3.3)
e
3= x
∗2− x
2. (3.4)
The error in speed is chosen along the axis X
E, that is perpendicular to the error in depth, e
1. This explains the rotation of the x
3and x
4in (3.3).
7
u
1= −m (
e
1(k
wi+ k
wpk
w˜) sin(x
2) + k
wik
w˜sin(x
2)
∫
t 0e
1(τ )dτ + x
3(k
wp+ k
w˜) sin(x
2)
2− x
4(k
wp+ k
w˜) cos(x
2) sin(x
2)
− e
2k
upcos(x
2) − k
uicos(x
2)
∫
t 0e
2(τ )dτ )
, (3.5)
u
2= m (
e
1(k
wi+ k
wpk
w˜) cos(x
2) + k
wik
w˜cos(x
2)
∫
t 0e
1(τ )dτ + x
3(k
wp+ k
w˜) cos(x
2) sin(x
2) − x
4(k
wp+ k
w˜) cos(x
2)
2+ e
2k
upsin(x
2) + k
uisin(x
2)
∫
t 0e
2(τ )dτ )
, (3.6)
u
3= I
yy(
e
3(k
qi+ k
q˜k
qp) − x
5(k
q˜+ k
qp) + k
q˜k
qi∫
t 0e
3(τ )dτ )
, (3.7) stabilizes the error dynamics
˙e
1= −k
wpe
1− k
wi∫
t 0e
1(τ )dτ + ˜ w, (3.8)
˙e
2= −k
upe
2− k
ui∫
t 0e
2(τ )dτ, (3.9)
˙e
3= −k
qpe
3− k
qi∫
t 0e
3(τ )dτ + ˜ q, (3.10)
˙˜
w = −k
w˜w, ˜ (3.11)
˙˜
q = −k
q˜q. ˜ (3.12)
Proof. We want the error in our states to decrease and since it is reasonable to assume that there might be a significant model error, a PI controller is used.
Hence we enforce the error dynamics
˙e
1= −k
wpe
1− k
wi∫
t 0e
1(τ )dτ + ˜ w, (3.13)
˙e
2= −k
upe
2− k
ui∫
t 0e
2(τ )dτ, (3.14)
˙e
3= −k
qpe
3− k
qi∫
t 0e
3(τ )dτ + ˜ q. (3.15)
9 DEPTH CONTROLLER FOR THE SEAL CARRIER
where ˜ w and ˜ q are backstepping parameters, introduced to enable further cal- culations, and will be designed to asymptotically vanish.
The control input can be found by taking the time derivative of (3.2) two times and the time derivative of
˙e
1= ˙ x
∗1− x
4cos x
2− x
3sin x
2, (3.16)
¨
e
1= ¨ x
∗1+ ( − ˙x
4+ x
3x
5) cos x
2+ ( ˙ x
3+ x
4x
5) sin x
2. Substitute ˙ x
3and ˙ x
4using (3.1)
¨
e
1= ¨ x
∗1+ u
1m sin x
2− u
2m cos x
2. (3.17)
Similarly, the control in the time derivative of (3.3)
˙e
2= ˙ u
∗w− ( ˙x
3+ x
4x
5) cos x
2+ ( − ˙x
4+ x
3x
5) sin x
2,
˙e
2= ˙ u
∗w− u
1m cos x
2− u
2m sin x
2, (3.18)
and after taking the time derivative of (3.4) twice
˙e
3= ˙ x
∗2− x
5, (3.19)
¨
e
3= ¨ x
∗2− u
3I
yy. (3.20)
Unfortunately (3.13) does not contain ¨ e
1, nor does(3.15) contain ¨ e
3, but this is where ˜ w and ˜ q can be used. Rearranging (3.13), we have
˜
w = ˙e
1+ k
wpe
1+ k
wi∫
t 0e
1(τ )dτ. (3.21)
taking the time derivative of 3.21, we find
˙˜
w = ¨ e
1+ k
wp˙e
1+ k
wie
1, (3.22) where ¨ e
1appears on the right hand side. Rearranging (3.15), we have
˜
q = ˙e
3+ k
qpe
3+ k
qi∫
t 0e
3(τ )dτ. (3.23)
Taking the time derivative of 3.23, we find
˙˜
q = ¨ e
3+ k
qp˙e
3+ k
qie
3, (3.24) where ¨ e
3appears on the right hand side.
Three equations can be constructed that uphold (3.13)-(3.15) and contain the control inputs u
1, u
2and u
3and make ˜ w, ˜ q asymptotically vanish:
w ˙˜
˙e
2˙˜
q
=
−k
w˜w ˜
−k
upe
2− k
ui∫
t0
e
2(τ )dτ
−k
q˜q ˜
. (3.25)
Solving (3.25) for u
1, u
2and u
3gives the expressions for u
1, u
2and u
3as a
function of the states and reference values. The time derivatives of the reference
signals are omitted, seeing as the aim is to track a constant set of references.
+ e
2k
upsin(x
2) + k
uisin(x
2)
∫
t 0e
2(τ )dτ )
, (3.27)
u
3= I
yy(
e
3(k
qi+ k
q˜k
qp) − x
5(k
q˜+ k
qp) + k
q˜k
qi∫
t 0e
3(τ )dτ )
. (3.28)
3.3 Actuator Input
Using (2.22), (2.18) and (2.24), the resulting force and torque at the center of mass from a specific set of actuator inputs can be calculated:
f
δ(α, δ
1, δ
2, δ
3, v
inf) =
f
δXf
δZf
δM
=
1 0 0 0 0 1 0 0 0
(f
δ1+ f
δ2)
+
0 0 1
(r
δ1× f
δ1+ r
δ2× f
δ2)
0 1 0
. (3.29)
The controller outputs the desired force and we need to calculate the corre- sponding actuator inputs. Meaning that we need to invert f
δ(α, δ
1, δ
2, δ
3, v
inf) with respect to δ. This is however not possible analytically. This section con- tinues to describes a way to find the best δ given a desired force and torque f
δ, angle of the incoming flow α and speed of the incoming flow v
inf.
3.3.1 Base change
The main idea for this section is to introduce a base change. The new base aims
to make the description of the saturation limits simple and to be independent
of the parameters v
infand α. Furthermore if the influence from δ
1,δ
2or δ
3can
be mapped to specific axes, then using (3.29) a mapping from corresponding
forces and input can be interpolated.
11 DEPTH CONTROLLER FOR THE SEAL CARRIER
Figure 3.2: Assuming α = 0 rad and v
inf= 1.9 m/s, all possible forces and torque from the actuators are enclosed by the surface.
The origin is chosen to be where the angle of the flow of the fluid coincides with the elevator angle, α = δ
1and the thrusters are turned off (δ
2= δ
3= 0) for any given speed v
inf:
O (α, v
inf) ≡ f
δ(α, α, 0, 0, v
inf) . (3.30) Calculating f
δwhile keeping one of the inputs at a time at one of its saturation points for the case when α = 0 and v
inf= 1.9 m/s, the surface plot in Figure 3.2 is obtained. The surface enclose all values of force and torque that can be reached under the specific α and v
inf.
Increasing v
infmakes the slice thicker and since v
infonly appears in the equation for the force from δ
1, it implies that δ
1has a great influence in this direction. Adjusting δ
2and δ
3shows no palpable change in the same direction.
Thus it seems reasonable to start off by putting the unit vectors along the thickness of the slice (+Z,+M) and the edges of the slice ((+X,-Z,-M) and (+X,+Z,+M)) from Figure 3.2.
The unit vectors for the new base along the axes x
′and y
′, are chosen to be the vector from the origin to the point of maximum thrust δ
2= δ
2maxand α = δ
1= 0 at maximum and minimum thruster angles, δ
3= δ
3minand δ
3= δ
3maxrespectively.
x
′≡ f
δ(0, 0, δ
2max, δ
3min, v
inf) − O (0, v
inf) , (3.31)
y
′≡ f
δ(0, 0, δ
2max, δ
3max, v
inf) − O (0, v
inf) . (3.32)
The unit vector for the z-axis z
′is set to be the cross product of x
′and y
′and
corresponds to the thickness of the slice from Figure 3.2. z
′is heavily dependent
on the elevator angle δ
1, since only the force from δ
1is dependent on v
infwith
v
inf2as a factor on all terms, the unit vector of the Z
′axis is multiplied by v
2inf,
α [rad]
Figure 3.3: Upper and lower saturations in Z
′making the base changed u
′more or less independent of v
inf. z
′≡ v
2infx
′× y
′|x
′× y
′| . (3.33)
We call the resulting the base change matrix B(v
inf). To calculate the coordi- nates in the new system u
′we use
u
′= B(v
inf) (u − O(α, v
inf)) . (3.34) Calculating the force and torque for the saturation values of the elevators, δ
1= δ
1min, δ
1= δ
1maxand δ
1− α = ±19
◦and transforming it to the [X
′, Y
′, Z
′] base, the saturation limits along the Z
′axis can be expressed as a function of α in accordance with Figure 3.3.
The influence of the speed v
infhas been effectively removed through the base change, the incoming angle α, however, is still relevant and also only affects the force contribution in δ
1. By varying δ
1and α for an arbitrarily chosen speed, the resulting points in the [X
′, Y
′, Z
′] space can be used to create a two dimensional interpolation table that takes α and a value in Z
′and outputs the corresponding δ
1as seen in Figure 3.4. This assumes knowledge of α.
Thus the elevator angle is identified and in turn can be used to calculate and subtract its contribution from u
′, leaving the contribution from the thrusters in [X
′, Y
′, Z
′]- space. We identified that δ
1was mainly contained in Z
′which corresponds to the thickness of the slice in Figure 3.2, meaning that the remain- der after having subtracted it, is the part looking similar to a circular segment.
It seems plausible that the radius of the circle segment would be connected to the thruster force δ
2and that its angle relates to the thruster angle δ
3. There- fore, transforming u
′to polar coordinates, [r, θ] could prove useful. The primed space was designed such that all valid points are in the first quadrant of [X
′, Y
′], giving the saturation 0 ≤ θ ≤
π2.
Similarly to how a mapping from Z
′to δ
1was made, we vary δ
3for constant
δ
2and interpolate a mapping from θ to δ
3, which prove to be more or less
independent on δ
2. For different δ
3and constant δ
2the radius R varies. As
13 DEPTH CONTROLLER FOR THE SEAL CARRIER
...
..
−0.4 .
−0.2 .
0 .
0.2 .
0.4 .
−1 .
−0.5 .
0 .
0.5 .
1
−1,000 . .
−500 . 0
. 500
. 1,000
.
elevator angle,
δ
1[rad]
.
angle of incoming
flow, α [rad]
.
Z
′.
. Z ..
′. Saturation limits ..
. α = 3 ..
◦Figure 3.4: The surface is the Z
′resulting from using (3.29) and applying the base change to a set including all valid combinations of elevator angle, δ
1and angel of incoming flow α. In red the saturation limits from Figure 3.3 are overlaid onto the surface. By saturating the desired force from the controller in Z
′we can make sure that it stays with the area encapsulated by the red lines.
Now, for a given α, such as α = 3
◦displayed in black in the figure, a mapping
from Z
′to δ
1can be interpolated from the points of the surface.
time constant of 0.1 s.
The SEAL Carrier only has sensors for the pitch angle, depth and speed over the sea bed. The remaining states, pitch rate q and velocity in depth w need to be estimated. Since they are derivatives of measured states, they are numerically derived and passed through a low pass filter to remove high frequency noise. However, the estimator takes a couple of seconds to converge to the true value after it is initiated, this is solved in simulation by letting the controller wait for the estimator and continue to give the initial value for first 10 s as input to the system.
Since the controller is to be turned on as the craft is moving, it is important to ensure that there is a smooth transition from pilot to controller steering. To this end, a linear transition is implemented
δ ≡ (fδ
calculated+ (f − 1)δ
initial), (3.35) with f defined as
f =
0, t < 10 s t/10 − 1, 10 s ≤ t ≤ 20 s
1, t < 20 s
. (3.36)
Using Simulinks code generator the discretized controller was converted to C++
code. After writing a bit of code, the controller was integrated with the software
aboard the SEAL Carrier.
Chapter 4
Result
In this chapter, the results of the module that calculates the actuator input based on desired force from Section 3.3, are presented in Section 4.1, as are the results of the simulations in Section 4.2.
4.1 Actuator Input
The controller outputs a desired force and torque and to find the correspond- ing actuator inputs a module was designed and described in Section 3.3. The performance of this module was tested through a few trials both within and out- side the saturation boundaries. The result of some of the trials are presented in Table 4.1.
4.2 Simulations
The simulations where designed to be as similar as possible to the desired work- ing environment. Consulting the test pilots and the logs, typical values for states of the craft under conditions when the controller is to be used, were gathered.
In order to find the input making the state from the logs a steady state. The craft was simulated initialized with the values for the states from logs and with generic values for the actuators δ
initial. The controller managed to stabilize the system around this point and the final values of the actuators recorded to be used as initial actuator values δ
initialfor further simulations.
In Figure 4.1 all states are plotted as the system starting from a stabilized state is asked to dive 0.5 m at 10 s, then increase the speed in u
wfrom 3.5 kn to 4 kn at 35 s and finally change the pitch from −2
◦to 2
◦at 60 s. The resulting inputs to the system can be seen in Figure 4.2.
The controller was tuned using restrictions on step responses, stability mar- gins of input and output and on pole placement in the Control System Tuner in Simulink. These values were then slightly adjusted to improve performance of the step response in Figure 4.1, mainly increasing the reaction to errors in pitch and lower the reaction to errors in depth. The goal is to make the controller stay within the constraints of the actuators for errors of a magnitude likely to arise in the real world, while it is less important to get a fast response, favoring
15
Trial 3,α = −1 , v
inf= 7 kn Trial 4,α = −34 , v
inf= 0.7 kn
Actual Calculated Actual Calculated
δ
1[deg] 19 16.999999245879064 −30 −18.9999967 δ
2[N] 4567 4569.966867107146 123 122.9687807383345 δ
3[deg] −20 −21.843710584081720 20 23.156277389399662
slow adjustments to reduce power consumption. The resulting parameter values are presented in Table 4.2
To test the tuning under different circumstances, a simulation with a differ- ent type of reference signal was performed using ramps instead of step functions.
The results from that simulation with regards to the states can be seen in Fig- ure 4.3 and the actuators in Figure 4.4.
Table 4.2: Parameter values from Control System Tuner in Simulink with adjustments
Parameter Value
k
qi0.044620257753742 k
qp0.169314172352887 × 1.1
k
q˜0.168008453391583 × 4
k
ui0.001583774375323
k
up0.114898127802007
k
wi0.003020160668785
k
wp0.149608076564063
k
w˜4.117979078663870/4
17 DEPTH CONTROLLER FOR THE SEAL CARRIER
...
0 .
20 .
40 .
60 .
80 .
100 .
120 .
140 .
160 .
180 .
200
−4 . .
−2 . 0
. 2
Pitc h angle, x [deg]
2. ..
..
0 .
20 .
40 .
60 .
80 .
100 .
120 .
140 .
160 .
180 .
200
−0.2 . . 0
. 0.2
. 0.4
. 0.6
. Depth, x
1[m]
.
States
.
. State ..
. Reference ..
..
..
0 .
20 .
40 .
60 .
80 .
100 .
120 .
140 .
160 .
180 .
200 .
1.8 . 2
Sp eed, x [m/s]
3. ..
..
0 .
20 .
40 .
60 .
80 .
100 .
120 .
140 .
160 .
180 .
200 .
−0.1 . 0
. 0.1
Sp eed, x [m/s]
4. ..
..
0 .
20 .
40 .
60 .
80 .
100 .
120 .
140 .
160 .
180 .
200
−0.4 . .
−0.2 . 0
. 0.2
. 0.4
.
Time [s]
Pitc h rate, x [deg/s]
5.
Figure 4.1: Step response of the SEAL Carrier model for the discreet con-
troller.
...
0 .
20 .
40 .
60 .
80 .
100 .
120 .
140 .
160 .
180 .
200 1,800 . .
2,000 . 2,200
. 2,400
. 2,600
. 2,800
.
Time [s]
Thruster force [N] . ..
..
0 .
20 .
40 .
60 .
80 .
100 .
120 .
140 .
160 .
180 .
200
−20 . .
−10 . . . .
Time [s]
Elev ator . .
..
..
0 .
20 .
40 .
60 .
80 .
100 .
120 .
140 .
160 .
180 .
200 .
0 . 10
. 20
.
Time [s]
Thruster angle, [deg] .
Figure 4.2: Inputs to the SEAL Carrier model from the discreet controller
during the step response of figure 4.1.
19 DEPTH CONTROLLER FOR THE SEAL CARRIER