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.

28109618_2005096586481509_1628032967_n.jpg

28175567_2005051133152721_786008385_n.jpg

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?