Need Help with Level Control Scene in Factory I/O using OpenPLC Modbus (PID)

Hi everyone,

I’ve been working on solving the Level Control scene in Factory I/O using OpenPLC, specifically implementing a PID controller to regulate the tank’s fill and discharge valves. I’ve tried multiple approaches, including working with several senior engineers, but we haven’t been able to get a stable and precise control.

If anyone has successfully implemented this, I would greatly appreciate it if you could share your FBD (Function Block Diagram) code, ladder logic, or structured text implementation. Any insights into PID tuning, register mapping, or best practices for handling float values in OpenPLC would also be extremely helpful.

Looking forward to your responses. Thanks in advance!

Hello,

Factory IO is not an exact precision simulator, among other things because there are many factors that influence the communication between the program you use, the Factory IO scene, what you have on your PC, the scan cycles there are etc etc…

There are even times when the pieces do not behave the same on a tape, which is why this simulator is so interesting, because it is not perfect and the student must sharpen his ingenuity to make up for those imperfections.

The code you have must work if it is good, but you must test it in reality and not in a simulator, among other things because in a hypothetical case, (which will never be possible), if you manage to make it in Factory IO as perfect as you want, it will not work for you in reality and you will have to recalculate everything again.

Sometimes, the simplest things are what work best, extrapolating this to your case, you should think that if instead of using the PID formula, you do the coding simulating said PID, the results may surprise you.

You cannot ask Factory IO for more than what you can ask of it, it has certain limitations that we must take advantage of to, as I said, learn from and with them.

Greetings.

Hello,

Demonstration of the precision of FACTORY IO using this project already done a long time ago on my channel, we adapt it to the tank to check the valve limit, to do this we take it to 1% opening and we observe that it still fills very very slowly.

Let’s see the accuracy of FACTORY IO in this project using a bucket with a PID.

Also some construction details to attach to the project.

Greetings.

I also tried to do get a PID tuned for this simulation. What I noticed is, that the simulation is a little finicky, I got some massive oscillations quite quickly. It is possible to carefully tune it, but just to let you know.

Hello janbumer1:

That video only demonstrates that even at 1% the flow rate is stable, however, the calculations are not the real PID calculations, but a programmed simulation, I think that is the maximum that can be demanded of Factory IO

Greetings.