awasen
Posts: 4
Joined: Thu Sep 14, 2017 1:13 pm

Solution for water pump control, RPi suitable?

Thu Sep 14, 2017 1:29 pm

We have a watering system for several households where we pump water from a nearby lake.

There are two pumps where the speed is controlled by two frequency controllers of 0-50 Hz and 400VAC.
There is a pressure sensor (0-10 bar) that today feeds a PLC. If the pressure is 0-5 bar both pumps spin at 50Hz (max speed), above 5 bar up to 7 bar first one pump scales down towards 0Hz and then the other pump. At 7 bars pressure both pumps are at standstill at 0Hz.

The frequency controllers is controlled by a VDC between 0-5VDC, e.g. 3VDC input means 30Hz to the motor.

The PLC is old and has been overheating a lot this summer so it needs replacing. I've already built a simple temperature and pressure control in the RPi using a Arduino One board so I figured I could continue on that project and add the frequency control as well...

Would this be something that I could build?
Is there already something similar?

What do I need to adjust the 0-5VDC output to the frequency controllers?

User avatar
OutoftheBOTS
Posts: 341
Joined: Tue Aug 01, 2017 10:06 am

Re: Solution for water pump control, RPi suitable?

Thu Sep 14, 2017 9:08 pm

If I am understanding your question properly you want to be able to output an analog voltage between 0v - 5v from a RPi. You need a DAC (digital to analog converter). Quite often using PWM will work.

A solution might be to output PWM to pin 18 and set the duty cycle as ur output level i.e if you want 0v then set duty cycle to 0% if you want want 5v then set duty cycle to 100% then this will output the PWM to pin 18 at 3v so you will need then to convert it to 5v with a level shifter (transistor )

User avatar
Ronaldlees
Posts: 224
Joined: Sat Apr 16, 2016 4:28 pm
Location: North Carolina, US
Contact: Website

Re: Solution for water pump control, RPi suitable?

Sun Sep 17, 2017 5:22 pm

I've seen some other projects on the forum here, to do what you want to do. In general, I'm against using a complex architecture to do a simple task. For example, my HVAC unit has an 8 bit MCU for control. It hasn't done anything wrong, nor has it reset in 15 years.

Cuz it's simple.

How much trouble has your PLC pump controller been? You say it's old, so that implies it's been doing neo-man's work for a long time? Or not?

The Pi *will* eventually hang. It has a software load that is considerable. All that software (Linux, and other things, including tons of third party stuff) - is simply more difficult to keep lined up all the time than less complex solutions. Some might say, impossible.

So, what are the downsides if the Pi hangs (more correctly, some piece of software causes it to hang) - and the pumps just keep on running? I'm not saying it can't be made reliable, but you'd need to immerse yourself into the world of watchdogs and the like to guard against the Pi's tripup. And then there's the power isolation issues that would need to be handled. It's not an expert's opinion here, but one I firmly believe in.
I am The Umbrella Man

awasen
Posts: 4
Joined: Thu Sep 14, 2017 1:13 pm

Re: Solution for water pump control, RPi suitable?

Mon Sep 18, 2017 5:34 am

Good points, Ronaldlees...

The current PLC unit "dies" now and again. I think it is because of some heat-up in it and it has not had the same problem since I left the cabinet open (to let more air in). It is however not very stable and needs to be replaced!

If the pumps stop then we won't have any water but it is water used for watering home-gardening, lawns and filling an occasional pool or two so no one is fully dependent on the water. Communal water here in Sweden is not expensive but it is considered a "waste of drinking water" to water your lawn with it so we pump directly from the sea as we have that opportunity and as we are on a small island in the same sea the water (or most of it) will return back to the same sea...

Anyhow, as I am building a monitoring solution on RPi anyway to monitor the pressure and temperature of the pumps (to not have them run dry for too long) I figured to add the "PLC" logic in there as well...

When you say that the RPi will occasionally "hang/crash". How often would you estimate that happening?

User avatar
rpdom
Posts: 11543
Joined: Sun May 06, 2012 5:17 am
Location: Essex, UK

Re: Solution for water pump control, RPi suitable?

Mon Sep 18, 2017 5:48 am

awasen wrote:
Mon Sep 18, 2017 5:34 am
If the pumps stop then we won't have any water but it is water used for watering home-gardening, lawns and filling an occasional pool or two so no one is fully dependent on the water. Communal water here in Sweden is not expensive but it is considered a "waste of drinking water" to water your lawn with it so we pump directly from the sea as we have that opportunity and as we are on a small island in the same sea the water (or most of it) will return back to the same sea...
Isn't most of Sweden small islands? (Lovely country, my wife and I are going to Stockholm in a few weeks).

Is the "sea" water fresh, or is it salty? I presume you do know what you're doing, but I wouldn't put salty water on my garden.
When you say that the RPi will occasionally "hang/crash". How often would you estimate that happening?
I've been partially controlling my house heating from a Pi B for over three years now. The only time it has caused a problem is when the power has failed. It is still using the original SD card. Current uptime is 172 days. It monitors the temperature in the room and switches a relay wired across the timer switch of the main heating system. This is safe because the heating still has all of its protection circuits in place - it won't go above a certain temperature and will stop working if there are any problems. I'd rather it fail "cold" than explode :lol:

Maybe one day I'll put a small electric heater in as a backup, controlled by another Pi and only switch on if the heating Pi appears to have failed.

awasen
Posts: 4
Joined: Thu Sep 14, 2017 1:13 pm

Re: Solution for water pump control, RPi suitable?

Tue Sep 19, 2017 2:58 pm

rpdom wrote:
Mon Sep 18, 2017 5:48 am
Isn't most of Sweden small islands? (Lovely country, my wife and I are going to Stockholm in a few weeks).
Well, no, Sweden is by most part one big landmass but has many archipelagos of island "clusters". The largest is several thousands of islands (of various size) west of Stockholm called the Stockholm Archipelago. Stockholm itself is made up of islands (14 of them actually).
rpdom wrote:
Mon Sep 18, 2017 5:48 am
Is the "sea" water fresh, or is it salty? I presume you do know what you're doing, but I wouldn't put salty water on my garden.
It is Fresh water. Actually the same sea as where most of the Stockholm region gets their fresh water in the taps from. The water from the lake Mälaren is first filtered through sand beds and then filtered and treated before it comes to our taps. It is among the cleanest water in the world so don't spend your money on bottled water while coming here. The tap water in Stockholm actually has less bacteria and impurities than most bottled waters... :)

As stated already it's no disaster if the pumps stops and having an up-time of 172 days would be more than good enough. We only run the pumps from May to October anyways...

Hoagie
Posts: 118
Joined: Sun Sep 23, 2012 7:19 pm

Re: Solution for water pump control, RPi suitable?

Fri Sep 22, 2017 7:17 pm

You don't mention much about the pressure sensors, but as you mention you have a monitor on the Pi, I guess you have that covered anyway. Look on eBay for ADC modules to do the analogue outputs. I'm sure there will be something that can give 0-5V.

As mentioned earlier, the Pi isn't really intended for mission critical operations, but if you don't mind having to re boot it every 6 months or so, you'll be fine. I'd make sure you have a spare SD card cloned from the main one as soon as you get it all working, just in case it gets corrupted.

awasen
Posts: 4
Joined: Thu Sep 14, 2017 1:13 pm

Re: Solution for water pump control, RPi suitable?

Sat Oct 14, 2017 9:25 am

Hoagie wrote:
Fri Sep 22, 2017 7:17 pm
You don't mention much about the pressure sensors, but as you mention you have a monitor on the Pi, I guess you have that covered anyway. Look on eBay for ADC modules to do the analogue outputs. I'm sure there will be something that can give 0-5V.

As mentioned earlier, the Pi isn't really intended for mission critical operations, but if you don't mind having to re boot it every 6 months or so, you'll be fine. I'd make sure you have a spare SD card cloned from the main one as soon as you get it all working, just in case it gets corrupted.
Yes, got a cheap pressure sensor from eBay with 15mm connection. No problem to reboot now and again!

Good idea with the backup SD card!
I hadn't thought about that.

I am currently rewriting my old "sensor" program into Node.js on the PI...

Return to “Automation, sensing and robotics”

Who is online

Users browsing this forum: No registered users and 14 guests