From a9414c62125013032850ff762791fd820c8e4ea6 Mon Sep 17 00:00:00 2001 From: mmcwilliams Date: Mon, 8 Jan 2018 22:08:41 -0500 Subject: [PATCH] Prevent motor from stopping before 100ms. Took out the logging in watchMicro, due to the fact that the problem with backwards frames was likely a bad connection. --- lib/intval/index.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/intval/index.js b/lib/intval/index.js index 606833a..5bde0de 100644 --- a/lib/intval/index.js +++ b/lib/intval/index.js @@ -236,11 +236,10 @@ intval._watchMicro = function (err, val) { if (err) { log.error('_watchMicro', err) } - log.info(`Microswitch val: ${val}`) + //log.info(`Microswitch val: ${val}`) //determine when to stop if (val === 0 && intval._state.frame.active) { - //&& (now - intval._state.frame.start) > 100 - if (!intval._state.micro.primed) { + if (!intval._state.micro.primed && (now - intval._state.frame.start) > 100) { intval._state.micro.primed = true intval._state.micro.time = now log.info('Microswitch primed to stop motor') @@ -375,7 +374,6 @@ intval.frame = function (dir = null, exposure = null, cb = () => {}) { log.info('frame', {dir : dir ? 'forward' : 'backward', exposure : exposure}) - intval._pause() if (dir) { intval._startFwd() } else {