You are on page 1of 9

FABRICATION OF SELF BALANCING

MOTORCYCLE

INTRODUCTION

The deployment of electric vehicles in vast quantity can viewed as a carbon free
transportation sector. The majority of the carbon emission is due to the fossil
fuel vehicles. There is so much innovation when it comes to the four or three
wheeler market, as most of the cars are now electric and come with lots of
different feature when it comes to the human safety.In the other hand because of
lack of innovation in manufacturing of the two wheel motorcycle we are still
lacking behind when it come to rider safety. The solution here is making a bike
which can balance itself using the principle of gyroscope so that the rider not
have to worry about falling because of lack of balance over the bike. The
purpose of this Project is to build a bike prototype that is capable of driving and
balancing without a rider. The Automatic balancing bike will employ a control
system to keep itself from falling over while in motion, and be propelled by a
motor. The goal of this project is to build a two inline-wheel bike prototype
capable of balancing itself using a reaction wheel. This bike isable to drive and
also come to a complete stop without losing its balance. In order to maintain
thebalance, the robot reads sensor input detect tilt.angle and correctly reacts to
maintain gyroscope for steady vertical position. The use of programming will
help to steer the bike in any direction as per the user. The requirement include
that the bike should be capable of accelerating, driving in a straight line and
stopping without falling. It will be combination of both hardware and software
technology.

CALCULATIONS AND OBSERVATIONS

Let mass of the system = m kg


Distance/Location of center of mass (m) from the ground
= h (m)
When angle of Tilt = θ
Then Torque induced = m g h sin θ
∴ Reactive Gyroscopic Torque = m g h sin θ (opposite
direction)
∴ τ’ = I ω ωp
⇒ m g h sinθ = I ω ωp
⇒ ωp = m g h sinθ / I ω
∵ F’ max = μ N = μ m g
∴ At Limited Condition
m g h sinθ = F’ h cosθ
⇒ m g h sinθ = μ m g h cosθ
⇒ μ = tanθ
If θ= 15o then μ should be 0.267
If θ=30o then μ should be 0.577
Mass of Hub Motor = 1.92 kg
Mass of Batteries = 2.12*2 kg = 4.24 kg Mass of Wheels = .25 kg *2 = 0.5 kg
Mass of Disc = 1.5 kg
Mass of Frame = 1 kg
Mass of Chassis = 1.25 kg
Miscellaneous (Linkage, accelerometer, servo motor, Arduino etc) =1.1 kg
Mass of the whole system, m = 1.92 + 4.24 + 0.5 + 1.25 + 1
+ 1.5 + 1.1
=11.51 kg
Centre of Mass (CM) from the ground, h = (CMwheel * Mwheel) + (CMchassis
* Mchassis) + (CMframe * Mframe)
+ (CMdisc * Mdisc) + (CMhub motor * Mhub motor) + (CMbattery *
Mbattery) + (CMlinkage * Mlinkage)
Where, CM = Centre of Mass; Mx = Mass of x;
Thus,
Centre of mass from the ground, h= {(5*0.5) + (6*1.25) + (10*1) + (19*1.5) +
(15*1.92) + (12*4.24) + (15*1.1)
}/11.51
=12.56 cm = 0.126 m
≈0.13 m
Moment of inertia of the disc, I=mdr2/2
=1.5*0.075*0.075/2
=0.00422 kg-m2
Speed of Disc, N = 2650 rpm
Angular Speed of Disc, ω= 277.366 rad/sec
Since We Know That
mghsinθ = Iωωp
The vehicle is designed for the maximum tilt angle= 15o
Therefore the highest precision speed of the disc is
ωp= mghsinθ/Iω
= 11.51*9.81*.13*sin15/0.0042*277.366
= 3.26 rad/sec
So Highest Required Gyroscopic Torque
τ' = Iωωp
= 0.0042*277.366*3.26
= 3.8 kg m2/sec2

ARDUINO CODE

// Include Libraries
#include "Arduino.h"
#include "DCMDriverL298.h"
#include "Relay.h"

// Pin Definitions
#define DCMOTORDRIVERL298_PIN_INT1 4
#define DCMOTORDRIVERL298_PIN_ENB 3
#define DCMOTORDRIVERL298_PIN_INT2 5
#define DCMOTORDRIVERL298_PIN_ENA 2
#define DCMOTORDRIVERL298_PIN_INT3 6
#define DCMOTORDRIVERL298_PIN_INT4 7
#define RELAYMODULE_PIN_SIGNAL 8

// Global variables and defines


String blehm10Str = "";
// object initialization
HardwareSerial& blehm10(Serial1);
DCMDriverL298
dcMotorDriverL298(DCMOTORDRIVERL298_PIN_ENA,DCMOTORDRIV
ERL298_PIN_INT1,DCMOTORDRIVERL298_PIN_INT2,DCMOTORDRIV
ERL298_PIN_ENB,DCMOTORDRIVERL298_PIN_INT3,DCMOTORDRIVE
RL298_PIN_INT4);
Relay relayModule(RELAYMODULE_PIN_SIGNAL);

// define vars for testing menu


const int timeout = 10000; //define timeout of 10 sec
char menuOption = 0;
long time0;

// Setup the essentials for your circuit to work. It runs first every time your
circuit is powered with electricity.
void setup()
{
// Setup Serial which is useful for debugging
// Use the Serial Monitor to view printed messages
Serial.begin(9600);
while (!Serial) ; // wait for serial port to connect. Needed for native USB
Serial.println("start");

blehm10.begin(9600);
//This example uses HM-10 BLE to communicate with an Android or iOS
device.
//For Android download Hm BLE Terminal from google play store, or any
other BLE app.
//For iOS download LightBlue from App Store, or any other BLE app.
//On both apps, pair and connect to your HM-10
//You should see this message your Smartphone
blehm10.println("BLE On....");
menuOption = menu();

// Main logic of your circuit. It defines the interaction between the components
you selected. After setup, it runs over and over again, in an eternal loop.
void loop()
{

if(menuOption == '1') {
// HM-10 BLE Bluetooth 4.0 - Test Code
//Receive String from bluetooth device
if (blehm10.available())
{
//Read a complete line from bluetooth terminal
blehm10Str = blehm10.readStringUntil('\n');
// Print raw data to serial monitor
Serial.print("BT Raw Data: ");
Serial.println(blehm10Str);
}
//Send sensor data to Bluetooth device
blehm10.println("PUT YOUR SENSOR DATA HERE");

}
else if(menuOption == '2') {
// L298N Motor Driver with Dual Hobby DC motors - Test Code
//Start both motors. note that rotation direction is determined by the motors
connection to the driver.
//You can change the speed by setting a value between 0-255, and set the
direction by changing between 1 and 0.
dcMotorDriverL298.setMotorA(200,1);
dcMotorDriverL298.setMotorB(200,0);
delay(2000);
//Stop both motors
dcMotorDriverL298.stopMotors();
delay(2000);

}
else if(menuOption == '3')
{
// Disclaimer: The MPU-9255 - Triple Axis Accelerometer ,Gyro and
Magnetometer Breakout is in testing and/or doesn't have code, therefore it may
be buggy. Please be kind and report any bugs you may find.
}
else if(menuOption == '4') {
// Relay Module - Test Code
// The relay will turn on and off for 500ms (0.5 sec)
relayModule.on(); // 1. turns on
delay(500); // 2. waits 500 milliseconds (0.5 sec). Change the value in
the brackets (500) for a longer or shorter delay in milliseconds.
relayModule.off(); // 3. turns off.
delay(500); // 4. waits 500 milliseconds (0.5 sec). Change the value in
the brackets (500) for a longer or shorter delay in milliseconds.
}
if (millis() - time0 > timeout)
{
menuOption = menu();
}

// Menu function for selecting the components to be tested


// Follow serial monitor for instrcutions
char menu()
{

Serial.println(F("\nWhich component would you like to test?"));


Serial.println(F("(1) HM-10 BLE Bluetooth 4.0"));
Serial.println(F("(2) L298N Motor Driver with Dual Hobby DC motors"));
Serial.println(F("(3) MPU-9255 - Triple Axis Accelerometer ,Gyro and
Magnetometer Breakout"));
Serial.println(F("(4) Relay Module"));
Serial.println(F("(menu) send anything else or press on board reset button\
n"));
while (!Serial.available());

// Read data from serial monitor if received


while (Serial.available())
{
char c = Serial.read();
if (isAlphaNumeric(c))
{

if(c == '1')
Serial.println(F("Now Testing HM-10 BLE Bluetooth 4.0"));
else if(c == '2')
Serial.println(F("Now Testing L298N Motor Driver with
Dual Hobby DC motors"));
else if(c == '3')
Serial.println(F("Now Testing MPU-9255 - Triple Axis
Accelerometer ,Gyro and Magnetometer Breakout - note that this component
doesn't have a test code"));
else if(c == '4')
Serial.println(F("Now Testing Relay Module"));
else
{
Serial.println(F("illegal input!"));
return 0;
}
time0 = millis();
return c;
}
}
}
BreadBoard - Half Size
Arduino Mega 2560 R3
L298N Motor Driver Board Module
Hobby Motor - Gear
Relay Module
MPU-9255 - Triple Axis Accelerometer ,Gyro and Magnetometer Breakout
9v Battery
HM-10 BLE Bluetooth 4.0
USB Cable A to B
Jumper Wires Pack - M/M
Jumper Wires Pack - M/F

You might also like