In4073 Emb RT Sys (2017-2018)
System Setup
(source: assignment.pdf)
user I/O(pilot)
joystick
drone
PC link
PC
flight control(ES)
2
HW view
In4073 Emb RT Sys (2017-2018)
ARMCortex M0
115k2bps
BLE
PC
BLE1 Mbps
Quadrupel drone
gyro/accel (6)motors (4)barometer
ms intervals
Drone: Frames & Main Variables
X, u
L, p
Z, w
earth framex
y
z
N, r
M, q
Y, v
body frame
In4073 Emb RT Sys (2017-2018)
Drone attitude: Euler Angles
z (3)
x (2,3)
y (0)
x (0)
x(1)
z (2)
z (0,1)
y (3)z (0,1)
ϕ(1) (2)θ
(3)
ϕ(3)
(1)
y (1,2)
θ (2)body frame
earth frame
ψ
ψ
In4073 Emb RT Sys (2017-2018)
rotation order ψ, θ, Φ
Drone: Forces
X, u
L, p
Z, w
earth framex
y
z
N, r
M, q
Y, v
body frame
In4073 Emb RT Sys (2017-2018)
Forces: X, Y, ZMoments: L,M,N
Drone: Actuators
rotor 1 – rotor 4through RPM, denoted by Ω
driven by ES signals ae1 – ae4
ae = 0 -> Ω = 0ae = 1000 -> Ω = max
xz
y
engine 4
engine 3
engine 2
engine 1
In4073 Emb RT Sys (2017-2018)
Drone: Dynamics (in hover)
dq/dt = M / IYTi = rotor thrust = f(Ωi)mg = gravityh = rotor distance ref. center of gravityIY = heli rotation inertia in Y-axis
h
mg
T1
M = T h
T2
T4T3 T
du/dt = X / maccelerated rotation & xlation!
mg
Tmg
mg
mg
X
X = Θ mgΘΣ Ti = mg
In4073 Emb RT Sys (2017-2018)
Drone: Rotor Actuators
In general
Z = -b(Ω12+Ω2
2+Ω32+Ω4
2)L = b(Ω4
2-Ω22)
M = b(Ω12- Ω3
2)N = d(Ω2
2+Ω42-Ω1
2-Ω32)
So compute Ωi (i.e., aei) fromdesired lift (Z), roll rate (L),pitch rate (M), and yaw rate (N)
xz
y
engine 4
engine 3
engine 2
engine 1
In4073 Emb RT Sys (2017-2018)
Drone: Sensors (angles)
In4073 Emb RT Sys (2017-2018)
ax = sinΘ g ~ Θ g
p, q, r.Gyro:
ax, ay, az.Accelerometer: .
SW view
joystick
drone
PC link
PC
liftrollpitchyaw
sensorsESjoystick
keyboard actuators
ae1ae2ae3ae4
phithetapqr
saxsaysazspsqsr
drone
In4073 Emb RT Sys (2017-2018)
Communication protocol (lab 1)
PC -> Drone (send) periodic: pilot control ad hoc: mode changing, param tuning
Drone -> PC (receive) periodic: telemetry (for visualization) ad hoc: logging (for post-mortem analysis)
Dependable, robust to data loss header synch
In4073 Emb RT Sys (2017-2018)
Drone: Control Circuit
control loop example (yaw rate):eps = yaw - sr; // measure deviationN_needed = P * eps; // compute ctl actionae1 .. ae4 = f(N_needed); // actuate, see slide 9
liftrollpitchyaw
sensorsESjoystick
keyboard actuators
ae1ae2ae3ae4
phithetapqr
saxsaysazspsqsr
drone
In4073 Emb RT Sys (2017-2018)
Calibration
• real p, q, r, .. are sensed in terms of sp, sq, sr, ..• sp, sq, .. have a (voltage) bias (are not zero at rest)• so need to calibrate all 6 sensors at rest:
• let sr0 be sensor output at rest• real estimate of r are given by (z for zeroed)
zr = sr – sr0
sr
sr0-
+
cal
zr
mode
In4073 Emb RT Sys (2017-2018)
Filtering
• signals also need to be filtered to remove noise• filtered signal input to embedded controller
filterzr
controlleryaw ae1-ae4
In4073 Emb RT Sys (2017-2018)
Controller Modes
• controller mode: manual• controller model: calibrate• controller mode: control (yaw, pitch, roll)
filter
controlleryaw ae1-4
sr
sr0-
+
cal
zr
mode
In4073 Emb RT Sys (2017-2018)