User Tools

Site Tools


lab4

Background

Servo Motor

A Servo 1) is a device that has an output shaft that can be positioned to a specific angular positions by sending the servo a coded signal. As long as the coded signal exists on the input line, the servo will maintain the angular position of the shaft. As the coded signal changes, the angular position of the shaft changes. Servos are topically have 3 wires; one is for power (+5 volts), ground, and the yellow wire is the control wire.

The servo motor has a control circuit and a potentiometer (a variable resistor also known as pot) that is connected to the output shaft. The pot allows the control circuitry to monitor the current angle of the servo motor. If the shaft is at the correct angle, then the motor shuts off. If the circuit finds that the angle is not correct, it will turn the motor the correct direction until the angle is correct. The output shaft of the servo is capable of traveling somewhere around 180 degrees. A normal servo is mechanically not capable of turning any farther due to a mechanical stop built on to the main output gear.

Infrared Range Finder

An Infrared Range Finder 2) works by the process of triangulation. A pulse of infrared light is emitted and then reflected back (or not reflected at all). When the light returns it comes back at an angle that is dependent on the distance of the reflecting object. The infrared range finder receiver has a special precision lens that transmits the reflected light onto an enclosed linear CCD array based on the triangulation angle. The CCD array then determines the angle and causes the rangefinder to then give a corresponding analog value to be read by external microcontroller.

Procedure

The goal is to have a task that every 300 ms checks the distance of the IR Rangefinder and change the servo's position accordingly.

  • Open the lab stationary using CodeWarrior located in:
LAB04/Micrium/Software/EvalBoards/Freescale/MC9S12DG256B/WytecDragon12/Metrowerks/Paged/
   OS-Probe-LCD/OS-Probe-LCD.mcp
  • Add a task that every 300 ms calls ir_range(ATD0DR0)
  • Connect the VCC and ground wires of Servo and IR Range Finder. Make sure you have +5 volts and have a common ground between the microprocessor and your power supply.
  • Connect PP7 pin to servo's input signal and PAD04 pin to R Range Finder output signal.
  • Double check your circuitry with your TA before powering up anything.
  • Recompile the project and transfer the binaries to Dragon12 board. icon3.jpg

Reference Manuals

Resources

lab4.txt · Last modified: 2010/03/19 15:55 by natalia

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki