Algorithm 3 - Proportional Integral
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.
Maximum allowed Integral value
Byte Index | Byte value - meaning |
---|---|
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] = 50[DEC] = 50Β°C
Proportional gain - Kp
Byte Index | Byte value - meaning |
---|---|
Byte Index | Byte value - meaning |
0 | 37 - The command code |
1 | A[23:16] |
2 | A[15:8] |
3 | A[7:0] |
A[23:0] = Kp * 131072 (default value Kp = 6) |
Example downlink: Setting Kp to 2.74688: 37 05 7E 67
2.74688*131072 = 360039 = 0x05 7E 6
Integral gain - Ki
Byte Index | Byte value - meaning |
0 | 3E - The command code |
1 | B[23:16] |
2 | B[15:8] |
3 | B[7:0] |
B[23:0] = Ki * 131072 (default value: Ki = 1) |
Example downlink: Setting Ki to 0.412678: 3E 00 D3 4A 0.412678*131072 = 54090 = 0x00D34A
Get the value of the integral
Byte index | Sent request | Response - Meaning |
---|---|---|
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
PI run period
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.
Temperature hysteresis (Thys)
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.
Last updated