Mechatronics Lab - MENG 390L - Final Project
Project Overview
This project was a lab class-based project aimed at teaching students about electrical implementation of mechanical systems,
which includes topics such as mathematical modeling, analysis and design of systems with mechanical and/or electrical components,
sensors, actuators, microcontrollers, and feedback control. The culmination of the labs and homework is to build, program, implement,
and race self-balancing and self-driving motorcycles. The motorcycles used were part of the Arduino Engineering Kit Rev2.
Your Role and Contributions
- I designed and implemented an IR sensor + RC filter which would allow us to detect certain colors of lines based on an a certain threshold.
- I characteried a DC motor and its Hall Sensor which would allow us to have a better idea of how to tune parameters when it comes to driving and balancing.
- I characterized a IMU along with designed and implemented a PID controller which would use IMU data to spin the inertia wheel and balance the motorcycle in a static position.
- With significant testing of the cycle while driving forward, I was able to tune the PID parameters to balance while driving forward.
- Using the IR sensor I tested, I integrated that onto the motorcycle to allow for the motorcycle to stay between lanes (steer) while driving forward and balancing.
Skills and Tools
- MATLAB/Simulink
- Arduino Programming
- Circuit Analysis
- Circuit Design
- Controller Design
Goals and Objectives
- Race a self-balancing self-steering motorcycle against other teams and get the fastest time.
Outcomes and Achievements
My teammate and I won second place in the competition and we were successfully able to make my motorcycle stay in the lane while balancing.
We recieved an A- for our project.
Visual Aids
Motorcycle view from front, you can see the IR sensors on the sides of the front wheeel
Motorcycle view from the side
Motorcycle view from the back top, you can see the IR sensor and RC filter circuitry
Due to the best attempt being lost, here is a video representing the race.
Lessons Learned and Technical Takeaways
- I realize that mathematical model simulations and predictions won't model a system perfectly, the testing part is arguably the most important part
of a control system.
- Due to lack of time in the semester, I could not take the PID controller model further by implementing IR sensor input, it was only expected of us to
model the wheel and IMU data, so IR sensor input was not considered. The motorcycle did not steer as best it could, and made me learn that if you miss even
one variable in a dynamic system, it can throw off the whole plant.
- I had to vary the initial conditions of the motorcycle as I did the race, I hoped I would have the time to make the motorcycle robust to any initial condition
such as varied starting angle.
Future Work
- I plan to buy my own motorcycle from Arduino with the same IR sensors and make a more robust PID controller which implements the IR sensor input. Since this
iteration only told the wheel to turn at a certain fixed angle, and did not vary based on other inputs.
- I plan to run more tests to figure out how to make the plant robust to other starting conditions.