|
R2R
|
control header More...
Go to the source code of this file.
Classes | |
| struct | control_error |
Functions | |
| void | MotorTimerInit (void) |
| This function sets up the timer interrupt for position control. More... | |
| void | Timer1IntHandler (void) |
| The interrupt handler for position control. More... | |
| void | set_position_gains (void) |
| Sets position gains on the Tiva microcontroller by reading from UART. More... | |
| void | get_position_gains (void) |
| Gets position gains on the Tiva microcontroller by reading to UART. More... | |
| int | get_desired_angle (int motor) |
| Gets desired angle for a given motor. More... | |
| void | set_desired_angle (int angle, int motor) |
| Sets desired angle for a given motor. More... | |
| void | reset_pos (void) |
| Resets desired position to 0 counts. More... | |
| void | reset_controller_error (void) |
| Resets controller error on both controllers to be zero. More... | |
| void | load_position_trajectory (int motor) |
| Loads position trajectory for a given motor over UART. More... | |
| void | PID_Controller (int reference, int actual, int motor) |
| Calculates pwm to send to the motor drivr. More... | |
| int | decog_motor (int x, int motor) |
| Motor decogging to smooth output of motor. More... | |
| void | setDecogging (void) |
| Turn on/off decogging by setting global variable. More... | |
control header
This file contains the pwm functions
| int decog_motor | ( | int | x, |
| int | motor | ||
| ) |
Motor decogging to smooth output of motor.
Motor decogging function that smoothes out the output from the motor by adding a term to the control signal to compensate for the cogging in the BLDC motor. Equations are fit using PositionDataAnalyze.m MATLAB script.
Example:
u = u + decog_motor(current_Angle_Radians, MOTOR_1);
| x | current angle in counts |
| motor | the motor to decog |
| int get_desired_angle | ( | int | motor | ) |
Gets desired angle for a given motor.
| motor | reads the desired angle for the given motor |
| void get_position_gains | ( | void | ) |
Gets position gains on the Tiva microcontroller by reading to UART.
| Void |
| void load_position_trajectory | ( | int | motor | ) |
Loads position trajectory for a given motor over UART.
| motor | specifies the trajectory that is being assigned from UART |
| void MotorTimerInit | ( | void | ) |
This function sets up the timer interrupt for position control.
| Void |
| void PID_Controller | ( | int | reference, |
| int | actual, | ||
| int | motor | ||
| ) |
Calculates pwm to send to the motor drivr.
| reference | the reference angle |
| actual | the commanded angle |
| motor | the specified motor |
| void reset_controller_error | ( | void | ) |
Resets controller error on both controllers to be zero.
| Void |
| void reset_pos | ( | void | ) |
Resets desired position to 0 counts.
| Void |
| void set_desired_angle | ( | int | angle, |
| int | motor | ||
| ) |
Sets desired angle for a given motor.
| motor | specifies the desired angle for the given motor |
| void set_position_gains | ( | void | ) |
Sets position gains on the Tiva microcontroller by reading from UART.
| Void |
| void setDecogging | ( | void | ) |
Turn on/off decogging by setting global variable.
| void |
| void Timer1IntHandler | ( | void | ) |
The interrupt handler for position control.
| Void |
1.8.14