Skip to content

PID

This module implements the PID algorithm, which stands for Proportional-Integral-Derivative. The PID algorithm is a widely used control algorithm in engineering and process control systems. It is designed to maintain a system at a desired setpoint by continuously adjusting a control input. The three components of the PID algorithm work together to minimize the error between the desired setpoint and the actual system output.

Here’s a brief overview of each component:

  1. Proportional (P):
  • The proportional term is directly proportional to the current error (the difference between the setpoint and the actual process variable).
  • It responds to the present error and produces an output based on the magnitude of the error.
  • A higher proportional gain results in a stronger response to the current error.
  1. Integral (I):
  • The integral term is proportional to the cumulative sum of past errors over time.
  • It addresses any sustained error that may exist even when the proportional term is not sufficient to bring the system to the setpoint.
  • The integral term eliminates the steady-state error by integrating the error over time.
  1. Derivative (D):
  • The derivative term is proportional to the rate of change of the error.
  • It anticipates future behavior by considering the trend of the error over time.
  • The derivative term helps dampen the system’s response and prevent overshooting of the setpoint.

The combined action of the P, I, and D terms provides a control signal that is used to adjust the system. The overall output of the PID controller is the sum of these three terms:

Output = Kp * Proportional + Ki * Integral + Kd * Derivative

where ( Kp ), ( Ki ), and ( Kd ) are the proportional, integral, and derivative gains, respectively. Tuning these gains is a critical aspect of implementing a PID controller to ensure stability, responsiveness, and minimal overshooting in the controlled system.

CREATE TABLE PID (
    ID INT AUTO_INCREMENT PRIMARY KEY,  -- The id of this PID instance
    INPUT double REFERENCE,             -- The input signal
    SETPOINT double REFERENCE,          -- The desired output value
    Kp double,                          -- The proportional gain
    Ki double,                          -- The integral gain
    Kd double,                          -- The derivative gain
    Direction TINY,                     -- Direction of the output. 
    OUTPUT double REFERENCE,            -- The output of the PID algorithm
);

The INPUT, SETPOINT, and OUTPUT columns are capable of handling references to other tables within the SignalSQL database. This flexibility allows you to establish relationships between different tables, enhancing the versatility of the system. By referencing columns from other tables, you can integrate and correlate data from various sources, contributing to a more interconnected and efficient signal processing environment.

Leave a Reply