Hello, IΒ΄m trying to simulate the control of a heating system. Then end of the control is a PID of the error between a power reference I generated internally for the heating system and the actual power consumption of the heating system. To test this control I want to implement a retard transfer function that simulates the power consumption. The idea is that the power consumption of the heating system will be the output of the PID with a retard of, for example, 5 second. The thing is that I donΒ΄t know how to implement this in CODESYS or if it is possible. Any ideas?
Any help will be appreciated.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
You may also do this, but it will surely oscillate and tends not to reflect any real system:
aRrBuffer : ARRAY1..100OFREAL; ---'Cycle index valueindex :=index+1;Ifindex>100Thenindex :=1;End_If'Recover stored valuerPidInputPower :=aRrBuffer[index];'Place new command in bufferaRrBuffer[index] :=rPidOutputPower;
Both examples need to be called in a cyclical task, where if we want 5s filtering/delay and 100 records, then the cyclical call time should be 5s/100samples so every 50ms.
π
1
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello, IΒ΄m trying to simulate the control of a heating system. Then end of the control is a PID of the error between a power reference I generated internally for the heating system and the actual power consumption of the heating system. To test this control I want to implement a retard transfer function that simulates the power consumption. The idea is that the power consumption of the heating system will be the output of the PID with a retard of, for example, 5 second. The thing is that I donΒ΄t know how to implement this in CODESYS or if it is possible. Any ideas?
Any help will be appreciated.
What about this :
This will introduce some filtering on your value.
You may also do this, but it will surely oscillate and tends not to reflect any real system:
Both examples need to be called in a cyclical task, where if we want 5s filtering/delay and 100 records, then the cyclical call time should be 5s/100samples so every 50ms.