From bdc857f31b48bbb9a6f704079f9898bad4820a53 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Tue, 19 Apr 2011 13:51:17 -0400 Subject: [PATCH] Set `axis = ...` earlier in AFM.move_just_onto_surface(). --- pyafm.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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") -- 2.26.2