balance.c

added lift-detection, tighter outer loop control,