In4073 Project Resources 2015 - 2016
This page contains essential information
to build the embedded control system of the AeroVinci quad-rotor aerial
vehicle (QR), which constitutes the lab project of the TUD course
in4073
Embedded Real-Time Systems.
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
Quad-Rotor Aerial Vehicle
The QRs we use are from
AeroVinci,
a brand new startup from the TU Delft Aerospace Department.
Before starting with the QR be sure to first read the
safety guidelines.
- QR Safety Guidelines
When doing the lab you are required to learn the
safety guidelines.
- QR Operation Manual
The QR Operation Manual can be found here
- LiPo Usage
How to properly use LiPo batteries can be found
here
- QR Interface Board
The electronics interface board on the QR is an
AutoPilot 2F.3
that interfaces the QR engines and
sensors with the FPGA board.
The circuit schematics can be found
here.
- QR Engines and Sensors
Some theory behind MEMS sensors can be found under Miscellaneous
- Wireless Link
Xbee-PRO 868 OEM RF Module
and corresponding
documentation
More information on the 868 MHz band can be found
here
- Video Link
Pollin Electronic Funk-cameraset 580-162
The Linux em28xx driver needed for the Pollin USB video receiver
can be obtained
here
(should already be installed on the lab)
Trenz Electronic TE0300-01BMLP FPGA Board
This is the FPGA board that is on-board the AeroVinci QR
(i.e., used when the QR is operated in TE0300 mode,
also see the QR Operation Manual on this site).
The version we use is the 1600K gates Spartan 3E that runs on 100 MHz
(TE0300-BMLP).
The X32 package (part of the in4073 distribution, also available
on this site) contains a port to the TE0300
(see X32 section on this page).
Digilent NEXYS2 FPGA Board
This is the FPGA board that is off-board the AeroVinci QR
(i.e., used when the QR is operated in NEXYS mode,
also see the QR Operation Manual on this site).
Althought currently we prefer to operate in TE0300 mode,
the stand-alone NEXYS board
offers a convenient X32 experimentation platform
when the QR is not available.
The Spartan-3E FPGA we use is the 1200K gates version which has more
room to accomodate the X32 plus peripherals than the
standard 500K issue.
The X32 package (part of the in4073 distribution, also available
on this site) contains a port to the NEXYS
(see X32 section on this page).
Joystick
Some joystick links.
RS232 Communication
A couple of links on RS232 communication to help you
understand the RS232 link between FPGA and PC
(and the RS232-like serial link between FPGA and the QR).
Software
X32 Soft Core
The X32 is an experimental 32 bit FPGA soft core developed at our
Embedded Software Lab.
It demonstrates the idea that (1) for many embedded applications, processor
design need not be a 9-figure project and (2) that it can be
done by anyone who knows how to write a byte code interpreter
in VHDL.
We simply took LCC (a well-known ANSI C compiler) and wrote
a VHDL interpreter for its intermediate byte code.
As all the software is free, we have a complete free
embedded solution that runs on any FPGA that carries more than some
250k gates (which is about any FPGA nowadays). You are free to
use the software outside of the course as long as you give
proper credit to the authors and our Embedded Software Lab.
Note, however, that
this free software is provided AS IS without any warranty whatsoever.
The above demo programs are targeted towards the NEXYS
board, which is the board you can use off-line
to get a feel for the X32 and experiment with it.
Note, that the TE0300 lab distribution's x32.h file
is targeted at the TE0300 board, which is slightly
different (no SSD, additional buttons, switches).
Consequently, the x32.h file you will use for the QR
is slightly different too. The x32.h file to be used
when compiling for the NEXYS board can be downloaded
here.
For those of you who want to experiment with an RTOS:
We have ported the TICS (free) and Uc/OS (licenced)
real-time kernels to the X32 (NEXYS).
Last, but not least, as a final X32 programming example,
qrtest.c
is a utility that tests all the QR's functionalities
(RS232, wireless, LEDs, button, engines, sensors).
VHDL
As mentioned earlier, the X32 is implemented in VHDL.
To get a taste of VHDL here are a bunch of tutorials
and text books (not the traditional Logic Design books
that focus on logic design plus a bit VHDL,
but the books that really do a good job on VHDL).
If you really want to learn the trade buy one of the text books.
-
Simple VHDL example projects
for non-graphical ISE, including makefile
- Tutorials:
Tutorial,
Tutorial,
Mini Reference,
Designer's Guide,
Other Resources
- Text Books (use any search engine):
"Circuit Design with VHDL" by Volnei Pedroni,
"VHDL, programming by example" by Doug Perry,
"VHDL for Logic Synthesis" by Andrew Rushton,
"VHDL for programmable logic" by Keven Skahill,
"A VHDL synthesis primer" by J. Bhasker,
"Digital System Design with VHDL" by Mark Zwolinski,
"VHDL Starter's Guide" by Sudhakar Yalamanchili,
"VHDL Cook book" by Peter J. Ashenden.
If you want to play with the (free!) ISE,
download the WebPACK (available for Windows 2000, XP,
and ome Linux flavors, see link below).
QR Control & Simulation Software
Simple QR sim (developed at our lab) to demonstrate
quad rotor vehicle mechanics and control.
Signal Processing Software
The sensor signals are contaminated with noise,
especially from the vibrating QR fuselage
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 (green)
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, ae0, ae1, ae2, ae3) is obtained
while the QR was in flight and finally touched down
(x-axis displays X32 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).
- Lecture in4073 on digital signal processing (slides)
- 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)
- My [Kalman] filter examples (Matlab)
- My 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 in4073 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 QR 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
Example IMU Systems
Some links on IMU and autopilot systems.
We used part of the QR simulator of the helicopter Autopilot
project as the basis for our lab simulator software.
Interesting Links
Just a couple of links that might interest you.