Bicycle Balancer

Hello!

I am attempting to figure out how to build a bicycle balancer using arduino so that when you stop riding your bike, you can sit at the stoplight without putting your feet down.

I am NOT trying to balance the bicycle while it is rolling. So, the model is essentially an inverted pendulum - with a stationary base.

The bicycle rider will be required to remain somewhat motionless while balancing.
Turning the handlebars will be OK.

To balance the bike, I want to use an inertial approach by rotating a cylindrical mass with a motor. I estimate about 20 - 40lb weight and a motor powerful enough to get the desired torque.

I would love your help and guidance...as much as you are willing to provide.

I do have plenty of software experience, some controller programming experience with PIC-AXE's, tons of hardware experience.

But what I don't know how to do is come up with the equations for balancing by controlling a motor position of a weight.

If someone has done this small scale and has all the parts, the code, and everything figured out -- PLEASE SHARE!!!!!!!!! It would be so great to just buy the parts, load your code, and build it instead of starting from scratch.

Thank you all for your help!

Thank you for your guidance in advance!

Pat

OPs image

Just to be sure that I understand your plans.

You are NOT planning on using the spinning mass for gyroscopic stability.
It appears that your image indicates that you are planning on using the torque of accelerating the mass to counter imbalance.

So if the bike begins to lean to the left, you will accelerate the mass to the left to tip the bike to the right.
And vice versa.

I would start with a model. A simple board that stands up with a smaller mass and motor on it. Then you can work out the control algorithm and lean about PID.

Are you planning on using this on a bike with a rider or a riderless bike? If you were to put my large body on a bike, it would take a significant amount of torque to correct even the smallest lean.

If you fix the moment of inertia, then you just need a motor capable of the torque (and maybe some RPM limits). Oh, and a motor driver capable of driving it. And a battery capable of powering it.

I imagine that the control logic will be similar to a wheeled balancing bot. Likely with different PID values, but similar logic.

Was there some math involved that we can see or was this just a gut feeling?

I'm going to go with "gut feeling".

The phrase "a motor powerful enough to get the required torque" could be the giveaway, as it is commonly used by people who have no idea what torque is.

With this design, it is interesting to speculate on what will actually happen the first time the process "weight shifted left to counteract fall to the right" fails. Might be some interesting gyroscopic action!