ME 305
|
Controls motors. More...
Public Member Functions | |
def | __init__ (self, TimerVal) |
Initializes and returns a DRV8847 object. More... | |
def | enable (self) |
Brings the DRV8847 out of sleep mode. More... | |
def | disable (self) |
Puts the DRV8847 in sleep mode. More... | |
def | fault_cb (self, IRQ_src) |
Callback function to run on fault condition. More... | |
def | motor (self, channel, PWM_tim, IN1_pin, IN2_pin) |
Creates a DC motor object connected to the DRV8847. More... | |
def | __init__ (self, TimerVal) |
Initializes and returns a DRV8847 object. More... | |
def | enable (self) |
Brings the DRV8847 out of sleep mode. More... | |
def | disable (self) |
Puts the DRV8847 in sleep mode. More... | |
def | fault_cb (self, IRQ_src) |
Callback function to run on fault condition. More... | |
def | motor (self, channel, PWM_tim, IN1_pin, IN2_pin) |
Creates a DC motor object connected to the DRV8847. More... | |
Public Attributes | |
FaultInt | |
Holds the pin information for the fault condition. More... | |
PWM_tim | |
Initializes the timer that the driver uses @detail Sets the driver variable to pins of the ESP32 board. | |
nSLEEP | |
Initializes the Sleep pin. More... | |
Controls motors.
def driver.DRV8847.__init__ | ( | self, | |
TimerVal | |||
) |
Initializes and returns a DRV8847 object.
Initializes driver class with Fault pin values, Sleep pin values and the actuive timer being used for this driver. This method assigns and activates the Fault and Sleep pins.
TimerVal | The index that the timer is set to. The values range from 1 to 14 |
def driver.DRV8847.__init__ | ( | self, | |
TimerVal | |||
) |
Initializes and returns a DRV8847 object.
Initializes driver class with Fault pin values, Sleep pin values and the actuive timer being used for this driver. This method assigns and activates the Fault and Sleep pins.
TimerVal | The index that the timer is set to. The values range from 1 to 14 |
def driver.DRV8847.disable | ( | self | ) |
Puts the DRV8847 in sleep mode.
Deactivates the SLEEP pin and does not allow the motors to spin
def driver.DRV8847.disable | ( | self | ) |
Puts the DRV8847 in sleep mode.
Deactivates the SLEEP pin and does not allow the motors to spin
def driver.DRV8847.enable | ( | self | ) |
Brings the DRV8847 out of sleep mode.
Activates the SLEEP pin and allows the motors to power up.
def driver.DRV8847.enable | ( | self | ) |
Brings the DRV8847 out of sleep mode.
Activates the SLEEP pin and allows the motors to power up.
def driver.DRV8847.fault_cb | ( | self, | |
IRQ_src | |||
) |
Callback function to run on fault condition.
Deactivates the driver once a fault is detected. It then prints to the user that the driver has shut down due to a fault
IRQ_src | The source of the interrupt request. |
def driver.DRV8847.fault_cb | ( | self, | |
IRQ_src | |||
) |
Callback function to run on fault condition.
Deactivates the driver once a fault is detected. It then prints to the user that the driver has shut down due to a fault
IRQ_src | The source of the interrupt request. |
def driver.DRV8847.motor | ( | self, | |
channel, | |||
PWM_tim, | |||
IN1_pin, | |||
IN2_pin | |||
) |
Creates a DC motor object connected to the DRV8847.
channel | Contains channel number for specific motor used |
PWM_tim | Contains the the timer value for proper PWM |
IN1_pin | Object to interface with pin that determines rotation direction |
IN2_pin | Object to interface with pin that determines rotation direction |
def driver.DRV8847.motor | ( | self, | |
channel, | |||
PWM_tim, | |||
IN1_pin, | |||
IN2_pin | |||
) |
Creates a DC motor object connected to the DRV8847.
channel | Contains channel number for specific motor used |
PWM_tim | Contains the the timer value for proper PWM |
IN1_pin | Object to interface with pin that determines rotation direction |
IN2_pin | Object to interface with pin that determines rotation direction |
driver.DRV8847.FaultInt |
Holds the pin information for the fault condition.
Assigns the fault condition pin to a variable that can be used to shut-down a driver in case of an emergency to stop any damage to the motors
Initializes the fault condition for the driver
Initializes the fault condition by using the nFAULT pin and the properties of that pin to signal the code that there is something wrong with the motor (usually high heat or a short through the wire). Once the fault pin is triggered, the driver will shut down the motors
driver.DRV8847.nSLEEP |
Initializes the Sleep pin.
Initializes the sleep pin that controls a pin of the board thatenables the driver to allow the motors to spin, or
disable the driver to keep the motors from spinning if there is a fault.