#include <control_interface.h>
|
| Motor_Out (float kp, float ki, float kd) |
|
void | getData (const Task::Action &a) |
|
float | get_L () |
|
float | get_R () |
|
void | adjust_gain (float angle_D, b2Transform observed, float *y_D=NULL) |
| Adjusts L/R wheel gain, implements a PID controller with option to turn it into cascaded controller. More...
|
|
void | PID (float e) |
| Implements a PID controller. More...
|
|
float | outer_loop (float e) |
| Implements a P controller in the outer loop of the cascade controller. More...
|
|
void | reset () |
|
void | reset_error () |
|
bool | isReady () |
|
void | setReady (bool b) |
|
|
float | L =0 |
|
float | R =0 |
|
float | L_gain =1.0f |
|
float | R_gain =1.0f |
|
float | Kp =0.45 |
|
float | Ki =0.25 |
|
float | Kd =0.2 |
|
float | prev_error =0 |
|
float | integral =0 |
|
bool | ready =false |
|
Output from Configurator to Motors
◆ adjust_gain()
void Motor_Out::adjust_gain |
( |
float |
angle_D, |
|
|
b2Transform |
observed, |
|
|
float * |
y_D = NULL |
|
) |
| |
Adjusts L/R wheel gain, implements a PID controller with option to turn it into cascaded controller.
- Parameters
-
angle_D | desired angle from disturbance |
observed | observed transform |
y_D | desired distance from disturbance on the y axis (pointer so optional) |
◆ outer_loop()
float Motor_Out::outer_loop |
( |
float |
e | ) |
|
Implements a P controller in the outer loop of the cascade controller.
max dl/dt and dr/dt = 2.0 (going from -1->1 and viceversa) max_corrective angle= ((max_dl-max_dr)/speed)*LIDAR_SAMPLING_RATE=(((-2-2)/0.2)*.15)*0.2= fabs(0.6)rad=34deg but this is not a typical case scenario. Usually the error is around 0.01-0.05rad for going straight. Since the angle is small, we want to keep Kp_outer around a plausible angle value. Distances will usually be +- 0.1m so the angle change will be in the range of 0.025-0.001 rad/s
- Parameters
-
- Returns
- desired angle
◆ PID()
void Motor_Out::PID |
( |
float |
e | ) |
|
Implements a PID controller.
- Parameters
-
The documentation for this class was generated from the following files: