Detect running sequece

Hello guys,
my farmbot decided to kill all plants today. OK, when I start an sequence manually (testing modifications or farmbot was locked and I needed to water plants without schedule) and calendar starts and another (second) sequence, then both are running concurrently and it consequently de-initialize fambot in an middle of running sequence - disables constant Z motor powering. Consequently the Z axe falls slowly down until it reaches ground and the farmbot start killing all plants like crazy and precisely.

OK, my configuration is no encoders, limit switches (it is OK normally) and I enable/disable motor powering via lua script in the watering sequences (I have two - one intensive for babies and one for grown plants).

As a programmer I see two points where the fambor can get command to start an sequence and no scheduling mechanism like one-by-one rule, mutal exclusion on sequences, etc. .

Ok for sack of simplicity can I detect somehow running sequence (to at least stop the second sequence) ? Could be fine to rechedule sequences and postpone the second sequence, but this can have no soluton (vitually), I do not ask for this now. Just exit the second sequence if other is running.

Here is my log to explain all. The log starts at bottom (as in web interface). The first taks is running, accidentally second task is started and the first is finishing. Consequently the farmbot enables motors constant powering (Y,Z) as the task #2 starts and then it disables motors constant powering as the task #1 ends and finally the task #2 continues watering the plants which turns into killing the plants…

2 Info The Tool Verification sensor value is 0 (digital) (3610, 510, -850) May 28, 4:05pm
2 Info The Water peripheral value is OFF (digital) (3610, 510, -850) May 28, 4:05pm
2 Info Moving to (3610, 510, -850) (7300, 510, -850) May 28, 4:05pm
2 Info The Water peripheral value is ON (digital) (7300, 510, -850) May 28, 4:05pm
2 Info Moving to (7300, 510, -850) (7300, 250, -850) May 28, 4:04pm
2 Info The Tool Verification sensor value is 0 (digital) (7300, 250, -850) May 28, 4:04pm
2 Info The Water peripheral value is OFF (digital) (7300, 250, -850) May 28, 4:04pm
2 Info Moving to (7300, 250, -850) (3600, 260, -850) May 28, 4:04pm
task#2 2 Info The Water peripheral value is ON (digital) (3600, 260, -850) May 28, 4:04pm
task#1 1 Success water-May-23 Done (4570.2, 260, -850) May 28, 4:03pm
task#1 1 Success FarmBot suspend done (4570.2, 260, -850) May 28, 4:03pm
task#1 1 Success Y movements unlocked (5653.8, 260, -850) May 28, 4:03pm
task#1 1 Success Z movements unlocked (6978.2, 683.8, -634) May 28, 4:03pm
task#2 2 Info Moving to (3600, 260, -850) (7150, 850, -600) May 28, 4:03pm
task#2 2 Info The Tool Verification sensor value is 0 (digital) (7150, 850, -600) May 28, 4:03pm
task#2 2 Info Moving to (7150, 850, -600) (7400, 0, 0) May 28, 4:02pm
task#1 1 Info suspending the FarmBot (7400, 0, 0) May 28, 4:02pm
task#2 2 Info The Water peripheral value is OFF (digital) (7400, 0, 0) May 28, 4:02pm
task#2 1 Success FarmBot initailization is done. (7400, 0, 0) May 28, 4:02pm
task#2 2 Info Finding home on the Y axis (7400, 2790, 0) May 28, 4:01pm
task#1 1 Info water-line-n-times done (7400, 2790, -900) May 28, 4:00pm
task#2 2 Info Finding home on the Z axis (7400, 809.8, -900) May 28, 4:00pm
task#2 1 Success Y movements locked (7400, 809.8, -900) May 28, 4:00pm
task#2 1 Success Z movements locked (7400, 809.8, -900) May 28, 4:00pm
task#2 1 Info FarmBot initialization start (7400, 809.8, -900) May 28, 4:00pm
task#2 1 Info Starting water-May-23 new-230520 (7400, 809.8, -900) May 28, 4:00pm
task#1 1 Info water-line-n-times 3 (7400, 50, -900) May 28, 3:59pm
task#1 1 Info water-line-n-times 2 (7400, 2790, -900) May 28, 3:59pm
task#1 1 Info water-line-n-times 1 (7400, 50, -900) May 28, 3:58pm
task#1 2 Info The Water peripheral value is ON (digital) (7400, 50, -900) May 28, 3:58pm
task#1 2 Info Moving to (7400, 50, -900) (7230, 2260, -904) May 28, 3:57pm
task#1 2 Info The Tool Verification sensor value is 0 (digital) (7230, 2260, -904) May 28, 3:57pm
task#1 2 Info The Water peripheral value is OFF (digital) (7230, 2260, -904) May 28, 3:57pm
task#1 1 Info water-line-n-times done (7230, 2260, -904) May 28, 3:57pm
task#1 1 Info water-line-n-times 3 (6370, 2260, -904) May 28, 3:57pm
task#1 1 Info water-line-n-times 2 (7230, 2260, -904) May 28, 3:57pm
task#1 1 Info water-line-n-times 1 (6370, 2260, -904) May 28, 3:57pm
task#1 2 Info The Water peripheral value is ON (digital)

Some ideas ? Encoders are scheduled in future (no time). I can always check the calendar before I will run an sequence manually but this is not for humans, it is hell and will not work, only temporary.

It is much more complicated than some CNC or 3D printer - it is obvious. I love this project. The features it has are great and it is obvious you spent lot of time with it. I also like community and way the team communicates on this forum.

Thank you for all effort,
Jan

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.