Skip to content

Commit

Permalink
96ch
Browse files Browse the repository at this point in the history
  • Loading branch information
nbshiland committed Aug 5, 2024
1 parent a70b7e6 commit 1510924
Show file tree
Hide file tree
Showing 4 changed files with 76 additions and 35 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -714,14 +714,14 @@ def _build_tip_motor_moves(
Axis.Q: tip_motor_current,
},
),
TipActionMoveSpec(
distance=prep_move_dist + clamp_move_dist,
speed=clamp_move_speed,
currents={
Axis.P_L: plunger_current,
Axis.Q: tip_motor_current,
},
),
# TipActionMoveSpec(
# distance=prep_move_dist + clamp_move_dist,
# speed=clamp_move_speed,
# currents={
# Axis.P_L: plunger_current,
# Axis.Q: tip_motor_current,
# },
# ),
]

@staticmethod
Expand Down Expand Up @@ -944,7 +944,7 @@ def plan_lt_drop_tip(
shake_off_moves=shakes,
)

def plan_ht_drop_tip(self) -> TipActionSpec:
def plan_ht_drop_tip(self, removal: int = 0) -> TipActionSpec:
mount = OT3Mount.LEFT
instrument = self.get_pipette(mount)
config = instrument.drop_configurations.cam_action
Expand Down
4 changes: 2 additions & 2 deletions api/src/opentrons/hardware_control/ot3api.py
Original file line number Diff line number Diff line change
Expand Up @@ -2189,7 +2189,7 @@ async def _tip_motor_action(
await self._backend.tip_action(
origin={Axis.Q: gear_origin_float}, targets=move_targets
)
await self.home_gear_motors()
#await self.home_gear_motors()

def cache_tip(
self, mount: Union[top_types.Mount, OT3Mount], tip_length: float
Expand Down Expand Up @@ -2260,7 +2260,7 @@ def _remove_tips() -> None:
await self._move_to_plunger_bottom(realmount, rate=1.0, check_current_vol=False)

if self.gantry_load == GantryLoad.HIGH_THROUGHPUT:
spec = self._pipette_handler.plan_ht_drop_tip()
spec = self._pipette_handler.plan_ht_drop_tip(removal)
await self._tip_motor_action(realmount, spec.tip_action_moves)
else:
spec = self._pipette_handler.plan_lt_drop_tip(realmount, removal)
Expand Down
18 changes: 11 additions & 7 deletions hardware-testing/hardware_testing/scripts/find_coords.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,18 @@ async def _main(simulate: bool, tiprack: str, removal: int):
protocol = helpers.get_api_context(
"2.18", # type: ignore[attr-defined]
is_simulating=simulate,
pipette_left="p1000_multi_flex",
pipette_left="p1000_96",
)
for offset in LABWARE_OFFSETS:
engine = protocol._core._engine_client._transport._engine # type: ignore[attr-defined]
engine.state_view._labware_store._add_labware_offset(offset)
if offset.id not in engine.state_view._labware_store._state.labware_offsets_by_id:
engine.state_view._labware_store._add_labware_offset(offset)
else:
print(f"Labware offset ID {offset.id} already exists.")

hw_api = get_sync_hw_api(protocol)
for i in range(25):
hw_api.cache_instruments(require={Mount.LEFT: "p1000_multi_flex"})
hw_api.cache_instruments(require={Mount.LEFT: "p1000_96"})
attached = hw_api.attached_pipettes
try:
print(attached[Mount.LEFT])
Expand All @@ -67,7 +70,7 @@ def run(protocol: protocol_api.ProtocolContext, tiprack: str, removal: int) -> N
print("7")

# Instrument setup
pleft = protocol.load_instrument("flex_8channel_1000", "left")
pleft = protocol.load_instrument("flex_96channel_1000", "left")
print("8")
# DECK SETUP AND LABWARE
tiprack_1 = protocol.load_labware(tiprack, location="D1")
Expand Down Expand Up @@ -97,11 +100,12 @@ def run(protocol: protocol_api.ProtocolContext, tiprack: str, removal: int) -> N
hw_api = get_sync_hw_api(protocol)
print("10")

hw_api.move_to(Mount.LEFT, Point(327,25,200))
hw_api.move_to(Mount.LEFT, Point(334,26,250))
input("Press Enter to continue...")

for i in list(range(100)):
#Limits are 455,416,250
hw_api.move_to(Mount.LEFT, Point(327,25,150-i))
#Center chute for 96ch 50 and 200: 334,26,128, 150 for 1000uL
hw_api.move_to(Mount.LEFT, Point(334,26,150))
print(i)
time.sleep(2)
protocol.home()
Expand Down
71 changes: 54 additions & 17 deletions hardware-testing/hardware_testing/scripts/static_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
pass


async def _main(simulate: bool, tiprack: str, removal: int, tip_location: int, tip_type: int, pipette_size: int):
async def _main(simulate: bool, tiprack: str, removal: int, tip_location: int, tip_type: int, pipette_size: int, nozzles, nozzle2):
print("3")
"""
if not simulate:
Expand Down Expand Up @@ -165,7 +165,7 @@ async def _main(simulate: bool, tiprack: str, removal: int, tip_location: int, t
protocol = helpers.get_api_context(
"2.18", # type: ignore[attr-defined]
is_simulating=simulate,
pipette_left="p1000_single_flex",
pipette_left= nozzle2,
)

for offset in LABWARE_OFFSETS:
Expand All @@ -178,7 +178,7 @@ async def _main(simulate: bool, tiprack: str, removal: int, tip_location: int, t
hw_api = get_sync_hw_api(protocol)
helpers_ot3.restart_server_ot3()
for i in range(25):
hw_api.cache_instruments(require={Mount.LEFT: "p1000_single_flex"})
hw_api.cache_instruments(require={Mount.LEFT: nozzle2})
attached = hw_api.attached_pipettes
try:
print(attached[Mount.LEFT])
Expand All @@ -188,14 +188,14 @@ async def _main(simulate: bool, tiprack: str, removal: int, tip_location: int, t
except:
print("failed to find")
await asyncio.sleep(2)
run(protocol, tiprack, removal, tip_location, tip_type, pipette_size)
run(protocol, tiprack, removal, tip_location, tip_type, pipette_size, nozzles, nozzle2)

def run(protocol: protocol_api.ProtocolContext, tiprack: str, removal: int, tip_location: int, tip_type: int, pipette_size: int) -> None:
def run(protocol: protocol_api.ProtocolContext, tiprack: str, removal: int, tip_location: int, tip_type: int, pipette_size: int, nozzles, nozzle2) -> None:

print("7")

# Instrument setup
pleft = protocol.load_instrument("flex_1channel_1000", 'left')
pleft = protocol.load_instrument(nozzles, "left")
print("8")
# DECK SETUP AND LABWARE
tiprack_1 = protocol.load_labware(tiprack, location="D1")
Expand All @@ -220,17 +220,21 @@ def run(protocol: protocol_api.ProtocolContext, tiprack: str, removal: int, tip_
"A12",
]
print("9")
protocol.home()
pleft.home()
#protocol.home()
print("9.5")
#pleft.home()
print("9.75")
hw_api = get_sync_hw_api(protocol)
print("10")
hw_api.move_to(Mount.LEFT, Point(125,25,250))
hw_api.drop_tip(mount=Mount.LEFT, removal=2)
print("hello? anyone home?")
input("Press Enter to continue...")
#making my life 10x easier
print("9 and 3/4")
protocol.home()
pleft.home()
#if pipette_size != 96:
#protocol.home()
#pleft.home()
start = time.time()
#setup differences between waste chute and trash bin and tip types
if pipette_size == 8:
Expand All @@ -257,23 +261,44 @@ def run(protocol: protocol_api.ProtocolContext, tiprack: str, removal: int, tip_
z_pos = 58
onek_adjust = 25

if pipette_size == 96:
onek_adjust = 0
adjustment = 0
# if tip_type == 50 or tip_type == 200:
# adjustment = 49
# if tip_type == 1000:
# adjustment = 87
y_pos = 26
x_pos = 334
knock_distance = 250
if tip_location == 1:
sys.exit("Cannot use 96ch and trash bin.")
elif (removal == 2 or removal == 0) and tip_location == 2:
if tip_type == 50 or tip_type == 200:
z_pos = 135
if tip_type == 1000:
z_pos = 150


#add pause to measure static charge
for column in tiprack_columns:
pleft.pick_up_tip(tiprack_1[column])
hw_api.move_rel(Mount.LEFT, Point(0,0,120)) #make it go up out of tiprack to avoid collision
if pipette_size != 96:
pleft.pick_up_tip(tiprack_1[column])
hw_api.move_rel(Mount.LEFT, Point(0,0,120)) #make it go up out of tiprack to avoid collision

hw_api.move_to(Mount.LEFT, Point(x_pos,y_pos,250-adjustment)) #200 is subject to change
#405 for tape, 330 for bin
hw_api.move_to(Mount.LEFT, Point(x_pos,y_pos,z_pos)) #is -5
# consider using tip size var to make it scale
print("104030")
hw_api.drop_tip(mount=Mount.LEFT, removal=removal)
if pipette_size != 96:
hw_api.drop_tip(mount=Mount.LEFT, removal=removal)
print("new one")
if removal == 2:
hw_api.move_to(Mount.LEFT, Point(x_pos - knock_distance,y_pos,(z_pos + adjustment - onek_adjust)))
pleft.home()
protocol.home()
pleft.home()
#pleft.home()
#protocol.home()
#pleft.home()

# from datetime we get our runtime
tot_run_time = int(time.time() - start)
Expand All @@ -297,5 +322,17 @@ def run(protocol: protocol_api.ProtocolContext, tiprack: str, removal: int, tip_

if args.tip_type == 1000:
tiprack = "opentrons_flex_96_tiprack_1000ul"

if args.pipette_size == 1:
nozzles = "flex_1channel_1000"
nozzle2 = "p1000_single_flex"

if args.pipette_size == 8:
nozzles = "flex_8channel_1000"
nozzle2 = "p1000_multi_flex"

if args.pipette_size == 96:
nozzles = "flex_96channel_1000"
nozzle2 = "p1000_96"

asyncio.run(_main(args.simulate, tiprack, args.removal, args.tip_location, args.tip_type, args.pipette_size))
asyncio.run(_main(args.simulate, tiprack, args.removal, args.tip_location, args.tip_type, args.pipette_size, nozzles, nozzle2))

0 comments on commit 1510924

Please sign in to comment.