Project 2: Serial Communication and Control

Project Goals

At the end of this project, you should be able to:

Hardware Overview

Our "helicopters" are 4-rotor X-UFOs that are equipped with their own, on-board microcontroller circuit that allows you to command the helicopter remotely and to query the state of a compass (both through a serial interface). The helis have four dimensions of control: throttle, roll, pitch, and yaw.

We will have a total of three complete heli systems available for this project. In addition, there will be two "test systems" that consist of the on-board microcontroller only. These latter units will allow you to test your own system's ability to request a compass reading and to read the response over the serial interface.

Project Overview

For this project, you will be creating a microcontroller circuit and the associated program to maintain the orientation of helicopter at a specified compass direction (i.e., you will be doing yaw control). In brief, your craft must:


Project Components

All components are required to receive full credit for the project. Although the final demonstration will focus on part 5, you should be prepared to show the functionality of the other components (this could be as simple as making a quick change to your code so that a different function is called).

Part 1: Microcontroller Circuit

Create a mega8-based circuit on a solderless breadboard.

Part 2: Serial Interface

Create a software interface to the craft. Implement the following functions. See the OU-XUFO hardware specification for details of the serial interface.

Part 3: Compass Test

Part 4: Throttle Test

Create a test function that will slowly ramp the throttle up to a given level and then slowly bring it down. The craft should lift gently into the air and (just as gently) return to the ground.

Part 5: Control

Create a proportional-derivative controller that will bring the craft's heading to a specified orientation. In essence, you will implement the following:

yaw_command = yaw_center + Kp * (theta_desired - theta_actual) - Kv * theta_derivative_actual

where Kp and Kv are gain parameters that you must select (start small!), and yaw_center is the yaw command that corresponds to "no yaw acceleration" (this latter parameter should be 128).

Note: if you are using different data types (e.g., int and float), you must take care to cast one in terms of the other before mixing them (see the AVR programming book on type casting)


References

What to Hand In

All components of the project are due by Thursday, March 29th at 5:00pm.

Grading

Group grade distribution:

Grades for individuals will be based on the group grade, but weighted by the assessed contributions of the group members.


fagg [[at]] ou.edu

Last modified: Wed Mar 7 10:55:33 2007