Exit Statement for a P loop?

Depending on whether you drive on the flat surface or try to climb the platform you may need to use I and D components later. You may check out several good discussions about exit conditions for PID loops from before: