Mechatronics Exercises

Workspace Navigation

Self-balancing reaction wheel toy

Versions Compared


  • This line was added.
  • This line was removed.
  • Formatting was changed.


An additional goal is to incorporate a motor driving one of the wheels and a servo motor that can steer the bicycle. The steering and drive of the bicycle are intended to be remotely controlled.

Update 14/3/2023

Projektin ideana on hyödyntää newtonin toista lakia tasapainottaaksemme kappaleen. Kun kappaleemme alkaa kallistua poispäin sen tasapainopisteestä, alketaan kyseistä akselia kohtisuorassa oleva vauhtipyörä kiihdyttämään ns. kaatumissuuntaan. Moottorin kiihdyttäessä vauhtipyörää, se tuottaa itseensä vastamomentin kallistumissuuntaa vastapäin. Sillä moottori on kiinnitetty kappaleeseen, saadaan oikein säädetyllä vastamomenttilla kappale suoritstumaan.

Image Removed

Edistääksemme projektia olemme saaneet kiihtyvyys sensorin kautta luettua dataa, jonka perusteella tulemme ohjaamaan moottoriamme.

Image Removed

Kappaleen tasapainotuksen periaatteen demoamista, ja harjoittelemista varten olemme suunitelleet, sekä 3D tulostanut prototyypin.

Image RemovedImage Removed

The idea of the project is to utilize Newton's second law to balance the object. When our object starts to tilt away from its equilibrium point, a flywheel perpendicular to that axis is accelerated in the so-called tipping direction. As the engine accelerates the flywheel, it generates a counter-torque in the opposite direction of the tilt. Since the engine is attached to the object, with properly adjusted counter-torque, the object can maintain stability.

Image Added

First step was to get data from sensor, which will be used to control the motor

Image Added

To demonstrate and practice the principle of balancing the object, we have designed and 3D-printed a prototype.

Image AddedImage Added

The counter-torque created by the motor is demonstrated in the video. We are using a DC motor and an H-bridge for this purposeDemottu moottorin luomaa vastamomenttia.  Käytössä DC-moottori ja H-silta.

View file

Final project

List of components:

  • esp32 development board
  • 12V DC-motor
  • Adafruit LSM6DSOX + LIS3MDL - Precision 9 DoF IMU.

  • SparkFun Motor Driver - Dual TB6612FNG (1A)
  • 12V powersupply
  • Breadboard and cables


Image Added

In short, microcontroller reads data from the IMU and then gives pwm signal to h-bridge and that controls the motors (white and yellow cable from red board).


View file

In the code there is PID-controller whose values can be changed to suit your setup.

Footage of the project

View file
View file
View file

Mechanical design

Reaction wheel is 3D printed and M3 bolts are threaded in to the wheel to give it more torque. Reaction wheel is attached to the DC-motor with glue and heat. Body is made from thin plywood and bolt and nuts acts as bearing.

Challenges and outcome

As you can see the project didn't work as it should have. Reaction wheel didn't have enough torque to pull the body to the center. With correct mechanical design project could have been a major success. Code of the project worked well and motor reacted to angular changes, but not with enough forceEdessä oleviin haasteisiin kuuluu mm. enkooderin rankentaminen moottorin pyörimisnopeuden määrittämiseksi, sekä edellä mainitun enkooderin intergraatio systeemiin.