From: W. Trevor King Date: Tue, 19 Apr 2011 17:51:17 +0000 (-0400) Subject: Set `axis = ...` earlier in AFM.move_just_onto_surface(). X-Git-Tag: v0.3~13 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=bdc857f31b48bbb9a6f704079f9898bad4820a53;p=pyafm.git Set `axis = ...` earlier in AFM.move_just_onto_surface(). --- diff --git a/pyafm.py b/pyafm.py index 7ef3a85..c16b0b8 100644 --- a/pyafm.py +++ b/pyafm.py @@ -66,11 +66,13 @@ class AFM (object): LOG.info('moving to %g onto the surface' % depth) stepper_tolerance = 2*self.stepper.step_size + + axis = self.piezo.axis_by_name(self.axis_name) + zero = _convert_volts_to_bits(axis.axis_channel_config, 0) target_def = _convert_volts_to_bits(axis.channel_config, setpoint) LOG.debug('zero the %s piezo output' % self.axis_name) - axis = self.piezo.axis_by_name(self.axis_name) self.piezo.jump(axis_name=self.axis_name, position=zero) LOG.debug("see if we're starting near the surface")