PID Closed-Loop Controller Extension

The PID Controller extension (pid_control.ts) implements closed-loop proportional-integral-derivative feedback control algorithms for robot line following, self-balancing rovers, and motor…

Advanced7 blocksMicroPythonC++

The PID Controller extension (pid_control.ts) implements closed-loop proportional-integral-derivative feedback control algorithms for robot line following, self-balancing rovers, and motor speed stabilization.

1. Mathematical Control Loop

The controller computes output adjustment based on setpoint vs. current input: Output=Kp⋅e(t)+Ki∫e(t) dt+Kdde(t)dt\text{Output} = K_p \cdot e(t) + K_i \int e(t)\,dt + K_d \frac{de(t)}{dt}

  • Proportional (KpK_p): Instant error correction proportional to deviation.
  • Integral (KiK_i): Accumulates long-term offset error to overcome friction or slope.
  • Derivative (KdK_d): Predicts future error trend to prevent overshoot and oscillations.

2. Supported PID Blockly Blocks (7 Blocks)

Drawing the blocks…

PID Closed-Loop Controller Extension — OMS Parts