Dependents:
PushToGo-F429
Revision 19:fd854309cb4c, committed 2018-09-24
- 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
diff -r 3ea58b079adc -r fd854309cb4c EquatorialMount.cpp
--- 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;
diff -r 3ea58b079adc -r fd854309cb4c StepOut.cpp
--- 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()
{