stepper_tolerance = 2*self.stepper.step_size
- axis = self.piezo.axis_by_name(self.axis_name)
+ axis = self.piezo.axis_by_name(self.config['main-axis'])
def_config = self.piezo.config.select_config('inputs', 'deflection')
zero = _convert_volts_to_bits(axis.config['channel'], 0)
target_def = _convert_volts_to_bits(def_config, setpoint)
self._check_target_deflection(deflection=target_def)
- _LOG.debug('zero the %s piezo output' % self.axis_name)
+ _LOG.debug('zero the %s piezo output' % self.config['main-axis'])
self.piezo.jump(
- axis_name=self.axis_name, position=zero, steps=steps, sleep=sleep)
+ axis_name=self.config['main-axis'], position=zero, steps=steps,
+ sleep=sleep)
_LOG.debug("see if we're starting near the surface")
try:
pos = self.piezo.get_surface_position(
- axis_name=self.axis_name, max_deflection=target_def,
+ axis_name=self.config['main-axis'], max_deflection=target_def,
min_slope_ratio=min_slope_ratio)
except _FlatFit, e:
_LOG.info(e)
self.stepper.single_step(-1)
try:
pos = self.piezo.get_surface_position(
- axis_name=self.axis_name, max_deflection=target_def,
+ axis_name=self.config['main-axis'],
+ max_deflection=target_def,
min_slope_ratio=min_slope_ratio)
except _FlatFit, e:
_LOG.debug(e)
self.stepper.single_step(1)
try:
pos = self.piezo.get_surface_position(
- axis_name=self.axis_name, max_deflection=target_def,
+ axis_name=self.config['main-axis'],
+ max_deflection=target_def,
min_slope_ratio=min_slope_ratio)
except _FlatFit, e:
_LOG.debug(e)
% (self.stepper.position, pos, pos_m))
_LOG.debug('adjust the %s piezo to place us just onto the surface'
- % self.axis_name)
+ % self.config['main-axis'])
target_m = pos_m + depth
target = _convert_meters_to_bits(axis.config, target_m)
- self.piezo.jump(self.axis_name, target, steps=steps, sleep=sleep)
+ self.piezo.jump(
+ self.config['main-axis'], target, steps=steps, sleep=sleep)
_LOG.debug(
'positioned %g m into the surface at stepper %d, piezo %d (%g m)'
'additional surface location attempt (stepping backwards)')
try:
pos = self.piezo.get_surface_position(
- axis_name=self.axis_name, max_deflection=target_deflection,
+ axis_name=self.config['main-axis'],
+ max_deflection=target_deflection,
min_slope_ratio=min_slope_ratio)
return pos
except _SurfaceError, e: