13 #ifndef CURRENT_CONTROL_H_ 14 #define CURRENT_CONTROL_H_ 151 extern void setADCMux(
int motor,
int number);
void get_mA(void)
Print the current in mA to UART.
Definition: CurrentControl.c:448
void get_counts(void)
Print the current counts to UART.
Definition: CurrentControl.c:464
void setADCMux(int motor, int number)
Sets the ADC MUX to read from either the current sense resistor 1, 2 or 3 from motor 1 or 2...
Definition: CurrentControl.c:481
void counts_read(void)
Reads the counts of the current to UART from an array.
Definition: CurrentControl.c:330
void currentControlInit(void)
Init ADC.
Definition: CurrentControl.c:41
void CurrentControlIntHandler(void)
The interrupt handler for the current control loop.
Definition: CurrentControl.c:88
void set_current_gains(void)
Sets the current gains by reading the UART buffer.
Definition: CurrentControl.c:281
void AD0_read(int mux)
Triggers the ADC reading and saves it to the TEMP array.
Definition: CurrentControl.c:431
void get_current_gains(void)
Print the current gains to UART.
Definition: CurrentControl.c:271
void reset_current_error(void)
Sets the current gains by reading the UART buffer.
Definition: CurrentControl.c:323
void PI_controller(int motor, int reference, int actual)
Simple PI controller that uses motorxControlPWM to control the motor output.
Definition: CurrentControl.c:250
int getCurrent(int motor)
Gets the motor current in counts (12 bit signed)
Definition: CurrentControl.c:308
void setCurrent(int motor, int u)
Sets the reference current for a given motor.
Definition: CurrentControl.c:295