Pdf24 Merged

Download as pdf or txt
Download as pdf or txt
You are on page 1of 42

SELF BALANCING BIKE USING

FLYWHEEL
A Mini Project Report
Submitted by

GRACE MARIA GEORGE JEC21MC011


JESWIN DEVASIA JEC21MC012
MUHAMMED RABEEH V P JEC21MC018
RINCE MATHEW JEC21MC022
to
APJ Abdul Kalam Technological University
in partial fulfillment of the requirements for the award of the Degree of
Bachelor of Technology (B.Tech)
in
M ECHATRONICS E NGINEERING

Under the guidance of


MR. ASHIK M S

D EPARTMENT OF M ECHATRONICS E NGINEERING

May 2024
DECLARATION

We the undersigned hereby declare that the Mini Project report “Self Balancing Bike
Using Flywheel”, submitted for partial fulfillment of the requirements for the award of degree
of Bachelor of Technology of the APJ Abdul Kalam Technological University, Kerala is a
bonafide work done by us under supervision of Mr. Ashik M S. This submission represents
our ideas in our own words and where ideas or words of others have been included, we have
adequately and accurately cited and referenced the original sources. We also declare that
we have adhered to ethics of academic honesty and integrity and have not misrepresented
or fabricated any data or idea or fact or source in this submission. We understand that
any violation of the above will be a cause for disciplinary action by the institute and or
the University and can also evoke penal action from the sources which have thus not been
properly cited or from whom proper permission has not been obtained. This report has not
been previously used by anybody as a basis for the award of any degree, diploma or similar
title of any other University.

Name of Students Signature


GRACE MARIA GEORGE (JEC21MC011)
JESWIN DEVASIA (JEC21MC012)
MUHAMMED RABEEH V P (JEC21MC018)
RINCE MATHEW (JEC21MC0022)

Place:
Date:
D EPARTMENT OF M ECHATRONICS E NGINEERING

CERTIFICATE

This is to certify that the report entitled “SELF BALANCING BIKE USING
FLYWHEEL ” submitted by GRACE MARIA GEORGE (JEC21MC011), JESWIN
DEVASIA (JEC21MC012), MUHAMMED RABEEH V P (JEC21MC018), RINCE
MATHEW (JEC21MC022) to the APJ Abdul Kalam Technological University in partial
fulfillment of the requirements for the award of the Degree in Bachelor of Technology in
Mechatronics Engineering is a bonafide record of the mini project work carried out by
him under my guidance and supervision. This report in any form has not been submitted
to any other University or Institute for any purpose.

Mr. Ashik M S Dr. Anoopa Jose Chittilapilly


Assistant Professor Associate Professor
Internal Supervisor Head of the Department
ACKNOWLEDGEMENT

We take this opportunity to thank everyone who helped us profusely, for the successful
completion of our mini-project work. With prayers, we thank God Almighty for his grace
and blessings, for without his unseen guidance, this project would have remained only in our
dreams.

We thank the Management of Jyothi Engineering College and our Principal, Dr Jose P
Therattil for providing all the facilities to carry out this project work. We are greatful to
the Head of the Department Dr. Anoopa Jose Chittilapilly for her valuable suggestions and
encouragement to carry out this project work.

I would like to express our whole hearted gratitude to the project guide Mr. Ashik M S for
his encouragement, support and guidance in the right direction during the entire mini-project
work.

We thank our Mini Project Coordinators Dr. Vivek Lukose & Mr. Johny George for
their constant encouragement during the entire project work. We extend our gratefulness to all
teaching and non teaching staff members who directly or indirectly involved in the successful
completion of this mini-project work.

Finally, I take this opportunity to express our gratitude to the parents for their love, care
and support and also to our friends who have been constant sources of support and inspiration
for completing this mini-project work.

GRACE MARIA GEORGE (JEC21MC011)


JESWIN DEVASIA (JEC21MC012)
MUHAMMED RABEEH V P (JEC21MC018)
RINCE MATHEW (JEC21MC0022)

ii
VISION OF THE INSTITUTE
Creating eminent and ethical leaders through quality professional education with
emphasis on holistic excellence.

MISSION OF THE INSTITUTE


• To emerge as an institution par excellence of global standards by imparting quality
Engineering and other professional programmes with state-of-the-art facilities.

• To equip the students with appropriate skills for a meaningful career in the global
scenario.

• To inculcate ethical values among students and ignite their passion for holistic
excellence through social initiatives.

• To participate in the development of society through technology incubation,


entrepreneurship and industry interaction.

VISION OF THE DEPARTMENT


Create eminent and ethical leaders committed to profession and society in the field of
Mechatronics through quality professional education to excel in industrial automation
and innovation.

MISSION OF THE DEPARTMENT


To impart orientation to meet the challenges of the modern industry and provide
motivation for research. To provide quality education to create graduates with
professional and social commitment.

iii
PROGRAMME EDUCATIONAL OBJECTIVES

PEO 1: Graduates shall possess fundamental and advanced knowledge in electronics,


electrical and mechanical along with fundamental knowledge in mathematics,
basic sciences and computer programming to analyze and solve the challenges
related to automation.

PEO 2: Graduates shall have ability to design and create novel solutions with modern
tool usage which lead to a lifelong learning or higher qualification, making
them experts in their profession.

PEO 3: Graduates shall have the ability to work in a multidisciplinary environment


with good professional and ethical commitment.

iv
PROGRAMME SPECIFIC OUTCOMES

Graduate possess -
PSO 1: Professional skills: Associate the concepts related to electrical, electronics,
Mechanical, Robotics, Control and Instrumentation to solve the challenges of
modern industries.

PSO 2: Problem solving ability: Analyze and design systems with modern tools for
the benefit of the society.

v
PROGRAMME OUTCOMES

1. Engineering knowledge: Apply the knowledge of mathematics, science, engineering


fundamentals, and an engineering specialization to the solution of complex engineering
problems.
2. Problem analysis: Identify, formulate, review research literature, and analyze complex
engineering problems reaching substantiated conclusions using first principles of
mathematics, natural sciences, and engineering sciences.
3. Design/development of solutions: Design solutions for complex engineering problems
and design system components or processes that meet the specified needs with appropriate
consideration for the public health and safety, and the cultural, societal, and environmental
considerations.
4. Conduct investigations of complex problems: Use research-based knowledge and
research methods including design of experiments, analysis and interpretation of data, and
synthesis of the information to provide valid conclusions.
5. Modern tool usage: Create, select, and apply appropriate techniques, resources, and
modern engineering and IT tools including prediction and modeling to complex engineering
activities with an understanding of the limitations.
6. The engineer and society: Apply reasoning informed by the contextual knowledge to
assess societal, health, safety, legal and cultural issues and the consequent responsibilities
relevant to the professional engineering practice.
7. Environment and sustainability: Understand the impact of the professional engineering
solutions in societal and environmental contexts, and demonstrate the knowledge of, and
need for sustainable development.
8. Ethics: Apply ethical principles and commit to professional ethics and responsibilities
and norms of the engineering practice.
9. Individual and team work: Function effectively as an individual, and as a member or
leader in diverse teams, and in multidisciplinary settings.
10. Communication: Communicate effectively on complex engineering activities with the
engineering community and with society at large, such as, being able to comprehend and
write effective reports and design documentation, make effective presentations, and give
and receive clear instructions.
11. Project management and finance: Demonstrate knowledge and understanding of the
engineering and management principles and apply these to one’s own work, as a member
and leader in a team, to manage projects and in multidisciplinary environments.
12. Life-long learning: Recognize the need for, and have the preparation and ability to engage
in independent and life-long learning in the broadest context of technological change.

vi
COURSE OUTCOMES

COs Description
The students will be able to think innovatively on the development of
C3O7.1
components, products, processes or technologies in the engineering field.
The students will be able to analyse the problem requirements and arrive
C3O7.2
workable design solutions.
C3O7.3 The students will be able to understand the concept of reverse engineering.
The students will be able to familiarise with the modern tools used in the
C3O7.4
process of design and development.

CO MAPPING TO POs
POs
COs PO1 PO2 PO3 PO4 PO5 PO6 PO7 PO8 PO9 PO10 PO11 PO12
C3O7.1
C3O7.2
C3O7.3
C3O7.4
Average

CO MAPPING TO PSOs
PSOs
COs PSO1 PSO2 PSO3
C3O7.1
C3O7.2
C3O7.3
C3O7.4
Average

vii
ABSTRACT

The bicycle, a seemingly simple invention, has woven itself into the fabric of societies
worldwide. Beyond its function as a mode of transportation, the bicycle has influenced social
movements, health practices, entertainment , sports and even urban planning.A well-balanced
bicycle is crucial for a safe and enjoyable ride. However, a lack of balance can lead to several
problems for cyclists, impacting their confidence, safety, and overall experience.The most
immediate consequence of poor balance is a higher chance of tipping over. Falls can result in
injuries ranging from scrapes and bruises to more serious broken bones , the fear of falling can
lead to a lack of confidence and make them hesitant to navigate tight spaces, handle sudden
changes in direction, or merge with traffic. Struggling to maintain balance requires extra effort
from core muscles and legs. This can lead to muscle fatigue and discomfort, especially on
longer rides. Lack of balance might restrict cyclists from venturing off smooth, flat surfaces.
The concept of a self-balancing bicycle presents an intriguing solution to many of the
problems faced by cyclists today, particularly those related to balance. Self-balancing bikes
could usher in a new era of safer, more accessible, and enjoyable cycling for everyone. It
would automatically adjust to maintain an upright position, significantly reducing the risk
of tipping over and the associated injuries,encourage more people to take up cycling,allow
for smoother and more precise maneuvering,could lessen the physical strain on core muscles
and legs and lead to less fatigue on longer rides Self-balancing bicycles have the potential to
revolutionize cycling by addressing many of the challenges currently faced by riders.

viii
CONTENTS

List of Figures xi
1 Introduction 1
1.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.2 Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.3 Benefits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
2 Literature Survey 3
2.1 Reaction Wheel Control System for a Self Balancng Bike . . . . . . . . . 3
2.2 Design and Analysis of a Self- Balancing Bicycle Model . . . . . . . . . . 4
2.3 Design and Development of Self Balancing Vehicle . . . . . . . . . . . . . 5
2.4 Self Stabilizing Bike using Gyroscope . . . . . . . . . . . . . . . . . . . . 6
2.5 Balancing Control and Model Validation of Self-Stabilizing Motorcycle . . 7
3 Methodology 8
3.1 Working Principle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
3.2 Mechanics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
3.2.1 Bike Dynamics . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
3.2.2 Reaction Wheels . . . . . . . . . . . . . . . . . . . . . . . . . . 9
3.2.3 System Dynamics . . . . . . . . . . . . . . . . . . . . . . . . . . 9
3.3 Calculations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
3.4 Controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
3.4.1 PID Controller . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
3.4.2 Ziegler-Nichols . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
3.4.3 Kalman Filter . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
3.5 Components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
3.5.1 NodeMCU 8266 . . . . . . . . . . . . . . . . . . . . . . . . . . 13
3.5.2 MPU-6050 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
3.5.3 BLDC Motor-1000KV . . . . . . . . . . . . . . . . . . . . . . . 14
3.5.4 SimonK 30A ESC . . . . . . . . . . . . . . . . . . . . . . . . . 15
3.5.5 3S LIPO 11.1V . . . . . . . . . . . . . . . . . . . . . . . . . . . 16

ix
3.5.6 Flywheel and Assembly . . . . . . . . . . . . . . . . . . . . . . 17
3.5.7 Jumper Wires . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
3.5.8 Bread Board . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
3.6 Circuit Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
4 Results & Discussion 20
4.1 Design 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
4.2 Design 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
4.2.1 Controller performance when balancing . . . . . . . . . . . . . . 22
5 Conclusion 23
6 Future Scope 24
References 25
Appendices 26
A Arduino Code 26

x
LIST OF FIGURES

Figure No. Title Page No.


3.1 Orientation of torques and angular momenta for a rapidly spinning top . . . 8
3.2 Free body diagram of bike with reaction wheel . . . . . . . . . . . . . . . . 10
3.3 Process Flow Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
3.4 PID Controller Block Diagram . . . . . . . . . . . . . . . . . . . . . . . . 12
3.5 NodeMCU 8266 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
3.6 MPU-6050 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
3.7 BLDC Motor-1000KV . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
3.8 SimonK 30A ESC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
3.9 3S LIPO 11.1V . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
3.10 FlyWheel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
3.11 Jumper Wires . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
3.12 Bread Board . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
3.13 Circuit Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
4.1 Previous Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
4.2 New Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21

xi
Chapter 1. Introduction 1

CHAPTER 1

INTRODUCTION

The traditional bicycle presents a unique control challenge- maintaining upright stability
while in motion. This seemingly simple feat relies on a complex interplay between rider input,
steering geometry and gyroscopic forces. So, we are introducing our project called gyroscope
stabilised bicycle. This project delves into the engineering principles behind self-balancing
bicycles, focusing on modern technology introduces methods like gyroscopes and motors to
actively sense and correct imbalances, promoting self-balancing functionality. Through the
development of a miniaturized model, we aim to demonstrate the potential of these systems
and their impact on bicycle control and accessibility.

1.1 Overview
A self-balancing bike, also known as a self-balancing scooter or hoverboard, is a two-wheeled
personal transporter typically powered by electric motors. It uses gyroscopic sensors and
accelerometers to detect the rider’s movements and adjust accordingly to maintain balance.
These devices have become popular for short-distance commuting and recreational use due to
their compact size and ease of use.

1.2 Application
Self balancing bikes can be used for personal commuting, especially in urban areas where
congestion is high. They offer a convenient and eco-friendly mode of transportation.Companies
can use self-balancing bikes for last-mile delivery of goods and packages. They are particularly
useful in crowded urban environments where larger vehicles may struggle to navigate. Security
personnel can use self-balancing bikes for patrolling large areas such as campuses, parks,
and shopping malls, enhancing their mobility and visibility. These bikes can be adapted
for individuals with mobility impairments, providing them with greater independence and
mobility. Self-balancing bicycles offer numerous practical applications that extend beyond
traditional cycling. One of the primary benefits is enhanced safety for riders. The inherent
stability of self-balancing bikes reduces the risk of falls and injuries, making cycling safer
for a broader range of people, including children, elderly individuals, and those with balance
impairments. This technology can encourage more people to adopt cycling as a mode of
transportation or recreation, knowing that the risk of accidents is significantly minimized.
Another important application is in providing transportation solutions for disabled individuals.
People with physical disabilities or balance issues often face significant challenges when it
comes to independent mobility. Self-balancing bikes can be a game-changer in this regard,

Jyothi Engineering College, Cheruthuruthy Dept. of MRE, May 2024


Chapter 1. Introduction 2

offering a reliable and easy-to-use mode of transport. This can greatly enhance their quality
of life by providing greater independence and the ability to travel short distances without
relying on others.
Self-balancing bikes also hold considerable potential for recreational use. The added
stability can make the experience of riding more enjoyable and less stressful, particularly
for beginners or those who are nervous about riding traditional bicycles. This can open
up cycling to a wider audience, promoting physical activity and outdoor enjoyment among
diverse age groups and fitness levels.In urban transportation, self-balancing bikes could be
integrated into bike-sharing programs, providing a more user-friendly option that can attract
new users. They can also serve as a practical alternative for short commutes in congested city
areas, helping to reduce traffic and pollution. The ease of use and increased safety can make
them particularly appealing for last-mile transportation solutions.Furthermore, self-balancing
bikes have potential applications in logistics and delivery services. In environments where
traditional vehicles are too large or cumbersome, these bikes can provide an efficient and
agile means of transporting goods. Their ability to maintain balance even at low speeds or
when stationary makes them ideal for navigating crowded urban areas or delivering items
directly to customers’ doors.

1.3 Benefits
Self balancing bikes are often easier for beginners to learn compared to traditional bicycles
since they automatically balance, reducing the fear of falling. Riders gain confidence quickly,
allowing them to focus more on enjoying the ride rather than worrying about balancing.People
of various ages and abilities, including those with physical limitations, can enjoy riding a
self-balancing bike.The automatic balancing mechanism helps prevent accidents caused by
loss of balance, especially at low speeds or during sudden maneuvers.They can be ideal
for short commutes or leisurely rides, requiring minimal effort to maintain balance and
control.Riding a self-balancing bike can be an enjoyable and stress-relieving activity for
people of all ages, providing a unique experience compared to traditional bicycles.

Jyothi Engineering College, Cheruthuruthy Dept. of MRE, May 2024


Chapter 2. Literature Survey 3

CHAPTER 2

LITERATURE SURVEY

2.1 Reman Soryani , “ Reaction Wheel Control System for a Self-balancing


Bike”, Journal , 2023 [1]
In this thesis, the focus is on designing a self-balancing prototype bike using a reaction
wheel as the primary mechanism for stability. Bicycles are inherently unstable when stationary,
resembling an inverted pendulum dynamically. Previous approaches have typically relied on
manipulating steering inputs and employing state-space models to achieve balance. However,
this project innovates by implementing a PID (Proportional-Integral-Derivative) controller
to manage the reaction wheel, which is driven by a brushless DC motor. The research
explores various tuning methods for the PID controller to optimize the bike’s stability.
Specifically, different variations of the Ziegler-Nichols tuning method are compared, alongside
an alternative heuristic tuning approach. Both the standard Ziegler-Nichols method and the
alternative heuristic method demonstrated the most promising results in terms of achieving
effective balance and responsiveness.
The PID controller plays a crucial role in this setup by continuously adjusting the
reaction wheel’s output based on sensor data, ensuring the bike remains upright under varying
conditions. This approach not only enhances stability but also reduces the need for constant
rider intervention, thereby improving the user experience and safety of the electric bike. The
experimental methodology involves rigorous testing and iteration on a small-scale prototype.
Data collection from sensors integrated into the bike provides insights into its dynamic
behavior, guiding further refinements in the control algorithms and system design. This
iterative process is essential for validating the feasibility of integrating a reaction wheel as a
balancing mechanism in electric bikes.
By investigating and implementing these advanced control strategies, the thesis aims to
contribute significantly to the field of electric vehicle technology. Future research directions
include scaling up the prototype to larger bike models and exploring more complex control
algorithms tailored to nonlinear dynamics. These advancements hold potential not only for
enhancing the stability and performance of electric bikes but also for advancing autonomous
systems in various transportation sectors. Thus, this research represents a critical step towards
realizing safer, more efficient, and more reliable electric bicycles in the near future.

Jyothi Engineering College, Cheruthuruthy Dept. of MRE, May 2024


Chapter 2. Literature Survey 4

2.2 Nitheesh Kumar G, Navaneeth S, Suraj A and Pramod Sreedharan,


“Design and Analysis of a Self- Balancing Bicycle Model”, Conference
Proceedings, 2021 [2]
This paper discusses the design and analysis of a self-balancing bicycle model. The
objective was to develop an efficient design that can be fabricated in the future. The different
methods of balancing a bicycle were studied to develop an optimal design. Solidworks and
Ansys have been used for modeling, simulation, and analysis of the structure. The use of a
Control Moment Gyroscope (CMG) to balance the bicycle model was studied and the results
show that the effect of precession increases with an increase in rpm and the weight of the
flywheel. Thus, a bicycle model actuated with CMG is far more stable and less prone to
accidental tilts and toppling than one without. The studied data can be used for future research.
The primary focus of the research is to examine the impact of a Control Moment Gyroscope
(CMG) on the balance and stability of the bicycle model. The paper encompasses various
aspects of the design process, mathematical modeling, and static and dynamic analysis of the
prototype. The study includes a thorough description of the design process, which involved
creating a 2D sketch of the prototype and developing a 3D model using Solidworks. The
finite element analysis of individual components was carried out using Ansys software, and
the static analysis verified the structural rigidity for manufacturability. Additionally, the
research delves into the mathematical modeling of the bicycle model, including equations
related to gyroscopic reaction torque and the dynamic analysis results, which demonstrate the
relationship between the flywheel’s RPM and the time taken for the bicycle model to tilt.
The research concludes that the implementation of a CMG in a two-wheeler model can
significantly reduce accidents caused by instability, making it a valuable safety feature. The
paper also emphasizes the potential applications of the research findings, particularly in
the development of self-balancing two-wheelers, and highlights the importance of safety in
motorcycling, especially in addressing the challenges posed by vehicle instability.

Jyothi Engineering College, Cheruthuruthy Dept. of MRE, May 2024


Chapter 2. Literature Survey 5

2.3 Kowshal S, Lakshmi Prasad H M, Nikhil K, Prashanth B. R, Abhilash,


“Design and Development of Self Balancing Vehicle”, International
Journal for Research in Applied ScieCMG exhibits increased stability
and is less prone to tilting and topplinnce & Engineering Technology
(IJRASET), ISSN: 2321-9653; IC Value: 45.98; SJ Impact Factor:
7.538, Volume 11, Issue VI, June 2023 [3]
The project work outlines the design and development of a self-balancing vehicle. The
project aimed to create a compact, lightweight, and energy-efficient vehicle that could maintain
balance without the need for a rider’s input. The vehicle’s energy consumption was also
significantly lower than that of similar vehicles, making it an efficient and environmentally-friendly
mode of transportation.Overall, the project was successful in achieving its goals of designing
and developing a self-balancing vehicle. With further refinement and testing, the vehicle
has the potential to become a viable mode of transportation for short distances in urban
environments. The data from the testing of the self-balancing vehicle model reveal key
insights into its performance and capabilities in maintaining balance and stability across
different angles of tilt. The vehicle was subjected to a series of trials where its speed in
revolutions per minute (RPM) was measured at various tilt angles. The data indicates a clear
trend: as the tilt angle increases, the speed required to maintain balance and stability also
increases. At a shallow tilt of 5 degrees, the vehicle operates at a relatively low speed of 189
RPM. As the tilt angle is gradually increased, there is a corresponding increase in speed. By
the time the tilt angle reaches 30 degrees, the vehicle’s speed has surged to 536 RPM.
This pattern suggests that the self-balancing mechanism, likely driven by a reaction wheel
and controlled by a PID controller, needs to work harder to stabilize the vehicle as the tilt
angle becomes more severe. The significant jump in speed at higher tilt angles demonstrates
the vehicle’s ability to respond dynamically to increasing instability. The graphical analysis
would visually depict this relationship, likely showing an exponential increase in speed with
respect to the tilt angle. This implies that the control system is effectively compensating for the
increased demand for stabilization as the tilt angle grows, ensuring the vehicle maintains its
balance under more challenging conditions. The test results highlight the vehicle’s capability
to adapt its balancing mechanism efficiently across a range of tilt angles, maintaining stability
by adjusting speed proportionally to the angle of tilt. This capability is crucial for the practical
application of self-balancing vehicles, especially in varying and unpredictable real-world
scenarios

Jyothi Engineering College, Cheruthuruthy Dept. of MRE, May 2024


Chapter 2. Literature Survey 6

2.4 Pratik D Tak , “ Self Stabilizing Bike using Gyroscope ”, Journal ,


2017 [4]
The paper explains that the principle of gyroscopic stabilization can be applied to bicycles
to maintain balance both while stationary and in motion. This is achieved by attaching a
heavy, high-speed rotating mass (Gyro Wheel) to the bike’s frame. The rotating mass, driven
by a motor, acts as a gyroscope. An additional motor is used to provide tilting motion to this
rotating mass. When the bike begins to tilt, electronic sensors detect the angle, velocity, and
acceleration of the tilt. This data is processed by a microcontroller, which then activates the
motor to tilt the rotating mass in response to the bike’s tilting motion. The tilting motion of
the rotor generates an anti-torque that opposes the bike’s tilt, helping to keep it upright.
It further suggests that the system should automatically adjust the rotor’s speed based
on the rider’s weight, as the tilting torque varies with different loads. By controlling the
rotor’s speed through the microcontroller, the system can effectively counteract the bike’s
tilting torque with an equal and opposite torque. The concept draws inspiration from the
gyroscopic stabilization systems used in ships and airplanes. This technology can potentially
lead to the development of fully enclosed bicycles, providing a more comfortable travel
experience similar to a car, with features like air conditioning. The text also suggests that
adaptive control could be integrated into the system to enhance its responsiveness to changes
in payload. The text shows that Control Moment Gyroscopes (CMGs) can be effectively
used for self-balancing bicycles, potentially leading to innovative designs that improve rider
comfort and stability by leveraging gyroscopic principles.

Jyothi Engineering College, Cheruthuruthy Dept. of MRE, May 2024


Chapter 2. Literature Survey 7

2.5 Hansol Moon, Thomas Sugar , “ Balancing Control and Model Validation
of Self-Stabilizing Motorcycle ”, Journal , 2020 [5]
Bicycles and motorcycles offer maneuverability, energy efficiency and acceleration
that four wheeled vehicles cannot offer given similar budget for. Two wheeled vehicles
have drastically different dynamics from four wheeled vehicles due to their instability
and gyroscopic effect from their wheels. This thesis focuses on self-stabilization of a
motorcycle using an active control momentum gyroscope (CMG) and validation of this
multi-degree-of-freedom system’s mathematical model. Physical platform was created to
mimic the simulation as accurately as possible and all components used were justified. This
process involves derivation of a 3 Degree-of-Freedom (DOF) system’s forward kinematics
and its Jacobian matrix, simulation analysis of different controller algorithms, setting the
system and subsystem specifications, and real system experimentation and data analysis. A
Jacobian matrix was used to calculate accurately decomposed resultant angular velocities
which are used to create the dynamics model of the system torque using the Euler-Lagrange
method. This produces a nonlinear second order differential equation that is modeled using
MATLAB/Simulink. PID, and cascaded feedback loop are tested in this Simulink model.
Cascaded feedback loop shows most promises in the simulation analysis. Therefore, system
specifications are calculated according to the data produced by this controller method. The
model validation is executed using the Vicon motion capture system which captured the roll
angle of the motorcycle. This work contributes to creating a set of procedures for creating
a validated dynamic model for a CMG stabilized motorcycle which can be used to create
variants of other self-stabilizing motorcycle system.

Jyothi Engineering College, Cheruthuruthy Dept. of MRE, May 2024


Chapter 3. Methodology 8

CHAPTER 3

METHODOLOGY

3.1 Working Principle


A self-balancing bike operates on principles similar to those of an inverted pendulum,
where the bike itself acts as the pendulum that must be kept upright. The dynamics of the
system can be modeled as an inverted pendulum mounted on a wheel. When the bike tilts,
sensors detect the tilt angle and angular velocity, and these measurements are fed into a control
system designed to apply corrective actions to maintain balance. The system calculates the
necessary torque required to counteract the tilt and applies this torque using reaction wheels
or other actuators.
The gyroscopic effect is leveraged through the use of reaction wheels. When these wheels
spin as shown in Figure 3.1, they create a gyroscopic torque that helps stabilize the bike. When
the bike tilts, sensors detect the lean angle and transmit this information to a control system.
Based on the detected tilt, the control system calculates the required torque and direction
needed from the reaction wheels to generate a counteracting torque. The speed and direction
of the reaction wheels are determined by the control algorithm, which processes sensor data
in real-time. Adjustments to the rotational speed of the reaction wheels create a gyroscopic
torque that opposes the bike’s tilt, thereby stabilizing it. By continuously monitoring and
adjusting the reaction wheel’s speed and direction in response to the bike’s dynamics, the
system effectively maintains balance, allowing the rider to maneuver safely without the need
for constant manual correction.

Figure 3.1: Orientation of torques and angular momenta for a rapidly spinning top

Jyothi Engineering College, Cheruthuruthy Dept. of MRE, May 2024


Chapter 3. Methodology 9

3.2 Mechanics
3.2.1 Bike Dynamics
The dynamics of bicycles encompass the physical forces that act upon them during motion,
presenting inherent challenges due to their unstable nature. This instability complicates
steering and riding, as bikes naturally lean with the rider’s movements, facilitating turns in
the direction of the lean while hindering steering in the opposite direction. At lower speeds,
maintaining balance demands continuous, subtle adjustments to the handlebars. Conversely,
at higher speeds, bicycles benefit from increased stability, partly due to gyroscopic effects
and the geometry of their construction, which aids in maintaining upright posture. However,
heightened stability at speed also amplifies responsiveness to rider inputs, including steering,
acceleration, and braking. Consequently, even minor adjustments or changes in velocity can
markedly influence stability and handling.
When stationary, bicycles are most unstable, lacking the gyroscopic forces that aid
balance during motion. Comprehending bike dynamics involves understanding of factors
such as geometry, weight distribution, tire characteristics, and the influence of rider actions.
These elements collectively dictate how bicycles behave in motion, impacting their stability,
maneuverability, and overall performance.

3.2.2 Reaction Wheels


Reaction wheels, also known as momentum wheels are a device commonly used in
satellites and other smaller spacecraft for attitude control. The construction for the device is
rather simple, a disc mounted on an axis, commonly powered by some kind of electric motor.
The output torque of the reaction wheel is related to the motor torque, and the moment of
inertia, this relation is displayed in the next subsection. The principle of a reaction wheel is to
apply torque in the opposite direction of the wanted rotation, as the torque from the reaction
wheel will be the cause of an equal reaction torque, that is directed antagonistic to the reaction
wheel torque. Reaction wheels are good in the use case where you would want stable and
precise rotation in an axis.

3.2.3 System Dynamics


The two-wheel bike model is shown in the Figure 3.2, in which m1 is the weight of the
bike (including the BLDC Motor), m2 is the weight of the flywheel, h1 is the height of the
center of the gravity of the bike (excluding the flywheel), h2 is the height of the center of the
gravity of the flywheel, I1 is the moment of inertia of the bike, I2 is the moment of inertia
of the flywheel, is the tilt angle of the bike compared to the vertical axis, and is the angle of
rotation of the flywheel.

Jyothi Engineering College, Cheruthuruthy Dept. of MRE, May 2024


Chapter 3. Methodology 10

Figure 3.2: Free body diagram of bike with reaction wheel

3.3 Calculations
According to Figure 3.2, the mass of the system is m1 + m2 kg. The distances from the
ground to the centers of mass of the bike and the flywheel are h1 and h2 meters, respectively.
When the angle of tilt is θ, the torque induced τ is given by:

τ = (m1 h1 + m2 h2 )g sin θ (1)

The Reactive Gyroscopic Torque (τ ′ ) is given as:

τ ′ = (m1 h1 + m2 h2 )g sin θ (opposite direction) (2)

Also,
τ ′ = I2 ωωp (3)

where I2 is the moment of inertia of the flywheel, ω the angular speed of the flywheel, and
ωp the precession speed of the flywheel.
On comparing equation (2) and equation (3),

(m1 h1 + m2 h2 )g sin θ = I2 ωωp (4)

Therefore,
(m1 h1 + m2 h2 )g sin θ
ωp = (5)
I2 ω

Jyothi Engineering College, Cheruthuruthy Dept. of MRE, May 2024


Chapter 3. Methodology 11

To infer the torque required for the reaction wheel according to the tilt angle θ from the
given equations, we proceed as follows:
The torque τ induced by the tilt of the bike is:

τ = (m1 h1 + m2 h2 )g sin θ

where: m1 : Mass of the bike (including BLDC Motor). h1 : Height of the bike’s center of
gravity (excluding the flywheel). m2 : Mass of the flywheel. h2 : Height of the flywheel’s
center of gravity. g: Acceleration due to gravity. θ: Tilt angle of the bike relative to the
vertical axis.
The gyroscopic torque τ ′ produced by the reaction wheel is:

τ ′ = I2 ωωp

where: I2 : Moment of inertia of the flywheel. ω: Angular speed of the flywheel. ωp :


Precession speed of the flywheel.
This shows that Mm , the required torque for the reaction wheel, is directly proportional
to the angular speed ω of the flywheel and the moment of inertia I2 of the flywheel. The
precession speed ωp adjusts dynamically based on the tilt angle θ and ω, ensuring that the
gyroscopic torque τ ′ effectively counters the torque τ induced by the tilt angle θ.

3.4 Controller

Figure 3.3: Process Flow Diagram

Jyothi Engineering College, Cheruthuruthy Dept. of MRE, May 2024


Chapter 3. Methodology 12

The process flow diagram shown in Figre 3.3 shows that the control of the bike is simple
and straightforward. This includes reading data from sensor, filtering the data, applying
control algorithms on the data, and sending control signal to the actuators. All the filtering
of data and generation of control signal is done by a microcontroller.The measured angle is
treated with a PID algorithm, and output generated is scaled to a corresponding voltage and
fed to the motor controller. The motor controller then outputs a voltage to the BLDC Motor.
This motor geared down, and ultimately actuates the flywheel. The torque exerted on the
flywheel, generates a reaction torque which is exerted on the bike.

3.4.1 PID Controller

Figure 3.4: PID Controller Block Diagram

PID control is the single undisputed most common control method in the industry. PID
control, according to Figure 3.4, stems from building on a simple control method, called
proportional control which on its own can increase the speed of the feedback system. The
integrating effect (I), allows the system to keep the output signal steady and constant when
approaching the sought after value. The derivative effect (D), notices the change over time in
system performance and adjusts accordingly. This derivative effect keeps systems from going
unstable when increasing the proportional and integral gain.
The full PID controller can be described mathematically as follows:
Zt
d
u(t) = KP e(t) + KI e(τ) dτ + KD e(t)
0 dt

Jyothi Engineering College, Cheruthuruthy Dept. of MRE, May 2024


Chapter 3. Methodology 13

Where u(t) is the input signal to the system, which depends on the error term e(t) = r(t) y(t) ,
where r(t) is the reference value and y(t) is the measured value. The constant values KP , KI ,
KD are the values meant to be tuned to the system in order to find satisfying performance.

3.4.2 Ziegler-Nichols
The Ziegler–Nichols tuning method is a heuristic method of tuning a PID controller. It
was developed by John G. Ziegler and Nathaniel B. Nichols. It is performed by setting the I
(integral) and D (derivative) gains to zero. The ”P” (proportional) gain, Kp , is then increased
(from zero) until it reaches the ultimate gain Ku , at which the output of the control loop has
stable and consistent oscillations. Ku and the oscillation period Tu are then used to set the P, I,
and D gains depending on the type of controller used and behavior desired. This tuning rule
is meant to give PID loops best disturbance rejection.

3.4.3 Kalman Filter


A Kalman Filter is a mathematical algorithm used for estimating the state of a system
when there’s uncertainty in the measurements. It combines measurements from sensors with
predictions from a mathematical model to produce an accurate estimate of the system’s state.
It’s commonly used in fields like navigation, control systems, and signal processing to improve
the accuracy of predictions based on noisy data.

3.5 Components
The each module in and the purpose of components are explained in the below sub
sections.

3.5.1 NodeMCU 8266

Figure 3.5: NodeMCU 8266

The NodeMCU ESP8266 (Figure 3.5) is a versatile microcontroller widely employed in


self-balancing bikes for its reliability, compact size, and integrated Wi-Fi capabilities. Serving
as the brain of the bike’s control system, the NodeMCU ESP8266 processes sensor data,
calculates necessary adjustments for balance, and controls actuators to maintain stability

Jyothi Engineering College, Cheruthuruthy Dept. of MRE, May 2024


Chapter 3. Methodology 14

during operation. Its compatibility with various sensors and peripherals allows for seamless
integration into the bike’s architecture, facilitating real-time monitoring and adjustment
of parameters. Moreover, its Wi-Fi connectivity enables remote control and data logging,
empowering riders and developers to fine-tune performance and analyze ride metrics. The
NodeMCU ESP8266 plays a pivotal role in enhancing the functionality and intelligence of
self-balancing bikes, contributing to their safety, efficiency, and user experience.

3.5.2 MPU-6050

Figure 3.6: MPU-6050

The MPU-6050 accelerometer (Figure 3.6) is a widely used sensor module that combines a
three-axis accelerometer and a three-axis gyroscope. It is capable of measuring acceleration,
tilt, and rotation in three-dimensional space. The module integrates motion detection
algorithms, making it suitable for various applications such as motion tracking, gesture
recognition, and robotics. The MPU-6050 accelerometer communicates with a microcontroller
or Arduino board through I2C communication protocol and provides accurate and reliable
motion data. Its compact size, low power consumption, and versatile features make it a
popular choice for projects requiring motion sensing capabilities.

3.5.3 BLDC Motor-1000KV


A Brushless DC (BLDC) motor (Figure 3.7) is a type of electric motor that uses permanent
magnets on the rotor and stationary coils on the stator to create a rotating magnetic field.
This rotating field induces current in the rotor windings, which creates torque and causes the
motor to spin. BLDC motors are known for their high efficiency, reliability, and long lifespan,
making them ideal for a wide range of applications. In a self-balancing bicycle, the BLDC
motor is typically used to power the Flywheels. The motor controller receives input from
various sensors, such as gyroscopes and accelerometers, and uses this information to adjust
the speed and torque of the motor in order to keep the bicycle upright. Balancing Mechanism
Self-balancing bicycles rely on a reaction wheel system to maintain balance. This system
uses a flywheel spun by a BLDC motor. When the bicycle tilts, sensors detect the lean and

Jyothi Engineering College, Cheruthuruthy Dept. of MRE, May 2024


Chapter 3. Methodology 15

Figure 3.7: BLDC Motor-1000KV

send signals to the motor controller. Controller Response The controller adjusts the motor’s
direction and speed to counteract the tilt. By spinning the flywheel in the opposite direction
of the lean, the gyroscopic effect creates a righting force that stabilizes the bicycle. BLDC
Motor Advantages BLDC motors are ideal for self-balancing bicycles due to several reasons
such as,BLDC motors convert electrical energy into mechanical energy with minimal losses,
resulting in longer battery life for the self-balancing bicycle results in high efficiency,BLDC
motors offer excellent speed and torque control, allowing the controller to make minute
adjustments to maintain balance effectively and BLDC motors react quickly to changes in
input from the sensors, ensuring the bicycle responds swiftly to maintain stability.

3.5.4 SimonK 30A ESC

Figure 3.8: SimonK 30A ESC

The SimonK 30A ESE (Electronic Speed Controller) shown in Figure 3.8 is a highly
regarded component used for managing the speed of brushless motors in various RC (radio-controlled)
models, including drones, airplanes, and helicopters. This ESC is capable of handling a
continuous current of 30A and is preloaded with SimonK firmware, known for its fast and

Jyothi Engineering College, Cheruthuruthy Dept. of MRE, May 2024


Chapter 3. Methodology 16

responsive motor control. It supports a wide range of battery types, typically from 2S to 4S
LiPo batteries, ensuring flexibility for different power requirements. Additionally, it often
includes a built-in Battery Eliminator Circuit (BEC) to supply power to the receiver and servos,
enhancing its utility in complex setups. The SimonK 30A ESC features standard PWM input
for broad compatibility with most RC receivers and incorporates protection mechanisms such
as low voltage cut-off, overheat protection, and throttle signal loss protection. Its compact
and lightweight design makes it an ideal choice for applications where space and weight are
at a premium.
Controlling reaction wheels in a self-balancing bike with a SimonK 30A ESC involves a
specialized application of the ESC’s capabilities. The ESC interfaces with the motors driving
the reaction wheels. The ESC receives input signals from sensors that detect the bike’s tilt or
orientation, typically gyroscopes and accelerometers. Based on these inputs, the ESC adjusts
the power supplied to the reaction wheels to counteract the bike’s lean and maintain balance.
SimonK firmware’s rapid response and precise motor control are crucial here, ensuring the
reaction wheels can quickly and accurately stabilize the bike by generating appropriate torque
in response to changes in the bike’s orientation. This setup allows for dynamic and real-time
adjustments, essential for effective self-balancing mechanisms in vehicles like self-balancing
bikes.

3.5.5 3S LIPO 11.1V

Figure 3.9: 3S LIPO 11.1V

A 3S LiPo (Lithium Polymer) battery shown in Figure 3.9 with an 11.1V voltage is
a rechargeable power source, favored in remote-controlled vehicles, drones, and other
high-performance electronics due to its high energy density and lightweight nature. The ”3S”
in its designation indicates that it consists of three lithium polymer cells connected in series.
This series connection adds the voltage of each individual cell. It comprises of three cells
in series, each providing 3.7V, totaling 11.1V. Capacities typically range from 1000mAh
to 5000mAh or more, with varying discharge rates (C-Ratings) such as 20C, 30C, or 40C,
which indicate the maximum current output relative to the battery capacity. It usually features

Jyothi Engineering College, Cheruthuruthy Dept. of MRE, May 2024


Chapter 3. Methodology 17

connectors like XT60, Deans, or EC3, along with a JST-XH balance connector for even cell
charging.

3.5.6 Flywheel and Assembly

Figure 3.10: FlyWheel

Flywheels (Figure 3.10) play a crucial role in the operation of self-balancing bikes, serving
as key components in maintaining stability and enhancing maneuverability. These rotating
discs store kinetic energy, which can be rapidly transferred to counteract shifts in the bike’s
balance, ensuring a smooth and controlled ride. By leveraging the principles of angular
momentum, flywheels help stabilize the bike by stabilizing its orientation and minimizing
deviations from the desired trajectory. Their compact design and efficient energy storage
make them well-suited for integration into self-balancing bike systems, contributing to their
reliability and performance in diverse urban environments.

3.5.7 Jumper Wires

Figure 3.11: Jumper Wires

Jumper wires (Figure 3.11) are essential electrical connectors used in electronics projects.
They consist of insulated wires with pins or sockets on each end, allowing for easy connection
and prototyping. They enable the transfer of signals, power, and data between components on
a breadboard or circuit board.

Jyothi Engineering College, Cheruthuruthy Dept. of MRE, May 2024


Chapter 3. Methodology 18

3.5.8 Bread Board


A breadboard (Figure 3.12), a key tool in electronic prototyping, provides a user-friendly
platform to experiment with electrical circuits.

Figure 3.12: Bread Board

3.6 Circuit Diagram

Figure 3.13: Circuit Diagram

Figure 3.13 shows the circuit diagram of electronic controlling part of self balancing
bicycle.The key concept is the gyroscopic effect. Imagine a spinning flywheel like a top; it
resists changes in its orientation. In the bicycle, the flywheel’s rotational axis is carefully

Jyothi Engineering College, Cheruthuruthy Dept. of MRE, May 2024


Chapter 3. Methodology 19

controlled to counteract the bike’s leaning motion. As the bicycle tilts, the system adjusts the
flywheel’s rotation to create a counteracting torque, essentially righting the bicycle.

Connections
• Power Connections: The 3S LiPo battery connects to the circuit, providing power to
the NodeMCU, ESC, and potentially the MPU6050.

• NodeMCU (Brain): This microcontroller acts like the bicycle’s brain. It receives data
from the MPU6050 sensor, which detects the tilt angle. The NodeMCU analyzes this
data and calculates the necessary adjustments to maintain balance.

• MPU6050 Sensor (Tilt Detection): This sensor plays a critical role by constantly
monitoring the bicycle’s tilt. By measuring the tilt angle and its direction, the NodeMCU
can determine the severity of the lean and calculate the appropriate corrective action.

• BLDC Motor and ESC (Flywheel Control): The BLDC motor acts as the flywheel in
this system. The ESC receives control signals from the NodeMCU, which dictate the
speed and direction of the flywheel’s rotation. By strategically adjusting this rotation,
the system introduces a corrective torque to counteract the tilt and restore balance.

Power Supply
• 3S LiPo Battery: This battery provides the main power source for the entire circuit.
A 3S battery indicates three cells connected in series, typically providing a nominal
voltage around 11.1V to 12.6V.

Control System and Programming


The core functionality lies in the programming on the NodeMCU. Based on the real-time
tilt readings from the MPU6050, the NodeMCU calculates the required adjustments and sends
control signals to the ESC. The ESC then regulates the BLDC motor’s rotation (acting as the
flywheel) to create a counteracting force and bring the bicycle back to upright.

Jyothi Engineering College, Cheruthuruthy Dept. of MRE, May 2024


Chapter 4. Results & Discussion 20

CHAPTER 4

RESULTS & DISCUSSION

4.1 Design 1

Figure 4.1: Previous Design

The initial design of the self-stabilizing bike shown in Figure 4.1 encountered several
significant challenges. One of the primary issues was the difficulty in accurately locating the
center of mass, which is essential for maintaining balance. This miscalculation led to frequent
instability. The design also included wheels with sharp edges, which adversely affected the
bike’s stability, causing it to tip over easily. Moreover, the bike experienced high levels of
vibration, which further compromised its stability and control. The motor used in this design
was a 5V DC motor, which did not perform adequately. It exhibited a noticeable delay in
response time, leading to sluggish adjustments and overall poor performance in maintaining
balance.

4.2 Design 2
In the second design, significant improvements were made to overcome the challenges
faced in the initial iteration as shown in Figure 4.2. The difficulty in finding the center of
mass was effectively addressed, resulting in enhanced stability and balance. The wheels were
redesigned with rounded edges, which significantly improved the bike’s stability and reduced
the likelihood of tipping over. To further enhance performance, the motor was upgraded from

Jyothi Engineering College, Cheruthuruthy Dept. of MRE, May 2024


Chapter 4. Results & Discussion 21

Figure 4.2: New Design

a 5V DC motor to a BLDC motor. This new motor provided better performance, with quicker
response times and more efficient control.
These changes led to a marked increase in the overall efficiency and stability of the
self-stabilizing bike, making it more reliable and effective in maintaining balance. The
self-balancing bike’s successful outcome stems from its integration of an MPU6050 sensor
with a BLDC Motor. This integration allowed for the precise measurement of tilt angles,
crucial for determining the necessary adjustments to maintain balance. By continuously
monitoring the tilt angle, the system calculated the corresponding torque and speed required
to counteract any deviations from the upright position. This real-time adjustment mechanism
ensures that the bike remains stable even when subjected to external forces or rider inputs.
The MPU6050 sensor plays a pivotal role in this process by accurately detecting the bike’s
orientation in space. Its data output serves as the foundation for the system’s decision-making
process, enabling it to respond swiftly and effectively to changes in tilt. Through sophisticated
algorithms, the system translates this sensor data into actionable commands for the BLDC
Motor, orchestrating precise adjustments to keep the bike upright.
As a result of this integrated approach, the self-balancing bike exhibits remarkable stability,
capable of maintaining balance within a 5-degree tilt range. This level of performance not
only enhances the safety and usability of the bike but also showcases the effectiveness of
sensor-driven control systems in dynamic environments

Jyothi Engineering College, Cheruthuruthy Dept. of MRE, May 2024


Chapter 4. Results & Discussion 22

4.2.1 Controller performance when balancing


The PID controller demonstrated potential in tests for balancing the bike, suggesting it
could achieve satisfactory performance for a stationary bike with further tuning to identify
optimal parameters.
A common issue during testing was that the bike would find a stable position, but a slight
offset caused the reaction wheel to accelerate in an attempt to counteract the torque on the
bike. This resulted in the motor gradually speeding up, which reduced the torque applied to
the bike since torque is proportional to the reaction wheel’s speed. One possible solution to
this problem could be to adjust the set point more aggressively. This approach would require
the motor to accelerate faster, thereby generating more torque from the reaction wheel.
Balancing a bike can be likened to managing an inverted pendulum. For small angles, this
can be considered a linear problem through linearization. However, as the angles increase,
the small angle approximation loses its accuracy. Since PID controllers are linear by nature,
finding parameters that work well in a highly non-linear system becomes quite challenging.
To enhance the reliability of a PID controller in a non-linear system, modifications such as
gain scheduling can be employed. Gain scheduling adjusts the controller parameters based on
the current operating conditions, allowing the PID controller to adapt better to non-linearities
and improve overall control.

Jyothi Engineering College, Cheruthuruthy Dept. of MRE, May 2024


Chapter 5. Conclusion 23

CHAPTER 5

CONCLUSION

Testing indicates the need for further evaluation to determine the stability achievable
with a PID controller. The results suggest that PID control could be a suitable method for a
self-balancing bike. One issue impacting performance is the bike’s construction, specifically
the high center of mass, which complicates PID tuning. This results in a limited range
of angles from which the bike can recover to its already unstable equilibrium point. Both
previous research and this project’s findings indicate that designing a self-balancing bike is
feasible, but the choice of control method and balance mechanism implementation is crucial
for optimal performance. Many successful implementations have used state-space models,
suggesting that these modern control methods may offer advantages over traditional PID
control, given the less impressive results observed.
Further research is needed to evaluate the control system’s performance under vehicular
motion, as this aspect has not been tested yet due to time constraints. In conclusion, the
development and adoption of self-balancing bikes represent a transformative shift in urban
mobility, accessibility, and sustainability. With their unparalleled stability, compact design,
and diverse applications, these innovative vehicles offer a multitude of benefits, from reducing
accidents and injuries to promoting health and wellness. As we look to the future, the
continued evolution of self-balancing bike technology promises even greater advancements,
including integration with autonomous systems and the implementation of cutting-edge
features. By embracing this vision of urban transportation, we can create more inclusive,
efficient, and environmentally friendly cities, where everyone can enjoy the freedom of safe
and convenient mobility.

Jyothi Engineering College, Cheruthuruthy Dept. of MRE, May 2024


Chapter 6. Future Scope 24

CHAPTER 6

FUTURE SCOPE

A comparison between a modern state-space control method like LQR and the traditional
PID controller is necessary to determine the best control method for a reaction wheel balanced
bike. Additionally, further research is needed to understand the behavior of the reaction wheel
bike under motion and to identify the most effective control method for this application. The
MPU6050 IMU lacked a built-in magnetometer, resulting in disturbed gyroscopic data due
to susceptibility to gyroscopic drift. Future work should consider using a higher precision
9-DoF IMU for more accurate data collection. Combined with a well-implemented Kalman
filter, this could improve the precision and consistency of angle readouts for the bike’s lean
angle, positively impacting system performance. Using a stable power source is advisable for
similar projects to maintain constant voltage. Rechargeable Li-Po batteries would be ideal due
to their low weight and ability to provide consistent voltage, enhancing system consistency
and aiding in tuning. A more rigid chassis with a lower center of mass would help the system
balance more easily, as the current high center of mass makes the bike prone to tipping and
losing ground contact due to resonance frequencies causing vibrations.
More research is needed on full-scale bikes to explore the potential of control mechanisms
for real-life applications. The future of self-balancing bikes holds immense potential for
technological advancements and expanded utility. Integration with self-driving technology
opens doors to autonomous urban transportation systems, reducing traffic congestion and
emissions. Moreover, continued innovation may lead to features such as obstacle detection
and route optimization, further enhancing safety and efficiency. Additionally, advancements
in customization and accessibility will ensure that self-balancing bikes remain inclusive,
catering to diverse user needs and preferences.

Jyothi Engineering College, Cheruthuruthy Dept. of MRE, May 2024


25

REFERENCES

[1] R. Soryani, “Reaction wheel control system for a self-balancing bike,” in Journal, IEEE,
2023.

[2] S. A. Nitheesh Kumar G, Navaneeth S and P. Sreedharan, “Design and analysis of a


self-balancing bicycle model,” in Conference Proceedings, IEEE, 2021.

[3] N. K. P. B. R. P. A. M. Kowshal S, Lakshmi Prasad H M, “Design and development of self


balancing vehicle,” in International Journal for Research in Applied Science Engineering
Technology (IJRASET), IEEE, 2023.

[4] P. D. Tak, “Self stabilizing bike using gyroscope,” in Journal, IEEE, 2017.

[5] T. S. Hansol Moon, “Balancing control and model validation of self-stabilizing


motorcycle,” in International Conference on Innovation in Modern Science and
Technology, pp. 475–483, Springer, 2019.

[1] [2] [3] [4] [5]

Jyothi Engineering College, Cheruthuruthy Dept. of MRE, May 2024


26

APPENDIX A
ARDUINO CODE
1 #include <Wire.h>
2 #include <MPU6050.h>
3 #include <PID_v1.h>
4 // Define motor control pins
5 const int motorPin1 = D3;
6 const int motorPin2 = D4;
7 const int motorEnablePin = D5;
8

9 // Initialize the MPU6050 sensor


10 MPU6050 mpu;
11

12 // PID parameters
13 double Setpoint, Input, Output;
14 double Kp = 18, Ki = 2, Kd = 8;
15 // Adjust PID gains for faster response
16 unsigned long lastTime = 0;
17 const unsigned long updateInterval = 100;
18 // Update interval in milliseconds
19

20 // Complementary filter constants


21 const float alpha = 0.98;
22 float angleAccelY, angleGyroY, angleFilteredY = 0;
23 float gyroRateY;
24

25 // Specify the links and initial tuning parameters


26 PID myPID(&Input, &Output, &Setpoint, Kp, Ki, Kd, DIRECT);
27

28 void setup() {
29 // Initialize serial communication
30 Serial.begin(115200);
31

32 // Initialize the MPU6050 sensor


33 Wire.begin();
34 mpu.initialize();
35 if (!mpu.testConnection()) {
36 Serial.println("MPU6050 connection failed");

Jyothi Engineering College, Cheruthuruthy Dept. of MRE, May 2024


27

37 while (1);
38 }
39

40 // Calibrate the sensor


41 mpu.setXAccelOffset(-1641); // Replace with your actual X offset
42 mpu.setYAccelOffset(-679); // Replace with your actual Y offset
43 mpu.setZAccelOffset(1457); // Replace with your actual Z offset
44 mpu.setXGyroOffset(107); // Replace with your actual X gyro offset
45 mpu.setYGyroOffset(-37); // Replace with your actual Y gyro offset
46 mpu.setZGyroOffset(-31); // Replace with your actual Z gyro offset
47

48 // Define the motor control pins as outputs


49 pinMode(motorPin1, OUTPUT);
50 pinMode(motorPin2, OUTPUT);
51 pinMode(motorEnablePin, OUTPUT);
52

53 // Initialize the PID controller


54 Setpoint = 0; // Set the setpoint to the desired angle, 0 for upright
55 myPID.SetMode(AUTOMATIC);
56 myPID.SetOutputLimits(-255, 255);
57 // Limits the output to the range of the motor
58 }
59

60 void loop() {
61 // Check if it’s time to update sensor readings and PID
62 unsigned long currentTime = millis();
63 if (currentTime - lastTime >= updateInterval) {
64 // Read the sensor values
65 int16_t ax, ay, az, gx, gy, gz;
66 mpu.getMotion6(&ax, &ay, &az, &gx, &gy, &gz);
67

68 // Calculate the angle of tilt using accelerometer along the y-axis


69 angleAccelY = atan2(-ax, sqrt(ay * ay + az * az)) * 180 / PI;
70 // Adjust sign for correct tilt direction
71

72 // Calculate the rate of turn from the gyroscope along the y-axis
73 gyroRateY = gy / 131.0;
74 // Assuming a full-scale range of 250 degrees/sec
75

76 // Calculate the angle using the gyroscope along the y-axis

Jyothi Engineering College, Cheruthuruthy Dept. of MRE, May 2024


28

77 angleGyroY = angleFilteredY + gyroRateY * (updateInterval / 1000.0);


78 // Convert milliseconds to seconds
79

80 // Apply the complementary filter along the y-axis


81 angleFilteredY = alpha * angleGyroY + (1 - alpha) * angleAccelY;
82

83 // Update the PID input with the filtered angle along the y-axis
84 Input = angleFilteredY;
85

86 // Compute the PID output


87 myPID.Compute();
88

89 // Control the motor based on the PID output


90 if (Output > 0) {
91 // If tilting to the left, rotate motor clockwise
92 digitalWrite(motorPin1, HIGH);
93 digitalWrite(motorPin2, LOW);
94 analogWrite(motorEnablePin, abs(Output));
95 } else if (Output < 0) {
96 // If tilting to the right, rotate motor counterclockwise
97 digitalWrite(motorPin1, LOW);
98 digitalWrite(motorPin2, HIGH);
99 analogWrite(motorEnablePin, abs(Output));
100 } else {
101 // If no tilt, stop the motor
102 digitalWrite(motorPin1, LOW);
103 digitalWrite(motorPin2, LOW);
104 analogWrite(motorEnablePin, 0);
105 }
106 // Debugging output
107 Serial.print("Angle along Y-axis: ");
108 Serial.print(angleFilteredY);
109 // Output the filtered angle along the y-axis
110 Serial.print(" Output: ");
111 Serial.println(Output);
112

113 // Update the lastTime for the next loop iteration


114 lastTime = currentTime;
115 }
116 }

Jyothi Engineering College, Cheruthuruthy Dept. of MRE, May 2024


COURSE OUTCOMES

COs Description
Make use of acquired knowledge within the selected area of technology for
C317.1
project development.
Identify, discuss and justify the technical aspects and design aspects of the
C317.2
project with a systematic approach.
C317.3 Interpret, improve and refine technical aspects for engineering projects.
To exercise their creative and innovative qualities in a group project
C317.4
environment.
C317.5 Report effectively the project related activities and findings.

CO MAPPING TO POs
POs
COs PO1 PO2 PO3 PO4 PO5 PO6 PO7 PO8 PO9 PO10 PO11 PO12
C317.1 3 3 3 3 3 3 3 3 - - - 3
C317.2 3 3 3 3 3 - 2 3 - 3 2 3
C317.3 3 3 3 3 3 2 3 3 - 2 3 3
C317.4 3 3 2 2 - - - 3 3 3 3 3
C317.5 3 - - - 2 - - 3 2 3 2 3
Average 3 2.4 2.2 2.2 2.2 1 1.6 3 1 2.2 2 3

CO MAPPING TO PSOs
PSOs
COs PSO1 PSO2
C317.1 1 3
C317.2 1 2
C317.3 2 1
C317.4 1 2
C317.5 1 1
Average 1.2 1.8

vii

You might also like