From 8638957b83eb9cde218a26affffa078ea3b82f5f Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Thu, 15 Mar 2012 07:39:52 -0400 Subject: [PATCH] Add `steps` and `sleep` options to `move_just_onto_surface()`. This takes advantage of yesterday's pypiezo commit: commit b66d6dbcb8cd381cf7515a42ab0aee4a4841beb3 Author: W. Trevor King Date: Wed Mar 14 16:18:23 2012 -0400 Add `steps` and `sleep` options for gentler `jump()`s. and I've bumped the minimum pypiezo version accordingly. When I was running some calibrations yesterday, I could hear the piezo clicking, and after the calibration the deflection was shifted half a volt or so from the initial deflection. I attribute this to the violent piezo jumps shaking the cantilever chip from its original position. The wimpy spring-loaded wire clips used in the MultiMode fluid cells probably aren't helping any either ;). --- pyafm/afm.py | 8 +++++--- setup.py | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/pyafm/afm.py b/pyafm/afm.py index fdacc81..284349a 100644 --- a/pyafm/afm.py +++ b/pyafm/afm.py @@ -63,7 +63,8 @@ class AFM (object): return self.temperature.get_temperature() def move_just_onto_surface(self, depth=-50e-9, setpoint=2, - min_slope_ratio=10, far=200): + min_slope_ratio=10, far=200, steps=20, + sleep=0.0001): """Position the AFM tip close to the surface. Uses `.piezo.get_surface_position()` to pinpoint the position @@ -90,7 +91,8 @@ class AFM (object): self._check_target_deflection(deflection=target_def) _LOG.debug('zero the %s piezo output' % self.axis_name) - self.piezo.jump(axis_name=self.axis_name, position=zero) + self.piezo.jump( + axis_name=self.axis_name, position=zero, steps=steps, sleep=sleep) _LOG.debug("see if we're starting near the surface") try: @@ -144,7 +146,7 @@ class AFM (object): % self.axis_name) target_m = pos_m + depth target = _convert_meters_to_bits(axis.config, target_m) - self.piezo.jump(self.axis_name, target) + self.piezo.jump(self.axis_name, target, steps=steps, sleep=sleep) _LOG.debug( 'positioned %g m into the surface at stepper %d, piezo %d (%g m)' diff --git a/setup.py b/setup.py index 01b7e52..89fb172 100644 --- a/setup.py +++ b/setup.py @@ -36,5 +36,5 @@ setup(name=package_name, classifiers=filter(None, classifiers.split('\n')), packages=['pyafm'], provides=['pyafm (%s)' % __version__], - requires=['pypiezo (>= 0.4)'], + requires=['pypiezo (>= 0.6)'], ) -- 2.26.2