PID Controller
ContinuousEl bloque PIDController implementa un controlador Proporcional-Integral-Derivativo estándar para sistemas de control por retroalimentación en bucle cerrado. Combina tres términos de control en paralelo para regular con precisión un proceso: una acción proporcional para respuesta inmediata, una acción integral para eliminar el error en estado estacionario y una acción derivativa para amortiguar sobreimpulsos.
Vídeo tutorial
Modelo Matemático
Aproximación numérica discreta:
I[n] = I[n-1] + Ki × e[n] × Δt (Euler hacia adelante)
D[n] = (Kd × N × (e[n] - e[n-1]) + D[n-1]) / (1 + N × Δt) (Filtro Euler hacia atrás)
La función de transferencia del filtro derivativo es Kd × N × s / (s + N), donde es el coeficiente del filtro. Este filtro paso bajo previene la amplificación del ruido de medición. Un valor mayor de implica menor filtrado ( corresponde a una derivada pura). Los valores típicos oscilan entre .
Entradas y Salidas
| Direction | ID | Label | Tipo | Status |
|---|---|---|---|---|
| → In | error |
Error | number | Required |
| → In | reset |
Reset | number | Optional |
| ← Out | out |
Output | number | Output |
| ← Out | p |
P | number | Output |
| ← Out | i |
I | number | Output |
| ← Out | d |
D | number | Output |
Parámetros
| Parámetros | Label | Tipo | Por defecto | Descripción |
|---|---|---|---|---|
kp |
Proportional Gain (Kp) | number | 1 |
Controls immediate response to error |
ki |
Integral Gain (Ki) | number | 0.1 |
Eliminates steady-state error over time |
kd |
Derivative Gain (Kd) | number | 0.1 |
Dampens oscillations by responding to error rate of change |
n |
Filter Coefficient (N) | number | 100 |
Derivative filter cutoff frequency. Higher = less filtering |
form |
PID Form | select | parallel |
Parallel: u = Kp·e + Ki·∫e + Kd·de/dt. Series: u = Kp·(1 + 1/(Ti·s) + Td·s)·e |
min |
Saturation Min | number | -1000000000000000 |
Lower output limit for anti-windup protection |
max |
Saturation Max | number | 1000000000000000 |
Upper output limit for anti-windup protection |
showComponents |
Show P/I/D Outputs | boolean | false |
Expose individual Proportional, Integral, and Derivative term outputs |
Ejemplos de Uso
Control de Temperatura de un Horno
Setpoint (200°C) → [+]
\
Temp Medida → [-] → Error → PIDController (Kp: 2, Ki: 0.05, Kd: 1) → Calentador
Control de Posición de un Servomotor
Una señal escalón como posición objetivo requiere para amortiguar el movimiento y evitar que el servomotor sobrepase u oscile alrededor de la posición final.
Observaciones y Buenas Prácticas
- Estándar Industrial: La gran mayoría de los lazos de control de retroalimentación en la industria emplean controladores PID.
- Sintonización (Tuning): Use el botón Auto-Tune del panel de propiedades para calcular dentro de su límite de sobreimpulso y margen de seguridad, o empiece solo con y añada después y .
- Paso de Simulación: Todas las ganancias operan de manera consistente e independiente del paso temporal , que se gestiona internamente.
Preguntas Frecuentes (FAQ)
Q: How does PID anti-windup clamping work and when should I use back-calculation?
Clamping (conditional integration) halts integration whenever the actuator output saturates AND the control error has the same sign as the saturated output. This prevents the integrator state from accumulating error that cannot be physically actuated. Back-calculation continuously discharges the integrator state via a feedback gain proportional to the difference between demanded and saturated control output (). Clamping is ideal for hard physical limits (valves, PWM duty cycle) to eliminate severe overshoot upon setpoint recovery.
Q: What is the derivative filter coefficient N in the PID block?
An ideal derivative term has infinite high-frequency gain, amplifying sensor noise and causing actuator chatter. BlockWerk implements a real, band-limited derivative filter: . The parameter (typically chosen between 8 and 20) places a low-pass roll-off pole at frequency rad/s, providing derivative phase lead at control frequencies while attenuating high-frequency noise.
Bloques Relacionados
- Integrator: Elemento integrador individual
- Derivative: Elemento derivativo individual
- TransferFunction: Modelado de la planta del sistema dinámico
- Saturation: Bloque de limitación externa