Skip to content

Commit a352186

Browse files
V1.6.17 - Updates
- Made calibration use two bytes for storage, so you can set adjust more than a factor 1.0255 - Renamed the Polaris RA coordinates. - Forced users to choose the correct RA ring before compiling.
1 parent 8abe62d commit a352186

File tree

3 files changed

+24
-18
lines changed

3 files changed

+24
-18
lines changed

Software/Arduino code/OpenAstroTracker/OpenAstroTracker.ino

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
=======================================================================================================================================
33
4-
Version 1.6.15
4+
Version 1.6.17
55
66
1. Connect your Arduino, under tools choose "Arduino Uno", set the right Port and set "Arduino ISP" as the Programmer.
77
2. Hit upload (Ctrl-U)
@@ -14,7 +14,7 @@
1414
1515
=======================================================================================================================================
1616
*/
17-
String version = "V1.6.16";
17+
String version = "V1.6.17";
1818

1919
// See NORTHERN_HEMISPHERE in Globals.h if you not in the northern hemisphere
2020

@@ -24,9 +24,9 @@ String version = "V1.6.16";
2424
// One RA revolution needs 26.43 (1057.1mm / 40mm) stepper revolutions (V2: 28.27 (1131mm/40mm))
2525
// Which means 108245 steps (26.43 x 4096) moves 360 degrees (V2: 115812 steps (28.27 x 4096))
2626
// So there are 300.1 steps/degree (108245 / 360) (V2: 322 (115812 / 360))
27-
// Theoretical RA tracking speed is 1.246586 (300 x 14.95903 / 3600) (V2 : 1.333800 (322 x 14.95903 / 3600) steps/sec
28-
29-
int RAStepsPerDegree = 300; // V1 Ring has a ridge that the belt runs on and the ring runs on the bearings
27+
// Theoretically correct RA tracking speed is 1.246586 (300 x 14.95903 / 3600) (V2 : 1.333800 (322 x 14.95903 / 3600) steps/sec
28+
#error "Please uncomment one of the two following lines depending on which version of the RA ring you printed. And comment out this line."
29+
// int RAStepsPerDegree = 300; // V1 Ring has a ridge on top of the ring that the belt runs on and the ring runs on the bearings
3030
// int RAStepsPerDegree = 322; // V2 Ring has belt in a groove and belt runs on bearings
3131

3232

@@ -61,9 +61,9 @@ float DECStepperDownLimit = 10000; // Going much more than this will make the
6161
float DECStepperUpLimit = -22000; // Going much more than this is going below the horizon.
6262

6363
// These values are needed to calculate the current position during initial alignment.
64-
int h = 21;
65-
int m = 2;
66-
int s = 25;
64+
int PolarisRAHour = 21;
65+
int PolarisRAMinute = 2;
66+
int PolarisRASecond = 25;
6767
// You get these values by calculating 24h minus the current (not J2000) RA of Polaris.
6868
// This changes slightly over weeks, so adjust every couple of months.
6969
// This value is from 27.Nov.19, I suggest next adjustment in mid 2020

Software/Arduino code/OpenAstroTracker/b_setup.ino

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,14 @@ void setup() {
3535

3636
// Configure the mount
3737
// Set the global HA correction
38-
mount.setHACorrection(h, m, s);
38+
mount.setHACorrection(PolarisRAHour, PolarisRAMinute, PolarisRASecond);
3939

4040
// Set the stepper motor parameters
4141
mount.configureRAStepper(FULLSTEP, RAmotorPin1, RAmotorPin2, RAmotorPin3, RAmotorPin4, RAspeed, RAacceleration);
4242
mount.configureDECStepper(HALFSTEP, DECmotorPin1, DECmotorPin2, DECmotorPin3, DECmotorPin4, DECspeed, DECacceleration);
4343

44-
// Read persisted values adn set in mount
45-
inputcal = EEPROM.read(0);
44+
// Read persisted values and set in mount
45+
inputcal = EEPROM.read(0) + EEPROM.read(3) * 256;
4646
DayTime haTime = DayTime(EEPROM.read(1), EEPROM.read(2), 0);
4747
mount.setSpeedCalibration(speed + inputcal / 10000);
4848
#ifdef DEBUG_MODE
@@ -76,9 +76,9 @@ void setup() {
7676
}
7777

7878
lcdMenu.updateDisplay();
79-
79+
8080
#ifdef DEBUG_MODE
8181
Serial.println("SetupDone");
8282
#endif
83-
83+
8484
}

Software/Arduino code/OpenAstroTracker/c76_menuCAL.ino

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,19 @@ bool processCalibrationKeys() {
1515
if (calState == SPEED_CALIBRATION)
1616
{
1717
if (lcdButtons.currentState() == btnUP) {
18-
inputcal += 1; //0.0001;
19-
mount.setSpeedCalibration(speed + inputcal / 10000);
18+
if (inputcal < 32760) { // Don't overflow 16 bit signed
19+
inputcal += 1; //0.0001;
20+
mount.setSpeedCalibration(speed + inputcal / 10000);
21+
}
2022
mount.delay(calDelay);
2123
calDelay = max(5, 0.96 * calDelay);
2224
checkForKeyChange = false;
2325
}
2426
else if (lcdButtons.currentState() == btnDOWN) {
25-
inputcal -= 1 ; //0.0001;
26-
mount.setSpeedCalibration(speed + inputcal / 10000);
27+
if (inputcal > -32760) { // Don't overflow 16 bit signed
28+
inputcal -= 1 ; //0.0001;
29+
mount.setSpeedCalibration(speed + inputcal / 10000);
30+
}
2731
mount.delay(calDelay);
2832
calDelay = max(5, 0.96 * calDelay);
2933
checkForKeyChange = false;
@@ -64,7 +68,9 @@ bool processCalibrationKeys() {
6468
case SPEED_CALIBRATION: {
6569
// UP and DOWN are handled above
6670
if (key == btnSELECT) {
67-
EEPROM.update(0, inputcal);
71+
int cal = floor(inputcal);
72+
EEPROM.update(0, cal & 0x00FF);
73+
EEPROM.update(3, (cal & 0xFF00) >> 8);
6874
mount.setSpeedCalibration(speed + inputcal / 10000);
6975
lcdMenu.printMenu("Stored.");
7076
mount.delay(500);

0 commit comments

Comments
 (0)