@@ -61,6 +61,10 @@ def __init__(self,
61
61
self ._current_state = State .sessionStarted
62
62
self ._state_machine = PipetteOffsetCalibrationStateMachine ()
63
63
64
+ point_one_pos = \
65
+ self ._deck .get_calibration_position (POINT_ONE_ID ).position
66
+ self ._cal_ref_point = Point (* point_one_pos )
67
+
64
68
self ._tip_origin_pt : Optional [Point ] = None
65
69
66
70
self ._command_map : COMMAND_MAP = {
@@ -173,20 +177,24 @@ async def move_to_deck(self):
173
177
async def move_to_point_one (self ):
174
178
assert self ._z_height_reference is not None , \
175
179
"saveOffset has not been called yet"
176
- coords = self ._deck . get_calibration_position ( POINT_ONE_ID ). position
177
- point_loc = Location ( Point ( * coords ), None )
178
- await self ._move (
179
- point_loc . move ( point = Point ( 0 , 0 , self ._z_height_reference )) )
180
+ target_loc = Location ( self ._cal_ref_point , None )
181
+ target = target_loc . move (
182
+ point = Point ( 0 , 0 , self ._z_height_reference ))
183
+ await self ._move ( target )
180
184
181
185
async def save_offset (self ):
182
186
cur_pt = await self ._get_current_point (critical_point = None )
183
187
if self .current_state == State .joggingToDeck :
184
188
self ._z_height_reference = cur_pt .z
185
189
elif self ._current_state == State .savingPointOne :
190
+ if self ._hw_pipette .config .channels > 1 :
191
+ cur_pt = await self ._get_current_point (
192
+ critical_point = CriticalPoint .FRONT_NOZZLE )
186
193
tiprack_hash = helpers .hash_labware_def (
187
194
self ._tip_rack ._definition )
195
+ offset = self ._cal_ref_point - cur_pt
188
196
modify .save_pipette_calibration (
189
- offset = cur_pt ,
197
+ offset = offset ,
190
198
mount = self ._mount ,
191
199
pip_id = self ._hw_pipette .pipette_id ,
192
200
tiprack_hash = tiprack_hash ,
0 commit comments