Kyle Chuang | ME405 Mechatronics Portfolio
m_driver.py File Reference

Motor Driver. More...

Classes

class  m_driver.MotorDriver
 This class implements a motor driver for the ME405 board. More...
 

Variables

 m_driver.pinA15 = pyb.Pin.cpu.A15
 
 m_driver.pinB2 = pyb.Pin.board.PB2
 
 m_driver.pinB4 = pyb.Pin.cpu.B4
 
int m_driver.ch1 = 1
 
 m_driver.pinB5 = pyb.Pin.cpu.B5
 
int m_driver.ch2 = 2
 
bool m_driver.motor1 = True
 
 m_driver.pinB0 = pyb.Pin.cpu.B0
 
int m_driver.ch3 = 3
 
 m_driver.pinB1 = pyb.Pin.cpu.B1
 
int m_driver.ch4 = 4
 
bool m_driver.motor2 = False
 
int m_driver.tim = 3
 
 m_driver.m1 = MotorDriver(motor1, pinA15, pinB2, pinB4, ch1, pinB5, ch2, tim)
 
 m_driver.m2 = MotorDriver(motor2, pinA15, pinB2, pinB0, ch3, pinB1, ch4, tim)
 

Detailed Description

Motor Driver.

This code sets up the motor driver for the ME405 board. This can be used to create two objects of this class that can independently control two separate motor drivers.

UPDATE FOR BALL BALANCING PROJECT: Included a saturation zone to account for each motor's deadzone when attached to the platform. Positive and negative bounds are different because the weight of the inertia rods affects the amount of work the motor has to do to move the platform.

Author
Kyle Chuang
Enoch Nicholson