Professional Documents
Culture Documents
Danylo Malyuta1 , Xavier Collaud1 , Mikael Gaspar1 , Gautier Rouaze1 , Raimondo Pictet1 , Anton Ivanov1 , and
Nikolay Mullin2
1
Space Engineering Center (eSpace), EPFL, Station 11, 1015, Lausanne, Switzerland.
2
Bauman Moscow State Technical University, ul. Baumanskaya 2-ya, 5, Moscow 105005, Russia.
Weighing 2560 [g], the rocket is 1.36 [m] long, 7.62 [cm] 5.2V DC/DC
in diameter and is composed of two bodies that sepa- Boost
rate after apogee for parachute deployment. The fuselage Converter
length is determined by the size of the RCS and avion-
SPI
Power
ics compartments as well as a static stability requirement.
The final static margin is 6.08 calibers between the center
of mass and center of pressure, offering sufficient aerody- Raspberry Pi 1
namic stability at lift-off. The diameter was dictated by Model B+
the available tubing serving as a mold.
UART
For propulsion, the Aerotech RMS H-238 reusable mo-
tor with 175 [Ns] specific impulse was chosen in
order to
UART
Power
obtain an off-launchrod velocity of 15-18 ms required MSP430G2553
for passive stabilization by the fins. The burn time is less slave microcontroller
than 1 [s] during which
the rocket undergoes an accelera-
tion of upto 78.9 sm2 and reaches a maximum speed of
Parker VSO
about 59 ms . The maximum altitude is approximately solenoid valve
187 [m]. power electronics
1 2 3 4 5
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
25
21 22 23 24
Where the indices refer to the locations of corresponding 3. CONTROL SYSTEM DESIGN
circled numbers in Figure 4. It is further assumed that
p2 = patm = 101325 [Pa]. It is then possible to compute
the temperature of the flow after the valve by making the 3.1. Dynamical model
isentropic flow assumption:
γ−1
p2 γ In this section, the dynamical attitude model of the rocket
T2 = T1 ≈ 184.48 [K], (1) is developed using Euler-Lagrange formalism. Because
p1
only rocket attitude is controlled, translational dynamics
where the CO2 specific heat ratio γ is 1.28. We check for are not modelled under the assumption that translational
sonic conditions at the valve orifice, assumed to be the and rotational motions are decoupled about the center of
narrowest part of the flow: mass. Furthermore, as the control system is turned on af-
γ
γ−1 ter engine cutoff, rocket mass is assumed to be constant.
2
pcr = p1 ≈ 329620 [Pa] > p2 . (2)
γ+1 The Lagrangian of a system is defined as:
Therefore the flow downstream of the valve orifice is L (q, q̇) = K (q, q̇) − U (q)
equal to the speed of sound. The nozzle exit velocity is 1 T (6)
therefore: = q̇ M (q)q̇ − U (q),
hmi 2
where K (q, q̇) ∈ R is the kinetic energy, U (q) ∈ R is
p
U2 = γRT2 ≈ 211.56 , (3)
s the potential energy, M (q) ∈ Rn×n is the inertia matrix
and q ∈ Rn is the vector of generalized coordinates. In
h i
J
where the CO2 gas constant R is 189 kg·K . We now use T
this case, q = [ϕ θ ψ] ∈ R3 and the Tait-Bryan Eu-
the isenthalpic throttling process assumption to compute
ler angle convention is used with (ψ, θ, ϕ) representing
the mass flow rate through the valve:
s respectively (yaw, pitch, roll).
γ+1
p1 pcr γ hgi
ṁmax = cd A √ γ ≈ 1.7069 . (4) The Euler-Lagrange equation that describes the system
RT1 p1 s dynamics is:
Note that (4) gives the maximum mass flow rate since the
d ∂L (q, q̇) ∂L (q, q̇)
maximum valve opening area A is used for the calcula- − = F (q), (7)
dt ∂ q̇ ∂q
tion. Finally, the maximum thrust is:
where F (q) ∈ Rn is the vector of generalized forces and
Fmax = U2 ṁmax ≈ 0.3611 [N]. (5) torques acting on the rocket. [15] shows that substituting
Note that this value is very close to experimental mea- (6) into (7) gives:
surements, for which maximum thrust varied between
M (q)q̈ + C(q, q̇)q̇ + G(q) = F (q), (8)
0.32 and 0.37 [N]. In the future, maximum thrust could
n×n
be increased by using de Laval nozzles instead of ejecting where C(q, q̇) ∈ R is the Coriolis and centrifugal
gas directly from the tube. force matrix and G(q) ≡ (∂U (q)/∂q) ∈ Rn is the gra-
4
I I B
ṘB = RB S(ωBI ), (15)
B
where ωBI is the angular velocity of the B frame with
x̂I respect to the I frame, written in the B frame. Combin-
ẑB x̂B
ing (13), (15) and the property S(a)b = −S(b)a yields:
ẑI
ṗI = −RB
I
S(pB )ωBI
B
. (16)
ŷI Consider now the kinetic energy of the infinitesimal ele-
pB
ŷB ment in Figure 5:
dm
1 I T I
dK = ṗ ṗ dm. (17)
2
Substituting (16) into (17) and using the property
I T I
(RB ) RB = I, we get:
Figure 5. Infinitesimal element kinematics.
1 h B T T B i
dK = ωBI S (p )S(pB )ωBI B
dm. (18)
2
dient of potential energy with respect to the generalized To obtain the kinetic energy of the entire rocket, we sim-
coordinates. ply integrate over the mass of the rocket. Since dm =
ρ dV , we get:
The C(q, q̇) matrix is computed using the Christoffel Z
1 B T
symbols of the first kind: K = ωBI ρS T (pB )S(pB ) dV ωBI B
. (19)
n 2 V
X 1 ∂mij ∂mik ∂mkj
cij = + − q̇k , (9) We identify the integral in (19) as the inertia tensor J of
2 ∂qk ∂qj ∂qi
k=1 the rocket, expressed in the B frame. This integral is
where cij and mij are the elements at row i and column not trivial given the multitude of elements inside a rocket
j of the C(q, q̇) and M (q) matrices respectively. Given – electronics, parachutes, coupling rings, engine casing,
that C(q, q̇) depends on M (q) via (9), we must only find etc. However, J is directly obtained from any CAD pack-
the M (q), G(q) and F (q) in order to obtain the full age (in this case, Solidworks
R
) if each part of the CAD
attitude dynamics. model is assigned the correct mass properties.
30 60
10 20
ŷB
Finding T ∗ (q). The most general control that Finding A∗ (q, q̇). We only consider the corrective
can be applied on the rocket is a torque vector τ B = and damping moment coefficients for the aerodynamic
[τxB τyB τzB ]T , expressed in the B-frame and positive ac- torques acting on the rocket, denoted as C1 and C2 re-
cording to the right-hand rule. To find T ∗ (q), we apply spectively. These are given by [18]:
the principle of virtual work. Because we consider the 1
rocket as a single rigid body, the virtual work principle C1 = ρAref V 2 CN α (Z − W ), (33)
2
degenerates to: nc
1 X
CN α,i (Zi − W )2 ,
T T C2 = ρAref V (34)
δW = τ B δr = (T ∗ ) δq, (28) 2 i=1
where δr is an infinitesimal change in the position vector
where Aref = πr2 is the nose cone base area, V is the
of the body (expressed in the same frame as τ B , i.e. the
speed, CN α is the total normal force coefficient deriva-
B frame) and δq is an infinitesimal change in the gener-
tive, CN α,i is the i-th structural component’s normal
alized coordinates. To find δr we “integrate” (20). Note
B force coefficient derivative, Z is the distance from the
that because ωBI is not integrable [17], this approach
nose to the rocket center of pressure, Zi is the distance
only works thanks to the infinitesimal change assump-
from the nose to the i-th structural component’s center of
tion. Therefore:
pressure, W is the distance from the nose to the center of
δr = Wη (q)δq. (29) mass, α is the angle of attack (in radians) and nc is the
total number of components of the rocket (FALCO-4 has
By substituting (29) into (28), the generalized control one nose cone, four body tubes and one set of four fins).
torques are expressed:
T ∗ (q) = WηT (q)τ B . (30) The rocket was modeled in OpenRocket
R
, whose techni-
cal documentation [19] [20] provides a method to evalu-
However, τ B can be related to the thrust forces generated ate (33) and (34). Thus, a plot of C1 and C2 for FALCO-4
by the four RCS nozzles of the rocket. For this, consider is produced in Figure 7.
Figures 3 and 6. Noting that f r, calling ~ri the po-
sition vector of the i-th nozzle and keeping in mind that For test flights, the RCS control is activated from the
thrusts (R1 ,R3 ) and (R2 ,R4 ) are parallel to the ±ẑB and 4th second of flight onwards in order to conserve CO2
6
3.1.4. The dynamical equations Figure 10. Euler angles evolution for a fast-moving
rocket with C1 = 0.5 and C2 = 0.1 (i.e. 6 seconds into
the flight moving at ≈ 4 [m/s]).
In summary, the following dynamical equations for the
rocket attitude were obtained:
M (q)q̈ + C(q, q̇)q̇ + G(q) = T ∗ (q) + A∗ (q, q̇),
with simulate the attitude of a rocket when it is flying quickly
(Figure 9) or slowly (Figure 10) with zero side wind in
M (q) = WηT (q)JWη (q),
(39) both cases. A side wind can also be simulated.
G(q) = 0,
T ∗ (q) = WηT (q)BR,
∗ In our application a restoring aerodynamic moment is
A (q, q̇) = A1 (q − qo ) + A2 (q̇ − q̇o ), only beneficial in the absence of side wind. When side
where C(q, q̇) is given by (9), Wη (q) is given by (21), wind is present, the local velocity vector would be off the
J ∈ R3 is the rocket inertia tensor in the B-frame, 0 ∈ geometric vertical (axis x̂I ) and the control would have
R3 is a zero vector, B and R are given by (31) and finally to work against the aerodynamic moments. As the ab-
A1 and A2 are given by (38). sence of side wind cannot be guaranteed, a neutrally sta-
ble rocket (C1 = C2 = 0) would be optimal for our
application. However, for safety and due to the presence
of body lift and other aerodynamic effects, a certain pas-
3.2. Open-loop simulation
sive stability was built into the FALCO-4 by the four tail
fins discussed in Section 2.1. However, at low speeds (e.g
Using (39) we can develop a non-linear Simulink
R
around apogee) aerodynamic effects become smaller (see
model (Figure 8) that is used for simulation. For control Figure 7), for which reason the control was designed for
system design, this plant is linearized about the rocket’s the case of small aerodynamic coefficients C1 = 0.5 and
vertical orientation (i.e. q = 0). Using this plant we can C2 = 0.1 (see Figure 10).
7
Figure 8. Simulink
R
block diagram of the rocket plant.
Now that the non-linear plant has been created, it is pos- Yr (s) E(s) U (s) Y (s)
sible to develop and test a control scheme for vertically Kp (s) Gp (s)
−
stabilizing the rocket.
3.3.1. Plant linearization From (40), the pitch transfer function is:
2.7802
Gp (s) = 2 . (41)
Physically, the system inputs are the four RCS thrusts. s + 0.2780s + 1.3901
However, it is easier to control in three torques A PID controller of the following form is sought:
[τxB τyB τzB ]T than in the four thrusts [R1 R2 R3 R4 ]T . 1
This is because WηT (q) in (30) is simpler than K(s) = K 1 + + Td s . (42)
Ti s
WηT (q)B in (32). Figure 8 handles this via the green
In order to obtain the coefficients in (42), Ziegler-Nichols
Linearization block which, using switches, selects
tuning rules are applied to Gp (s):
four RCS thrusts {R1 , R2 , R3 , R4 } for simulation or
K = 1.4197,
(
three torques {τxB , τyB , τzB } for linearization.
Ti = 0.8565, (43)
Using MATLAB
R
’s linmod to linearize the Simulink
R Td = 0.2141.
plant model for Figure 10’s conditions, we obtain: However, subsequent hardware-in-the-loop testing re-
B vealed that the integral term caused persistent saturation
ϕ̈ = 337.8378τx ,
θ̈ = −1.3901θ − 0.2780θ̇ + 2.7802τyB , (40) due to sensor noise, fast nature of rocket dynamics and
the limited thrust of the final RCS. As a result, the inte-
ψ̈ = −1.3901ψ − 0.2780ψ̇ + 2.7802τzB .
grator term was removed.
The coefficients above result from FALCO-4’s geometric
and dynamic properties, such as its inertia tensor values. Manual tuning of the remaining proportional and deriva-
Converting (40) into state space form, it can be shown tive terms gives the final pitch controller architecture:
that each axis (roll, pitch and yaw) is controllable using (
K = 5,
RCS torques [τxB τyB τzB ]T as inputs. Td = 3, (44)
Kp (s) = K + Td s.
Notice that each equation in (40) is decoupled. There-
fore, decoupled PID controllers for roll, pitch and yaw A Bode plot of the loop transfer function Kp (s) · Gp (s)
can be designed (at least in the linear case). Since the is shown in Figure 12. K was tuned by hardware-in-the-
pitch and yaw dynamics of (40) are identical, they are loop testing to avoid excessive saturation in the control
assigned identical PID controllers. signal. Td was chosen to place a zero after the resonance
frequency in Figure 12 so as to prevent the −180 degree
drop in phase, therefore stabilizing the system.
3.3.2. Pitch control design
The lack of an integrator means that a steady-state off-
set is present in the response. However, for a 10 degree
Figure 11 shows the implemented feedback control disturbance, this offset is only 2.6 degrees in simulation.
scheme. This is within our tolerated precision. For this reason,
8
For final implementation, (44) is discretized using back- To develop the controllers, we replaced the RCS thrusts
wards Euler difference (i.e. substituting s = z−1
zTs ):
with net torques about the rocket’s center of mass. Now,
1 − z −1 a combination of {R1 , R2 , R3 , R4 } to produce these net
Kp (z) = K + Td
, (45) torques must be found. As an infinite number of such
Ts combinations exist – and as this allocation problem is
where Ts is the sampling time. The coefficients K and linear – linear programming is used to find the optimal
Td therefore remain the same. Note, that θ and θ̇ were {R1 , R2 , R3 , R4 } combination. On-board, this is imple-
Kalman filtered prior to being passed into the controller. mented as the Simplex algorithm [21].
e(k) ∼ N (0, 1)
100
HIMU (z)
Amplitude [dB]
u(k) v(k) y(k)
IMU + 10−3
Figure 14. Additive noise model for the IMU. Empirical H(ejω ) for θ,ψ
Fitted H(ejω )
10−6
On-board, (52) is solved using the Simplex algorithm 10−2 10−1 100
[21] at a frequency of 50 [Hz]. Frequency [Hz]
Amplitude [dB]
An important part of control system design is modeling
the feedback dynamics – i.e. the sensors. Here the IMU 10−2
dynamics are ignored (assume it is a unit gain), however
we do model sensor noise according to Figure 14. Simulated additive noise v(k)
10−4
Empirical additive noise v(k)
To identify HIMU (z), the IMU was placed on a steady
surface and the output angle signals were measured for 10−2 10−1 100
one minute. A Discrete Fourier Transform of the output
Frequency [Hz]
signal was then taken in MATLAB
R
. Assuming white
Gaussian noise e(k) ∼ N (0, 1) as the input, the follow-
ing transfer function was obtained by fitting and then dis- Figure 15. Identification of the IMU noise filter.
cretizing a second-order model to fit the blue noisy em-
pirical transfer function in the top plot of Figure 15:
ω12 s
HIMU (s) = KIM U · 2 · 1 + . (53) Filtered pitch θ
s + 2ω1 ζs + ω12 ξ
Angular Rate [deg/s]
5 Filtered yaw ψ
Filtered roll rate ω ϕ
Figure 15 shows the visual match between our measure-
Angle [deg]
{ϕ0 , ϕ̇0 , θ0 , θ̇0 , ψ, ψ̇0 } = {0, 30, −7, 0, 7, 0} · π/180. Filtered yaw rate dψ/ dt
tau R3 R3 lintheta 2
R CL theta
phi R4 R4
Optimal thrust allocator
1 linTerm1 linpsi 3
[phi_filt] In1 psi
out1
2 linTerm2
In2 Euler angles Clean angles Noisy angles
[psi_filt;
psi_dot_filt] 3 linTerm3
tau_z^B err out2 in Razor 9-DOF IMU
In3
FALCO-4 attitude sensor model
PD yaw regulator dynamics
[theta_filt;
theta_dot_filt] [phi_filt;
tau_y^B err out3 theta_filt; [phi_save;
psi_filt; theta_save;
PD pitch regulator phi_dot_filt; psi_save]
Selector theta_dot_filt;
psi_dot_filt]
tau_x^B err u(4)-u(6)*sin(u(2)) x_filt x
z-1
P roll rate regulator wx
[phi_dot_save; Ts.z
Kalman filter (observer) theta_dot_save;
psi_dot_save] Discrete
derivative
Figure 18. Attitude control system overview. Green – selectors; orange – computations; blue – controllers.
R2
0.3 R3
next section describes how test flight data confirms these
R4 simulation results.
0.2
x̂B
0.360
100
0.000 ẑI
0.360
50
ŷB
0.360 ŷI
0
3 4 5 6 7 8 9 10
Time since takeoff [s]
Figure 21. Attitude and RCS thrusts at t = 7.035 [s]
Figure 19. Deviation angle between rocket longitudinal (flight #2 data).
axis and the vertical (test flight data).
Figure 20 shows the commanded RCS thrusts by the on- 3. Change the IMU to give angles at a higher frequency
board computer for the controlled flight. Note that Figure – the 50 [Hz] limitation of [22] may be a limiting
20 shows the expected RCS thrusts. These were not ac- factor for future development.
tually measured in flight. The valves were calibrated in
open-loop on the ground, so a value in the graph sim- In conclusion, this paper and the flight software [14]
ply indicates the value that the controller assigned to that should help individuals interested in learning and help-
valve and not the one that was actually output. As previ- ing advance rocket vertical landing efforts.
ously noted, after ≈ 5 [s] CO2 pressure began droppping
and the open-loop PWM-to-thrust mappings no longer
held.
ACKNOWLEDGMENTS
Figure 21 allows to visualize Figure 20 at t = 7.035 [s]
(the same color scheme for RCS thrusts is used). As the
rocket tipped at apogee, the RCS saturated trying to push This work was kindly sponsored by the Space Engineer-
it back to the vertical orientation. This is the “resistance ing Center at the École Polytechnique Fédérale de Lau-
to deviation” effect discussed for Figure 19. sanne.
12