self balance robot code for dead spot help needed

to make it clear as to what I am trying to do,
I want the motors to stop in the dead spot aka the balance zone!!!