Microscopic
This commit is contained in:
parent
a2764c9461
commit
f2ebd6e9cd
@ -14,7 +14,7 @@
|
|||||||
#include <PID_v1.h>
|
#include <PID_v1.h>
|
||||||
|
|
||||||
/*Constructor (...)*********************************************************
|
/*Constructor (...)*********************************************************
|
||||||
* The parameters specified here are those for for which we can't set up
|
* The parameters specified here are those for which we can't set up
|
||||||
* reliable defaults, so we need to have the user set them.
|
* reliable defaults, so we need to have the user set them.
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
PID2::PID2(double* Input, double* Output, double* Setpoint,
|
PID2::PID2(double* Input, double* Output, double* Setpoint,
|
||||||
@ -26,9 +26,9 @@ PID2::PID2(double* Input, double* Output, double* Setpoint,
|
|||||||
inAuto = false;
|
inAuto = false;
|
||||||
|
|
||||||
PID::SetOutputLimits(0, 255); //default output limit corresponds to
|
PID::SetOutputLimits(0, 255); //default output limit corresponds to
|
||||||
//the arduino pwm limits
|
//the arduino pwm limits
|
||||||
|
|
||||||
SampleTime = 100; //default Controller Sample Time is 0.1 seconds
|
SampleTime = 100; //default Controller Sample Time is 0.1 seconds
|
||||||
|
|
||||||
PID::SetControllerDirection(ControllerDirection);
|
PID::SetControllerDirection(ControllerDirection);
|
||||||
PID::SetTunings(Kp, Ki, Kd, POn);
|
PID::SetTunings(Kp, Ki, Kd, POn);
|
||||||
@ -75,7 +75,7 @@ bool PID2::Compute()
|
|||||||
else if(outputSum < outMin) outputSum= outMin;
|
else if(outputSum < outMin) outputSum= outMin;
|
||||||
|
|
||||||
/*Add Proportional on Error, if P_ON_E is specified*/
|
/*Add Proportional on Error, if P_ON_E is specified*/
|
||||||
double output;
|
double output;
|
||||||
if(pOnE) output = kp * error;
|
if(pOnE) output = kp * error;
|
||||||
else output = 0;
|
else output = 0;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user