View Full Version : [Project] Ground Robot (GBOT) Object Tracker with PID Control

03-03-2010, 11:03 PM

This is the GBOT with a PID controller using the ZX-40A microcontroller from zbasic.net. ZX-40A is based on the ATMEGA644 AVR chip. Inputs include 2 IR range sensors (GP2D12). Outputs include 2 PWM signals to the Pololu motor driver (VNH2SP30).

The GBOT maintains a setpoint distance of 10-inches from a target and maintains that distance, no matter what. The control system was originally coded with P-control only and resulted in excessive overshoot and oscillations. So then I added PID control. See video to observe P-control vs. PID control.

YouTube- Ground Bot Tracker with PID Control

Had trouble with IR sensor noise. Issue mitigated with hardware and software. Hardware... added low ESR 1,000uF capacitors on VIN and VOUT of the LM2940T voltage regulator. Software includes an 8th order butterworth filter to clean IR sensor position and velocity. I did have issues with a fire, probably caused by a short or the motor driver. Not sure yet. Since isolating the regulator with the filters and after adding a large heatsink to the voltage regulator, no more fires. See picture below of "incident".


Anyone have experience or information on GP2D12 IR sensor distance variabiability? I have the noise reduced to 0.025" amplitude. Can this be reduced further? Thanks.

03-04-2010, 12:01 AM
Wow. Very cool. That's a really nice way to see a PID in action.

Pi Robot
03-04-2010, 08:13 AM
Double wow! I'd love to get that kind of responsiveness from the Serializer PID controller board I am using. It almost looks like your bot is connected to the box with a rigid bar. Very nice!



03-24-2010, 09:53 PM
I went ahead and rotated the GBOT 90 degrees to balance on its 2 wheels. I disabled the IR range sensors and added a new GP2D120 IR sensor. The result is the GBOT90 shown in the link below. Noise and resolution was an issue but manageable. The Vref was set to 3.0V. No gyros and no acceleromenters were used, just the single GP2D120 for pitch rate & angle measurements. I used the same PID control system from the horizontal GBOT with updated gains. Proportional and integral gains were much higher. Integral gain was highest.

YouTube- GBOT90 Balancing Ground Bot with PID Control

03-24-2010, 10:09 PM

Liam, very nice work. That's awesome!

I especially like addition of the martini, that's just too cool.