EE192: Mechatronics Design Lab

Checkpoint 3

This checkpoint should largely guarantee a functioning motor drive circuit and steering actuation (does not have to be simultaneous).

Motor Driver Circuit

IMPORTANT!!! When using a  12V supply (high current benchtop supply or 3 cell LiPo battery) use a max duty cycle of 40% for the brushed DC motor. Otherwise you risk burning out components in your circuit.

Debugging

It is highly recommended to use the oscilloscope and function generator to isolate bugs in your logic level PWM signals (produced by the micro controller) from bugs in your motor driver circuitry. Additionally, when first testing your motor drive circuit you can run the circuit on a lower voltage (8V and up should be enough to drive the Mosfet).

Code

You will have to write code to generate PWM and control its duty cycle on the FRDM K64F. You may find the pwm example in the skeleton code useful.

Up to this point you have output data from the K64F to the serial terminal (UART). In this checkoff you will also have to read input from the serial terminal. You need to be able to send commands from your computer to the K64F. The hello world skeleton code example has been updated to demonstrate how to read a character from the serial terminal.

Checkoff Procedure

For this checkpoint, you MUST use the benchtop power supply to power your system. Do not use the thin alligator clip connectors on your high current power supply. These have a high resistance (about 1 Ohm) which may cause your circuit to run inefficiently and burn out. The TA example car is left on the lab bench at the back of the room. Feel free to look at it- pay special attention to the lower gauge wire used for power, motor, and Mosfet connections. Also notice the custom xt60 (yellow) power supply adaptor, which uses thick, low gauge wire (you will want to make something like this for yourself). Finally, some of these high current power supplies say “5A limit” on the front panel. If your station has one of these power supplies make sure to connect the power cables to the terminals at the back of the supply box (see TA example for reference).

All control signals must be generated from your microcontroller running your code. You may use the serial terminal to send manual control signals (like setting the motor duty cycle).

This checkpoint is divided into two equal parts which may be checked off separately (for example, if you need to deploy different code for the motor driver and steering actuation).

Your hardware should not be damaged (i.e. components should not catch fire or smoke) during any of these tests.

C3.1: Demonstrate your motor drive circuit works (in any order, instructor's choice):

  • Full on (40%)

  • Full off (0%)

  • 30% duty cycle

  • 5s stall test at 30% duty cycle

    • The intent is to ensure proper thermal design on your transistors and ensure your designs are safe under worst-case scenarios

    • If running off the benchtop power supply, it must be configured so that it doesn't go into current-limiting mode

    • You must disable any software overcurrent protections or cut-offs (worst-case scenario includes a software fault)

    • You may retain any hardware overcurrent protections or cut-offs, but permanent fusing is disallowed (I may decide to run this test first)

    • We should see about 6A of current output from the power supply during this stall test

  • You must also show your PWM waveforms on the oscilloscope. You may be required to explain your circuitry, choice of switching frequency, etc.

C3.2: Demonstrate steering control:

  • Turn left

  • Turn right

  • Center steering

  • You must also show your PWM waveforms on the oscilloscope.