Water Backup Logic Development

A forum for discussion on the software for the WMT River Control System
TerryJC
Posts: 2616
Joined: 16/05/2017, 17:17

Re: Water Backup Logic Development

Post by TerryJC »

Done.

I wasn't able to reduce the number of if structures in sumppi_control_logic() as much as I did in the water_backup_control_logic() function owing to the additional requirement to control the Gate Valve to different amounts at different levels. I have added the water depth value to the logging though.
Terry
hamishmb
Posts: 1891
Joined: 16/05/2017, 16:41

Re: Water Backup Logic Development

Post by hamishmb »

Looks good, only change is that the butts pump will now stay on until 300mm instead of 400mm, and then the gate valve will be opened - a bit inefficient. You probably want to leave the 500-400mm check in just to turn the butts pump off.
Hamish
TerryJC
Posts: 2616
Joined: 16/05/2017, 17:17

Re: Water Backup Logic Development

Post by TerryJC »

I did wonder if I'd gone too far
Terry
TerryJC
Posts: 2616
Joined: 16/05/2017, 17:17

Re: Water Backup Logic Development

Post by TerryJC »

Done.
Terry
hamishmb
Posts: 1891
Joined: 16/05/2017, 16:41

Re: Water Backup Logic Development

Post by hamishmb »

Looks good.

Note: For sump_reading >= 400 and sump_reading <= 500:, the reported levels in the logging and print statements are wrong, but I'm happy to fix that because I realise this is getting nit-picky.

Hopefully, I will test this towards the end of next week, will depend on how much other work I get through.
Hamish
hamishmb
Posts: 1891
Joined: 16/05/2017, 16:41

Re: Water Backup Logic Development

Post by hamishmb »

Okay, having a busy week and still lots to do so it'll have to be next week instead. That should be a quieter week I think.
Hamish
hamishmb
Posts: 1891
Joined: 16/05/2017, 16:41

Re: Water Backup Logic Development

Post by hamishmb »

Okay, see merge request at: https://gitlab.com/wmtprojectsteam/rive ... requests/9

Still need to get the VMs set up to test properly, but have made some minor modifications.
Hamish
TerryJC
Posts: 2616
Joined: 16/05/2017, 17:17

Re: Water Backup Logic Development

Post by TerryJC »

I've just been looking at the work needed to support the new Valve and Pump. I had naively believed that I would simply create a similar function to the one I did for the Sump water backup (see viewtopic.php?p=5880#p5880) in the Wendy Butts control function. However, I now realise that Wendy Butts Pi doesn't run a specific function because it currently doesn't control anything and simply monitors using the generic_control_logic() function.

We could still manage the new Gate Valve from sumppi because that is done using sockets logic. However, the new mains driven pump will need to be controlled from the Wendy Butts Pi, because the SSR Box is driven from a GPIO pin.

I've sort of got my head round how the logic for this works. We would have to add a new entry under G4 in config.py defining the pump as 'G4:P0' with the definition:

Code: Select all

"Class": Tools.deviceobjects.Motor,
"Pins":  (5)
We would then need new code to run in the Wendy Pi, so a new function would be required in controllogic.py to use instead of the generic_control_logic() function. Having got that far the control for the new Gate Valve should also be included in this new function.

Hamish,

Have you any thoughts on this?
Terry
hamishmb
Posts: 1891
Joined: 16/05/2017, 16:41

Re: Water Backup Logic Development

Post by hamishmb »

Yep, that's all right, except that the valve is controlled through the database, not the sockets.
Hamish
TerryJC
Posts: 2616
Joined: 16/05/2017, 17:17

Re: Water Backup Logic Development

Post by TerryJC »

Thanks. However, the exact method of control doesn't effect my code because I simply make the call to the Motor class having set up the parameters in config.py. Right?
Terry
Post Reply