Table of Contents

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.

LAB04/Micrium/Software/EvalBoards/Freescale/MC9S12DG256B/WytecDragon12/Metrowerks/Paged/
   OS-Probe-LCD/OS-Probe-LCD.mcp

Reference Manuals

Resources