Pumps randomly diluting out the culture


Culture in vial 2 was diluted out - it is unclear what triggered the signal.

EDIT 3/21/2019
The cause of the random dilution events was from the errors in socket communication causing reconnect events. This would cause a spike in the optical density measurements (still undetermined why exactly). As a quick fix to the issue, custom_script.py was modified, courtesy of @heinsz. Briefly, instead of averaging the last few values for trigger dilution events, the script was modified to calculate the median, which would be less sensitive to outliers.

Can you paste in what is logged in the pump_log for vial 2? Thanks so much!

This issue can be connected with the previous one


Hi @fkuzminov,

We’re still thinking through the root cause of the problem, but for now, I think using your suggestion of using the median value instead of the mean could help.

In custom_script.py:

        # Determine whether turbidostat dilutions are needed
        if len(data) > 7:
            # Take median to avoid outlier
            od_values_from_file = []
            for n in range(1,7):
            average_OD = float(np.median(od_values_from_file))

This should replace the following around line 103:

        if len(data) > 7:
            for n in range(1,6):
                average_OD = average_OD + (data[len(data)-n][1]/5)

One good way to test this is to continue the experiment you are running right now, but turn OFF the pump array. You can look at the dilution events and see if these events still happen where they randomly trigger a high value, on a disconnect event.

Also, you can simulate a similar disconnect event by toggling OFF the eVOLVER power (both 5V and 12V) in the middle of an experiment. This will result in the error similar to the ones you’ve been seeing.

@heinsz @bgwong
Thanks for the code - I’ll try to continue the old experiment and see if it helps with random spikes

@bgwong @heinsz

Just got another error (see image)20190322_904