kingmatrix
System controller selected stm32bluepi, 100k NTC through the emitter follower to the AD interface of bluepi, through the PID control relay on and off time, just can measure the temperature, the temperature deviation.

WK1.jpg
Reply 1 0
thiagoralves
Built-in ADCs are never good. If you want something more reliable you’ll need an external ADC, but that requires specific OpenPLC drivers and will be complicated to implement 
Reply 0 0
kingmatrix
In order to verify the feasibility of pid control relay, use commercial softplc to experiment, because its pid library is complete, the experiment is very successful, use softplc to control the modbus slave made by stm32bluepill, the temperature can be controlled within +/- 1.5 degrees Celsius. If ported to openplc need to write their own pid function.
Since the stm32bluepill has only 2 holding registers, it can only be used for the actual temperature, and the set temperature. Adjusting pid parameters may be a problem, that is, can only be fixed in the program written inside, more trouble, so may be on/off control may be more suitable, through the return difference setting, control accuracy can be within +/-3 degrees Celsius.

温控器10.png
Reply 0 0
kingmatrix
This is the graph of heating control using on/off, the return difference setting is 1 degree Celsius, obviously not as accurate as pid control, can be used in less demanding situations, this kind of control is not very good for heating inertia is relatively large.

温控器3.png
Reply 0 0
thiagoralves
Check the OSCAT library, there is a link to download it here on the Cutom Blocks section. I'm pretty sure they have PID blocks with a digital output. The one offered by OpenPLC is more appropriate for analog controls (heating power instead of ON/OFF)
Reply 0 0
Reply