Kenneth Marcano
Hello! I am trying to control the temperature of a home oven based on an electrical resistance, the sensor I use is the lm35, but sometimes the signal I receive has noise, in OPENPlc Editor will have a block of some digital filter? the hardware I am using is the PI (PLC) and esp8266 (RTU) the sensor is connected to the RTU
Reply 1 0
thiagoralves
Hi Kenneth. There isn't any block for signal filtering in PLCOpen Editor, however you can create your own filter using some ST Code. Attached is an example I created for a similar situation. I have a water tank with a level sensor that oscillates quite a bit. So I created a little Function Block in ST code that calculates the average of the last 20 measurements. This is a good way to filter out outliners. Of course there are more advanced filters out there. You can implement any of those if you know the algorithm.
Reply 0 0
Kenneth Marcano
thanks, another question, how much is the minimum time recommended to place in the cyclical time of the program for a raspberry pi 3 model b? is the one that recommends in the tutorial how to use plcopen editor? or can it be a little less?
Reply 0 0
thiagoralves
On the Raspberry Pi you can use something like 10ms or even less. However, if you put something very low, it may increase the CPU usage up to 100% which will make OpenPLC timers inaccurate. Also, if you're using a slave device, you might want to check the polling rate under Settings on OpenPLC Runtime. Even if you have a very short task cyclical time, but keep your polling rate high, what will happen is that you will be processing many cycles using old data from the slave devices. Ideally you should try to keep a balance between these two numbers. With just one slave device you can try having around 10ms polling rate in ideal network conditions. Again, setting this number too low may overwhelm your network, the slave device, or both. While trying to find the best numbers for your configuration, I would create just a simple blink program that blinks and LED on the slave device every second, and then run this program with different numbers. If you realize that the one second delay between the blinks are getting more inaccurate, then you just found a bad number configuration.
Reply 2 0
Reply