Hello everyone,
I am doing a two wheel self balancing inverted pendulum project, where I am using stepper motor to more to robot. Now I made a time subroutine to be run every 20 micro second to pulses the two steppers. everything is fine and my robot work great.
The problem is when I turn it off and then on it get crazy. Sometime it works fine but then it just do a random move.
If anyone can help me to figure out this problem. Please I need to finish this work as soon as possible.

