Go Down

Topic: PID parameters for self-balancing motorcycle (Read 1 time) previous topic - next topic


For those getting here after struggling to get the bike to balance for a long time, do not despair! It's not trivial and that's what makes it so rewarding when you solve it! A "dumb" PID is not enough, you need to supplement it. Some have talked about dynamic bias, I called it control with a leaky integrator, but in any case you need to add an element that makes "finding" or tracking the exact balance point which is always changing minutely for many reasons (sensor realities, weight distributions, etc) and in a naturally unstable system these tiny perturbations are enough to send simple control schemes. If you get a really good algorithm you need surprisingly little effort, while if the algorithm isn't the best you can sometimes compensate with a fully charged battery and lots of micro adjustments in gain and weight centering, but that kind of "cheating" will never lead to a long running balance as the motor heats up quickly (and the battery depletes quickly) in this scenario. So take heart and push forward, this is a challenge you can conquer with learning and perseverance!


Got the bike balancing, very rewarding. It lasted a total of 10 minutes, but the video just shows 5 minutes. I can reproduce, though I do need to adjust the bias to be pretty close when I put back the battery.


Here is it moving in a straight line, starting, stopping and finally falling over.

titantomorrow, would you mind sharing your work or at least give away some tips? I wish my motorcycle balanced like yours!!!

Go Up