Home Forums Software Pumping to selected volume every x minutes

Tagged: , ,

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #1339
    SinaBeier
    Participant

    Hello!
    I am trying to solve a similar problem to the one where you answered:

    Probably the easiest way to do so would be to add a conditional statement in the main loop of the code (the function runExperiment) which turns the pumps on every 12*60=720 cycles (since each cycle is nominally 60 seconds).
    You could to this in a similar way to the function already there to code the terminal which looks like this:

    if(sysData[M][‘Experiment’][‘cycles’]%10==9): #Dont want terminal getting unruly, so clear it each 10 rotations.
    clearTerminal(M)

    In your case you would want it to happen every 720 cycles (i.e. set the top line to have %720=1 or something) and then when that condition is true, set the pump rates to whatever you want and switch them on, and if the condition is false (i.e. add an else statement below it) turn the pumps off.

    I have a few questions on how to implement this as a custom program.
    1) The example custom programs which do something repeatedly have a step where they increase the timept by 1

    timept=int(sysData[M][‘Custom’][‘Status’]) #This is the timestep as we follow in minutes
    sysData[M][‘Custom’][‘Status’]=timept+1 #Increment time as we have entered the loop another time!<\blockquote>

    I am not sure why this is used in some of the custom programs and not in others or why this would be necessary at all.
    2) Then I want to pump out a percentage of the existing volume (so I can set a target volume) and later pump that back in from a medium to top up the volume back to the original.

    So the next question is, if I do what you said in the first quote, wouldn’t that just pump for the current timestep (1 minute) and then turn everything off the next minute even if the target volume has not been reached?
    If I set

    sysData[M][‘Pump2’][‘target’] = Pump2 * Pump2Direction
    SetOutputOn(M,’Pump2′,1)
    #then I have to wait until the ouptut pump is finished
    Pump2Ontime = sysData[M][‘Experiment’][‘cycleTime’] * 1.05 * abs(sysData[M][‘Pump2’][‘target’]) * \
    sysData[M][‘Pump2’][‘ON’] + 0.5
    time.sleep(Pump2Ontime)

    Then set the input pump (Pump1) to the original volume and pump medium back in.
    After all of that start stirring. That should work? Because if I set the condition to be a timepoint and stop the pumps when that condition is false, they should only pump for maximally a minute, right? I am just doing the programming part of the experiment, so I do not know how long it would take to reach the target volume.

    But how would I calculate the time the pump needs to be on properly, to reach the target volume? I can’t find a good example in the code. Maybe I am blind to it. And does what I am planning to do make any sense at all?

    #1340
    harrison
    Keymaster

    Hi Sina,
    I must say the description confused me; would it be possible for you to write down precise steps you want to achieve point-by-point?

    There is some ambiguity in what is meant by “volume reduction” in my mind. In particular, as the Chi.Bio is set up by default the “outlet” tube is only some way down into the reactor. It is set at a fixed height so that you can never reduce the volume in the reactor below the normal amount (20ml or so). That said, you can dilute it by adding fresh media and taking out a mixture of media + cells, but during that process the total volume remains (approximately) constant.

    If you really want to reduce the volume this is possible (but would require changing the height of the tube and would not be very effective), but it is somewhat unclear to me what you would gain based on your description.

    In my subsequent messages you referenced I suggested another approach which is to use the OD Regulation function already in the system. You could on a X hour loop do something like:
    1. Measure current OD (say, it is equal to 1.0)
    2. Turn on OD regulation with a target of 0.5 (i.e. half the measured value).
    3. Wait until OD has reached 0.5 (probably will take 5 minutes, though pumps are only on a fraction of the time). At this point half the cells + media have been removed (and replaced with fresh media).
    4. Turn off OD regulation and wait 12 hours before beginning step 1 again.

    Does that make sense?

    I am afraid I may have misinterpreted your specific goal, if so please do let me know what was meant 🙂

    • This reply was modified 3 years, 3 months ago by harrison.
    #1342
    SinaBeier
    Participant

    I think I could use RegulateOD() to do what I need. If I do not want to reach a goal OD, but would like to do it the equivalent of “pump out until volume is x and then fill back to normal amount”, how would I do that?
    Measure the OD, calculate what the OD would be if I removed volume X and pumped the same volume of medium back in, then RegulateOD to what I calculated?
    or can I just set sysData[M][‘Volume’][‘target’] without setting sysData[M][‘OD’][‘target’] and let it run its course?

    #1343
    harrison
    Keymaster

    The difference between that proposal and what I am suggesting is that my suggestion is pumping out/in at the same time, while keeping the volume constant.

    In practice what you are suggesting (reduce volume then pump back in fresh media) will yield the same result as setting a specific OD reduction target (i.e. reduce OD by half) – is this not correct?

    #1344
    SinaBeier
    Participant

    The difference between that proposal and what I am suggesting is that my suggestion is pumping out/in at the same time, while keeping the volume constant.

    I don’t necessarily have to pump out first, then back in. But I would have to pump out (& in at the same time) a fixed volume, not to reach a fixed OD. Can I do that using RegulateOD()? Maybe by calculating the OD I would reach if I replaced the volume I want to remove with medium? (Which then supposedly should result in what I want when setting the right target OD?)

    • This reply was modified 3 years, 3 months ago by SinaBeier.
    • This reply was modified 3 years, 3 months ago by SinaBeier.
    #1347
    SinaBeier
    Participant

    This is roughly what I have right now (in a custom program):

    timept=int(sysData[M][‘Custom’][‘Status’]) #This is the timestep as we follow in minutes
    sysData[M][‘Custom’][‘Status’]=timept+1 #Increment time as we have entered the loop another time!

    #We have 2 custom parameters. Max volume and “reduced volume” (goal volume)
    sysData[M][‘Custom’][‘param1’] =float(Params[0]) #max volume, probably 20.0
    sysData[M][‘Custom’][‘param2’] = float(Params[1]) #goal volume
    #For now I am just trying to do something every hour
    timelength = 60 # time interval in minutes
    if (timept % timelength == 2): # So this happens every hour!

    GoalVolume = sysData[M][‘Custom’][‘param2’]
    sysData[M][‘Volume’][‘target’] = GoalVolume
    ODNow = sysData[M][‘OD’][‘current’]
    ODTarget = 0 #We probably also need to set that, based on ODNow and GoalVolume
    sysData[M][‘OD’][‘target’] = ODTarget

    #Now we can have it regulate the OD based on OD and/or Volume target
    RegulateOD(M)

    Volume = sysData[M][‘Volume’][‘target’]

    The question is do I need to calculate the ODTarget, or can I just co with a GoalVolume? If I need to calculate it, how?

    • This reply was modified 3 years, 3 months ago by SinaBeier.
    • This reply was modified 3 years, 3 months ago by SinaBeier.
    #1350
    harrison
    Keymaster

    OK – but I think the two goals (volume change vs OD change) can be made to go hand in hand.
    That is, if you have a calibrated OD then in theory OD is linearly proportional to cells per unit volume.
    Thus if I halve my OD (from 1.0 to 0.5 say) then that is the same as taking 20ml of cells, reducing volume to 10ml, then adding in fresh media back to 20ml – right?

    I think confusion might have come from the use of the sysData[M][‘Volume’][‘target’] in the system. This parameter does not “control” anything. The volume in the software is only there to help the OD regulation algorithm’s accuracy. So setting a Goal Volume there would not solve it.
    What I think you need to do is as in my above post with the steps laid out. You have the right time check in there (i.e. the timept % timelength==2) to start the process, but what you should instead do is inside that if statement set OD target = 0.5*ODNow (for example), then turn on Regulate OD.
    Then, OUTSIDE that If statement, have another check which does something like (if ODNow

    • This reply was modified 3 years, 3 months ago by harrison.
    #1351
    SinaBeier
    Participant

    Thank you! I think that will help a lot to get this working.

    #1352
    SinaBeier
    Participant

    But I think a part at the end of your reply got missing?

    • This reply was modified 3 years, 3 months ago by SinaBeier.
    #1355
    harrison
    Keymaster

    I see what you mean, the last line was meant to say “Then, OUTSIDE that If statement, have another check which does something like (if ODNow is less than target ODTarget then turn off RegulateOD).”

    • This reply was modified 3 years, 3 months ago by harrison.
Viewing 10 posts - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.
Log in/Register
Scroll to top