CONTROLADOR PROPORCIONAL INTEGRAL Y DERIVATIVO

Páginas: 31 (7629 palabras) Publicado: 6 de junio de 2014



Proyecto Control P+I+D
Objetivo.- Basado en este proyecto construir prototipo de regulación de velocidad de motor empleando encoder óptico como sensor de velocidad, y realizar su calibración de parámetros de los modos de control (Sintonización).

« Arduino Uno Keeps Header Offset
Improving the Beginner’s PID – Sample Time »
Improving the Beginner’s PID – Introduction
In conjunctionwith the release of the new Arduino PID Library I’ve decided to release this series of posts. The last library, while solid, didn’t really come with any code explanation. This time around the plan is to explain in great detail why the code is the way it is. I’m hoping this will be of use to two groups of people:
People directly interested in what’s going on inside the Arduino PID library will geta detailed explanation.
Anyone writing their own PID algorithm can take a look at how I did things and borrow whatever they like.
It’s going to be a tough slog, but I think I found a not-too-painful way to explain my code.  I’m going to start with what I call “The Beginner’s PID.”  I’ll then improve it step-by-step until we’re left with an efficient, robust pid algorithm.
The Beginner’s PIDHere’s the PID equation as everyone first learns it:

This leads pretty much everyone to write the following PID controller:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/*working variables*/
unsigned long lastTime;
double Input, Output, Setpoint;
double errSum, lastErr;
double kp, ki, kd;
void Compute()
{
   /*Howlong since we last calculated*/
   unsigned long now = millis();
   double timeChange = (double)(now - lastTime);
  
   /*Compute all the working error variables*/
   double error = Setpoint - Input;
   errSum += (error * timeChange);
   double dErr = (error - lastErr) / timeChange;
  
   /*Compute PID Output*/
   Output = kp * error + ki * errSum + kd * dErr;
  
   /*Remembersome variables for next time*/
   lastErr = error;
   lastTime = now;
}
  
void SetTunings(double Kp, double Ki, double Kd)
{
   kp = Kp;
   ki = Ki;
   kd = Kd;
}
Compute() is called either regularly or irregularly, and it works pretty well. This series isn’t about “works pretty well” though. If we’re going to turn this code into something on par with industrial PID controllers,we’ll have to address a few things:
1. Sample Time - The PID algorithm functions best if it is evaluated at a regular interval. If the algorithm is aware of this interval, we can also simplify some of the internal math.
2. Derivative Kick - Not the biggest deal, but easy to get rid of, so we’re going to do just that.
3. On-The-Fly Tuning Changes - A good PID algorithm is one where tuningparameters can be changed without jolting the internal workings.
4. Reset Windup Mitigation -We’ll go into what Reset Windup is, and implement a solution with side benefits
5. On/Off (Auto/Manual) - In most applications, there is a desire to sometimes turn off the PID controller and adjust the output by hand, without the controller interfering
6. Initialization - When the controller first turnson, we want a “bumpless transfer.” That is, we don’t want the output to suddenly jerk to some new value
7. Controller Direction - This last one isn’t a change in the name of robustness per se. it’s designed to ensure that the user enters tuning parameters with the correct sign.
Once we’ve addressed all these issues, we’ll have a solid PID algorithm. We’ll also, not coincidentally, have the codethat’s being used in the lastest version of the Arduino PID Library. So whether you’re trying to write your own algorithm, or trying to understand what’s going on inside the PID library, I hope this helps you out. Let’s get started.
Next >>
UPDATE: In all the code examples I’m using doubles. On the Arduino, a double is the same as a float (single precision.) True double precision is WAY...
Leer documento completo

Regístrate para leer el documento completo.

Estos documentos también te pueden resultar útiles

  • Controlador Proporcional integral derivativo
  • controladores proporcional integral derivativos
  • Control, Control Proporcional, Proporcionalintegral, Integral Derivativo, Caracteristicas Y Diferencias Concepto...
  • Diseño del controlador proporcional derivativo
  • Controlador Proporcional Integral
  • Proporcional Integral Derivativo
  • `Proporcional integral derivativo
  • Controlador proporcional derivativo

Conviértase en miembro formal de Buenas Tareas

INSCRÍBETE - ES GRATIS