projects
/
pyafm.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Change AFM._check_target_deflection argument name to `deflection`.
[pyafm.git]
/
pyafm
/
afm.py
diff --git
a/pyafm/afm.py
b/pyafm/afm.py
index 406b15f9eb089b775f542ac34e342eedf7644ce0..12543e4834d89a54682c029ebbd752b9da054f2e 100644
(file)
--- a/
pyafm/afm.py
+++ b/
pyafm/afm.py
@@
-87,7
+87,7
@@
class AFM (object):
zero = _convert_volts_to_bits(axis.config['channel'], 0)
target_def = _convert_volts_to_bits(defc.config, setpoint)
zero = _convert_volts_to_bits(axis.config['channel'], 0)
target_def = _convert_volts_to_bits(defc.config, setpoint)
- self._check_target_deflection(target_def)
+ 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)
_LOG.debug('zero the %s piezo output' % self.axis_name)
self.piezo.jump(axis_name=self.axis_name, position=zero)
@@
-150,7
+150,7
@@
class AFM (object):
'positioned %g m into the surface at stepper %d, piezo %d (%g m)'
% (depth, self.stepper.position, target, target_m))
'positioned %g m into the surface at stepper %d, piezo %d (%g m)'
% (depth, self.stepper.position, target, target_m))
- def _check_target_deflection(self,
target_
deflection):
+ def _check_target_deflection(self, deflection):
defc = self._deflection_channel()
max_def = defc.get_maxdata()
if target_deflection > max_def:
defc = self._deflection_channel()
max_def = defc.get_maxdata()
if target_deflection > max_def:
@@
-158,6
+158,11
@@
class AFM (object):
'than the maximum deflection value of {:d} bits'
).format(setpoint, target_deflection, max_def))
raise ValueError(setpoint)
'than the maximum deflection value of {:d} bits'
).format(setpoint, target_deflection, max_def))
raise ValueError(setpoint)
+ elif target_deflection < 0:
+ _LOG.error(('requested setpoint ({:g} V = {:d} bits) is less '
+ 'than the minimum deflection value of 0 bits'
+ ).format(setpoint, target_deflection))
+ raise ValueError(setpoint)
def _stepper_approach_again(self, target_deflection, min_slope_ratio, far):
_LOG.info('back off %d half steps and approach until deflection > %g'
def _stepper_approach_again(self, target_deflection, min_slope_ratio, far):
_LOG.info('back off %d half steps and approach until deflection > %g'