|
HRI board firmware
v2.1
Microcontroller firmware of the board used during the HRI labs.
|
Driver for the H-bridge of the motor. More...
Functions | |
| void | hb_Init (void) |
| Initialize the pins and the PWM timer to control the H-bridge. More... | |
| void | hb_Enable (void) |
| Enable the motor driver. More... | |
| void | hb_Disable (void) |
| Disable the motor driver. More... | |
| void | hb_SetPWM (float32_t ratio) |
| Set the PWM duty. More... | |
| bool | hb_HasFault (void) |
| Gets the fault state. Gets the fault state of the H-Bridge from its nFAULT line. A fault may be because of an undervoltage, overcurrent or overtemperature. More... | |
Driver for the H-bridge of the motor.
The DC motor is supplied by a H-bridge on the HRI board. These power electronics are controlled by the microcontroller using a PWM timer.
Call hb_Init() first in the initialization code. Then, call hb_Enable() to enable the H-bridge chip (power on), and hb_SetPWM() to set the motor voltage.
| void hb_Disable | ( | void | ) |
Disable the motor driver.
| void hb_Enable | ( | void | ) |
Enable the motor driver.
| bool hb_HasFault | ( | void | ) |
Gets the fault state. Gets the fault state of the H-Bridge from its nFAULT line. A fault may be because of an undervoltage, overcurrent or overtemperature.
| void hb_Init | ( | void | ) |
Initialize the pins and the PWM timer to control the H-bridge.
| void hb_SetPWM | ( | float32_t | ratio | ) |
Set the PWM duty.
| ratio | PWM duty ("on" time ratio) [-1.0 to 1.0]. 0 means zero voltage at the motor leads, -1 and 1 are max voltages. |
1.8.13