Sure. Anytime ptime>setpoint, when (setpoint-ptime) should go negative, it rolls over instead to 65000 or so. Stamps do simple integer math. I doubt if that particular software ever worked as written. It may have been copied from the very general Parallax PID simulator.
Fortunately for you, the Ping has been demonstrated to work in a stationary balancing robot, so you can probably tweak that code and get it going... at least the proportional part.
How about posting some pics of your robot to get some people interested in your project?
Comments
Did you try changing the PID constants Kp, Ki, Kd? Did you remove that DEBUG statement when you ran the program?
Fortunately for you, the Ping has been demonstrated to work in a stationary balancing robot, so you can probably tweak that code and get it going... at least the proportional part.
How about posting some pics of your robot to get some people interested in your project?