This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

PID Problem
#4
Hello, admin,

Thanks for the response!

What do you mean by kp value too low? As I've mentioned before, I'm trying to achieve (6K/150min) control, which would translate to kp value being 0.16 (1/6K-->0.16), or I'm calculating something wrong?

I've tried putting in kp equal to 1, but all outputs still give out 0. Current temp - 22.5C, setpoint - 23C.

I'm trying to simulate different controls, output isn't connected to valves right now, but I just need some information from trend logs for now.

I also added 1sec delay after each run:

Code:
local P_value = 6
local I_value = 150
local kp_value = 1
local ki_value = 0.0017
local delay = 1

if not P then

P = PID:init({
    current = 'RTC05_Current_Temperature',
    setpoint = 'RTC05_Setpoint_Temperature_Status',
    output = 'BD_P_Output',
    kp = kp_value,
    ki = 0,
    kd = 0
})

PI = PID:init({
    current = 'RTC05_Current_Temperature',
    setpoint = 'RTC05_Setpoint_Temperature_Status',
    output = 'BD_PI_Output',
    kp = kp_value,
    ki = ki_value,
    kd = 0
})

PID1 = PID:init({
    current = 'RTC05_Current_Temperature',
    setpoint = 'RTC05_Setpoint_Temperature_Status',
    output = 'BD_PID1_Output',
    kp = kp_value,
    ki = ki_value,
    kd = 0.1
})

PID2 = PID:init({
    current = 'RTC05_Current_Temperature',
    setpoint = 'RTC05_Setpoint_Temperature_Status',
    output = 'BD_PID2_Output',
    kp = kp_value,
    ki = ki_value,
    kd = 0.2
})

PID3 = PID:init({
    current = 'RTC05_Current_Temperature',
    setpoint = 'RTC05_Setpoint_Temperature_Status',
    output = 'BD_PID3_Output',
    kp = kp_value,
    ki = ki_value,
    kd = 0.3
})
  
PID4 = PID:init({
    current = 'RTC05_Current_Temperature',
    setpoint = 'RTC05_Setpoint_Temperature_Status',
    output = 'BD_PID4_Output',
    kp = kp_value,
    ki = ki_value,
    kd = 0.4
})

PID5 = PID:init({
    current = 'RTC05_Current_Temperature',
    setpoint = 'RTC05_Setpoint_Temperature_Status',
    output = 'BD_PID5_Output',
    kp = kp_value,
    ki = ki_value,
    kd = 0.5
})

PID6 = PID:init({
    current = 'RTC05_Current_Temperature',
    setpoint = 'RTC05_Setpoint_Temperature_Status',
    output = 'BD_PID6_Output',
    kp = kp_value,
    ki = ki_value,
    kd = 0.6
})

PID7 = PID:init({
    current = 'RTC05_Current_Temperature',
    setpoint = 'RTC05_Setpoint_Temperature_Status',
    output = 'BD_PID7_Output',
    kp = kp_value,
    ki = ki_value,
    kd = 0.7
})

PID8 = PID:init({
    current = 'RTC05_Current_Temperature',
    setpoint = 'RTC05_Setpoint_Temperature_Status',
    output = 'BD_PID8_Output',
    kp = kp_value,
    ki = ki_value,
    kd = 0.8
})

PID9 = PID:init({
    current = 'RTC05_Current_Temperature',
    setpoint = 'RTC05_Setpoint_Temperature_Status',
    output = 'BD_PID9_Output',
    kp = kp_value,
    ki = ki_value,
    kd = 0.9
})

PID10 = PID:init({
    current = 'RTC05_Current_Temperature',
    setpoint = 'RTC05_Setpoint_Temperature_Status',
    output = 'BD_PID10_Output',
    kp = kp_value,
    ki = ki_value,
    kd = 1
})

end

P:run()
os.sleep(delay)
PI:run()
os.sleep(delay)
PID1:run()
os.sleep(delay)
PID2:run()
os.sleep(delay)
PID3:run()
os.sleep(delay)
PID4:run()
os.sleep(delay)
PID5:run()
os.sleep(delay)
PID6:run()
os.sleep(delay)
PID7:run()
os.sleep(delay)
PID8:run()
os.sleep(delay)
PID9:run()
os.sleep(delay)
PID10:run()


Update: Okay, so I've set ki to 1 aswell, and now PI and PID controllers give out 11 percent, and add 10 percent every minute, which is way too fast. How do I achieve (6K/150min) control? And why P controller still gives out 0?
Reply


Messages In This Thread
PID Problem - by MantasJ - 13.02.2021, 14:56
RE: PID Problem - by MantasJ - 13.02.2021, 16:11
RE: PID Problem - by admin - 15.02.2021, 10:30
RE: PID Problem - by MantasJ - 15.02.2021, 12:07
RE: PID Problem - by admin - 15.02.2021, 12:25
RE: PID Problem - by MantasJ - 15.02.2021, 12:41
RE: PID Problem - by admin - 15.02.2021, 14:06

Forum Jump: