XLogic4: PID controller
This article shows how to implement a PIC controller in the NETx Server through XLogic. For the LUA implementation, please refer to this article.
Basics
A PID controller is a versatile control loop mechanism that compares an input reading with a set point and writes a control value based on the controller parameters and state.
Implementation
The required items and parameters are specified when calling the PID controller loop. This is done by setting up an XCommand event definition of type Timer.
- In the NETx Studio, go to Extensions > XCommand event definitions.
- Create a new definition. Set Type to Timer and set the Interval to 10 s. The controller loop will then be called every 10 seconds.
- In the XCommand column select Logic.PidControl and provide the inputs and parameters.
- Save the XCommand event definitions and restart the NETx Server.
In this example we use the following inputs and parameters:
Name | Value |
---|---|
actual | NETx\VIRTUAL\BuildingA\Floor1\RoomA\Current |
setpoint | NETx\VIRTUAL\BuildingA\Floor1\RoomA\Setpoint |
control | NETx\VIRTUAL\BuildingA\Floor1\RoomA\Control |
Kp | 0.2 |
Ki | 0.0000222222 |
Kd | 0 |
minControlValue | 0 |
maxControlValue | 255 |
esumMin | -2 |
esumMax | 65536 |
After the NETx Server has finished start-up, the PID controller is operational. Set a value for the set point. Vary the current value and watch how the control value changes accordingly.
Background information
Kp is the proportional factor which 1/P where P is the gain of the controller in K (Kelvin). Notable hardware vendors suggest for warm water heating a P of 5 K. Therefore, Kp for heating is 0.2.
Ki is calculated as Kp/Tr where Tr is the reset time in seconds of the controller. A typical value for warm water heating is 150 minutes . Thus, Ki = 0.2/150*60 = 0. 00002222222 for heating.
Article applies to the following products:
- NETx BMS Platform R2 Build 1000+
- NETx Multi Protocol Server R2 Build 1000+