[HomePage] [TitleIndex] [WordIndex

Stick Balancer

/!\ Project discontinued due to practical difficulties with potentiometer coupling and drive motors being not powerful enough and the gear not robust enough to provide good acceleration of the cart with the weight of the RCX.

A Lego Mindstorms project aimed at a machine which can balance a stick (say 0.5 metres long) which can hinge in only one direction (i.e. within a plane). The project combines:

Other Issues:

Stage 1 - Build cart with simple control

The first task is to build a cart which can mechanically balance the stick. The cart at this stage looks like this:

cart1a.jpg cart1b.jpg cart1c.jpg cart1d.jpg

The program (balance1.f) reads the potentiometer voltage through the normal RCX port. This needs to be converted to angle by using the voltage divider equations because the angle is not proportional to the voltage. For the 25k Ohm potentiometer used here, the equation is  angle = 128*x /(1023-x)  where  x  is the raw integer reading from the port.

The control algorithm is executed and the drive signal applied to both motors (for more traction/acceleration).

For this first stage, a very simple control algorithm was devised. The power setting for the motors was set proportional to the angle deviation from vertical (120 deg for ours) such that 30 degrees of deviation resulted in the full power setting for the motor (integer 7). The equation was  power = (angle-120)*(-7)/30 .

Unfortunately, there was significant backlash (~5 deg) in the linkage between the stick pivot and the potentiometer. This would cause significant delay to the reactions of the cart. However, even with this simple control calculation (plus backlash), it was clear that the cart was making a good effort to balance the stick. On most trials it would keep the stick up for around 3 reversals of cart movement.

Proportional control of a double-integrator (approximately) process cannot eliminate the cycling of the control loop, even if there was no backlash. In fact, if you count the motor power accelerating the cart mass (including 2 motors + RCX), the process is actually rather more like a triple-integrator. Quite a task, and not surprising that the proportional control doesn't work.

Stage 2 - smarter control

Two additional pieces of information might help the control algorithm:

Now, its a bit hard to measure the speed of the cart, so we might be able to predict the cart speed by simulating the movement of the cart given the set of motor speed commands that we have recently sent to the motors. But we need more information:

To be continued.

Hypothesis of required control scheme

The final control scheme could be potentially complex and a hypothetical scheme is illustrated (extremely poorly, but good enough for my purposes) below:

ControlScheme.jpg

ToDo


CategoryComplete


2015-05-14 10:30