PID Regulation of Electrolyser Production Rate Based on Outlet Pressure
What We Control?​
Electrolysers can control production rate in the range of 60% to 100%.
Objective of Automation​
Reduce amount of starts and stops of electrolyser to increase stack life.
Requirements​
At least one Enapter electrolyser required. Enapter Dryer is optional.
Rule​
Due to the fact that we need to measure output pressure on output we should measure it on electrolyser or on the dryer if we have one.
Electrolyser automatically stop at 35 bar. We will will try to keep pressure on outlet close to 30 bar by reducing production rate.
Without Enapter Dryer​
electrolysers.pid_output_pressure_manager({
electrolysers = {
'FAB1D8F747BCF71E48E2FBB6DDEDAFCF',
'60570E9A0D53B0C3A24D450A11A0B28D',
},
p = 2.0,
i = 0.001,
d = 1.0,
target_pressure = 30,
})
With the Enapter Dryer​
electrolysers.pid_output_pressure_manager({
electrolysers = {
'FAB1D8F747BCF71E48E2FBB6DDEDAFCF',
'60570E9A0D53B0C3A24D450A11A0B28D',
},
dryer = "0A8D26ABD5731E85F1A44B749ED0B09F",
p = 2.0,
i = 0.001,
d = 1.0,
target_pressure = 30,
})
With the Enapter Dryer and Dynamic Variables Values​
It is also possible to use dynamic values in the storage. This values can be changed over MQTT interface.
electrolysers.pid_output_pressure_manager({
electrolysers = {
'FAB1D8F747BCF71E48E2FBB6DDEDAFCF',
'60570E9A0D53B0C3A24D450A11A0B28D',
},
dryer = "0A8D26ABD5731E85F1A44B749ED0B09F",
p = storage.public.read('electrolysers_group_pid_p'),
i = storage.public.read('electrolysers_group_pid_i'),
d = storage.public.read('electrolysers_group_pid_d'),
target_pressure = storage.public.read('electrolysers_group_pid_target_pressure')),
})
If you decided to use variables then you will need to setup Public MQTT as described in tutorial
Enapter Public MQTT API allows to set variables values. In this example mosquitto_pub
command-line tool from mosquitto MQTT broker package used to send MQTT message.
mosquitto_pub -p 9883 -h 127.0.0.1 -u public -P password -t 'variables/v1/set/electrolysers_group_pid_p' -m '{ "value": "2.0" }'
mosquitto_pub -p 9883 -h 127.0.0.1 -u public -P password -t 'variables/v1/set/electrolysers_group_pid_i' -m '{ "value": "0.001" }'
mosquitto_pub -p 9883 -h 127.0.0.1 -u public -P password -t 'variables/v1/set/electrolysers_group_pid_d' -m '{ "value": "1.0" }'
mosquitto_pub -p 9883 -h 127.0.0.1 -u public -P password -t 'variables/v1/set/electrolysers_group_pid_target_pressure' -m '{ "value": "30" }'
References​
- Learn more about PID-regulator at Wikipedia page: https://en.wikipedia.org/wiki/PID_controller