Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Corrado Santoro
1 Why Multi-rotors?
2 Structure and Physics of a Quadrotor
3 From Analysis to Driving:
How can I impose a movement to my quadrotor?
4 The ideal world and the real world:
Why we need Control Systems Theory!
5 Rates and Angles:
Could I control the attitude?
6 What about Altitude or GPS control?
Why Multi-rotors?
P4
1 Equilibrium of forces: i=1 Ti = mg
2 Equilibrium of directions: T1,2,3,4 ||g
Equilibrium of moments: 4i=1 Mi = 0
P
3
P4
1 No equilibrium of forces: i=1 Ti 6= mg
2 Equilibrium of directions: T1,2,3,4 ||g
Equilibrium of moments: 4i=1 Mi = 0
P
3
P4
Go Up: i=1 Ti > mg
Down: 4i=1 Ti < mg
P
Go
P4
1 Equilibrium of forces: i=1 Ti = mg
2 Equilibrium of directions: T1,2,3,4 ||g
Equilibrium of moments: 4i=1 Mi = 0
P
3
(1 + 4 ) (2 + 3 ) 6= 0
As a consequence:
= kR ((1 + 4 ) (2 + 3 ))
R
= dt
No equilibrium of directions: T1,2,3,4 not parallel to g
Corrado Santoro How does a Quadrotor fly?
Roll Rotation and Translated Flight
P4
Total thrust T = i=1 Ti is decomposed in:
Lift Force:TL = T cos
Drag Force:TD = T sin
= k((1 + 4 ) (2 + 3 )) = k1 k2 k3 + k4
= k((1 + 2 ) (3 + 4 )) = k1 + k2 k3 k4
= k((1 + 3 ) (2 + 4 )) = k1 k2 + k3 k4
F = k((1 + 2 + 3 + 4 )) = k1 + k2 + k3 + k4
k k k k 1 1
k k 2
= K 2
k k
=
k k k k 3 3
F k k k k 4 4
1 k k k k
2
= K 1 k
= k k k
3 k k k k
4 F k k k k F
Problem
We need to set i by
1
2
1
3 = K
4 F
Solution ??
Lets characterize each driver/motor/propeller chain and derive the
functions:
Ti = fi (PWMi )
Then, lets invert the functions:
But...
Characterization is not so easy
If we change a component, we must repeat the process
There are unpredictable variables, e.g. air density, wind, etc.
Corrado Santoro How does a Quadrotor fly?
The Computer Scientist/Engineer Solution
Solution ??
Lets sperimentally tune:
an offset for each channel
a gain for each channel
until the system behaves as expected!
But...
Tuning is not so easy
If we change a component, we must repeat the process
There are unpredictable variables, e.g. air density, wind, etc.
Corrado Santoro How does a Quadrotor fly?
The Control System Engineer Solution
Our set-points:
Desired angular velocities on the three axis (T , T , T )
They are given through the remote control
Algorithmically
while True do
On T timer tick ;
(T , T , T , F ) = sample remote control();
(M , M , M ) = sample gyro();
e := T M ; e := T M ; e := T M ;
C :=roll rate controller(e );
C :=pitch rate controller(e );
C :=yaw rate controller(e );
(pwm1 , pwm2 , pwm3 , pwm4 )T := K 1 (CT , CT , CT , F )T ;
send to motors(pwm1 , pwm2 , pwm3 , pwm4 );
end
Algorithmically
while True do
On T timer tick ;
(T , T , T , F ) = sample remote control();
(M , M , M ) = sample gyro();
e := T M ; e := T M ; e := T M ;
C :=roll rate controller(e );
C :=pitch rate controller(e );
C :=yaw rate controller(e );
(pwm1 , pwm2 , pwm3 , pwm4 )T := K 1 (CT , CT , CT , F )T ;
send to motors(pwm1 , pwm2 , pwm3 , pwm4 );
end
PID Function
k
X e(k) e(k 1)
C(k) := Kp e(k) + Ki e(j) T + Kd
T
j=0
Gyros
Drift
Approximate discrete integration
Accelerometers
Precise only if sensor is not shaking
Basic Algorithm
while True do
On T timer tick ;
,
(, )
= sample gyro();
(ax , ay , az ) = sample accel();
(, , ) = (, , ) + T (, ,
);
= tan (ay / az );
1
q
= tan1 (ax / a2y + a2z );
);
(, , ) = fusion filter (, , , ,
end
Corrado Santoro How does a Quadrotor fly?
Sensor Fusion: Algorithms
Basic idea:
Derive an error function e(t) = real(t) estimated (t)
Design a controller able to guarantee limt e(t) = 0
Corrado Santoro How does a Quadrotor fly?
Sensor Fusion: Algorithms
s = sin, c = cos
Quaternions
A quaternion is a complex number with one real part and three
imaginary parts:
q = q0 + q1 i + q2 j + q3 k
i, j, k = imaginary units
i2 = j2 = k2 = ijk = 1
q (, , )
(, , ) q
q (, , )
while True do
On Tr timer tick ;
(M , M , M ) = sample gyro();
(ax , ay , az ) = sample accel();
(M , M ) = fusion filter (M , M , M , ax , ay , az );
if after N loops then
(T , T , T , F ) = sample remote control();
T :=roll controller(M , T );
T :=pitch controller(M , T );
end
C :=roll rate controller(M , T );
C :=pitch rate controller(M , T );
C :=yaw rate controller(M , T );
(pwm1 , pwm2 , pwm3 , pwm4 )T := K 1 (CT , CT , CT , F )T ;
send to motors(pwm1 , pwm2 , pwm3 , pwm4 );
end Corrado Santoro How does a Quadrotor fly?
Part VI
while True do
On Tr timer tick ;
...;
if after M loops then
HM = sample altitude sensor();
F :=altitude controller(HM , HT );
end
...
end
while True do
On Tr timer tick ;
...;
if after G loops then
(LatM , LonM ) = sample gps();
T :=gps lon controller(LonM , LonT );
T :=gps lat controller(LatM , LatT );
end
...
end
while True do
On Tr timer tick ;
...;
if after H loops then
(X , Y , ) = identify target with camera();
T :=x controller(X );
T :=y controller(Y );
T :=heading controller();
end
... Corrado Santoro How does a Quadrotor fly?
Conclusions
Wiring/Electronics problems
Current spikes reset the ultrasonic sensor
I2C sometimes locks (a watchdog intervenes and turn-off
motors)
Firmware problems
Still working on the sensor fusion algorithm, since it is not
satisfactory (we want more stability...)
Corrado Santoro How does a Quadrotor fly?
How does a Quadrotor fly?
A journey from physics, mathematics, control
systems and computer science
towards a Controllable Flying Object
Corrado Santoro