I made "Inverted Pendulum" used the EdgeBoy steering contorl unit powered by legOS-1.0.7.
The mass unit has white blocks and black blocks.The light sensor detects the black and white border, and feedback the sensing result to RCX . The RCX contorols traverse direction. For example the motor rotates forward direction when the sensor detects bright, the motor rotates reverse direction when the sensor detects dark. Once the system gets balance, the rod keep on standing by hight speed traverse.
If you turn off the RCX power, the rod losts balance,and falls down.