Results
The light tracker was able to track bright light source quite
well and generally could move to face the light source within a second.
Initially, I had some trouble with one of the light sensors due to a bad
internal contact, but once I replaced it everything worked well. The servo
operation in the light tracker was very smooth, but there was some slight
hesitation in the movement when a light source was suddenly applied. This was
most likely due the integral term since its calculation depends on many previous
error values and would be slow to respond to a sudden change in lighting
conditions. The light tracker did have some difficultly following a light source
when there were other lights in the room that were pointed at the light sensors.
This difficulty could be mitigated by changing the orientation of the light
sensor so that the room lights did not shine directly into either light sensor.
The ability to use the STK 500’s buttons to change the weightings on the PID
equation worked well to fine tune the light tracker’s movement and to
demonstrate the kinds of improper behavior that should be avoided. For example,
if one were to slowly raise the ‘gain’ term in the PID equation, the light
tracker would initially move faster to track the light source. However, if the
gain term was too high, then the light tracker would begin overshooting the
light source and oscillate around the source indefinitely.
The only part of the light tracker that was intended for the
user to manipulate was the servo motor with the light sensors attached and the
STK 500’s buttons. To ensure safety in the design, I wrapped all leads connected
to the servo motor in electrical tape to make sure the user didn’t touch them
and that the leads would not touch each other. Overall, the light tracker is
very easy to use as the setup is minimal and the preset PID weights are set so
that the tracker will reliable follow a light source when the MCU’s power is
turned on.