Checkpoint / Assignment 2
Motor Drive Circuitry, Introduction to the HC12

Due 4pm Tuesday, Jan 23 on web site

 

Reading
Notes on motor drive circuits and HC12 tutorial.  Look through the HC12 manual so you know where to find more detailed information when you need it.

To Do
Build your motor driver circuitry, attach it to the vehicle, and wire up the motor.  The circuit should be fully operational when a battery is plugged in and a pwm signal is input (0-5 V square wave from cpu).

Work through the HC12 tutorial.  Write a simple C program to run the motor at a frequency of 200 Hz and a fixed duty cycle of your choice (it better not be too fast for the next part to work!)   Write another program to make the servo go to a given position.  Do not power the servo directly off the battery (it will burn up, no joke).  The servo takes a 50 hz signal, with a pulse (high) width of approx. 1-2 ms controlling the angle.  Calibrate the angle by trial and error so that your program limits the travel to the possible turning radius of the vehicle.

Once the servo is working, put a small resistor in series with one of the power leads.  Hooking up the scope across this resistor will allow you to measure the current that the servo is drawing.  Using the relationship between current and speed, you can determine the speed of the servo as a function of time.  Servo position is simply the integral of speed.  Modify your program so that the servo oscillates ~30 degrees at 2 Hz (every 250 ms you command it to go 30 degrees in the direction from which it just came). 

Checkoff 
Show the servo working in class on Tuesday.

Servo Data
Make a sketch of velocity and position vs. time for your servo.  Label all of the axes.  Show at least two full waveforms. Post these up to your web page.