Telescope Control Library

Dependents:   PushToGo-F429

Files at this revision

API Documentation at this revision

Comitter:
caoyu@caoyuan9642-desktop.MIT.EDU
Date:
Mon Sep 24 19:36:48 2018 -0400
Parent:
18:3ea58b079adc
Commit message:
Fix bug in nudging with small speeds mentioned in the last commit

Changed in this revision

EquatorialMount.cpp Show annotated file Show diff for this revision Revisions of this file
StepOut.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/EquatorialMount.cpp	Sun Sep 23 02:32:42 2018 -0400
+++ b/EquatorialMount.cpp	Mon Sep 24 19:36:48 2018 -0400
@@ -402,9 +402,11 @@
 
 			curr_dir = ra.getCurrentDirection(); // Current direction
 
+
 			double trackSpeed = ra.getTrackSpeedSidereal() * sidereal_speed;
 			double absSpeed = nudgeSpeed;
 
+
 			if (ra_dir == AXIS_ROTATE_POSITIVE) {
 				// Same direction as tracking
 				absSpeed = nudgeSpeed + trackSpeed;
@@ -412,6 +414,7 @@
 			} else if (nudgeSpeed < trackSpeed) { // ra_dir == AXIS_ROTATE_NEGATIVE
 												  // Partially canceling the tracking speed
 				absSpeed = trackSpeed - nudgeSpeed;
+				ra_dir = AXIS_ROTATE_POSITIVE; // Rotate in the tracking direction
 			} else if (nudgeSpeed > trackSpeed) {// ra_dir == AXIS_ROTATE_NEGATIVE
 												 // Direction inverted
 				absSpeed = nudgeSpeed - trackSpeed;
--- a/StepOut.cpp	Sun Sep 23 02:32:42 2018 -0400
+++ b/StepOut.cpp	Mon Sep 24 19:36:48 2018 -0400
@@ -9,7 +9,7 @@
 #include "mbed.h"
 #include <StepOut.h>
 
-#define MAX_PERIOD 1000000
+#define MAX_PERIOD 1000000LL
 
 void StepOut::start()
 {