Building a custom fluid pumping machine

More
02 Apr 2019 00:47 #130124 by andypugh

I think you can probably make a HAL file executable. But I have never tried it. (#! /usr/bin/halrun ). I will try to remember to give it a try tomorrow.


OK, that works. Not that it is particularly important for what you need, but it's interesting.

If you save this code as a file called "something.hal" (it does need the .hal extension, it seems)
#! /usr/bin/halrun -I
loadrt stepgen step_type=0 ctrl_type=v
loadrt threads
addf stepgen.update-freq thread1
addf stepgen.make-pulses thread1
addf stepgen.capture-position thread1
start
setp stepgen.0.enable 1
setp stepgen.0.velocity-cmd 5
loadusr halmeter pin stepgen.0.position-fb
Then make it executable it will run as an executable Linux command.
(it loads realtime threads, loads a stepgen, sets it running at a constant speed and shows the position in a halmeter box)
The following user(s) said Thank You: Mike_Eitel

Please Log in or Create an account to join the conversation.

More
10 Apr 2019 00:25 #130581 by yoshimitsuspeed
So I'm still looking into options and linuxcnc is still probably in the top two right now. I would love to try and get a slightly better understanding of what specific process would be required and how hard it would actually be to accomplish.

What would have to be done outside of programming a python program?

I assume most of the process would be pretty similar to setting up linuxcnc. Install the OS, get everything set up so HAL, linuxcnc, whatever was talking to the mesa card, and then is it just a matter of writing the python program to do what we need?

Then what is involved in getting the glade display panel talking and working properly? Is this pretty easy?

I'm not sure if we would need help but I would definitely feel much more comfortable if andypugh or anyone else who was confident they could pull this off was willing to be available if we got stuck or needed help. Like I said we should be able to pay for their time.

Please Log in or Create an account to join the conversation.

More
10 Apr 2019 01:29 #130583 by cmorley
Can you draw approximately on paper what you want for a display and post it here?
Can you roughly describe how the pumps are to be controlled?

I am sure we can get this to work.
Chris M

Please Log in or Create an account to join the conversation.

More
10 Apr 2019 15:14 #130599 by yoshimitsuspeed
I have been trying to figure out how much I want to share publicly and or how to explain more without disclosing too much.
This is a start

The goal is to mix two liquids and air in precise measurements. The air pump is positive displacement so we hope we don't need any flow sensor on it but we may add one if needed. It will use a 3 ph motor with VFD. We want the RPM controlled by the program.
Liquid 1 will be pumped in a fairly low volume. I want to use a positive displacement pump here as well. Ultimately I am thinking probably stepper but for now I have ordered a 24v gear pump. The first stage will likely be running it just at 24v and dialing everything else in to dispense the proper ratios to match it. The next stage might be trying to control the voltage to control the speed and offer a range of flow rates. But ideally I would like it to be stepper driven to improve precision. A small Nema 23 motor will probably be plenty.

Liquid 2 will be a higher volume and is running off a 3 ph electric motor and VFD.

We definitely want the L1 and L2 flow meters rates to be displayed on the HMI. We also want the program to be able to use the flow rate data to change the pump speeds. So if a flow meter starts reading slow it will speed up the pump.

That should cover everything on the definite list so far.

At some point we may want to add more steppers that will run other components down the road. Beyond that we want it to be relatively easy to add hardware, features, or sensors as things evolve and grow.
Attachments:

Please Log in or Create an account to join the conversation.

More
10 Apr 2019 16:47 #130608 by Todd Zuercher
This definitely does not sound like a job for Linuxcnc. This is more of a simple PLC sort of job. But that doesn't mean that Linuxcnc (or parts of it) could not be made to do it. You should only need a simple gui and hal. You won't be needing the motion planner or any of that side of Linuxcnc.

Please Log in or Create an account to join the conversation.

More
10 Apr 2019 22:20 #130628 by yoshimitsuspeed
Yeah so then the question becomes which route should we take.
The other top competitor I have found is this setup.
velocio.net/plc-stepper-motor-control/

The prices look decent and it looks like it should be able to do everything we need. The price will probably be pretty similar to a mesa/linuxcnc route so then it comes down to which will be easier, more hassle free, and offer the most modularity, expandability and easy on the fly tweaking.

Their flow chart programming method looks like it would be pretty easy to learn but I haven't researched it enough yet to understand if it will easily do everything we need or what happens if we need a functionality that doesn't easily fit into one of it's boxes or things of that nature.

velocio.net/plc-stepper-motor-control/

I will keep looking into this option but I am still interested in the Mesa/HAL/linuxcnc route as well. My buddy who is familiar with python seems to be leaning more in the direction of something that utilizes that as well.

The Codesys option has moved lower on the list because we have a bit of a hard time wanting to rely on a pi for fault free operation and because the more advanced computer based Codesys options are a good bit more expensive. But it's still a possible option.

Please Log in or Create an account to join the conversation.

More
10 Apr 2019 22:55 #130629 by Badger
Posting your diagram is a big help. I use Linuxcnc on my rug making machine, and I use the Velocio PLCs on my yarn spinning mill. Of course Linuxcnc is great for motion control and can be made to run your pump. Each $49 Ace PLC can control up to 3 step & direction devices up to a combined step rate of 250k steps per second. To program a constant rate you give it a target destination which is a 32 bit number that would take a very long time to arrive at.(you can also have it reset to zero to go forever). I use two stepper motors to turn sets of rollers at different speeds to stretch the fiber out, and a servo to spin the flyer at 1350 rpm to twist the fiber. I have the accelerations all set to ramp up and down together and they always stay in sync. If you are using positive displacement pumps it should work fine without any feedback. Velocio also has PLC with greater I/O but they can still only control 3 motors. On my spinbot I use a second PLC on the part that moves the spool back and forth. I do not represent or get money from Velocio. They do have good customer service and helped me get things going. A quick video of my gadgets is at



Good luck

Please Log in or Create an account to join the conversation.

More
14 Apr 2019 21:32 #130875 by yoshimitsuspeed
I will call Velocio again tomorrow with a few more questions but if anyone has any input here it would be greatly appreciated. And then I am still wondering about which would have the best capability.
I do like the idea of using as much FOSS and public licensed stuff as possible. At some point we would hope to offer plans for someone to make a similar diy budget version if they wanted and if we got ours working with Mesa and Linuxcnc it should be pretty easy for someone with the right knowhow to convert that to using even much cheaper electronics if they really wanted.

If we don't need feedback that would be awesome but we definitely want to plan the capability in. Moreover we want that feedback to have a variable degree of control. So just to throw some numbers out there let's say we start with a 1-1% ratio so let's say the flow decreases by 2% the program increases the motor RPM by 2%, then if flow decreases by 10% the motor increases 10%. Then we find this causes a runaway problem so we would want to be able to change the curve so say maybe 2%=2% but 10% decrease in flow = 15% increase in RPM or something like that to make sure it stays within an acceptable range. And also with some degree of curve or a number of points inbetween averaging that out.
We would also want a few safety cutoffs. So say if the flow exceeded 10% for more than 4 seconds a warning light goes on and if say it exceeds more than 15% for more than 4 seconds the whole system shuts down. Or something like that.
We also want a couple other similar ones. For example if our air pressure line exceeds a set value it gives us a warning and or shuts down.
Another thing I know for sure we want to control is smoothing of our sensor inputs. Our flow sensors bounce all over the place and I believe it's because of the pulsation of our pump and I believe because the sensor is taking an instantaneous reading and then reporting that reading. So we will likely need to tell it to do something like take 100 readings, smooth them and then report that averaged number.
I assume these are all things that are possible in velocio but their tutorials are much more basic than this and I haven't found one that discusses things like compensation curves, sensor smoothing, etc.

I also am sure these are things that should be easily doable in linuxcnc but would love to know we had some support to fall back on if we needed. One issue though is I am hesitant to discuss too much technical detail in a public forum for now.

andypugh I did try to PM you but didn't see how or if that is possible on this board.
If I had some sort of comittment from one or more people to feel secure we had someone to fall back on if we got stuck I would feel pretty safe moving forward. Even better I would love to see some kind of rough draft as far as how they would code this or at least some components and how they would get everything working. I have a decent bit of knowledge on the hardware side and my friend is pretty good with python but he hasn't tried to do something specifically like this and there is plenty others know better than myself so I think it would be worth a bit to us to at least see how someone else might go about it even if just for guidance and inspiration on our own development.
We may even want to go so far as having people sign a basic NNN or something before moving forward but at that point I would be happy to email more detailed diagrams and discuss the project in more detail.
If you would be interested or willing to help us out let me know, or feel free to contact me at
sscott
at

inourhands
d0t love

Thanks

Please Log in or Create an account to join the conversation.

Time to create page: 1.331 seconds
Powered by Kunena Forum