Difference between revisions of "HP Tips & tricks during installation and troubleshooting"

From OpenMotics
Jump to navigation Jump to search
Line 503: Line 503:
  
 
=== Configuring the PID parameters ===
 
=== Configuring the PID parameters ===
 +
==== Background PID parameters ====
 +
The PID parameters are programmed in the eeprom of HVAC module. Programming happens by using the CLI instruction "eeprom write" as explained in the previous section.
 +
 +
Each PID filter (PID0, PID1 etc) has a double set of PID parameters, 1 set for Cooling and 1 set for Heating. Switching between cooling and heating happens by changing an eeprom value (see Eeprom byte 92..95). Cooling and Heating can have different behaviour hence the different set of parameters.
 +
 +
The main application passes the error to the filter via the pid_Error variable (16bits, two's complement) then Gosubs PID.
 +
 +
The filter responds with the calculated drive in the pid_Out variable (16bits, two's complement)
 +
 +
The three gains are set from the main application via pid_Kp, pid_Ki and pid_Kd. These are all 16bit variables representing the gain of each term in 1/256 parts. One LSB is 0.00390625 so to set the integral gain to 5.5 pid_Ki should be set to $0580. ( 0580(hex) is 1408(dec), 1408 * 0.00390625 = 5.5 )
 +
The integrator has a time constant that is set thruthe pid_Ti variable. The pid_Ti tells the PID-filter how often the I-term should be updated. If pid_Ti is set to 10 the I-term is calculated every 10 times that the filter is called. This is sometimes refered to as 'reset-time'. The pid_I_Clamp is a 16bit variable that is used to  *
 +
prevent wind-up of the integrator. If a large error is present for an extended time period the I-term can grow too big. The pid_I_clamp clamps the I-term to whatever value the variable is set to.
 +
Finally there's the pid_Out_Clamp variable. This 16-bit variable is used to clamp the final output of the PID-filter to a setable value.
 +
The pid_Status is a byte size variable containing various flags that the main application can read and/or write. The flags are latched so once they are set by the PID-sub the main application needs  to reset them if need be.
 +
 
=== Testing the PID filter ===
 
=== Testing the PID filter ===

Revision as of 15:20, 2 January 2022

Introduction

The HP (Heat Pump) module is made to work in combination OpenMotics. This module will allow to built a full electric solution for Heating and Cooling in combination with a Heatpump. The HP module has following connections:

  • 6x NTC (temperature) probe connections
  • 4x 230VAC outputs
  • 2x Relay outputs (dry contacts)
  • 2x 0-10VDC inputs
  • 2x 0-10VDC outputs
  • 1x Aquastat input

Firmware information

Release notes

The Firmware release notes can be found here: HP Module Release Notes

Eeprom Memory Model

Location DEC Location HEX Description
0
0
Output Module ID_NE (Module is New "N" or Existing "E")
1
1
Output Module ID0
2
2
Output Module ID1
3
3
Output Module ID2
4
4
Output Module ID3
20
14
Sensor Module ID_NE (Module is New "N" or Existing "E")
21
15
Sensor Module ID0
22
16
Sensor Module ID1
23
17
Sensor Module ID2
24
18
Sensor Module ID3
64
40
Hardware Version
65
41
Firmware Version Major
66
42
Firmware Version Minor
67
43
Firmware Version Built
74
4A
Bootloader Flashmode variable
75
4B
Bootloader Timeout value
90
5A
Sensor debugging via local UART (on the HCAC module itself) disabled (==255) or enabled (!=255)
91
5B
Sensor Refresh rate: Time (x40ms) between each cycle of sensors reading (Default 255x40ms=+/-10s)
92
5C
PID0 in Heating (!=0) or Cooling (==0)
93
5D
PID1 in Heating (!=0) or Cooling (==0)
94
5E
Reserved for PID2
95
5F
Reserved for PID3
96
60
PID0 HEATING: Temperature Sensor (0-5) linked to this PID routine
97
61
PID0 HEATING: Output (0-2) linked to this PID routine
98
62
PID0 HEATING: PID P (MSB) Parameter (Kp)
99
63
PID0 HEATING: PID P (LSB) Parameter (Kp)
100
64
PID0 HEATING: PID I (MSB) Parameter (Ki)
101
65
PID0 HEATING: PID I (LSB) Parameter (Ki)
102
66
PID0 HEATING: PID D (MSB) Parameter (Kd)
103
67
PID0 HEATING: PID D (LSB) Parameter (Kd)
104
68
PID0 HEATING: PID Ti Parameter -> How often the I PID filter needs to be updated
105
69
PID0 HEATING: PID I Clamp (MSB) -> Clamp value to avoid windup
106
6A
PID0 HEATING: PID I Clamp (LSB) -> Clamp value to avoid windup
107
6B
PID0 HEATING: PID OUT Clamp (MSB) -> Clamp value Output value
108
6C
PID0 HEATING: PID OUT Clamp (LSB) -> Clamp value Output value
109
6D
PID0 HEATING: Time (x40ms) between each PID execution (Default ?)
110
6E
PID0 HEATING: Maximum Temperature setpoint that the HVAC module will accept for this PID filter, temperature setpoint is programmed in System Value Format. Default=255
111
6F
PID0 HEATING: Enable (==1 without local UART debug,==2 with local UART debug)/Disable (!=1 & !=2) PID
112
70
PID0 COOLING: Temperature Sensor (0-5) linked to this PID routine
113
71
PID0 COOLING: Output (0-2) linked to this PID routine
114
72
PID0 COOLING: PID P (MSB) Parameter (Kp)
115
73
PID0 COOLING: PID P (LSB) Parameter (Kp)
116
74
PID0 COOLING: PID I (MSB) Parameter (Ki)
117
75
PID0 COOLING: PID I (LSB) Parameter (Ki)
118
76
PID0 COOLING: PID D (MSB) Parameter (Kd)
119
77
PID0 COOLING: PID D (LSB) Parameter (Kd)
120
78
PID0 COOLING: PID Ti Parameter -> How often the I PID filter needs to be updated
121
79
PID0 COOLING: PID I Clamp (MSB) -> Clamp value to avoid windup
122
7A
PID0 COOLING: PID I Clamp (LSB) -> Clamp value to avoid windup
123
7B
PID0 COOLING: PID OUT Clamp (MSB) -> Clamp value Output value
124
7C
PID0 COOLING: PID OUT Clamp (LSB) -> Clamp value Output value
125
7D
PID0 COOLING: Time (x40ms) between each PID execution (Default ?)
126
7E
PID0 COOLING: Minimum Temperature setpoint that the HVAC module will accept for this PID filter, temperature setpoint is programmed in System Value Format. Default=0
127
7F
PID0 COOLING: Enable (==1 without local UART debug,==2 with local UART debug)/Disable (!=1 & !=2) PID
128
80
PID1 HEATING: Temperature Sensor (0-5) linked to this PID routine
129
81
PID1 HEATING: Output (0-2) linked to this PID routine
130
82
PID1 HEATING: PID P (MSB) Parameter (Kp)
131
83
PID1 HEATING: PID P (LSB) Parameter (Kp)
132
84
PID1 HEATING: PID I (MSB) Parameter (Ki)
133
85
PID1 HEATING: PID I (LSB) Parameter (Ki)
134
86
PID1 HEATING: PID D (MSB) Parameter (Kd)
135
87
PID1 HEATING: PID D (LSB) Parameter (Kd)
136
88
PID1 HEATING: PID Ti Parameter -> How often the I PID filter needs to be updated
137
89
PID1 HEATING: PID I Clamp (MSB) -> Clamp value to avoid windup
138
8A
PID1 HEATING: PID I Clamp (LSB) -> Clamp value to avoid windup
139
8B
PID1 HEATING: PID OUT Clamp (MSB) -> Clamp value Output value
140
8C
PID1 HEATING: PID OUT Clamp (LSB) -> Clamp value Output value
141
8D
PID1 HEATING: Time (x40ms) between each PID execution (Default ?)
142
8E
PID1 HEATING: Maximum Temperature setpoint that the HVAC module will accept for this PID filter, temperature setpoint is programmed in System Value Format. Default=255
143
8F
PID1 HEATING: Enable (==1 without local UART debug,==2 with local UART debug)/Disable (!=1 & !=2) PID
144
90
PID1 COOLING: Temperature Sensor (0-5) linked to this PID routine
145
91
PID1 COOLING: Output (0-2) linked to this PID routine
146
92
PID1 COOLING: PID P (MSB) Parameter (Kp)
147
93
PID1 COOLING: PID P (LSB) Parameter (Kp)
148
94
PID1 COOLING: PID I (MSB) Parameter (Ki)
149
95
PID1 COOLING: PID I (LSB) Parameter (Ki)
150
96
PID1 COOLING: PID D (MSB) Parameter (Kd)
151
97
PID1 COOLING: PID D (LSB) Parameter (Kd)
152
98
PID1 COOLING: PID Ti Parameter -> How often the I PID filter needs to be updated
153
99
PID1 COOLING: PID I Clamp (MSB) -> Clamp value to avoid windup
154
9A
PID1 COOLING: PID I Clamp (LSB) -> Clamp value to avoid windup
155
9B
PID1 COOLING: PID OUT Clamp (MSB) -> Clamp value Output value
156
9C
PID1 COOLING: PID OUT Clamp (LSB) -> Clamp value Output value
157
9D
PID1 COOLING: Time (x40ms) between each PID execution (Default ?)
158
9E
PID1 COOLING: Minimum Temperature setpoint that the HVAC module will accept for this PID filter, temperature setpoint is programmed in System Value Format. Default=0
159
9F
PID1 COOLING: Enable (==1 without local UART debug,==2 with local UART debug)/Disable (!=1 & !=2) PID
160
A0
PIDx: Reserved for additional PID filters
...
...
...
223
DF
PIDx: Reserved for additional PID filters
240
F0
Eeprom Protected Area: Production Year (DEC 0-99)
241
F1
Eeprom Protected Area: Production Month (DEC 1-12)
242
F2
Eeprom Protected Area: Production Day (DEC 1-31)
243
F3
Eeprom Protected Area: Production Company (DEC 0-9)
244
F4
Eeprom Protected Area: Serial Number MSB
245
F5
Eeprom Protected Area: Serial number LSB
246
F6
Eeprom Protected Area: Number of errors found during production testing

Configuration HVAC module

Command line Interface (CLI)

The Brain(+) has a command line interface that interacts directly with the Master processor of the Brain(+). Since the HVAC module communicates directly with the Master processor, it's a good practice to test functionality on this layer before integrating on a higher layer (graphical interface, cloud and others).

The Master processor has a CLI (Command Line Interface) with about 160 different instructions. Details regarding the CLI instruction set can be found here: CLI Reference Guide AIO and AIO Tips & tricks during installation and troubleshooting

In the portal, maintenance mode can be opened (or an UART cable can be used to directly connect to the Brain(+)).

Debug information will also appear on the HVAC module. This information can be seen by connecting an UART cable on the HVAC module (115200 baud).

Connecting the HVAC module

Connecting the HVAC module is easy:

  • Connect an UTP between the Brain(+) and the HVAC module to have the RS485 bus connected. Make sure to insert the termination plug on the first and the last module on the bus.
  • Connect the necessary NTC temperature sensors
  • Connect 230VAC on the HVAC module: The HVAC module doesn't use the power of the RS485 bus but uses its own power supply in case of Brain and/or bus power problem so fail safe can still happen on the HVAC module

Discovery of the HVAC module

Discovery of a new HVAC modules happens fully automatic and no manual actions are needed. In the below example, we plugged a new Input, CAN Control and HVAC module. As you can see below on the CLI output, the 3 modules have been added just after power on of the Brain:

----------Hardware Check------------
FRAM found
EEPROM found (255)
**I2C2 failed, address=152 i2cMode=4**
**DAC5574 not found**
Brain detected
AT24C02 found
MCP7940 RTC found
 -> Clock is running
PCA9534_1 found
PCA9539_1 found
PCA9539_2 found
LM75 found
Std (125kbps) CAN settings used
CAN speed is set at 125kbps
Search started
New Sensor module found: 084.001.126.000
New Input module (I) found: 073.017.243.000
New Can Control module found: 067.051.255.000
New Output module (O) found: 079.001.126.000
Search done

As you can see, 2 modules have the same ID2, ID3 & ID4 (These are the modules generated by the HVAC module). Performing the CLI instruction "error list" or "el" will give following result:

el
--- Total Uptime: 000442 Hours, Last Startup: 17:12:59 31/12/21   ---
--- Module Type: BRAIN, RS485 mode: 0, Board: 29'C  --.--V --.--A ---
--- PWR RS485/CAN: 1/1, CANTERM: 1, BB Debug: 255, Fw: 1.0.120       ---
-------Output------------ID---------Err-------Status--------Pwr---
 00 (l I 000->007) 108.000.000.000 00000   GOOD       (000)  1
 01 (O H 008->015) 079.001.126.000 00000   GOOD       (000)  0
-------Input-------------ID---------Err-------Status--------Pwr---
 00 (i I 000->007) 105.000.000.000 00000   GOOD       (000)  1
 01 (I E 008->015) 073.017.243.000 00000   GOOD       (016)  1
-------Sensor------------ID---------Err-------Status--------Pwr---
 00 (T H 000->007) 084.001.126.000 00000   GOOD       (080)  0
-------CAN Control-------ID---------Err-------Status--------Pwr---
 00 (C E 000->000) 067.051.255.000 00000   GOOD       (016)  1
OK

The 2 modules with "H" in the third column are the modules generated by the HVAC module:

  • 1 output module with ID79.1.126.0: The relays in the HVAC module are linked with this module
  • 1 Sensor module with ID84.1.126.0: The sensors of the HVAC module:
    • Sensor 0-5: External connected NTC's
    • Sensor 6: Not used
    • Sensor 7: Board sensor (Temperature and humidity)

The temperature list can be seen by using following CLI instruction:

sensor list
-Sensor---Temp (Offset)---Hum------Bright---CO2------VOC-----Dali--Setpoint--Th Mode--Name-----------
000 (T)  +22.0'C (+00)     NC       NC      NC       NC     255(0)   NC      000
001 (T)  +23.0'C (+00)     NC       NC      NC       NC     255(0)   NC      000
002 (T)  +23.0'C (+00)     NC       NC      NC       NC     255(0)   NC      000
003 (T)  +22.5'C (+00)     NC       NC      NC       NC     255(0)   NC      000
004 (T)  +22.5'C (+00)     NC       NC      NC       NC     255(0)   NC      000
005 (T)  +22.0'C (+00)     NC       NC      NC       NC     255(0)   NC      000
006 (T)    NC    (+00)     NC       NC      NC       NC     255(0)   NC      000
007 (T)  +27.0'C (+00)    039%      NC      NC       NC     255(0)   NC      000
OK

Configuring the HVAC module

The HVAC module has an onboard eeprom that contains all the configuration parameters. In the beginning of this page, you can find the memory model with all configuration bytes. We'll explain the use of these bytes in the following section.

Configuring the sensor parameters

As you can see in the Eeprom Memory Model, only 2 bytes are used to configure the sensors:

  • Byte 90: On the HVAC module, an UART cable can be connected on which debug information can be displayed. Also, after each temperature measurement of all sensors, a debug line will be printed on the UART console when Byte 90 is put at 0.
  • Byte 91: This byte will program the speed of sensor measurement, each unit is 40ms. Standard non programmed value in eeprom is 255 which means 255x40ms=+/-10s so every 10 seconds a measurement of all sensors is executed.

To have good PID results, a measurement of the sensors every 10 seconds is too slow, a measurement of 1 second should be much better so the value in eeprom should be put at 25. To accomplish this, we need to program this value in the eeprom of the remote HVAC module. To do so, we use the CLI instruction "eeprom write" followed by the 4 ID's of the module (can be the HVAC output or sensor module ID's), followed by the eeprom address and then the byte to be programmed.

eeprom write 79 1 126 0 91 25
OK

To display the temperature measurement on the UART of the HVAC module, use following CLI instruction:

eeprom write 79 1 126 0 90 1
OK

Configuring the PID parameters

Background PID parameters

The PID parameters are programmed in the eeprom of HVAC module. Programming happens by using the CLI instruction "eeprom write" as explained in the previous section.

Each PID filter (PID0, PID1 etc) has a double set of PID parameters, 1 set for Cooling and 1 set for Heating. Switching between cooling and heating happens by changing an eeprom value (see Eeprom byte 92..95). Cooling and Heating can have different behaviour hence the different set of parameters.

The main application passes the error to the filter via the pid_Error variable (16bits, two's complement) then Gosubs PID.

The filter responds with the calculated drive in the pid_Out variable (16bits, two's complement)

The three gains are set from the main application via pid_Kp, pid_Ki and pid_Kd. These are all 16bit variables representing the gain of each term in 1/256 parts. One LSB is 0.00390625 so to set the integral gain to 5.5 pid_Ki should be set to $0580. ( 0580(hex) is 1408(dec), 1408 * 0.00390625 = 5.5 ) The integrator has a time constant that is set thruthe pid_Ti variable. The pid_Ti tells the PID-filter how often the I-term should be updated. If pid_Ti is set to 10 the I-term is calculated every 10 times that the filter is called. This is sometimes refered to as 'reset-time'. The pid_I_Clamp is a 16bit variable that is used to * prevent wind-up of the integrator. If a large error is present for an extended time period the I-term can grow too big. The pid_I_clamp clamps the I-term to whatever value the variable is set to. Finally there's the pid_Out_Clamp variable. This 16-bit variable is used to clamp the final output of the PID-filter to a setable value. The pid_Status is a byte size variable containing various flags that the main application can read and/or write. The flags are latched so once they are set by the PID-sub the main application needs to reset them if need be.

Testing the PID filter