DIY Aduino One Axis Self Balancing Device

by mircemk in Circuits > Arduino

1996 Views, 25 Favorites, 0 Comments

DIY Aduino One Axis Self Balancing Device

APH3.jpg

  Simple to build one axis self stabilizing device witch consist only three components Arduino nano, Nem24 brushless motor, and MPU6050 Accelerometer + Gyroscope sensor module.

Supplies

IMG_20220528_190841.jpg
  • Arduino nano microcontroller
  • 6DOF Sensor-MPU6050
  • Nidec 24H brushless motor

Description

DIY Aduino One Axis Self Balancing Device
PCBway big.png

 This time I will show you how to make a simple One axis self balancing device, which is based on the PID control system. A proportional–integral–derivative controller is a control loop mechanism employing feedback that is widely used in industrial control systems and a variety of other applications requiring continuously modulated control. A PID controller continuously calculates an error value as the difference between a desired setpoint and a measured process variable and applies a correction based on proportional, integral, and derivative terms.

 In our case, the MPU6050 sensor collects data of the position (more precisely the angle) of the device, and sends that data to the microcontroller which performs calculations based on previously given algorithms and constants, and sends the result to the electric motor, which with its movement tends to hold the device in the desired position. This loop is performed very quickly so that the device is stable in a vertical position. Nuts and bolts are added to the wheel in order to increase its weight, thus increasing the impact of the rotation on the whole device. This project is open source and the original code can be downloaded from GitHub https://github.com/remrc/One-Axis-Reaction-Wheel-Stick

Building

IMG_20220528_153908.jpg
IMG_20220528_134854.jpg
IMG_20220528_161724.jpg
IMG_20220528_195323.jpg
IMG_20220529_113044.jpg
IMG_20220529_113123.jpg
IMG_20220529_141001.jpg
IMG_20220529_201626.jpg
IMG_20220529_230738.jpg

  The device is simple to build and contains only a few components:

    - Arduino Nano microcontroller

    - MPU6050 Gyroscope + Accelerometer sensor module

    - Nidec 24H brushless motor

    - Buzzer

    - 3pcs Lithium Ion Batteries connected in series

    - and 3Dprinted parts

--------------------------------------------------------------------------------

  To make this, and other electronics projects you can order a PCB prototype from PCBWAY. How to order is very easy and you will get 10 Pcs PCB for $5 with very great PCB quality TG150-160.You can design Gerber files for this circuit and upload it on their site ( www.pcbway.com)Generally, shipping of the orders take only 3 to 5 days.

-------------------------------------------------------------------------------

 One note about the motor, ignore the colors of the wires and follow the pinout shown in the given picture.  The device starts in this (lying) position and we wait until we hear two short beeps, which indicate that it is ready. Depending on the placement and weight of the batteries and the characteristics of the sensor itself, during the first activation the device will probably not be completely stable and will swing left and right. To stabilize, it is necessary to experiment with the values of floatX1, floatX2, and floatX3 in the code. If it is well tuned even if we try to mechanically shift it to an unbalanced state, it returns automaticly to a state of equilibrium.

Schematic, Code, and 3D Parts

Schematic.png

Schematic diagram , and code are given below. You can download 3D print .STL files at: https://www.thingiverse.com/thing:5361714