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

refactor(shared-data): update plunger motor configs #13372

Closed

Conversation

caila-marashaj
Copy link
Contributor

@caila-marashaj caila-marashaj commented Aug 23, 2023

Due to mechanical changes, the PVT single channel pipette needs to run at a lower current than other pipette models.

Additionally, after some period without use, all pipette plungers, except the 96 channels, will need to home using 1A motor current to overcome their static friction.

This branch is just these couple of changes, however I'd like a quick sanity check before merging to make sure that speed won't be an issue during homing. It looks like homing for the first time after attaching will happen using the _build_home_pipettes_runner function, in which case the speed chosen should be 5 mm/sec.

@codecov
Copy link

codecov bot commented Aug 23, 2023

Codecov Report

Merging #13372 (e9020b3) into chore_release-7.0.0 (880a5de) will decrease coverage by 0.26%.
Report is 23 commits behind head on chore_release-7.0.0.
The diff coverage is 47.61%.

Impacted file tree graph

@@                   Coverage Diff                   @@
##           chore_release-7.0.0   #13372      +/-   ##
=======================================================
- Coverage                71.67%   71.41%   -0.26%     
=======================================================
  Files                     2427     1585     -842     
  Lines                    67649    52667   -14982     
  Branches                  7808     3437    -4371     
=======================================================
- Hits                     48486    37614   -10872     
+ Misses                   17334    14523    -2811     
+ Partials                  1829      530    -1299     
Flag Coverage Δ
app 43.28% <ø> (-26.75%) ⬇️
g-code-testing 96.44% <ø> (ø)
hardware-testing ∅ <ø> (∅)
notify-server 89.13% <ø> (ø)
shared-data 74.34% <40.00%> (-0.03%) ⬇️
step-generation 87.25% <0.00%> (+0.06%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Changed Coverage Δ
api/src/opentrons/hardware_control/ot3api.py 79.43% <ø> (ø)
api/src/opentrons/protocol_api/protocol_context.py 91.90% <ø> (+0.47%) ⬆️
...opentrons/protocol_engine/commands/load_labware.py 100.00% <ø> (ø)
...i/src/opentrons/protocol_engine/errors/__init__.py 100.00% <ø> (ø)
...src/opentrons/protocol_engine/errors/exceptions.py 100.00% <ø> (ø)
...l-designer/src/components/steplist/ContextMenu.tsx 3.84% <0.00%> (-2.57%) ⬇️
...-server/robot_server/service/legacy/models/logs.py 100.00% <ø> (ø)
...server/robot_server/service/legacy/routers/logs.py 100.00% <ø> (ø)
...s_shared_data/pipette/scripts/build_json_script.py 0.00% <0.00%> (ø)
...neration/src/commandCreators/atomic/moveLabware.ts 73.68% <0.00%> (ø)
... and 5 more

... and 844 files with indirect coverage changes

@caila-marashaj caila-marashaj changed the title new pipette current configs refactor(sahared-data): update plunger motor configs Aug 24, 2023
@caila-marashaj caila-marashaj marked this pull request as ready for review August 24, 2023 16:28
@caila-marashaj caila-marashaj requested a review from a team as a code owner August 24, 2023 16:28
@vegano1
Copy link
Contributor

vegano1 commented Aug 24, 2023

Nice!
Let's retarget this for the 7.0.0 release branch

@caila-marashaj caila-marashaj requested review from a team as code owners August 24, 2023 18:03
@caila-marashaj caila-marashaj requested review from smb2268 and removed request for a team August 24, 2023 18:03
@caila-marashaj caila-marashaj force-pushed the pipette-plunger-current-changes branch 2 times, most recently from 115fdb2 to e86c105 Compare August 24, 2023 18:09
@caila-marashaj caila-marashaj changed the base branch from edge to chore_release-7.0.0 August 24, 2023 18:20
@caila-marashaj caila-marashaj changed the base branch from chore_release-7.0.0 to edge August 24, 2023 18:23
@caila-marashaj caila-marashaj changed the title refactor(sahared-data): update plunger motor configs refactor(shared-data): update plunger motor configs Aug 24, 2023
@caila-marashaj caila-marashaj changed the base branch from edge to chore_release-7.0.0 August 24, 2023 18:31
Copy link
Contributor

@Laura-Danielle Laura-Danielle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Gotta update the json schema to reflect the new change to plunger positions
  2. Don't forget to make sure we remove the auto-generated junk that replaced uL in some of the pipette definitions.

@@ -97,6 +97,7 @@ def _build_motor_configurations(
if model_configurations:
run = model_configurations["plungerCurrent"]["value"]
idle = model_configurations.get("idleCurrent", run)
homing = model_configurations["plungerHomingCurrent"]["value"]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this instance, you wouldn't use the build_json_script.py but the update_configuration_files.py when you're updating files. (Just for future reference).

api/src/opentrons/hardware_control/ot3api.py Outdated Show resolved Hide resolved
instr = self._pipette_handler.hardware_instruments[mount]

if instr is not None:
await self._backend.set_active_current(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
await self._backend.set_active_current(
async with self._backend.restore_current():
await self._backend.set_active_current(

(The home will also need to be wrapped in this)

Copy link
Member

@sfoster1 sfoster1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agree with laura's comments, need to fix that mu. probably can do it with find and replace in your editor.

@@ -1,6 +1,6 @@
{
"$otSharedSchema": "#/pipette/schemas/2/pipettePropertiesSchema.json",
"displayName": "Flex 8-Channel 1000 μL",
"displayName": "Flex 8-Channel 1000 \u03bcL",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

whoa buddy

@@ -1295,6 +1295,16 @@ async def _retrieve_home_position() -> Tuple[
await self._backend.home([axis], self.gantry_load)
else:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

homing current should be used for all homing actions, not just the initial homing motion. This is because the static friction issue can happen regardless of if the pipette is powered on or off, it just needs to be still for the problem to happen.

Because non-initial homing motions include that faster move to get close to the endstop, we'll need a per-pipette homing-speed that is used as a motion constraint for the plunger axis during this faster movement.

The currently used default max-speed for 1ch/8ch plungers is 70 while 96ch is 15. So for example, during homing we can instead constrain these to be 30 for 1ch/8ch and 5 for 96ch

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh and we should also be setting the pipette's run current during all other plunger motions, which right now does not include the movement that happens inside OT3API._move_to_plunger_bottom() but it should.

@@ -17,7 +17,8 @@
},
"plungerMotorConfigurations": {
"idle": 0.3,
"run": 0.8
"run": 0.8,
"homing": 0.8
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's set this to 2.2 then test on a few 96ch to see if it needs changing. Ideally we can use the motor's max rated current so we can get the most torque out of it to overcome any static-friction that may have built up.

Same goes for the v3_4.json 96ch

"plungerMotorConfigurations": {
"idle": 0.05,
"run": 0.3,
"homing": 1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't remember what the OT2 does for homing, but ideally this PR doesn't affect it at all and the configurations don't describe values that aren't accurate.

@caila-marashaj caila-marashaj force-pushed the pipette-plunger-current-changes branch 2 times, most recently from 5d94e9d to e9020b3 Compare August 29, 2023 16:20
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.

5 participants