Matthew Tagupa's ME 405 Labs and Term Project
Matthew Tagupa's ME 405 Labs and Term Project Documentation

Introduction

The purpose of this project was to become familiar with the motor driver and the microcontroller for our ME405 Mechatronics course. Along with being tasked to code the enabling and disabling of the motor, we were tasked with changing the pulse width module (PWM) that whould control the speed of the motor.

Motor Driver

The motor driver was built connecting a X-NUCLEO-IHM04A1 motor driver platform and a NUCLEO-L476RG. The motor was connected to the A ports in the IHM04A1 along with connecting a 12V power source to port B. The program was coded in python and uses Thonny to interact between the code and the microcontroller. Please see MotorDriver.MotorDriver which is part of the MotorDriver package.

Repository Link to MotorDriver.py: https://bitbucket.org/Matstertagger/me405-mechatronics/src/master/Lab3/MotorDriver.py

Encoder

The encoder was included in the motors provided with our kit. We were tasked to allow the encoder to use the internal timers in the microcontroller to count the distance rotated by the motor. Encoders A and B for the first motor will be connected to ports PB6 and PB7, respectively. Encoders A and B of the second motor will be connected to ports PC7 and PC6, respectively. Please see Encoder.Encoder which is part of the Encoder package.

Repository Link to Encoder.py: https://bitbucket.org/Matstertagger/me405-mechatronics/src/master/Lab3/Encoder.py

Closed-Loop Proportional Controller

The Closed-Loop Proportional Controller is a code that I included with this set of instructions. The proportional controller will be given a proportional gain, a setpoint, and the measured angle of the motor by the encoder. This was added to have a more accurate response of the motor from 0 to the designated setpoint. Please see PropControl.CLPropControl which is part of the CLPropControl package.

Repository Link to PropControl.py: https://bitbucket.org/Matstertagger/me405-mechatronics/src/master/Lab3/PropControl.py

Author
Matthew Tagupa
Date
May 21, 2020