Algorithm 3 - Proportional Integral
Last updated
Was this helpful?
Last updated
Was this helpful?
This algorithm is an implementation of a typical PI algorithm.
Both the proportional gain Kp and the integral gain Ki can be set with 5 decimal places after the comma.
The algorithm will run on 3 occasions:
- Periodic run (by default every 10 minutes)
- New target temperature is set
- T(measured) - T(target) > 2 degrees Celsius
There's a software hysteresis in place, which prevents the movement of the motor unless the error is > Thys.
The implementation does not have integral reset time - it integrates all previous errors. There's an integral anti wind-up and anti wind-down in place, which limits the integral to 0-50 degrees by default. You can change the maximum value via the command below, increasing the error limit.
Byte Index
Byte value - meaning
0
4C - The command code
1
XX - I[15:8]
2
XX -I[7:0]
Example command: 0x4C012C
I[15:0] = 012C[HEX] = 300
Integral = I[DEC] / 10 = 300 / 10 = 30
The error is set to its maximum allowed value of 30°C
Default: I[15:0] = 01F4[HEX] = 500[DEC] = 50°C
Byte Index
Byte value - meaning
0
37 - The command code
1
XX[23:16]
2
XX[15:8]
3
XX[7:0]
XX[23:0] = Kp * 131072 Default: 0x0C0000[HEX] = 786432[DEC] -> Kp = 6
Example downlink: Setting Kp to 2.74688: 37057E67
2.74688*131072 = 360039 = 0x057E67
Byte Index
Byte value - meaning
0
3E - The command code
1
XX[23:16]
2
XX[15:8]
3
XX[7:0]
XX[23:0] = Ki * 131072
Default: 0x020000[HEX] = 131072[DEC] -> Kpi = 1
Example downlink: Setting Ki to 0.412678: 3E00D34A 0.412678*131072 = 54090 = 0x00D34A
0
3F – The command code.
3F – The command code.
1
Integral [15:8]
2
Integral [7:0]
The value of the integral is pre-multiplied by 10 by the device, so it can use 0,1 resolution.
Example uplink:
If the integral is 2.5, the complete command response is going to be: 0x3F0019
Integral [15:0] = 0x0019 = 25
Integral = 25/10 = 2.5
Byte Index
Byte value - meaning
0
41 - The command code
1
XX = Run period in minutes. (default value: 10 minutes)
Example downlink:
0x410F - sets the run period to 15 minutes.
Byte Index
Byte value - meaning
0
43 - The command code
1
XX = Temperature hysteresis value (Thys), multiplied by 10. (default value: 0.2 deg. C)
Min. acceptable value of Thys is 0.2C
Example downlink:
0x4303 - sets the temperature hysteresis to 0.3 degrees Celsius.