Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ePBR pump usage #17

Open
xtrojak opened this issue Oct 29, 2019 · 5 comments
Open

ePBR pump usage #17

xtrojak opened this issue Oct 29, 2019 · 5 comments
Assignees
Labels
enhancement New feature or request

Comments

@xtrojak
Copy link
Collaborator

xtrojak commented Oct 29, 2019

Compared to PSI PBR, the change of the state of pump in ePBR is more complicated. It cannot be simply switched on and off. The pump works as following:

  1. it is turned on and additional medium is added to the bioreactor (takes 20 seconds)
  2. then the pump is turned off and another pump extracts extra medium from the bioreactor

The problem with point 2. is that the extraction pump is possibly shared with other devices.

Considering the given information, we propose the following implementation of set_pump_state for ePBR (has to be verified)

OD = measure_od()
while OD > min_OD:
     setAux1(1)             # this turns on the pump
     time.sleep(40)        # sleep 40 seconds, should be enough to accomplish steps 1. and 2.
     OD = measure_od()

such that min_OD is given to ePBR during initialisation.


Question for Jan:

We are still not sure how correctly use setAux1. It takes as argument 0/1, which should turn off/on the pump. As described above it is quite clear how setAux1(1) should be used. What is not clear, however, is whether after the "40 seconds" the state is set back to 0. Also it is not clear whether setAux1(0) has any effect at all - and if it does, what does it actually mean in the context of steps described above and on the pseudo-code provided above.

@xtrojak xtrojak added enhancement New feature or request question Further information is requested labels Oct 29, 2019
@JanCervenyy
Copy link
Member

JanCervenyy commented Nov 5, 2019

The implementation needs to be slightly modified according to the initial description (https://czechglobe-doab.slack.com/archives/CLN16B9CH/p1571978282001000), i.e. I would do it following way:

OD = measure_od()
while OD > min_OD:
     setAux2(1)             # this turns on the pump (works only if the pump goes from 0 to 1)
     time.sleep(20)        # sleep 20 seconds, should be enough to accomplish steps 1. and 2.
     setAux2(0)        # reset the pump to zero state that is necessary for success of next set of the pump
     time.sleep(20)
     OD = measure_od()

@xtrojak xtrojak removed the question Further information is requested label Nov 5, 2019
@xtrojak
Copy link
Collaborator Author

xtrojak commented Nov 5, 2019

It was just a testing close, the issue has not been resolved by implementation yet.

@xtrojak xtrojak reopened this Nov 5, 2019
@DanDayne
Copy link
Collaborator

DanDayne commented Nov 7, 2019

I tried to address this in this commit. I expect bugs to occur, but I do not have the resources to test it at the moment. @xtrojak could possibly try it out?

Basically, I added a pump manager which manages the pump state for ePBRs in its own thread - log messages should be consistent with other device classes.

@xtrojak
Copy link
Collaborator Author

xtrojak commented Nov 27, 2019

The pump manager is working, but will be possibly modified to more general usage.

@DanDayne
Copy link
Collaborator

DanDayne commented Dec 4, 2019

TODO: move pump manager to Phenometrics\PBR

@xtrojak xtrojak removed their assignment Jun 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants