Balancing robot firmware