Meyenberg_Project
Meyenberg_Project Documentation

Introduction

This webpage contains information about labs completed by David Meyenberg for ME 405.

Lab 1

This lab simulates a vending machine, Vendotron. The source code and a FSM diagram can be found at https://bitbucket.org/DavidMeyenberg/me405_labs/src/master/Lab1.

Lab 2

This lab tests a user's reaction time with a flashing LED. The source code can be found at https://bitbucket.org/DavidMeyenberg/me405_labs/src/master/Lab2.

Lab 3

This lab records an ADC reading from a button press and sends it to a seperate program over a serial connection, where it is plotted and saved as a .csv file. The source code, an example plot, and an example .csv file can be found at https://bitbucket.org/DavidMeyenberg/me405_labs/src/master/Lab3.

Lab 4

This lab uses a mcp9808 module to take temperature readings every second from the mcp9808 temperature sensor, as well as internal temperature readings from the STM32. It save it as a .csv file on the Nucleo board, where it can extracted and plotted. The source code can be found at https://bitbucket.org/rmmcmull/cpe-mech-team/src/master/. An example .csv file and plot can be found at https://bitbucket.org/DavidMeyenberg/me405_labs/src/master/Lab4/Lab4%20Data/.

Lab 5

This lab, we developed a simplified 2-D analytical model of a pivoting platform. This was the first step in designing a controller to balance a ball on top of the platform. The hand calculations made to find the analytical model can be found at Lab 5 Calculations.

Lab 6

This lab, we developed a simulation and tested a controller for the simplified model of the pivoting platform that was completed in Lab 5. The plots showing the results of the simulations, as well as the State Space Block Diagram can be found at Lab 6 Plots.

Lab 7

This lab creates a TouchPanelDriver class to read touch input on a ER-TP080-1 touch panel. The tests showing the class's speed and accuracy can be found at Lab 7 Tests. The source code can be found at https://bitbucket.org/DavidMeyenberg/me405_labs/src/master/Lab7.

Lab 8

This lab creates a EncoderDriver class for a US Digital E4T optical encoder and a MotorDriver class for a DC motor connected to a DRV8847 motor driver. The EncoderDriver can be used to measure position and changes in angle of rotation by counting the pulses of light generated by the encoder and keeping track of its last count. This class also implements overflow and underflow protection. The MotorDriver class can be used to set the speed and direction of the motor by providing a positive or negative duty cycle for clockwise and counter-clockwise directions. The class also implements hardware fault protection, by disabling the motor whenever this is a hardware fault detected form the DRV8847 motor driver. It then waits for a user to fix the hardware problem and press enter before enabling the motors again.

The source code can be found at https://bitbucket.org/DavidMeyenberg/me405_labs/src/master/Lab8.

Lab 9

I worked on this project with Ryan McMullen, a proud member of the CPE/MECH Team. Lab 9 is the final term project and encompasses labs 5 through 8; the goal is to program a self-balancing platform designed by our instructors, such that it can balance a ball. In lab 5 we derived simplified equations of motion for our platform by hand. In lab 6 we used MATLAB to simulate our system in an open loop configuration and a closed loop configuration with provided proportional gains. In lab 7 we programmed a class for a resistive touch panel that could track the position of the ball in 2D. In lab 8 we programmed a class which could drive both motors at a specified duty cycle in both clockwise and counterclockwise directions. Note that these motors are connected, with a small belt, to a lever arm which is used to control the angular position of the platform on which the resistive touch panel sits. The angular position of the lever arm is measured with an encoder; in lab 8 we also programmed a class which can be used to read data from encoders connected to both lever arms. In lab 9, we tied control models and motor/encoder/touchscreen drivers together with main.py. In addition, we took our controller design one step further by analytically determining controller gains based on a desired natural frequency of 5 and damping coefficient 0.8. We added a new section into our MATLAB code (which can be found at the source code link) called "Gain Calculation by Char. Polynomial Matching" which calculates the proportional gains through a polynomial coefficient matching method. Thereafter, we applied those gains to our system and did further tuning by hand to account for any dissimilarities between our model and system. See below for pictures of our setup and a video demonstration. Drivers re-used from previous labs were MotorDriver.py, TouchPanelDriver.py, and EncoderDriver.py.

Images of the system, video explanation, and video demonstration can be found at Final Project

The source code can be found at https://bitbucket.org/rmmcmull/cpe-mech-team/src/master/LAB_0X09/.