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.
This commit is contained in:
parent
b114ef8b0e
commit
a9414c6212
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue