Project 3: Pulse-Width Modulation and Proportional-Derivative Control

Project Goals

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


Project Components

All components are required to receive full credit for the project.

Part 1: Microcontroller Circuit

The current amplifier board is composed of two full H-Bridge circuits. We will be using one full H-Bridge to control the lift fan (allowing us to control rotation speed and direction). We will split the other H-Bridge into two "Half Bridges": one for each of the left and right fans. This will allow us to control speed of these two fans, but not direction.

The detailed documentation for the motor control board can be found on the Lab Hardware page: see the Motor Control Board section. The high-level view is given below.

Add wires to connect the motor control board to the fans and to the batteries:

Connect the current amplifier board to your Atmel chip (the 15 pin connector on the left side of the board in the picture below):

Part 2: Fan Control Interface

Note: this part will count for a total of one personal programming credit

Create the function interface that will generate the PWM signals for each of the three PWM inputs to the motor control board.

Define a new variable type in "project.h" (keep your SensorSide definition):

typedef enum {
   BRAKE,
   HOVER
} MotorDirection;


MotorDirection is the new variable type. BRAKE and HOVER are the two values that MotorDirection variables can take on. Remember to include "project.h" in your C file.

Implement the following functions:

Note:

Testing

Implement the following functions:

Modify your main function such that it executes one of the two above functions, depending on the initial state of switch 0.

Part 3: Proportional Derivative Control

Note: this part will count for one personal programming credit

Create a function that will implement a proportional-derivative controller:

    void pd_control(uint16_t forward_thrust, int16_t error, int16_t rotation_rate)

Where:

This function will:

Note: remember that integer math is much more efficient. However, you have to be more careful about your data types and the order of your multiplication and division operations.

Notes on tuning the PD control parameters:

Part 4: High-Level Control

Note: this part will count for one personal programming credit

For this part, you will implement a high-level control loop that will cycle once every 50 ms. For each of these control steps, if no obstacles are visible, the craft will hover and move forward. If an obstacle is detected, then the craft should brake.

Part 5: Hovercraft Layout

Revisit the mounting of your components on the Frisbees: Let us know if you need any additional components for mounting.


References


What to Hand In

The project checkpoint is due by Thursday, April 4th at 5:00pm. All components of the project are due by Thursday, April 11th at 5:00pm.


Grading

Group grade distribution:

Group Grading Rubric

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


fagg [[at]] cs.ou.edu

Last modified: Mon Feb 9 02:01:21 2015