Skip to content

Commit

Permalink
Mode _FORK no longer does Meridian flips during align
Browse files Browse the repository at this point in the history
Also dropped mode _FORK_ALT since it's redundant now
  • Loading branch information
hjd1964 committed Apr 26, 2019
1 parent a5c9591 commit 89f8e6d
Show file tree
Hide file tree
Showing 13 changed files with 30 additions and 33 deletions.
8 changes: 4 additions & 4 deletions AlignEq.ino
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ void TGeoAlign::autoModel(int n) {
}
ohe=ohe/num; best_ohe=round(ohe*Rad*3600.0); best_ohw=best_ohe;

#if defined(MOUNT_TYPE_FORK) || defined(MOUNT_TYPE_FORK_ALT)
#ifdef MOUNT_TYPE_FORK
Ff=1; Df=0;
#else
Ff=0; Df=1;
Expand Down Expand Up @@ -325,7 +325,7 @@ void TGeoAlign::autoModel(int n) {
altCor=best_pe/3600.0;

tfCor=best_tf/3600.0;
#if defined(MOUNT_TYPE_FORK) || defined(MOUNT_TYPE_FORK_ALT) || defined(MOUNT_TYPE_ALTAZM)
#if defined(MOUNT_TYPE_FORK) || defined(MOUNT_TYPE_ALTAZM)
dfCor=best_ff/3600.0;
#else
dfCor=best_df/3600.0;
Expand Down Expand Up @@ -369,7 +369,7 @@ void TGeoAlign::equToInstr(double HA, double Dec, double *HA1, double *Dec1, int
// misalignment due to Dec axis being perp. to RA axis
double PDh=-pdCor*(sinDec/cosDec)*p;

#if defined (MOUNT_TYPE_FORK) || defined(MOUNT_TYPE_FORK_ALT)
#ifdef MOUNT_TYPE_FORK
// Fork flex
double DFd=dfCor*cosHA;
#else
Expand Down Expand Up @@ -432,7 +432,7 @@ void TGeoAlign::instrToEqu(double HA, double Dec, double *HA1, double *Dec1, int
// works on HA instead. meridian flips affect this in HA
double PDh=-pdCor*(sinDec/cosDec)*p;

#if defined (MOUNT_TYPE_FORK) || defined(MOUNT_TYPE_FORK_ALT)
#ifdef MOUNT_TYPE_FORK
// Fork flex
double DFd=dfCor*cosHA;
#else
Expand Down
6 changes: 3 additions & 3 deletions AlignHor.ino
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ void TGeoAlignH::autoModel(int n) {
altCor=best_pe/3600.0;

tfCor=best_tf/3600.0;
#if defined(MOUNT_TYPE_FORK) || defined(MOUNT_TYPE_FORK_ALT) || defined(MOUNT_TYPE_ALTAZM)
#if defined(MOUNT_TYPE_FORK) || defined(MOUNT_TYPE_ALTAZM)
dfCor=best_ff/3600.0;
#else
dfCor=best_df/3600.0;
Expand Down Expand Up @@ -380,7 +380,7 @@ void TGeoAlignH::horToInstr(double Alt, double Azm, double *Alt1, double *Azm1,
// misalignment due to Alt axis being perp. to Azm axis
double PDh=-pdCor*(sinAlt/cosAlt)*p;

#if defined (MOUNT_TYPE_FORK) || defined(MOUNT_TYPE_FORK_ALT) || defined(MOUNT_TYPE_ALTAZM)
#if defined (MOUNT_TYPE_FORK) || defined(MOUNT_TYPE_ALTAZM)
// Fork flex
double DFd=dfCor*cosAzm;
#else
Expand Down Expand Up @@ -446,7 +446,7 @@ void TGeoAlignH::instrToHor(double Alt, double Azm, double *Alt1, double *Azm1,
// works on Azm instead. meridian flips affect this in Azm
double PDh=-pdCor*(sinAlt/cosAlt)*p;

#if defined (MOUNT_TYPE_FORK) || defined(MOUNT_TYPE_FORK_ALT)
#ifdef MOUNT_TYPE_FORK
// Fork flex
double DFd=dfCor*cosAzm;
#else
Expand Down
8 changes: 2 additions & 6 deletions Command.ino
Original file line number Diff line number Diff line change
Expand Up @@ -665,8 +665,6 @@ void processCommands() {
reply[i++]='E';
#elif defined(MOUNT_TYPE_FORK)
reply[i++]='K';
#elif defined(MOUNT_TYPE_FORK_ALT)
reply[i++]='k';
#elif defined(MOUNT_TYPE_ALTAZM)
reply[i++]='A';
#endif
Expand Down Expand Up @@ -723,8 +721,6 @@ void processCommands() {
reply[3]|=0b10000001; // GEM
#elif defined(MOUNT_TYPE_FORK)
reply[3]|=0b10000010; // FORK
#elif defined(MOUNT_TYPE_FORK_ALT)
reply[3]|=0b10000100; // FORK ALT
#elif defined(MOUNT_TYPE_ALTAZM)
reply[3]|=0b10001000; // ALTAZM
#endif
Expand Down Expand Up @@ -778,7 +774,7 @@ void processCommands() {
case '3': sprintf(reply,"%ld",(long)(Align.azmCor*3600.0)); quietReply=true; break; // azmCor
case '4': sprintf(reply,"%ld",(long)(Align.doCor*3600.0)); quietReply=true; break; // doCor
case '5': sprintf(reply,"%ld",(long)(Align.pdCor*3600.0)); quietReply=true; break; // pdCor
#if defined(MOUNT_TYPE_FORK) || defined(MOUNT_TYPE_FORK_ALT) || defined(MOUNT_TYPE_ALTAZM)
#if defined(MOUNT_TYPE_FORK) || defined(MOUNT_TYPE_ALTAZM)
case '6': sprintf(reply,"%ld",(long)(Align.dfCor*3600.0)); quietReply=true; break; // ffCor
case '7': sprintf(reply,"%ld",(long)(0)); quietReply=true; break; // dfCor
#else
Expand Down Expand Up @@ -1665,7 +1661,7 @@ void processCommands() {
case '3': Align.azmCor=(double)strtol(&parameter[3],NULL,10)/3600.0; break; // azmCor
case '4': Align.doCor=(double)strtol(&parameter[3],NULL,10)/3600.0; break; // doCor
case '5': Align.pdCor=(double)strtol(&parameter[3],NULL,10)/3600.0; break; // pdCor
#if defined(MOUNT_TYPE_FORK) || defined(MOUNT_TYPE_FORK_ALT)
#ifdef MOUNT_TYPE_FORK
case '6': Align.dfCor=(double)strtol(&parameter[3],NULL,10)/3600.0; break; // ffCor
case '7': break; // dfCor
#else
Expand Down
3 changes: 2 additions & 1 deletion Config.Classic.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
// Default speed for Serial1 com port, Default=9600
#define SERIAL_B_BAUD_DEFAULT 9600

// Mount type, default is _GEM (German Equatorial) other options are _FORK, _FORK_ALT. _FORK switches off Meridian Flips after alignment is done. _FORK_ALT disables Meridian Flips. _ALTAZM is for Alt/Azm mounted 'scopes.
// Mount type, default is _GEM (German Equatorial.) This allows Meridian flips and can be used for other mount types if that behaviour is desired. _FORK switches off Meridian Flips
// but allows travel across the Meridian. _ALTAZM is for Alt/Azm mounted 'scopes.
#define MOUNT_TYPE_GEM

// Strict parking, default=_OFF. Set to _ON and unparking is only allowed if successfully parked. Otherwise unparking is allowed if at home and not parked (the Home/Reset command ":hF#" sets this state.)
Expand Down
3 changes: 2 additions & 1 deletion Config.MaxESP2.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@
// For an ESP32 SerialC is the Bluetooth port so use a name instead of a baud "ONSTEP", etc.
#define SERIAL_C_BAUD_DEFAULT_OFF

// Mount type, default is _GEM (German Equatorial) other options are _FORK, _FORK_ALT. _FORK switches off Meridian Flips after alignment is done. _FORK_ALT disables Meridian Flips. _ALTAZM is for Alt/Azm mounted 'scopes.
// Mount type, default is _GEM (German Equatorial.) This allows Meridian flips and can be used for other mount types if that behaviour is desired. _FORK switches off Meridian Flips
// but allows travel across the Meridian. _ALTAZM is for Alt/Azm mounted 'scopes.
#define MOUNT_TYPE_GEM

// Strict parking, default=_OFF. Set to _ON and unparking is only allowed if successfully parked. Otherwise unparking is allowed if at home and not parked (the Home/Reset command ":hF#" sets this state.)
Expand Down
3 changes: 2 additions & 1 deletion Config.MaxPCB.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@
// Pin 18 (Aux1) for GPIO0 and Pin 5 (Aux2) for Rst control. Choose only one feature on Aux1/2.
#define ESP8266_CONTROL_OFF

// Mount type, default is _GEM (German Equatorial) other options are _FORK, _FORK_ALT. _FORK switches off Meridian Flips after alignment is done. _FORK_ALT disables Meridian Flips. _ALTAZM is for Alt/Azm mounted 'scopes.
#define MOUNT_TYPE_GEM
// Mount type, default is _GEM (German Equatorial.) This allows Meridian flips and can be used for other mount types if that behaviour is desired. _FORK switches off Meridian Flips
// but allows travel across the Meridian. _ALTAZM is for Alt/Azm mounted 'scopes.

// Strict parking, default=_OFF. Set to _ON and unparking is only allowed if successfully parked. Otherwise unparking is allowed if at home and not parked (the Home/Reset command ":hF#" sets this state.)
#define STRICT_PARKING_OFF
Expand Down
3 changes: 2 additions & 1 deletion Config.MiniPCB.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
// Pin 18 (Aux1) for GPIO0 and Pin 5 (Aux2) for Rst control. Choose only one feature on Aux1/2.
#define ESP8266_CONTROL_OFF

// Mount type, default is _GEM (German Equatorial) other options are _FORK, _FORK_ALT. _FORK switches off Meridian Flips after alignment is done. _FORK_ALT disables Meridian Flips. _ALTAZM is for Alt/Azm mounted 'scopes.
// Mount type, default is _GEM (German Equatorial.) This allows Meridian flips and can be used for other mount types if that behaviour is desired. _FORK switches off Meridian Flips
// but allows travel across the Meridian. _ALTAZM is for Alt/Azm mounted 'scopes.
#define MOUNT_TYPE_GEM

// Strict parking, default=_OFF. Set to _ON and unparking is only allowed if successfully parked. Otherwise unparking is allowed if at home and not parked (the Home/Reset command ":hF#" sets this state.)
Expand Down
3 changes: 2 additions & 1 deletion Config.Ramps14.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@
// Default speed for Serial1 com port, Default=9600
#define SERIAL_B_BAUD_DEFAULT 9600

// Mount type, default is _GEM (German Equatorial) other options are _FORK, _FORK_ALT. _FORK switches off Meridian Flips after alignment is done. _FORK_ALT disables Meridian Flips. _ALTAZM is for Alt/Azm mounted 'scopes.
// Mount type, default is _GEM (German Equatorial.) This allows Meridian flips and can be used for other mount types if that behaviour is desired. _FORK switches off Meridian Flips
// but allows travel across the Meridian. _ALTAZM is for Alt/Azm mounted 'scopes.
#define MOUNT_TYPE_GEM

// Strict parking, default=_OFF. Set to _ON and unparking is only allowed if successfully parked. Otherwise unparking is allowed if at home and not parked (the Home/Reset command ":hF#" sets this state.)
Expand Down
3 changes: 2 additions & 1 deletion Config.STM32.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@
// Pin (Aux1) for GPIO0 and Pin (Aux2) for Rst control. Choose only one feature on Aux1/2.
#define ESP8266_CONTROL_OFF

// Mount type, default is _GEM (German Equatorial) other options are _FORK, _FORK_ALT. _FORK switches off Meridian Flips after alignment is done. _FORK_ALT disables Meridian Flips. _ALTAZM is for Alt/Azm mounted 'scopes.
// Mount type, default is _GEM (German Equatorial.) This allows Meridian flips and can be used for other mount types if that behaviour is desired. _FORK switches off Meridian Flips
// but allows travel across the Meridian. _ALTAZM is for Alt/Azm mounted 'scopes.
#define MOUNT_TYPE_GEM

// Strict parking, default=_OFF. Set to _ON and unparking is only allowed if successfully parked. Otherwise unparking is allowed if at home and not parked (the Home/Reset command ":hF#" sets this state.)
Expand Down
7 changes: 2 additions & 5 deletions Globals.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ double sinLat = 0.0;
double longitude = 0.0;

// fix UnderPoleLimit for fork mounts
#if defined(MOUNT_TYPE_FORK) || defined(MOUNT_TYPE_FORK_ALT)
#ifdef MOUNT_TYPE_FORK
#undef UnderPoleLimit
#define UnderPoleLimit 12
#endif
Expand All @@ -123,7 +123,7 @@ double longitude = 0.0;
#ifdef MOUNT_TYPE_GEM
double homePositionAxis1 = 90.0;
#endif
#if defined(MOUNT_TYPE_FORK) || defined(MOUNT_TYPE_FORK_ALT) || defined(MOUNT_TYPE_ALTAZM)
#if defined(MOUNT_TYPE_FORK) || defined(MOUNT_TYPE_ALTAZM)
double homePositionAxis1 = 0.0;
#endif
double homePositionAxis2 = 90.0;
Expand Down Expand Up @@ -204,9 +204,6 @@ boolean axis2Enabled = false;
byte meridianFlip = MeridianFlipAlways;
#endif
#ifdef MOUNT_TYPE_FORK
byte meridianFlip = MeridianFlipAlign;
#endif
#ifdef MOUNT_TYPE_FORK_ALT
byte meridianFlip = MeridianFlipNever;
#endif
#ifdef MOUNT_TYPE_ALTAZM
Expand Down
4 changes: 2 additions & 2 deletions Goto.ino
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ GotoErrors syncEqu(double RA, double Dec) {
#endif
} else {
// always on the "east" side of pier - we're in the western sky and the HA's are positive
// this is the default in the polar-home position and also for MOUNT_TYPE_FORK and MOUNT_TYPE_ALTAZM. MOUNT_TYPE_FORK_ALT ends up pierSideEast, but flips are allowed until aligned.
// this is the default in the polar-home position and also for MOUNT_TYPE_FORK and MOUNT_TYPE_ALTAZM.
newPierSide=PierSideEast;
}

Expand Down Expand Up @@ -333,7 +333,7 @@ GotoErrors goTo(double thisTargetAxis1, double thisTargetAxis2, double altTarget
} else {
if (getInstrPierSide()==PierSideNone) {
// always on the "east" side of pier - we're in the western sky and the HA's are positive
// this is the default in the polar-home position and also for MOUNT_TYPE_FORK and MOUNT_TYPE_ALTAZM. MOUNT_TYPE_FORK_ALT ends up pierSideEast, but flips are allowed until aligned.
// this is the default in the polar-home position and also for MOUNT_TYPE_FORK and MOUNT_TYPE_ALTAZM.
thisPierSide=PierSideEast;
}
}
Expand Down
3 changes: 0 additions & 3 deletions Initialize.ino
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,6 @@ void initStartupValues() {
meridianFlip = MeridianFlipAlways;
#endif
#ifdef MOUNT_TYPE_FORK
meridianFlip = MeridianFlipAlign;
#endif
#ifdef MOUNT_TYPE_FORK_ALT
meridianFlip = MeridianFlipNever;
#endif
#ifdef MOUNT_TYPE_ALTAZM
Expand Down
9 changes: 5 additions & 4 deletions Validate.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@
// -----------------------------------------------------------------------------------
// correct for configuration backwards compatability

// the mount type FORK with Meridian flips enabled for align (only) is not-longer required use _FORK instead
#ifdef MOUNT_TYPE_FORK_ALT
#define MOUNT_TYPE_FORK
#endif

// automatically set MaxRate if DefaultSlewRate is present
#if !defined(MaxRate) && defined(DesiredBaseSlewRate)
#define MaxRate ((1000000.0/DesiredBaseSlewRate)/StepsPerDegreeAxis1)
Expand Down Expand Up @@ -154,8 +159,6 @@
#define MAX_NUM_ALIGN_STARS '9'
#elif defined(MOUNT_TYPE_FORK)
#define MAX_NUM_ALIGN_STARS '9'
#elif defined(MOUNT_TYPE_FORK_ALT)
#define MAX_NUM_ALIGN_STARS '9'
#elif defined(MOUNT_TYPE_ALTAZM)
#define MAX_NUM_ALIGN_STARS '9'
#endif
Expand All @@ -164,8 +167,6 @@
#define MAX_NUM_ALIGN_STARS '6'
#elif defined(MOUNT_TYPE_FORK)
#define MAX_NUM_ALIGN_STARS '6'
#elif defined(MOUNT_TYPE_FORK_ALT)
#define MAX_NUM_ALIGN_STARS '6'
#elif defined(MOUNT_TYPE_ALTAZM)
#define MAX_NUM_ALIGN_STARS '6'
#endif
Expand Down

0 comments on commit 89f8e6d

Please sign in to comment.