Skip to content

Comments

Multiple hubs support in the same MultiPumpController, parallel transfer, better support for pump groups#7

Merged
Tyrannican merged 15 commits intocroningp:masterfrom
dcambie:misc_change_pull_req
Aug 12, 2019
Merged

Multiple hubs support in the same MultiPumpController, parallel transfer, better support for pump groups#7
Tyrannican merged 15 commits intocroningp:masterfrom
dcambie:misc_change_pull_req

Conversation

@dcambie
Copy link

@dcambie dcambie commented Aug 12, 2019

Allows multiple hub handling in MultiPumpController, this is useful
when more than 15 pumps are needed in the same project

This new implementation allows controlling pumps shared between
different controllers (i.e. different serial connections) effectively
allowing to control more than 15 pumps with the same object.

Rather than introducing a new, higher level of abstraction, the existing
MultiPumpController has been modified to allow both the former config
syntax (with the JSON settings assuming a one-to-one relationship
between serial connection and MultiPumpController) and the updated
syntax featuring a "hubs" parameter aggregating the pump settings per
serial connection, providing the I/O settings of each hub.

Note that, if the "hubs" parameter is provided in the configuration
dictionary, the latter configuration mode is assumed.

A new example (pycont_test_multihub.py and relative config) has been
added to clarify the matter.

A new method has been added to MultiPumpController called
parallel_transfer() for, you guessed it, parallel transfers across
multiple pumps when the volumes per each pump are not equal

Other less interesting methods added to the same class are:

  • get_all_pumps()
  • get_pumps_in_group()
  • wait_until_group_idle()

The version number has been bumped.
Many typos have been fixed.

Dario Cambie and others added 15 commits May 20, 2019 17:50
Jumper 5 has to be present only for operation with 3-WAY Y valves (but
not with 3-WAY T-valves).
However, is should never be present in 4-WAY operations, so we can check
for that.

Also, initialize at half plunger speed for syringes smaller than 1 ml
and improves get_current_valve_config()
If the pump is flashed via pycont a note is added in the field 20 of the
device EEPROM
Enable sending "u" commands to change pump EEPROM settings, e.g.
set_eeprom_lowlevel_config(2, 90) to set motor run current to 90%
instead of 75%

See manual Table 5-5 for commands reference
Method to get all the pump objects in the controller object or those
belonging to a specific group.
Not really necessary but allows this:

--- controller.apply_command_to_group('group', 'wait_until_idle')
+++ controller.wait_until_group_idle('group')

This is useful in cleaning cycles when 2 pumps are used at the same time
to fill and empty a container, as in:

# Empty container and prepare acetone for wash
waste_pump.pump(...)
acetone_pump.pump(...)
self.controller.wait_until_group_idle(group_name='cleaning_pumps')

# Deliver acetone and discard waste
waste_pump.deliver(...)
acetone_pump.deliver(...)
self.controller.wait_until_group_idle(group_name='cleaning_pumps')
This new implementations allows to control pumps shared between
different controllers (i.e. different serial connections) effectively
allowing to control more than 15 pumps with the same object.

Rather than introducing a new, higher level of abstraction, the existing
MultiPumpController has been modified to allow both the former config
syntax (with the JSON settings assuming a one-to-one relationship
between serial connection and MultiPumpController) and the updated
syntax featuring an "hubs" parameter aggregating the pump settings per
serial connection, providing the I/O settings of each hub.

Note that, if the "hubs" parameter is provided in the configuration
dictionary, the latter configuration mode is assumed.

A new example has been added to clarify the matter.

Version number has been bumped.
Unfortunately, if a dict of pumps and volumes only are passed, the valve
in and out have to be the same for all the pumps.

This is usually not a big deal as parallel transfer is performed among
group of similar pumps (oils, stock solutions etc) and it can be an acceptable
limitation.

Note that the previous version of transfer was already compatible with
parallel transfers if a list of pumps was passed as parameter, however
the volume across the different pumps had to be the same. This removes
only such limitation.

Friday afternoon considerations:
All of this is needed due to the blocking nature of transfer that has a
wait between pump and deliver.
If the C3000Controller was re-designed with threading so that each pump
is a thread that get locked during long transfer operation with only
terminate commands allowed that would fix all the problems.
A major re-design of pycont would be needed though.
(Reduces the diff with master for cleaner merge later)
@Tyrannican
Copy link
Contributor

Legend, merged!

@Tyrannican Tyrannican merged commit 201c33e into croningp:master Aug 12, 2019
@dcambie dcambie deleted the misc_change_pull_req branch August 12, 2019 16:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants