AME 3623: Project 4
- All components of the project are due by Thursday, March 23rd
at 8:55 am
- Groups are the same as for project 1.
- Discussion within groups is fine.
- Discussion across groups may not be about the specifics of the
solution (general programming/circuit issues are fine to
discuss).
At the end of this project, you should be able to:
- through low-level functions, control the speed and direction of DC motors through an H-bridge circuit, and
- use a high-level program to test the functionality of the DC motor control interface.
Component 1: Microcontroller Circuit
The new hardware for this project includes:
- Two Dual H-Bridge boards
- Three motor power cables (red connector) for lateral fans
- One motor power cable (black connector for the middle fan
- Also: pick up a second trickle charger for your kit
The 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 (6 screw terminal connectors on the right side of the
board):
H-Bridge Control Connections
Connect the H-Bridge boards to your Teensy chip (the 15 pin
connector on the left side of the board):
- Connect GND and GND to your Teensy's ground
- Connect +5V to the hovercraft +5V supply
- Connect PWM to a Teensy pin that generates PWM output
- INa and INb:
- Lateral fans: connect to a pair of Teensy pins on the same
digital I/O port
- Central fan: connect one pin to GND and one pin to +5V
(the latter through a 10K-ohm resistor). Make your
choices are such that the middle fan will push air into the
chamber when the motor is turned on.
Component 2
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:
- int16_t clip(int16_t value, int16_t min_value, int16_t max_value) that returns
- min_value if value is smaller than min_value
- max_value if value is larger than max_value
- value otherwise
- void set_lift_motor_magnitude(int16_t magnitude) that sets
the thrust magnitude for the lift fan. This function must
ensure that magnitude falls within the range of 0... 255
(which correspond to 0% ... 100% duty cycle). If the value
does not fit within the range,
then it should be clipped to this range.
- void set_lateral_motor_magnitudes(int16_t magnitudes[3]) that sets the thrust magnitude for the
lateral fans (the order in the array is LEFT, RIGHT and BACK). This function must
ensure that each of the magnitudes fall
within the range of -255... 255. If any do not, then
the offending value
should be clipped to this range. Note that -255 corresponds to
a 100% duty cycle with the fan moving backwards and 255
corresponds to 100% duty cycle with the fan moving forwards.
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 a
value in the range 0 ... 255.
Component 3
Implement the following in your loop() function:
Note: it is okay in this case for you to have one or more loops within
your loop() function.
What to Hand In
- Code: Check your documented code into your
group subversion tree for project 4.
This is due by Thursday, March 23rd at 8:55 am.
- Demonstration/Code Review: All group
members must be present. This must be completed by Tuesday, March 28th.
- Personal report: there is no personal report for this project.
Grading
-
Personal programming credit: this project offers one programming credit.
-
Group grade distribution:
- 35%: Project implementation
- 30%: Demonstration of working project (to either
of the TA or the instructor)
- 35%: Code documentation
-
Group Grading Rubric
-
Grades for individuals will be based on the group grade, but weighted
by the assessed contributions of the group members to the non-personal programming items.
andrewhfagg -- gmail.com
Last modified: Thu Mar 9 03:11:07 2017