while pos_m < -stepper_tolerance: # step back if we need to
LOG.debug('step back')
self.stepper.step_relative(-1, backlash_safe=True)
- pos = self.piezo.get_surface_position(
- axis_name=self.axis_name, max_deflection=target_def)
+ try:
+ pos = self.piezo.get_surface_position(
+ axis_name=self.axis_name, max_deflection=target_def)
+ except _FlatFit, e:
+ LOG.debug(e)
+ continue
pos_m = _convert_bits_to_meters(
axis.axis_channel_config, axis.axis_config, pos)
LOG.debug('located surface at stepper %d, piezo %d (%g m)'
while pos_m > stepper_tolerance: # step forward if we need to
LOG.debug('step forward')
self.stepper.step_relative(1)
- pos = self.piezo.get_surface_position(
- axis_name=self.axis_name, max_deflection=target_def)
+ try:
+ pos = self.piezo.get_surface_position(
+ axis_name=self.axis_name, max_deflection=target_def)
+ except _FlatFit, e:
+ LOG.debug(e)
+ continue
pos_m = _convert_bits_to_meters(
axis.axis_channel_config, axis.axis_config, pos)
LOG.debug('located surface at stepper %d, piezo %d (%g m)'