Go Down

Topic: PID parameters for self-balancing motorcycle (Read 2934 times) previous topic - next topic


pauldanielcox

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!

Wuanto

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.

https://youtu.be/RWtfrmY-zEA

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

https://youtu.be/ipkUTBycZwM
titantomorrow, would you mind sharing your work or at least give away some tips? I wish my motorcycle balanced like yours!!!

juancarlossaavedra1997

Hello, I have the same problem. I've made a model of the self-balancing motorcycle and then I've exported it to Simulink to design the PID controller. In the model, the controller that I've designed works well, but when I put it in the self-balancing motorcycle, it fell down. Also, I've tried with a LQR controller and I've achieved 10 or 15 seconds of balance, only. I've modeled the inertial wheel motor to put it in the model, but I think the motor's parameters isn't correct. Could someone help me?

Julian_ortiz_olaya

I'm not sure about doing a write up. But I think the videos are interesting just to show what the bike can do as a low cost learning platform. Obviously it can do far more.

Anyway here are some more videos.

RC integration part on the desk
https://youtu.be/T6iC4rBEi-0

RC integration part demo
https://youtu.be/68zZfn8rCSY

responding to slopes
https://youtu.be/EZatXXvxVz8

responding to weight imbalance
https://youtu.be/b1NKk96fH1g


Hello

Can you help us with your enhancements for the bike?

Thanks you

Go Up