Mechatronics Portfolio
Logan Williamson's Mechatronics Portfolio and Documentation Repository
|
*Please see the files tab for file documentation
The source code files for Lab 4 can be found at https://bitbucket.org/wokka29/me305_labs/src/master/Lab%200x04/
This program consists of nine files which together generate and present a user interface for control of and data collection from two small permanent magnet DC motors connected
to an STM32 Nucleo development board. Data collection in this program is performed using an encoder object from the encoder.py class file, which records position and speed data
associated with the encoder iteratively in the taskEncoder.py file, and prints the results to the console via shares.Share variables passed to the taskUser.py file. Additionally,
this program generates two motor.Motor objects from the motor.py class file, which are used to control the operation of two physical motors connected to the STM32 Nucleo board used for
this project. Higher level control of these motor objects is performed by a motor driver object instantiated from the DRV8847.py class which can be used to enable and disable
operation of the subservient motor objects in this class heirarchy. The DRV8847.DRV8847 and motor.Motor objects are instantiated and managed by the taskMotor.py task file.
Finally, this program instantiates a closed-loop controller object from the closedLoop.py class within the taskMotor task as well. This object serves as a closed-loop controller
which allows the user to set controller parameters for managing the motor operation rather than directly controlling the motor duty cycle with user input (i.e. open-loop control).
Management of multitasking between the taskUser.py, taskEncoder.py, and taskMotor.py task files is handled within the main.py file.
ME305_Lab0x04 from Brianna Roberts on Vimeo.