Drive#

Drive.c includes motor drive related functions,

Variables#

int enc_angle_int#
int16_t electrical_angle_offset#

Functions#

Calibration and Diagnostic#

void estimate_phase_resistance(float voltage)#

Estimate phase resistance by applying a known voltage and measuring resulting phase current.

Throws a fault if any resistance is out of line with expected. (0.1 to 10 ohms)

Note

This will disable FOC during the duration of the test as it requires direct access to phases voltages.

Parameters:

voltage – voltage to apply during estimation

enum DriveError check_supply_voltage()#

Gate drive#

void set_duty_phase_A(uint8_t value)#
void set_duty_phase_B(uint8_t value)#
void set_duty_phase_C(uint8_t value)#
void set_duty_phases(uint8_t A_value, uint8_t B_value, uint8_t C_value)#