#include <PID.h>
Public Member Functions | |
PID (float p, float i, float d, float max_pwm, int actual) | |
~PID (void) | |
float | CalcPWM (int desired, int actual) |
On each "iteration" with new PID control values, call the CalcPWM() method
Implementation is currently incomplete -- does not yet have an implementation for "integral" control. (i.e. current this is just a PD control loop)
PID::PID | ( | float | p, | |
float | i, | |||
float | d, | |||
float | max_pwm, | |||
int | actual | |||
) |
Allocate a PID object with the given constants for P, I, D, and max_power
PID::~PID | ( | void | ) |
Free the PID object
float PID::CalcPWM | ( | int | desired, | |
int | actual | |||
) |
Calculate a PWM value for the motor given the current sensor info.