Skip to content
This repository has been archived by the owner on Mar 20, 2022. It is now read-only.

Move Oil Refinery into Master #7

Open
prjpet opened this issue Jan 13, 2018 · 2 comments
Open

Move Oil Refinery into Master #7

prjpet opened this issue Jan 13, 2018 · 2 comments

Comments

@prjpet
Copy link

prjpet commented Jan 13, 2018

Hi,

First of all, many thanks for sharing this great project! I am using it for some research I do at the University of Amsterdam and I believe it's a great tool to simulate basics of liquid flow and modbus commands.

I've made my own adjustments to the oil-refinery branch, which you can find at https://github.com/prjpet/virtuaplant.

I have implemented the following additions:

  • An analogue valve in the middle pipe, controlled by PID logic (todo: the PID logic currently happens in the "word" application - this should be moved to the HMI)
  • a new level sensor in the separator tank
  • sequential logic, which runs a stable system forever

HOWEVER - THE MOST IMPORTANT FINDING IS THE FOLLOWING:

I have noticed that the collisions are flaky - "space" seems to keep a "history" of the object's collision space, even after the collision is removed.

SOLUTION:

You have to "redraw" the valves at ever update of the graphical environment. First all valves have to be drawn within the "while running:" loop within the run_world() function, then removed at the end of the loop, using space.remove(outlet) (for instance).

Kind regards,

Peter - peter.prjevara@os3.nl

@jseidl
Copy link
Owner

jseidl commented Jan 15, 2018

Hi! Thanks for your collaboration!

Is this the same project as https://github.com/bealerjm/virtuaplant/tree/master/plants/oil-refinery ? I'll be reviewing the code and putting into the main branch as soon as I can.

Indeed this physics library is completely flaky to say the least, I had to use fewer updates per second otherwise the collisions wouldn't be computed at all. I'm currently looking for alternatives to this library (pymunk).

I really wanted to try out Google's LiquidFun project google.github.io/liquidfun but they don't have python bindings yet. My goal is to have something that can provide more realistic fluids and also pressure and heat exchange capabilities.

If anyone knows a better suitability please let me know.

@prjpet
Copy link
Author

prjpet commented Jan 16, 2018

Well the oil-refinery, made by bealerjm and ike-clinton is a more mature end product, which in my opinion could easily be moved to the main branch. My branch contains some nice improvements such as:

  • a flow control valve, with a single loop controller,
  • an automated control sequence,
  • a more realistic master/slave relationship between the HMI and the WORLD, with the HMI sending all control commands.
  • and variable size and weight oil units
  • the improvement described above w.r.t. to the collisions - if the valves are redrawn after every cycle, the valves open smoothly

It requires some tidy up though, so I would not recommend moving it to the main branch as of yet.

I will keep an eye out for a more realistic library to be used!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants