ME405 Portfolio
The following documentation details each step of the ME 405 term project.
Motor_Driver.MotorDriver Class Reference

Sets up methods required to control a motor. More...

Public Member Functions

def __init__ (self, timer, nSLEEP_pin, IN1_pin, IN2_pin, channel_A, channel_B)
 Sets up pins and timers for two motors (1 and 2). More...
 
def enable (self)
 Sets the motors enable pin to high, allowing operation.
 
def disable (self)
 Sets the motors enable pin to low, disabling operation.
 
def set_duty (self, duty)
 Adjusts the motors duty cycle based on input parameter. More...
 

Public Attributes

 enable_pin
 
 M1_pos
 
 M1_neg
 
 timer1
 
 M1CH1
 
 M1CH2
 

Detailed Description

Sets up methods required to control a motor.

The Motor Driver class allows the user to set up two motors using the init method. This method assigns the appropriate pins, timers, and channels required by the motors. The class also includes the enable and disable methods which set the motors enable pin either to high or low. Finally the set duty method allows the user to input a desired motor duty cycle after it has been enabled.

Constructor & Destructor Documentation

◆ __init__()

def Motor_Driver.MotorDriver.__init__ (   self,
  timer,
  nSLEEP_pin,
  IN1_pin,
  IN2_pin,
  channel_A,
  channel_B 
)

Sets up pins and timers for two motors (1 and 2).

Parameters
timerA timer object used PWM generation on inputs 1,2. @parram nSLEEP_pin A pin object used to define enable pin.
IN1_pinA pin object used to define half bridge input 1.
IN2_pinA pin object used to define half bridge input 2.
timerA timer object used PWM generation on inputs 1,2.
channel_ADefines the channel for the IN1 pin
channel_BDefines the channel for the IN2 pin

Member Function Documentation

◆ set_duty()

def Motor_Driver.MotorDriver.set_duty (   self,
  duty 
)

Adjusts the motors duty cycle based on input parameter.

Parameters
dutyA signed integer holding PWM signal duty cycle.

The documentation for this class was generated from the following file: