Updated with Version 5: Steering
Got up at 4:00am, couldn't sleep so knocked out a simple steering mechanism using a butterfly hinge.
Video shows the good stuff, what I cut out was the bloopers - gyro tumbled serveral times due to a couple of things I think: one is the stupid rabbit ears counterweight I am using that just vibrates off and then makes the rotor fall over. Another is that I don't have any way currently to limit the rotor travel so it won't fall over. I will work on those two problems next and then see how well it operates. In some other self balancing gyro projects out there you see them moving the vehicle very slowly, I suspect the reason being is that gyros can be very tippy. Is that a problem with the C1 as I don't remember seeing it cruising quickly around corners. I'm sure they handle that by computer control of the gimbal directly, something I may have to play with in the future. I can also address tumbling rotor issues programmatically and with a heavier servo/counterweight. We'll see. But so far am happy with progress. It moves pretty quick.
Used hinge to mount the wheel and attached servo. Works pretty good.
Next Steps: get rid of rabbit ears and put in rotor gimbal stops of some kind to limit travel.
Version 4: Forward motion
Back on wheels with forward motion! Very stable balance, no weird tumbling of rotor when I stop and start which is what I feared most. I powered the rear wheel with an RC ESC, receiver and lipo. The Arduino which controls the counterweight servo is powered by a small lipo and the gyro motor has it's own 6 volt power supply. Could have combined all of these into a single power source but didn't. Now that I am sure it is stable when starting and stopping I will mount some kind of servo controlled steering mechanism for front wheel and see what sort of new problems surface. Anyway, closer to final version. If I was going to build a serious model I would reduce the gyro size and use two of them spinning counter to each other to cancel out precession. I would also get someone to make me a decent brass or steel rotor that doesn't take up so much room. Would also like to get rid of bunny ears.
Front wheel: on the bottom is the Arduino Uno, then a piece of foam, then the 6 volt (2AAs) battery box to power the gyroscope motor, then a 7.4 2s lipo to power the Arduino and counterweight servo.
Potentiometer attached to gyro gimbal to measure angle of rotor. It is connected to Arduino, center pole is the signal to A2 pin of Arduino and the the other two poles are ground and 5 volt positive.
Other side of front wheel.
Rear wheel
Rear wheel with radio receiver, ESC and 3s 11.1 lipo.
In the video at the end of my run the rear wheel locked up (mechanical problem) so have to fix that.
Version 3:
Finally the gyro can stand on it's own without any external input. I used the Arduino and a small program to read the potentiometer, which is a great little tilt sensor, and control the servo which moves a counter weight. A neat effect of using the Arduino is that I can reduce the rotor speed way down and it will still balance. The program is too simple in it's current form and could really be expanded to finesse the balance routine but it works as it stands and I probably won't mess with it right now.
Photo above shows 10k potentiometer which I attached with a piece of fiberglass rod hotglued over the gimbal axle and then secured the body to the gyro frame to keep it from turning..
There is still a little precession going on but I think it is because the servo/weight mechanism is mounted off center. Also, a heavier rotor/motor combo would knock that out. I can push pretty decisively on the sides of the gyro and it resists firmly.
Simple Arduino program to control counterweight:
#include <Servo.h>
Servo servo1;
int servangle = 0; // servo angle variable
int potPin = 2; // select the input pin for the potentiometer
int ledPin = 13; // select the pin for the LED
int val = 0; // variable to store the value coming from the sensor
int valInc = 4;
int currAngle = 0;
int newAngle = 0;
int delayTime = 0;
void myServo(int curAngle,int newAngle,int angleInc,int incDelay) {
if (curAngle < newAngle) {
for(int angle=curAngle;angle < newAngle;angle += angleInc) {
servo1.write(angle);
delay(incDelay); }
}
else if (curAngle > newAngle) {
for(int angle=curAngle;angle > newAngle;angle -= angleInc) {
servo1.write(angle);
delay(incDelay); }
}
}
void setup() {
Serial.begin(9600);
pinMode(ledPin, OUTPUT); // declare the ledPin as an OUTPUT
servo1.attach(9);
servo1.write(90);
}
void loop() {
val = analogRead(potPin); // read the value from the pot sensor
delayTime = 10;
if (val >= 420 && val <= 435) digitalWrite(ledPin, HIGH); // turn the ledPin on
else digitalWrite(ledPin, LOW); // turn the ledPin off
if (val >= 420 && val <= 435) { newAngle = 90; delayTime = 40;}
else if (val >= 300 && val < 410) { newAngle = 50; delayTime = 1000; }//force back down
else if (val > 445 && val < 500) { newAngle = 130; delayTime = 1000;}// force front up
//Serial.print(val); Serial.print(" ang: "); Serial.println(newAngle);
if (newAngle != currAngle) {
myServo(currAngle,newAngle,1,10);
Serial.print(val); Serial.print(" ang: "); Serial.println(newAngle);
currAngle = newAngle;
delay(delayTime);
}
}
Next Steps: guess I am ready to put the wheels back on and take it for a little spin.
When I was playing around with it in its version 1 state I discovered an interesting little behavior that should allow me to balance the gyro in another manner without using a counter weight. Perhaps I will work on that a some point.
_____________________________________________________________________________________________________________
Version 2: I am incorporating my chopstick gyro into this project as it has a better chassis with inline skate bearings for the gimbal axel. Balancing on wheels just introduces some additional vibration that I don't need right now and will add them later.
Problem: there is some unwanted precession from the vertical that requires I manually input some force to keep the gyro balanced and I need to get rid of that. As the gyro runs the precession gradually gets larger and then the gyro will tumble.
Solutions: I have two solutions so far: One - is that by making the rotor/motor heavier it reduces the size of the precession. I increased the number of cds from 5 to 7, and added corresponding weight to the motor side. It now runs smoother with smaller precession. Now the rotor weight to total machine weight runs about 27%. I think the precession can almost be eliminated with a heaver rotor/motor. I can't run higher rpm as the motor is getting warm as it is. But while I have some precession I want to experiment with another way of getting rid of it.
Two - as the (Version 2) video shows, I use a servo that moves a counterweight back and forth to actually speed up the precession so that the gyro will recenter in the vertical axis. Works pretty well.
I also have some pretty severe vibration with the unbalanced rotor and the plastic clip on the motor adds needed weight to the top and it allows the motor to rev up a little higher by absorbing some of the vibration.
Next Steps: I plan to use an Arduino Uno and an inclinometer sensor to automatically operate the counterweight and keep the gyro centered. If that works I have another idea how to absorb large shocks and also to control leaning and still keep the gyro balanced.
_____________________________________________________________________________________________________________
Version 1:
Update: Warning: cd rotors can explode, mine did. I like all things gyroscopic, maybe because I ride a unicycle. This is my first pass at building a self-balancing two wheel model vehicle. I like the idea of Lit Motor's C-1 self balancing motorcycle and thought it would be cool if I could just make a model balance on two wheels. It turned out harder, and easier than I thought; harder to find out how to do it and pretty easy to accomplish once you know how. Turns out there is a secret to balancing on two wheels with a mechanical gyroscope that no one out there seems to be sharing. Unfortunately to discover this secret you will have to watch my video.
Hope to incorporate an arduino, potentiometer and servo to effect some kind of balance mechanism to play with the precession of the gyroscope and then on to steering.
Here is C-1. Hope it works out.
The cool Gyro-X car.
The really cool monorail gyroscopically balanced train.
And lots of others that didn't pan out.
https://www.youtube.com/watch?v=gM4ybW0TDZE