My Project get crazy

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.



Please give a better description of the problem.

I think it will help if you post your code; after all you posted on the programming section.

And tell us which boards you're using and how they are wired (diagram of wiring, not photo of setup). Looks like the micro board is a Uno?