From 7c934e1f5f0838a42a7a0b1d5a392e3f0686e1c4 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Mon, 23 Jan 2012 14:41:10 -0500 Subject: [PATCH] Add min-slope-ratio option to BumpConfig. I was running into trouble moving to the surface with extremely long cantilevers, as the difference between the contact slope and non-contact drift was smaller than my hardcoded cutoff. Now the cutoff is configurable. --- calibcant/bump.py | 8 +++++--- calibcant/config.py | 7 +++++++ 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/calibcant/bump.py b/calibcant/bump.py index 90a4b92..4d0db84 100644 --- a/calibcant/bump.py +++ b/calibcant/bump.py @@ -86,11 +86,13 @@ def bump_acquire(afm, bump_config): Returns the acquired ramp data dictionary, with data in DAC/ADC bits. """ afm.move_just_onto_surface( - depth=bump_config['initial-position'], far=bump_config['far-steps']) + depth=bump_config['initial-position'], far=bump_config['far-steps'], + setpoint=bump_config['setpoint'], + min_slope_ratio=bump_config['min-slope-ratio']) #afm.piezo.jump('z', 32000) - _LOG.info('bump the surface to a depth of %g m' - % bump_config['push-depth']) + _LOG.info('bump the surface to a depth of %g m with a setpoint of %g V' + % (bump_config['push-depth'], bump_config['setpoint'])) axis = afm.piezo.axis_by_name(afm.axis_name) diff --git a/calibcant/config.py b/calibcant/config.py index c80e791..2cb32da 100644 --- a/calibcant/config.py +++ b/calibcant/config.py @@ -88,6 +88,13 @@ class BumpConfig (_config.Config): help=('Maximum deflection in volts in case of stepper positioning ' 'to achieve the initial position.'), default=2.0), + _config.FloatSetting( + name='min-slope-ratio', + help=('Set the minimum ratio between the deflection/displacement ' + 'of the contact and the non-contact regions for bumps ' + 'seeking the surface. Bumps without sufficient difference ' + 'assume they need to move closer to find the surface.'), + default=10.0), _config.IntegerSetting( name='far-steps', help=('Number of stepper steps to move "far" away from the ' -- 2.26.2