Monday, March 29, 2010

Initial Motor Testing

So some exciting news: the motors and ESCs from Singapore have finally arrived! We have hooked them up and tested their speed/current characteristic using a 3A power supply set to 11.1V, a 50Hz PWM (Period of 20000 at 1MHz) signal from the MaEvArM, and the tri-blade rotors. Our initial test results and some pictures/video are below!

Dual-blade props with Mystery motor:

Tri-blade prop with Mystery motor:

Tachometer setup to read RPM of tri-blade props:

Temporary test bench with two tri-blade props:

Current and RPM vs. % duty cycle for tri-blade prop:

Tri-blade motor spin test:

Saturday, March 27, 2010

Razor IMU Bootloader Issues

After connecting the Razor 9DOF IMU to the Arduino IDE and attempting the upload the code to the board, the following errors were displayed:

avrdude: stk500_getsync(): not in sync: resp=0x72
avrdude: stk500_disable(): protocol error, expect=0x14, resp=0x72

The board was connected correctly to the computer (since we were reading values output from the sample code pre-loaded onto the chip) and the IDE settings were correct. The correct COM port as well as the correct board (Arduino Pro or Pro Mini (3.3V, 8Mhz) w/Atmega328) were selected.

So after several hours of searching online and looking at other posts/replies regarding this type of issue (such as resetting the board, updating the FTDI drivers, etc), it was mentioned that it may be possible that either the Arduino Bootloader was the wrong version (since SparkFun just changed these boards from the Atmega168 to the Atmega328) or even the Bootloader was corrupted. With these in mind, we tracked down a programmer to try re-burning the Bootloader to the chip.

We weren't able to find an ISP programmer (any from the list in the Arduino IDE, such as the AVRISP or AVR ISP mkII), however we were able to find a AVR JTAGICE mkII programmer. This programmer is able to program through either the JTAG or ISP pins, which is great since the only connections available on the board are Serial and ISP/SPI. Since this programmer is incompatible with the Arduino IDE, we had to use AVRStudio4. Here are the steps we took to re-burning the Arduino Bootloader and getting the Arduino IDE to communicate with the chip:
  1. Connected the programmer to the computer with the USB cable (and made sure that the computer had the correct drivers for it).
  2. Connected the programmer to the board. After soldering pin headers to the 6-pin ISP/SPI connection, the squid breakout cable (which allows for each of the 10 JTAG cables to be connected individually) was connected using the following websites: JTAGICE mkII (for the programmer connections) and Razor 9DOF IMU Schematic (for the Razor ISP/SPI connections).
  3. In AVRstudio, click "Tools" and then "Program AVR".
  4. In the "Main" tab, change the device to "Atmega328p" and the programming mode to "ISP".
  5. In ISP settings, we used 500kHz since the board has a 8MHz clock (ISP requires something under 1/4 the system clock for any board running below 12 MHz. 8/4 -> anything under 2MHz). We chose this just to stay on the safe side.
  6. Click "Read Signature". We got a long hex string back (in the box under device name). This is a very good sign, since it means that we are getting data back from the board.
  7. In the "Program" tab under "Flash", find the bootloader (this hex file is located in the Arduino folder so for us it was under arduino-0018\hardware\arduino\bootloaders\atmega). We used the ATmegaBOOT_168_atmega328_pro_8MHz.hex (several posts we found indicated that this was what should be used on this board).
  8. Click "Program". The Razor board as well as the Tx and Rx pins on our FTDI board lit up as the data was sent and the new Bootloader was burning onto the chip. We didn't see any errors listed at the bottom of the screen, but we clicked "Verify" to make sure.
After we went through these steps, we were able to upload the AHRS code on the board using the Arduino IDE without any problems.

Thursday, March 25, 2010

9DOF Board Has Arrived!

Alright, so a few updates since the last post:

The 9DOF IMU (Inertial Measurement Unit) has arrived today from SparkFun. At 1.95" x 1.10", the board is only slightly larger than the MaEvArM. Currently, the connections are set so that the board outputs all of the sensor data over the serial output (Tx and Rx pins), however we'll be looking into the other possible connectors on the board (look like SPI). If they are, we may be able to use the board to grab data from our barometric pressure unit, which also arrived today. This keeps the sensor data separated from our main processor (the Atmega32U4 on the MaEvArM) which will be doing the PID and motor control. More on this board will be posted soon.

9DOF Razor from Spark Fun

FTDI USB to Serial adapter from Spark Fun:

Barometer IC from Spark Fun:

MaEvArM Microcontroller with ATMega32u4:

The props have arrived. We've decided to get a couple variations to test which works best. (All our sets consist of two normal and two counter-rotating blades. This prevents us from having to tilt the motors in order to counteract the rotational inertia).
  • The first set are two-blade, 8x3.8 props. (8" diameter, 3.8 blade pitch). These are fairly large rotors and have decent specs when run on our motors (will post more detailed results later).

  • The second set are tri-blade, 7x3.5 props (7" diameter, 3.5 blade pitch). After some research, it was found that tri-blade props can be quieter than dual-blade when run at the same speed. We'll also post tests with these props once the motors come in (still on their way from Singapore!).

Lastly, we've been starting to program the MaEvArM's basic tasks to ensure that our specifications will be made. So far, two main tasks have been tested and working properly:
  • Four 16-bit PWM channels (0-65536 resolution) have been tested to control the four motor controller (Brushless ESCs). With the System Clock set to 8MHz, a 150Hz output signal was able to be generated with a resolution of 0-53333 (this will have to be tested with the ESCs since they normally take 50Hz Remote Control Standard servo controls).
  • Buffered Interrupt-controlled serial communication was successfully accomplished by modifying the AVR306 (Atmega UART) code to work with the Atmega32U4 registers. This will allow us to read the output from the 9DOF board without wasting CPU usage (allowing for our PID calculations, PWM Control, and Wireless Receive to run continuously). This code uses a Circular Buffer technique to get store data when the CPU is in use and read it when it has time to.

That's it for now, but we'll keep you updated with our progress!

Sunday, March 7, 2010

First Milestone!

Project Wyvern has officially begun! The orders have been placed for the quadrotor components. Once they arrive, we will begin testing and interfacing the different control/sensor elements and post our results

Some of the key components:
-FireFly Wireless Microcontroller Platform
-MaEvArM Microcontroller
-A2208-14 1450KV Outrunner Brushless Motors (x4)
-30A ESC (Brushless Motor Controllers) DC 5.6V-16.8V (x4)
-9DOF Razor IMU (3-axis accelerometer, 3-axis gyroscope, 3-axis magnetometer)
-3 Blade Rotor - Two sets of both normal and reverse rotation 7x3.5


This overview for Project Wyvern is a basic explanation of the main components, controls, and applications of an inexpensive quadrotor aircraft.

The majority of quadrotors are very expensive. The possibility of creating a budget quadrotor robot opens the door to new and interesting experiments such as group communication and flocking patterns. Within the scope of this course, building a quadrotor robot offers an interesting application of wireless communication, high frequency sensor and ADC measurements, and a combination of mechanical design, electrical design, and controls theory.


The MaEvArM is a general purpose microcontroller platform using the ATmega32U4. The primary purpose of the MaEvArM on the robot platform is dedicated motor control to the four (4) ESC brushless motor controllers.

Zigbee wireless communication, allowing for wireless control of direction, altitude, and localization information as well as feedback from on-board sensors.

Dedicated ADC microcontroller to output a constant stream of accelerometer, gyroscope, magnetometer values via SPI to the MaEvArM and FireFly.

Brushless Motors

Brushless DC motors are more efficient and longer lasting than brushed motors, offering lower cost in the long run and a greater thrust to power ratio. A downside to using this type of motor is that it requires a particular form of dedicated motor controller and is frequently more expensive than a brushed motor. Brushless motors have a significantly longer life-span and better performance per weight than one finds in most brushed motors. The proposed quad-rotor will utilise the Suppo A2208/14 motor which for the approximated weight will draw around 3.4 [amperes] at 7 [volts] for stable flight with an overall lifting capability of 700 [grams] and will be capable of an overall lifting capability of 1.2 [kilograms]. Moreover, the motor has a rise of 1450 [Kv]. The aforementioned properties should be sufficient for stability and most maneuvering. Variation of rotors will allow for differing lifting capabilities at greater ampere consumptions.

Brushless Motor Controllers
Brushless ESCs are used to allow a convenient PWM output from the MaEvArM to control the motors while producing the necessary sinusoids to drive the brushless motors at the necessary current. Using back-EMF the motor controller is able to determine the current phase of the motor and apply the correct voltage in sequence and cause the motor to rotate.


To sense changes in movement. Three degrees of freedom.

To sense changes in direction and absolute position. Three degrees of freedom

Absolute xyz orientation over time, correcting steady state fluctuations in Gyroscope (a novelty included in the sensor PCBA)

To allow for autonomous flight or flight stabilization, a vertical height (altimeter) is required. Through the use of atmospheric pressure, a barometer is able to output voltage changes which can be converted into altitude within a 9 cm cylinder of air resolution.

GPS (possible add-on)
In addition to the barometer, GPS is another useful sensor for autonomous flight. In addition to position globally within approximately 2-3 meters, the global positioning system adds a second measurement for vertical position. Combining the measured vertical positions from the GPS and the barometer could lead to a more accurate measurement.

CCTV (possible add-on)
To transmit video wirelessly, two options are available. Serial video cameras use RS232 connections directly to the microcontroller with wireless capability (in our project, the FireFly). This video or image information can be directly used on a computer for use in image processing/autonomous modes. A downside to using this type of camera is that lower quality video/images are transmitted due to different processes (control, sensor information, etc) using the same transceiver. A more efficient and less expensive option would be to use a separate video/transmitter combo that uses the 2.4GHz frequency. The receiver, connected to a TV, would show the view from the aircraft in real-time. This option, however, is more difficult to use in image processing and autonomous control.

Approximate Total Weight

Carbon Fiber (if feasible), otherwise acrylic/abs for manufacturability.

Flight Control

PID, or proportional-integral-derivative controllers are loop feedback controls that aim to minimize over-compensation to data, which one might anticipate as being rather noisy. They use different feedback methods to limit the difference, or error, between the output and the desired goal.

Kalman Filter
A Kalman Filter is used to obtain more precise values over time from data that contains noise.

Roll (Left/Right Control)
Roll control, which is rotation about the X-axis (the axis between Front and Back rotors), is accomplished by increasing/decreasing the Left and Right rotors. A left roll is achieved by increasing the Right rotor while simultaneously decreasing the Left rotor. The opposite, increasing the Left rotor while simultaneously decreasing the Right rotor, results in a right roll.

Yaw (Turning Control)
Yaw control, which is rotation about the Z-axis (the vertical axis), is accomplished by increasing/decreasing the Left/Right and Forward/Back rotor pairs. A left yaw (or left rotation of the aircraft) is achieved by increasing the Left/Right rotor pair while simultaneously decreasing the Front/Back rotor pair. The opposite, increasing the Front/Back rotor pair while simultaneously decreasing the Left/Right rotor pair, results in a right yaw (or right rotation of the aircraft).

Pitch (Foward/Backward Control)
Pitch control, which is rotation about the Y-axis (the axis between Left and Right rotors), is accomplished by increasing/decreasing the Front and Back rotors. A forward pitch is achieved by increasing the Back rotor while simultaneously decreasing the Front rotor. The opposite, increasing the Front rotor while simultaneously decreasing the Back rotor, results in backward pitch.

Stable, minimal oscillation flying at constant altitude--the first great milestone

Second great milestone--stable liftoff and landing, controlling aircraft in the face of air disturbances

March 15 - Gather materials and parts
March 22 - Airframe construction complete
March 29 - Program Sensor MCU
April 5 - ESC PWM and birth flight, open loop
April 12 - Sensor serial communication to MaEvArM
April 19 - Initial PID design started
April 28 - Control tweaking and testing, etc.

(Senior Design)
Wireless communication between multiple flying robots, flocking patterns, etc.

The proposed project is very ambitious, and care must be taken to divide it into parts that can be more easily managed. This will more than likely become a senior design project and, if it is done right, will allow for a multitude of very interesting applications and modifications.

Friday, March 5, 2010


Welcome to the home of the Wyvern, a quadrotor aircraft that is in its infant stage. We will be posting to this blog when we reach certain noteworthy milestones.