ME 305
ME 305

Introduction

This website documents the code required to balance a ball on a platform autonomously. Use the top pull down tabs to navigate to all classes and files used to accomplish this. Each file is organized under the lab assignment where it was performed. All labs teach valuable elements of mechatronics that culminate into a the final project. See the image below for a general setup of the ball balancing platform.

For access to the entire code repository, click on the link below. Navigating to the main.py file of each lab section will also provide a direct link. https://bitbucket.org/rdeanr/me305/src/master/

Balancing Platform Analysis and Modeling

The behavior of a ball on a platform was modeled in MATLAB and can be found in the Platform_Analysis and Platform_Modeling pages.

Ball Balancing Platform

See Term Project for in-depth details regarding the term project and its implementation.

Drivers Used

The information below details the driver files used to run the program and build a foundational knowledge of mechatronics.

Motor Driver

Please see motor.Motor for details. This has the capability to change the speed of each motor.

Encoder Driver

Please see encoder.Encoder for details. It has the capability to return encoder position, speed, and zero the encoder.

ADC Driver

Please see ADC_driver.ADC_Driver for details. This has the capability to read touch sensor data and calculate calibration coefficients as well as read/write the coefficients from/to a text file.

IMU Driver

Please see BNO_driver.BNO055 for details. This has the capability to find the orientation and angular velocity of the ball balancing platform. It also finds the calibration status of the IMU and read/write calibration coefficients from/to a text file.

Labs

This section details all labs critical to developing the ball balancing platform.

Lab 3

This lab looks at how to control DC motors through pulse width modulation by creating task files that can directly interface with the motor and encoder. A variety of commands are implemented such as finding the encoder position, velocity, setting the motor duty cycle, collecting data, and setting up a testing interface. You can find more information here: Lab 3

Lab 4

This lab looks at the implementation of closed loop speed control of a permanent magnet DC motor. You can find more information here: Lab 4

Lab 5

This lab looks at the implementation of closed loop control to automatically level a platform, even after tapping. You can find more information here: Lab 5

Author
Ryan Dean
Zachary Hendrix
Date
February 3, 2022