Starting dosing automation at certain nOD

I am trying to set up a dosing automation profile that starts when the culture reachs a certain OD. Here is the profile I am using that ChatGPT generated:

experiment_profile_name: custom_chemostat_pr1_with_batch_mode
metadata:
  author: Your Name
  description: Custom chemostat operation for Pioreactor pr1 with initial batch mode growth for the first 5 hours, followed by chemostat operation maintaining constant stirring and temperature, with a dilution rate of 0.3 h⁻¹ (0.63 mL every 9 minutes) and growth rate estimation.
pioreactors:
  pr1:
    jobs:
      stirring:
        actions:
          - type: start
            hours_elapsed: 0.0
            options:
              target_rpm: 650.0
      temperature_control:
        actions:
          - type: start
            hours_elapsed: 0.0
            options:
              automation_name: thermostat
              target_temperature: 30.0
      od_reading:
        actions:
          - type: start
            hours_elapsed: 0.0
      growth_rate_calculating:
        actions:
          - type: start
            hours_elapsed: 0.0
      dosing_control:
        actions:
          - type: start
            hours_elapsed: 0.0
            if: pr1:od_reading:normalized_od >= 30
            options:
              automation_name: chemostat
              volume: 0.63
              duration: 9 # In minutes, which translates to 0.1 mL every 2.1 minutes

I think the line in particular that is giving me issues is this one

if: pr1:od_reading:normalized_od >= 30

Hi @kradical,

This is possible, but you currently have to use the repeat action to enable it. Maybe in a future release we’ll create a syntax to make these “start when X” easier. Until then, here’s your solution. Let’s discuss it:

  • normalized OD is called od_filtered and part of the growth_rate_calculating job, so we use that.
  • in pseudo-code, we define something like:
    while (od_filtered <= 30):
        wait 5min
        if (od_filtered > 30):
            start chemostat
        # since (od_filtered > 30), the while loop will break
    

In profile, this looks like:

experiment_profile_name: custom_chemostat_pr1_with_batch_mode

metadata:
  author: Your Name
  description: Custom chemostat operation for Pioreactor pr1 with initial batch mode growth for the first 5 hours, followed by chemostat operation maintaining constant stirring and temperature, with a dilution rate of 0.3 h⁻¹ (0.63 mL every 9 minutes) and growth rate estimation.

pioreactors:
  pr1:
    jobs:
      stirring:
        actions:
          - type: start
            hours_elapsed: 0.0
            options:
              target_rpm: 650.0
      temperature_control:
        actions:
          - type: start
            hours_elapsed: 0.0
            options:
              automation_name: thermostat
              target_temperature: 30.0
      od_reading:
        actions:
          - type: start
            hours_elapsed: 0.0
      growth_rate_calculating:
        actions:
          - type: start
            hours_elapsed: 0.0
      dosing_control:
        actions:
          - type: repeat
            hours_elapsed: 0.08 # start after 5m
            repeat_every_hours: 0.08 # check every ~5m
            while: pr1:growth_rate_calculating:od_filtered.od_filtered <= 30 
            actions:
              - type: start
                hours_elapsed: 0.079
                if: pr1:growth_rate_calculating:od_filtered.od_filtered > 30
                options:
                  automation_name: chemostat
                  volume: 0.63
                  duration: 9 # In minutes, which translates to 0.1 mL every 2.1 minutes
1 Like

Thank you,
I have run into another issue so I copied and pasted this profile to work for the workers in my clusters and it runs the profile fine in the leaders but it only starts the temperature automation in the workers.

pioreactors:
  pr2:
    jobs:
      stirring:
        actions:
          - type: start
            hours_elapsed: 0.0
            options:
              target_rpm: 650.0
      temperature_control:
        actions:
          - type: start
            hours_elapsed: 0.0
            options:
              automation_name: thermostat
              target_temperature: 30.0
      od_reading:
        actions:
          - type: start
            hours_elapsed: 0.0
      growth_rate_calculating:
        actions:
          - type: start
            hours_elapsed: 0.0
      dosing_control:
        actions:
          - type: repeat
            hours_elapsed: 0.08 # start after 5m
            repeat_every_hours: 0.08 # check every ~5m
            while: pr1:growth_rate_calculating:od_filtered.od_filtered <= 30 
            actions:
              - type: start
                hours_elapsed: 0.079
                if: pr1:growth_rate_calculating:od_filtered.od_filtered > 30
                options:
                  automation_name: chemostat
                  volume: 0.63
                  duration: 9 # In minutes, which translates to 0.1 mL every 2.1 minutes
  pr4:
    jobs:
      stirring:
        actions:
          - type: start
            hours_elapsed: 0.0
            options:
              target_rpm: 650.0
      temperature_control:
        actions:
          - type: start
            hours_elapsed: 0.0
            options:
              automation_name: thermostat
              target_temperature: 30.0
      od_reading:
        actions:
          - type: start
            hours_elapsed: 0.0
      growth_rate_calculating:
        actions:
          - type: start
            hours_elapsed: 0.0
      dosing_control:
        actions:
          - type: repeat
            hours_elapsed: 0.08 # start after 5m
            repeat_every_hours: 0.08 # check every ~5m
            while: pr1:growth_rate_calculating:od_filtered.od_filtered <= 30 
            actions:
              - type: start
                hours_elapsed: 0.079
                if: pr1:growth_rate_calculating:od_filtered.od_filtered > 30
                options:
                  automation_name: chemostat
                  volume: 0.84
                  duration: 9 # In minutes, which translates to 0.1 mL every 2.1 minutes

Hm, I’m not sure I understand. Can you explain the issue to me again?

When I tried running this automation it would start fine in the host but for the workers it would only show the temperature automation as having started.