CSE466 | Class Schedule | Lab Updates | Syllabus | Web Resources | Final Project | Lab 8 | Lab 7 | Lab 6 |    | Email Archive | Hardware Lab

CSE466-02au Lab Assignment 4 -- Due In Two Weeks

Objectives

After this lab you should know:

Background

Tasks

  1. Stepper Pattern, formerly Lab 3, part 4

    1. Using PC4, PC5, PC6, and PC7 as outputs, demonstrate stepping and (interleaved) half-stepping patterns using the potentiometer to set the Maximum speed, and the switches and your ramp code to control the process.Ensure that your logic levels are correct for driving the ULN2003, which inverts the signals. Use the logic analyzer to view your patterns.
      • Demonstrate operating code to TA
      • Turn-in commented C program for stepper sequence:
        • a description of how your code works, how you used the timers and interrupts, and describe your state machine that handles ramping.
        • The total memory requirements of your system (code, data)
        • A calculation of the effective utilization of your CPU, in percent of cycles used, not counting busy-waiting instructions.
  2. Stepper motor.

    1. Wire up the ULN2003, the Zener diode, and the stepper motor, according to the colors shown on the schematic. Pay close attention to the stripe on the diode, to ensure correct direction.
    2. Use the code from Lab 3, part 4 to run the motor.
    3. Fix your code:
      • this lab's code should use short interrupt service routines. Use flags or function queues to signal to your foreground task what needs to be done.
      • Document in comments at the begining of your code any critical sections, and why you think they are so.
      • Place a bit of tape on the shaft of your motor to provide a reference direction. Using half-stepping mode, and remembering that your motor moves 15 degrees in 1 full step, experiment to find out the following:
        1. Write code to turn for 1 full revolution and then stop, when the start button is pressed.
        2. What are the usable max and min stepping rates in 1 full revolution? (too fast and you'll drop steps, thereby not completing the rotation)
        3. What is the minimum ramp-up time? The minimum ramp down time? (for smooth operation in 1 revolution)
        4. Do the same in 1/2 revolution. On start, make the motor ramp up, run, ramp down and stop in 1/2 revolution. Reverse direction, and repeat to return to your starting point.
        5. Determine how quickly this can be done, smoothly.
        6. Demonstrate the above to TA, and document your code, including answers to the above questions as comments..

  3. Accelerometer

    1. Make a cable for your accelerometer module, using black wire for ground, red for +5v, and blue for the Y axis out. Cut the wires about 10" long, and strip and crimp a Molex contact on one end of each wire. The TAs will demonstrate. Push the contacts into a red shell in the correct positions.
    2. Wire in your accelerometer module with the cable you made.
    3. Add a 1.2MΩ resistor to the accelerometer board at R1. Trim the leads to fit.
    4. Apply power, and observe the y-axis output with an oscilloscope. Measure the period and min-max duty cycle.
    5. Use timer 1 input capture mode to time the positive pulse of your accelerometer.
    6. Use the start button to set "level" in your operation:
      • scale the numbers so that tilting left runs the motor right, and tilting right runs the motor left.
      • The motor should run faster the farther from level, and slower the nearer to level the accelerometer is.
    7. Using double-sided sticky tape, and/or any other ingeneous methods of your own devising, fasten the accelerometer to the shaft of the stepper.
    8. Write code so that the accelerometer stays level while you hold and rotate the stepper motor.
    9. Check-off with TAs; the motor/acceletometer needs to pass their "wiggle" test.
      • Turn in your documented code, with a description of operation.
      • A factor in grading will relate to how well you've removed processing from your ISRs. Explain what you moved and your mechanism of communication.

Questions/comments can be directed to:
Instructor: bruceh
Staff: cse466-staff
Webmaster: cse466-webmaster
 CSE466 | Class Schedule | Lab Updates | Syllabus | Web Resources | Final Project | Lab 8 | Lab 7 | Lab 6 |    | Email Archive | Hardware Lab