Posts: 260
Threads: 37
Likes Received:
0 in 0 posts
Likes Received:
0 in 0 posts
Reputation:
1
Joined: Jul 2016
Country:
With the possibility for dosing more times a day and even at night the thought of something going wrong with the dosing pumps scared me a little.
Of course a hardware failure couls occur but I was thinking:
is it possible to monitor the dosing pump output and intervene when dosing "hangs"...
Posts: 3,239
Threads: 90
Likes Received:
163 in 120 posts
Likes Received:
163 in 120 posts
Reputation:
184
Joined: Sep 2015
Country:
Hi Arne, yes I hear you. One thing you might try is running a pump manually and while its running power down the controller completely, then power it up again and the pump shouldn't be running. With that said, the last update I added a watchdog timer, this monitors the Arduino main loop. The Arduino runs in a constant loop over and over and everytime the loop runs (takes a couple milliseconds) it resets the watchdog timer. If the timer doesn't get reset within 15 seconds the Arduino restarts. So if something was to hang the controller the maximum time the dosing pump would run is 15 seconds.
I do have plans to add logs for all the equipment, for the dosing pumps I'll probably have it show the time the pump ran and how long it ran for.
If you can think of something else that might help I can think about adding it.
Posts: 260
Threads: 37
Likes Received:
0 in 0 posts
Likes Received:
0 in 0 posts
Reputation:
1
Joined: Jul 2016
Country:
I have to go out for an 1 1/2 hour now Rob, I will get back to you when I'm home again...
Posts: 260
Threads: 37
Likes Received:
0 in 0 posts
Likes Received:
0 in 0 posts
Reputation:
1
Joined: Jul 2016
Country:
Hi Rob,
It is great you already implemented the watchdog... ;-)
What I mean, and you see this also in medical dosing, that no matter what, the dosing pump cannot run longer then XXX seconds.
I'm not a programmer but when I think about this, I think of an extra monitor on the dosing pump output, completely separated from the scheduler/timer or whatever...
Posts: 3,239
Threads: 90
Likes Received:
163 in 120 posts
Likes Received:
163 in 120 posts
Reputation:
184
Joined: Sep 2015
Country:
I'll think about it more and see if I can add a backup, this is how its setup and has changed over time. Obviously the Arduino on the controller turns the dosing pumps on/off, in the main loop that runs over and over, its always going through code to shut down the dosing pumps. When a pump starts up a flag is set so the controller knows its running and the timer to turn it off begins. The code to turn off the code sees the flag was set and shuts down the pump when the timer expires. So basically the controller is always trying to turn them off and if it happens to lock up while a pump is running the Arduino should restart stopping the pumps.
Posts: 260
Threads: 37
Likes Received:
0 in 0 posts
Likes Received:
0 in 0 posts
Reputation:
1
Joined: Jul 2016
Country:
Okay Rob, that already sound great to me.
You're the expert so I leave it up to you to decide whether it would bring something or not... ;-)
Posts: 3,239
Threads: 90
Likes Received:
163 in 120 posts
Likes Received:
163 in 120 posts
Reputation:
184
Joined: Sep 2015
Country:
I am confident the pumps won't keep running especially with the watchdog. Only reason it wouldn't stop is if controller locked up but watchdog should solve that. I'm always thinking of ways to improve the code, if I think of something I'll definitely make changes.
Posts: 260
Threads: 37
Likes Received:
0 in 0 posts
Likes Received:
0 in 0 posts
Reputation:
1
Joined: Jul 2016
Country:
Good to hear that Rob, thanks !