Skip to content

Not work #128

Closed
Closed

Description

@amgstone

Image
With such settings, the PID controller does not change, the value is always 30, even the ppm codes change. The input value is ppm and the output is the motor speed in %.

Activity

  1. amgstone commented on Feb 2, 2026

    @amgstone
    Author

    Image
    Image

  2. bvweerd commented on Feb 2, 2026

    @bvweerd
    Owner

    Please disable windup protection and retry.

    If this does not help please upload the diagnostics file obtained from the integration.

  3. amgstone commented on Feb 2, 2026

    @amgstone
    Author

    disable windup protection

    Image

  4. bvweerd commented on Feb 2, 2026

    @bvweerd
    Owner

    As said, please upload the diagnostics if it doesn't help.

  5. bvweerd commented on Feb 3, 2026

    @bvweerd
    Owner

    Thanks for the detailed diagnostics!

    I can see what's happening here. The PID output has experienced severe integral windup, with the I-term at approximately -2,137,000 while your output should be between 30-100.
    The Problem

    Your system is a direct acting controller: higher CO2 should result in higher ventilation output. However, the standard PID formula with positive gains is designed for reverse acting systems (like cooling, where higher temperature → higher cooling → lower temperature).

    With your current setup:

    When CO2 (960) is above your target setpoint, the error becomes negative
    Positive Ki with negative error causes the I-term to accumulate negatively
    This pushes the output down instead of up
    

    The Solution

    For a direct acting system (higher input → higher output), you need negative gains:
    Parameter Current Change to
    Kp 1 -1
    Ki 0.1 -0.1
    Kd 0.05 -0.05
    Steps to fix

    Turn off Auto Mode
    Set Kp = -1, Ki = -0.1, Kd = -0.05
    Verify your Setpoint is your target CO2 level (e.g., 600-800 ppm)
    Ensure Windup Protection is enabled
    Set Start Mode to "Zero start" or "Startup value"
    Turn on Auto Mode
    

    This resets the PID and starts fresh with the correct gain signs. The output should now increase when CO2 rises above your setpoint.

  6. amgstone commented on Feb 3, 2026

    @amgstone
    Author

    max ppm- 1 004 ppm, Rekuperator PID Output-100%.

    How can I make the fan speed not increase so rapidly, because my room has a range from 400 to 2500, so at 1000, I understand it shouldn't be 100%, or will it reduce the fan speed when the set value is reached?

  7. bvweerd commented on Feb 3, 2026

    @bvweerd
    Owner

    With your current settings (Kp = -1) and assuming setpoint = 700 ppm:

    error = setpoint - input = 700 - 1004 = -304
    P contribution = -1 × (-304) = +304
    

    That P value alone is already 3x your entire output range (30-100)! So it instantly hits the maximum.
    How to fix: Lower your gains

    For your input range (400-2500 ppm) and output range (30-100%), try these values as a starting point:
    Parameter Current Recommended
    Kp -1 -0.03
    Ki -0.1 -0.005
    Kd -0.05 -0.01
    Setpoint ? 600-800 (your comfort target)
    What this gives you

    With Kp = -0.03 and setpoint = 700:

    At 1000 ppm: P = -0.03 × (700-1000) = +9 → modest increase
    At 2500 ppm: P = -0.03 × (700-2500) = +54 → stronger push toward max
    At 400 ppm: P = -0.03 × (700-400) = -9 → pushes toward minimum
    

    The Ki (integral) will slowly adjust the output over time to reach and maintain your setpoint. The Kd (derivative) dampens rapid changes.
    Tuning tips

    Start with Ki = 0 and Kd = 0, tune Kp first until the response speed feels right
    Then add small Ki to eliminate steady-state error
    Add Kd only if you see oscillation
    

    After changing gains, turn Auto Mode off and on again (with Zero start) to reset the I-term.

  8. amgstone commented on Feb 3, 2026

    @amgstone
    Author

    config_entry-simple_pid_controller-01KGFMNGP4HH0REEVEQGFR511A-2.json
    something is not working properly, with ppm the situation does not change so sharply and the fan speed increases to the maximum. 50 ppm higher than the setpoint and the speed is already 91%

  9. bvweerd commented on Feb 3, 2026

    @bvweerd
    Owner

    Looking at your PID contributions:

    P = -8.34 → Kp is correctly negative ✓
    i_delta = +1.9 → Ki is still positive ✗
    I = 100 → stuck at maximum
    

    You only changed Kp to negative, but Ki is still positive. This causes the I-term to grow in the wrong direction until it hits the limit (100).
    What's happening

    Output = P + I + D = -8.34 + 100 + 0 = 91.66

    The I-term is stuck at maximum and won't come down because Ki has the wrong sign.
    Fix

    Turn OFF Auto Mode
    
    Change your gains - ALL must be negative:
    Parameter	Your current	Change to
    Kp	-0.03 (or similar)	Keep as is
    Ki	+0.1 ← wrong!	-0.005
    Kd	(check this too)	-0.01
    
    Set Start Mode to "Startup value"
    
    Set Startup Value to 50 (middle of your 30-100 range)
    
    Turn ON Auto Mode
    

    This resets the I-term to a neutral value and ensures all gains work in the same direction.
    Why all gains must have the same sign

    For a direct-acting system (higher CO2 → higher fan speed):

    Kp negative: When CO2 > setpoint, P pushes output UP ✓
    Ki negative: When CO2 stays above setpoint, I gradually pushes output UP ✓
    Kd negative: When CO2 is rising, D pushes output UP ✓
    

    If you mix positive and negative gains, the P/I/D components fight each other.

  10. amgstone commented on Feb 3, 2026

    @amgstone
    Author
  11. bvweerd commented on Feb 5, 2026

    @bvweerd
    Owner

    It's working if I see the logs. your PPM stays stable as , and your I-term is slowly decreasing, so it will stabilize at some point when your input starts decreasing towards your setpoint. Now it's up to you to tune the parameters to make it move quickly but within bounds.

  12. amgstone commented on Feb 5, 2026

    @amgstone
    Author

    suggest initial parameters for a more or less stable system for my needs

  13. bvweerd commented on Feb 6, 2026

    @bvweerd
    Owner

    That's hard for me to guess, because I do not have the information of your system, and you need to trail-and-error. I would suggest finding some youtube videos or ask an AI agent to support you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions