Reflectance Sensors

The reflectance sensors (pictured right attched to the AEV arm) are an alternate means of measuring the distance traveled according to wheel rotations. The sensors contain an LED light and photo transistor on the red board (see below). This works directly with the wheel containing the reflective tape (see below) in order to count marks. One full wheel rotation consists of 8 marks due to there being two reflectance sensors and the wheel has two strips of relective tape, therefore, 4 signals to the sensor times two due to two sensors means 8 marks per revolution. Since the wheel is roughly 3.9in. in circumference, it is about .4875in per mark.

 

Reflective Sensor  and wheel with reflective tape (left), Reflectance Sensors attached to AEV arm (above)

There are two basic functions using the reflective sensors. One, termed goToRelativePosition, continues a previously stated command for m marks from the current position. If m is positive, this indicates the vehicle is moving forward, whereas vice versa for a negative m. The other command, termed goToAbsolutePosition, continues a previously stated command until the AEV has traveled to mark c relative to the starting position of the vehicle. The key difference here is that the goToRelativePosition operate based on the current position, whereas the goToAbsolutePosition operates based on where it originally started.

 

This code is used to ensure that the Reflectance Sensors perform correctly:

1.Run all motors at a constant speed of 25% power for 2 seconds.
     motorSpeed(4, 25);
     goFor(2);

2.Run all motors at a constant speed of 20% and using the goToAbsolutePosition
function, travel a total distance of 12 feet (from the starting point). You will actually
rotate the wheel by hand (since you are on the desktop tracks) until the wheel has
completed the required distance and the motors stop.
     motorSpeed(4, 20);
     goToAbsolutePosition(1476);

3.Reverse motors.
     reverse(4);

4.Run all motors at a constant speed of 30% power for 1.5 second.
     motorSpeed(4, 30);
     goFor(1.5);

5.Brake all motors.
     brake(4);