28.01.2021, 18:50
Try this:
To make it work as expected, i.e output 0-100%:
The p-term is calculated in range 0-1, so it should be multiplied with 100 in the script.
Some other points:
Kp = 1 / P-band --> P-band = 4 K -> Kp = 0,25
Ki = Kp / Ti * 100 --> Ti = (1 min * 60 s) -> Ki = 0.42
You can easily test this:
Current: 20
Setpoint: 21
P-term immediately gives output: 25%
After 1 min output is 50% (as the I-term is aiming reaching P-term i Ti-time)
So if you want 5 K / 240 min
Kp = 1 / 5 -> 0,2
Ki = (0,2 / 240 * 60) * 100 -> 0.0014
To make it work as expected, i.e output 0-100%:
The p-term is calculated in range 0-1, so it should be multiplied with 100 in the script.
Some other points:
Kp = 1 / P-band --> P-band = 4 K -> Kp = 0,25
Ki = Kp / Ti * 100 --> Ti = (1 min * 60 s) -> Ki = 0.42
You can easily test this:
Current: 20
Setpoint: 21
P-term immediately gives output: 25%
After 1 min output is 50% (as the I-term is aiming reaching P-term i Ti-time)
So if you want 5 K / 240 min
Kp = 1 / 5 -> 0,2
Ki = (0,2 / 240 * 60) * 100 -> 0.0014