1 of 1

Automatic Control for Self Balancing Segway Robot

Lucas Tam, Somya Valecha, Raymond Yuan, Abbey Taylor

Presented 21.6.2024

Presenters: Lucas Tam, Somya Valecha, Abbey Taylor, Raymond Yuan

Emails: lucastam@umich.edu, svalecha@umich.edu, abbeytay@umich.edu, yraymond@umich.edu

Mentors: Magnus Axelson-Fisk, Roxanne Rose Jackson, Tom

J. Jüstel.

Emails: magnus.axelson-fisk@tu-berlin.de, jackson@tu-berlin.de, t.juestel@tu-berlin.de

Contact

[1] MinSeg.com. The Miniature Balancing Robot: A low cost lab experiment kit for education. 2024. URL: https://minseg.com /collections/minseg-kits/products/minsegshield-m2v5-dual-axis-balance-minseg-kit-new (visited on 06/19/2024).

[2] R. Jackson, M. Axelson-Fisk, T. Jüstel, ‘IESS – Laboratory 1 Modeling a self-balancing robot’, Technische Universität Berlin, Institute for Process and Chemical Engineering, Chair of Control Engineering, 2024.

Project completed as a part of IESS 2024 Study Abroad Program at Technische Universität Berlin

Our goal is to implement a control system onto our MinSeg robot that will allow it to balance without any external support. We attempt to accomplish this by creating an algorithm that can take input data from the robot and return a movement command.

Motivation

Our robot uses an MPU6050 chip, which houses a 3-axis gyroscope and 3-axis accelerometer. We read this information in real-time using the MPU6050.h library. We could then find our θ by taking the tangent of the horizontal and vertical accelerometer values, and we could find our dθ value from the gyroscope data. To find our φ and dφ values, we used an encoder to read the position and angular velocity of the wheels.

The components of the Kalman filter were implemented in Arduino IDE using the BasicLinearAlgebra.h library to perform matrix operations. We then implemented the controller and control allocation in Arduino to provide voltage to the motors using pulse width modulation (PWM), with a saturation feature to cap out provided voltage to the max voltage (7.2V) if the requested voltage exceeded 7.2V.

Phase I

Even though we did not manage to achieve our goal with the robot, we gained experience and knowledge that would allow us to tackle this problem much more effectively in the future. We noticed that we were getting very large values for the supplied voltage, which is a likely culprit of the jittery motion of the robot. Other solutions could be adjusting certain constants or altering the timer length of the main loop.

�Given more time, we likely would have experimented with alternate methods of implementing our algorithm (if not restarted entirely). For example, rather than deciding which direction to move based on torque, we could base the system strictly off of deviation from the equilibrium point, and supply more voltage for larger deviations.

Discussion

When designing an autonomous robot system, it is important to have accurate data on the robots state and to use simulations to fine-tune the robot’s controller. This data is necessary in order for any implemented systems to run effectively.

Conclusions

Phase II

Figure 1. MinSeg Robot [1]

Chart 1. Graph of Theta vs. Time for a self-balancing robot

Our system consists of a MinSeg robot, pictured above, with a self-balancing algorithm implemented via Arduino IDE.

�The first phase of creating this system consisted of deriving equations for the system states, along with developing an algorithm that could take input data from the robot to predict future states. This data could then be used to find the voltage necessary to propel the robot back to an equilibrium.

�The second phase consisted of implementing our system on Arduino IDE and modifying our code in order to take into account the physical properties of our system. We tested our code at each point of this step in order to identify flaws with our algorithm or gaps in our system.

Introduction

Figure 2. Diagram of a self-balancing robot [2]

By the end of our course, none of our robots could successfully self-balance for a significant period of time. Most have very “jittery” movements – the robot will rapidly self-correct with excessive power, meaning it will fall over very quickly after being released.

Results

Chart 2. Graph of Voltage vs. Time for a self-balancing robot

References

We started with deriving a system of equations to represent our robot and the forces acting upon it. Our system state vector is [φ θ dφ dθ], where φ is the angle position of the wheels, θ is the angle of the robot chassis with respect to the ground, and dφ and dθ are their respective velocities (See Figure 2). With this system, in addition to a mathematical model for the robot’s motor, we could determine an equilibrium state and derive an equation for other necessary variables such as torque.

After deriving the equations of motion for the robot, we modeled the dynamics of our robot using SIMULINK, an extension of MATLAB that allows us to visualize the states of our system. We then implemented a Linear Quadratic Regulator and state control strategy which gave us the optimal feedback gain vector K to use in the state controller u(t) = -Kx(t) to control the states of our robot. We also designed a Kalman filter that reduces noise and removes bias in the robot’s data. The Kalman filter works by calculating estimates of the states that are less noisy than the sensor data.

Figure 3. Block diagram of Closed-Loop Control System

Poster Print Size:

This poster template is set up for A0 international paper size of 1189 mm x 841 mm (46.8” high by 33.1” wide). It can be printed at 70.6% for an A1 poster of 841 mm x 594 mm.

Placeholders:

The various elements included in this poster are ones we often see in medical, research, and scientific posters. Feel free to edit, move, add, and delete items, or change the layout to suit your needs. Always check with your conference organizer for specific requirements.

Image Quality:

You can place digital photos or logo art in your poster file by selecting the Insert, Picture command, or by using standard copy & paste. For best results, all graphic elements should be at least 150-200 pixels per inch in their final printed size. For instance, a 1600 x 1200 pixel photo will usually look fine up to 8“-10” wide on your printed poster.

To preview the print quality of images, select a magnification of 100% when previewing your poster. This will give you a good idea of what it will look like in print. If you are laying out a large poster and using half-scale dimensions, be sure to preview your graphics at 200% to see them at their final printed size.

Please note that graphics from websites (such as the logo on your hospital's or university's home page) will only be 72dpi and not suitable for printing.

�[This sidebar area does not print.]

Change Color Theme:

This template is designed to use the built-in color themes in the newer versions of PowerPoint.

To change the color theme, select the Design tab, then select the Colors drop-down list.

The default color theme for this template is “Office”, so you can always return to that after trying some of the alternatives.

Printing Your Poster:

Once your poster file is ready, visit www.genigraphics.com to order a high-quality, affordable poster print. Every order receives a free design review and we can delivery as fast as next business day within the US and Canada.

Genigraphics® has been producing output from PowerPoint® longer than anyone in the industry; dating back to when we helped Microsoft® design the PowerPoint software.

US and Canada: 1-800-790-4001

International: +(1) 913-441-1410�Email: info@genigraphics.com

�[This sidebar area does not print.]