13.02.2021, 16:11
So I've changed the script a bit, it now looks like this:
Setpoint is 23C and current temperature is 22.3C. All controllers give out 0 percent. Why? I have tried enabling/disabling the script, changing kp and ki values with and without calculation formula (example above is without) - didn't help.
Code:
local P_value = 6
local I_value = 150
local kp_value = 0.16
local ki_value = 0.0017
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()
PI:run()
PID1:run()
PID2:run()
PID3:run()
PID4:run()
PID5:run()
PID6:run()
PID7:run()
PID8:run()
PID9:run()
PID10:run()
Setpoint is 23C and current temperature is 22.3C. All controllers give out 0 percent. Why? I have tried enabling/disabling the script, changing kp and ki values with and without calculation formula (example above is without) - didn't help.