So I am completely new to coding other than in MatLab and I have taken on the task of building a self balancing bicycle. We will be using a flywheel mounted on a bicycle that produces gyroscopic torque through the pitching of the flywheel. This gyroscopic torque is what will balance the bicycle. The accelerometer I am using is an IMU605 by motion sense. Its features are below. The accelerometer would then drive the pitch motor of the flywheel. I am just lost as to where to start for the coding of the arduino. Any guidance would be greatly appreciated.
Features
IMU605-02150: +/- 2 g, +/- 150 °/sec
IMU605-10300: +/- 10 g, +/- 300 °/sec
Fully Calibrated
6 cm × 2.5 cm × 3.2 cm, 20 grams
Digital Outputs: UART, SPI
GPS PPS Input Synchronized
Variable Sampling and Output Rate
Variable FIR Filter
Low Standby Current:
0.1 mA @ 6 V + 3.6 mA @ 3.3 V
Automatic Power-Cycling Mod
Hi,
I have no idea if what you plan to do will work, but humans do not balance bicycles through any gyroscopic effect, instead whether they know it or not, cyclists make continual small adjustments to the steering to keep the bike centered under their weight.
DuaneB:
Hi,
I have no idea if what you plan to do will work, but humans do not balance bicycles through any gyroscopic effect, instead whether they know it or not, cyclists make continual small adjustments to the steering to keep the bike centered under their weight.
Yep, and while many are able to learn to ride a bike, most don't realize that when they press forward on just the right handle bar the bike turns to the right not the left and visa versa. Learned that from a friend the raced AMA bikes. He told stories about beginners on the track often crashing due to seeing an obstacle ahead and would drive right into it while over-thinking trying to avoid it. Once a brain has learned to steer a bike it just works even though the person may well not understand the principles involved or actual 'think' it works opposite of what the reality is.
So I am completely new to coding other than in MatLab and I have taken on the task of building a self balancing bicycle. We will be using a flywheel mounted on a bicycle that produces gyroscopic torque through the pitching of the flywheel. This gyroscopic torque is what will balance the bicycle. The accelerometer I am using is an IMU605 by motion sense. Its features are below. The accelerometer would then drive the pitch motor of the flywheel. I am just lost as to where to start for the coding of the arduino. Any guidance would be greatly appreciated.
Features
IMU605-02150: +/- 2 g, +/- 150 °/sec
IMU605-10300: +/- 10 g, +/- 300 °/sec
Fully Calibrated
6 cm × 2.5 cm × 3.2 cm, 20 grams
Digital Outputs: UART, SPI
GPS PPS Input Synchronized
Variable Sampling and Output Rate
Variable FIR Filter
Low Standby Current:
0.1 mA @ 6 V + 3.6 mA @ 3.3 V
Automatic Power-Cycling Mod
This approach would be necessary in order for the bike to balance while stationary / moving arbitrarily slowly. Remember that as well as managing the roll attitude of the bike you also have to manage the rotational speed of the flywheel.
But if your bike is moving fast enough, it will be self stabilising due to the geometry and gyroscopic effect of the front wheel. The smaller the bike the faster it needs to be going (in scale speed) to balance itself so if you want intend it to self-stabilise while moving, the bigger it is the easier it will be. It also helps to give the front wheel as much inertia as possible to maximise the gyroscopic forces relative to the overall mass.
So I guess you have a fundamental decision to take: under what conditions do you want the bike to be self-balancing?
The bicycle will have fixed steering and be moving arbitrarily slow. so essentially it will only be the flywheel that keeps the bicycle upright. I have all the calculations and everything complete, it is only the coding that confuses me. If I am using an IMU connected to an Arduino Uno, which is then run into a Sabertooth V1 motor control board (by dimension engineering) which will control the pitch motor of the flywheel, does this seem like a possible setup? I feel as though the arduino board should be capable of analyzing the data from the IMU and then interpreting it before sending it to the motor controller. Any input would be appreciated. Sorry for such a delayed response.
Hi,
As Moutain biker, trials biker and even occasional BMXer, I have no idea. Sorry not to be able to be more helpful but in/on every bike I ride its weight shifting and steering that keeps me upright.
Have you seen anything similar to what you are trying to do that might help this old biker picture your plan ?
@retro- That only applies at speed. Pushing the opposite handlebar. Below about 20 mph it works the opposite. At slow speed we balance a motorcycle with our weight shift, and large turns of the bars/bike.
Hi,
Counter steering or carving as some call it works on a bicycle at anything over about 10Mph. What no one ever explains is that for it to work you need to be looking into the turn, this puts your weight on the inside of the bike so when you push the handlebar away (out of the turn) the bike leans hard and fast. At this point you have to steer back into the turn as you normally would but the bike will be leaning harder into the corner so you can take much tighter corners with more speed.
Try it with a toy bike turn the handle bars slighty but keep the bike upright and it will turn a large radius, now keep the same steering angle and lean the bike over into the turn, it will turn a much tighter radius. The initial counter steer is basically a way over overcoming the bikes/riders natural tendency to right themselves and limit the lean angle when steering into a corner. Try it yourself on a bicycle, turn into a corner and see how far you can get the bike to lean, it wont be much, then try the same corner but enter it leaning your body into the corner and steering the bike the opposite way, the bike will lean over hard then as you catch the lean by steering back into the corner you can really carve the bike hard around the turn.
boardr790:
I have all the calculations and everything complete, it is only the coding that confuses me.
I'm not sure what you mean by 'coding'. Have you worked out what control algorithm you are going to use? How is that algorithm expressed? Figuring out the control algorithm is the hard part (but is not specific to Arduino) - coding the algorithm once you have worked it out is Arduino specific but is the easy part.