Ejemplo n.º 1
0
PID::PID(float Kc, float tauI, float tauD, float interval) {
 
    usingFeedForward = false;
    inAuto           = false;
 
    //Default the limits to the full range of I/O: 3.3V
    //Make sure to set these to more appropriate limits for
    //your application.
    setInputLimits(0.0, 3.3);
    setOutputLimits(0.0, 3.3);
 
    tSample_ = interval;
 
    setTunings(Kc, tauI, tauD);
 
    setPoint_             = 0.0;
    processVariable_      = 0.0;
    prevProcessVariable_  = 0.0;
    controllerOutput_     = 0.0;
    prevControllerOutput_ = 0.0;
 
    accError_ = 0.0;
    bias_     = 0.0;
    
    realOutput_ = 0.0;
 
}
Ejemplo n.º 2
0
void Spooler::on() {
  setTunings(0.5, 0.01, 0.0);
  setMode(MANUAL);
  setRPM(120);
  setMode(AUTOMATIC);
  enable();
  _startFlag = true;
}
Ejemplo n.º 3
0
PID::PID(double kp, double ki, double kd, uint8_t direction, uint32_t period, uint32_t time){
	setOutputLimits(0, 255);
	setPeriod(100);
	setDirection(direction);
	setTunings(kp, ki, kd);

	if (time > period) lastTime = time - period;
	else lastTime = 0;
}
Ejemplo n.º 4
0
PIDProcess::PIDProcess(const char* name, float desiredValue, float ki, float kd, float kp,
                       ControllerDirections controllerDirection, float outMin, float outMax)
        :desiredValue(desiredValue), specifiedDesiredValue(desiredValue), outMin(outMin), outMax(outMax),
         controllerDirection(controllerDirection), sampleTime(DEFAULT_SAMPLE_TIME), ITerm(0) {
    setTunings(kp, ki, kd);

    strcpy(this->name, name);
    this->lastExecMillis = millis() - this->sampleTime;
}
Ejemplo n.º 5
0
	PID(volatile float* error, volatile float* output, float epsilon)
	{
		this->output = output;
		this->error = error;

		setTunings(0, 0, 0);
		this->epsilon = epsilon;
		pre_error = 0;
		derivative = 0;
		integral = 0;
	}