CS4140 Project Resources 2021 - 2022
This page contains essential information
to build the embedded control system of the Quadrupel quad-rotor drone,
which constitutes the lab project of the TUD course
CS4140
Embedded Systems Laboratory.
NOTE: The following material is presented to provide
easy access to existing websites or publically available documents.
Copyright and all rights therein
are retained by authors or by other copyright holders.
All persons copying this information are expected to adhere to the
terms and constraints invoked by each author's copyright.
Assignment
Hardware
Quadrupel drone
We are using home-brew quad-rotor drones designed and assembled by Ioannis
Protonotarios.
- Safety Guidelines
When doing the lab you are required to learn the
safety guidelines.
- Operation Manual
The Operation Manual can be found here
- LiPo Usage
How to properly use LiPo batteries can be found
here
- Hardware Components
- Frame: Turnigy Talon V2.0 (550mm)
- Motors: Sunnysky X2212-13 980kV
- ESC: Flycolor 20A BCHeli 204S Opto
- Sensor module: GY-86 (10 DOF)
- RF SoC: nRF51822
- wireless: Bluetooth Low Energy
- microcontroller: ARM Cortex M0 CPU with 256kB flash + 16kB RAM
Joystick
Some joystick links.
RS232 Communication
A couple of links on RS232 communication to help you
understand the RS232 link between the Quadrupel drone and the PC.
Software
Starters package
Sample skeleton program illustrating how to read sensor values and
set enige speeds, as well as various other utilities.
Signal Processing
Note, that the discussion below is based on a prior version of the quadcopter
hardware. A meaningful trace of the quadrupel drone captured at 200Hz
with running motors and some roll, pitch, yaw movements can be found here
The sensor signals are contaminated with noise,
especially from the vibrating drone frame
due to the four engines and rotors, which is picked up by the sensors
(especially the accelerometers!).
In order to filter out the higher frequencies due to
the engines low-pass filters are needed.
The next
link shows a log of
phi (blue), p (red)
as obtained from the y-axis accelerometer and
x-axis gyro, respectively.
The approximately 8 seconds sensor
log
(format: time, ax, ay, az, p, q, r) was obtained
while the motors were running and the drone was making a pitch and roll
movement by hand
(x-axis displays time in microseconds).
Since the scale is dominated by the phi noise,
we integrated p to show the "real" phi (red).
The following
link shows a log of
phi (blue), p (green)
after applying a low-pass Butterworth filter with 10Hz
cut-off frequency.
For designing the filters see the following links:
- IIR Digital Filter Design Applet calculates the a and b coefficients
for your IIR filter according to
b[0] * y[n] + b[1] * y[n-1] + ... = a[0] * x[n] + a[1] * x[n-1] + ...
in the form
y[n] = a[0] * x[n] + a[1] * x[n-1] + ...
+ (-b[1]) * y[n-1] + (-b[2]) * y[n-2] + ...
Of course, you can also use matlab to compute the coefficients
using the butter() command (for a Butterworth filter).
- For the diehards who insist on building filters with a higher order
than 2, here are some
2nd-order designs (biquads) as basic building block for higher-order IIRs
(floating point and fixed point implementations)
- Arjan's [Kalman] filter examples (Matlab)
- Arjan's DSP examples (C)
- Here's a paper of a control systems
student who compared a fixed-point and a floating-point implementation of
a 2nd-order Butterworth LP filter (as an alternative CS4140 task assignment).
Special attention is given to the determination of the number
of bits required for sufficiently accurate fixed-point representation.
Kalman Filtering
From the above it will be clear that the accelerometers
hardly provide any useful information, even after extensive
filtering.
The gyro's, on the other hand, tend to drift, which limits
their utility as single source for drone stabilization.
Kalman filtering is the standard way of fusing gyro and accelerometer
data into reliable sensor data that allows for
stable vehicle attitude control.
People who want to experiment with a simple
Kalman filter in Matlab can use the following files:
Miscellaneous
Just a couple of links that might interest you.