Hello there.
For our robot’s autonomous code, we are attempting to create a target tracking system. Our camera is mounted on two servos, one horizontal, and one vertical. We want to have the camera constantly center the target. How would I go about doing this?
You should feed the number of pixels from the center of the camera in the X direction into a PID loop with the setpoing being the centermost pixel. Do the same for y. The output of these loops should be fed into the set servo positions for the x and y respectively. Then adjust the gain downward until the jittering stops.
To learn more about PID loops, download the white paper on PID’s from chief delphi’s media section.