Anyone out there with experience of building a balancing robot along the lines of nBot, LegWay or GyroBot?
I've built the hardware for such a robot but I always end up with it oscillating unstably, even if I try to help it out with my hands (in which case my hands prevent it from falling but it still oscillates quite a bit about the equilibrium point hitting my hands).
If I scale down the torque on the wheels to the point that it doesn't fly back and forth unstably then the motor is too weak to actually respond to any kind of falling. The fact that it does swing back and forth suggests to me that I can be sure the motors (standard servos modified for continuous rotation and controlled by a PWM controller) are at least powerful enough to do the job but that instead it's the algorithm that's the problem.
I'm using a simple PID type controller with outputPWMPulseSize = a*angularDisplacement+b*angularRate for various values of a and b.
The main thing that springs to mind is that the PWM pulse size doesn't directly control the torque on the motor because there is also a back EMF term proportional to the motor velocity. Funnily enough, nBot and GyroBot both use encoders to measure motor speed. Do you think it is essential to feed the motor speed into my PID equation? LegWay seems not to need feedback from the motor. I already have some Hamamatsu IR emitter/detector pairs on order to start building an encoder...
Looking at my robot in action it seems like it does respond to falling but too late. And outputPWMPulseSize is updated hundreds of times per second.
Any ideas anyone?
Thanks,
-- Torquemada