LanceBot: a platform robot in infancy
Like many dynamics and control theory enthusiasts before me, I sought out to design and build a two-wheeled balancing robot and to build intuition and experience about stabilizing unstable systems.
This robot, hereby dubbed Sir LanceBot, was conceived as a platform robot for developing and testing various control schemes for both balancing and navigation.
In this post and in the accompanying github repository, I chronicle the implementation of a Proportional-Integral-Derivative (PID) control scheme to keep LanceBot upright, as a first milestone toward building bots like Ascento.
PID Control
The general control architecture features a constant tracking of the robot’s pitch angle by an inertial measurement unit (IMU) and a responsive control command sent by the on-board microcontroller to modulate the voltages supplied to the motors, all towards the goal of achieving a reference configuration/state. There is considerable theoretical deliberation in characterizing the stability, controllability, observability of a non-linear dynamic system and towards developing an optimal controller - a scheme among many worth exploring and implementing in the near future.
The PID-based controller, however, lends itself to robust control based on the robot’s error from a reference state. In this case, my reference state is that the robot stays upright with zero pitch. The controller is captured by the following formulation:
Control PWM Command = P * pitch error + I * total pitch error + D * rate of change of the pitch
Progress Snapshots
This milestone bookends a series of redesigns and rebuilds, a shift from a microprocessor implementation to a microcontroller build, where I have tighter control and more flexibility on control the control signal, timing and peripheral interfacing.
Next Steps
My next steps:
- to switch from a bench power supply to battery power;
- to continue tuning gains;
- to incorporate the motor encoders into determining the robot’s wheel states, and
- to implement some driving control possibly based on the wheel states and with a user-interface.