Multiple hubs support in the same MultiPumpController, parallel transfer, better support for pump groups#7
Merged
Tyrannican merged 15 commits intocroningp:masterfrom Aug 12, 2019
dcambie:misc_change_pull_req
Merged
Multiple hubs support in the same MultiPumpController, parallel transfer, better support for pump groups#7Tyrannican merged 15 commits intocroningp:masterfrom dcambie:misc_change_pull_req
Tyrannican merged 15 commits intocroningp:masterfrom
dcambie:misc_change_pull_req
Conversation
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.
Clarifies old and new code
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)
Contributor
|
Legend, merged! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
The version number has been bumped.
Many typos have been fixed.