AME 3623: Project 4

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

Component 0: Library Installation

Install the PeriodicAction library into your Arduino environment:

Component 1: Microcontroller Circuit

You will receive two current amplifier boards for this project. Each current amplifier board is composed of two full H-Bridge circuits. We will be using one full H-Bridge to control each of the four fans on board your hovercraft.

The detailed documentation for the motor control board can be found on the Pololu Web site. Below is a picture of the H-Bridge board:

Motor/Power Connections

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

H-Bridge Control Connections

Connect the H-Bridge boards to your Teensy chip (the 15 pin connector on the left side of the board):

Component 2

Add the following declarations at the top of your program:
// Promise that we will implement this function later
void fsm_step();

// Create a task that will be executed once per 50 ms
PeriodicAction fsm_task(50, fsm_step);

// Gains to be used for reverse thrust
const float FAN_GAIN[] = {1.0, 1.0, 1.0}

Implement your loop() function in this way:

void loop()
  // Check to see if it is time to execute the fsm_task

With this implementation, you will ensure that the function fsm_task() is called once every 50ms

Component 3

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

Implement the following functions:

Use the following Arduino function to set the duty cycle of a PWM pin:

analogWrite(pin, duty);
where pin is an Arduino pin index and duty is an integer value in the range 0 ... 255 (though we are limiting the allowable range for our fans).

Component 4

Implement a Finite State Machine that does the following:

Finite State Machine notes:

What to Hand In


andrewhfagg --

Last modified: Mon Mar 5 16:22:44 2018