What is wrong with my inverted pendulum?
I knew of a group of students that were building an inverted pendulum, they analyzed the system found the transfer function and programmed it. It refused to work until they put a negative sign on the output to the motor control which put the system in positive feedback. Try putting the system in positive feedback and see if that helps.