Skip to content

Commit

Permalink
Fixes to GTA alignment
Browse files Browse the repository at this point in the history
Most significantly a fix to how the df term is handled.
  • Loading branch information
hjd1964 committed Oct 30, 2018
1 parent f1d0a6f commit e072f77
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 14 deletions.
11 changes: 6 additions & 5 deletions AlignEq.ino
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ void TGeoAlign::model(int n) {
}

// returns the correction to be added to the requested RA,Dec to yield the actual RA,Dec that we will arrive at
void TGeoAlign::correct(double ha, double dec, double pierSide, double sf, double _deo, double _pd, double _pz, double _pe, double _da, double _ff, double _tf, double *h1, double *d1) {
void TGeoAlign::correct(double ha, double dec, double pierSide, double sf, double _deo, double _pd, double _pz, double _pe, double _df, double _ff, double _tf, double *h1, double *d1) {
double DO1,DOh;
double PD,PDh;
double PZ,PA;
Expand Down Expand Up @@ -129,7 +129,7 @@ void TGeoAlign::correct(double ha, double dec, double pierSide, double sf, doubl

// ------------------------------------------------------------
// Axis flex
DF =_da*sf;
DF =_df*sf;
DFd =-DF*(cosLat*cosHa+sinLat*tanDec);

// ------------------------------------------------------------
Expand Down Expand Up @@ -239,6 +239,7 @@ void TGeoAlign::do_search(double sf, int p1, int p2, int p3, int p4, int p5, int
if (p8!=0) best_ode=ode*Rad*3600.0; else best_ode=-best_pe/2.0;
if (p9!=0) best_ohw=ohw*Rad*3600.0;
if (p9!=0) best_ohe=ohe*Rad*3600.0;

}

// keep the main loop running
Expand Down Expand Up @@ -267,7 +268,7 @@ void TGeoAlign::autoModel(int n) {

// figure out the average HA offset as a starting point
ohe=0;
for (l=1; l<num; l++) {
for (l=0; l<num; l++) {
h1=actual[l].ha-mount[l].ha;
if (h1>PI) h1=h1-PI*2.0;
if (h1<-PI) h1=h1+PI*2.0;
Expand Down Expand Up @@ -325,9 +326,9 @@ void TGeoAlign::autoModel(int n) {

tfCor=best_tf/3600.0;
#if defined(MOUNT_TYPE_FORK) || defined(MOUNT_TYPE_FORK_ALT) || defined(MOUNT_TYPE_ALTAZM)
dfCor=best_df/3600.0;
#else
dfCor=best_ff/3600.0;
#else
dfCor=best_df/3600.0;
#endif

ax1Cor=best_ohw/3600.0;
Expand Down
12 changes: 6 additions & 6 deletions AlignHor.ino
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ void TGeoAlignH::model(int n) {
}

// returns the correction to be added to the requested RA,Dec to yield the actual RA,Dec that we will arrive at
void TGeoAlignH::correct(double azm, double alt, double pierSide, double sf, double _deo, double _pd, double _pz, double _pe, double _da, double _ff, double _tf, double *z1, double *a1) {
void TGeoAlignH::correct(double azm, double alt, double pierSide, double sf, double _deo, double _pd, double _pz, double _pe, double _df, double _ff, double _tf, double *z1, double *a1) {
double DO1,DOh;
double PD,PDh;
double PZ,PA;
Expand Down Expand Up @@ -143,7 +143,7 @@ void TGeoAlignH::correct(double azm, double alt, double pierSide, double sf, dou

// ------------------------------------------------------------
// Axis flex
DF =_da*sf;
DF =_df*sf;
DFd =-DF*(cosLat*cosAzm+sinLat*tanAlt);

// ------------------------------------------------------------
Expand Down Expand Up @@ -281,7 +281,7 @@ void TGeoAlignH::autoModel(int n) {

// figure out the average Az offset as a starting point
ohe=0;
for (l=1; l<num; l++) {
for (l=0; l<num; l++) {
z1=actual[l].azm-mount[l].azm;
if (z1>PI) z1=z1-PI*2.0;
if (z1<-PI) z1=z1+PI*2.0;
Expand Down Expand Up @@ -336,9 +336,9 @@ void TGeoAlignH::autoModel(int n) {

tfCor=best_tf/3600.0;
#if defined(MOUNT_TYPE_FORK) || defined(MOUNT_TYPE_FORK_ALT) || defined(MOUNT_TYPE_ALTAZM)
dfCor=best_df/3600.0;
#else
dfCor=best_ff/3600.0;
#else
dfCor=best_df/3600.0;
#endif

ax1Cor=best_ohw/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)
#if defined (MOUNT_TYPE_FORK) || defined(MOUNT_TYPE_FORK_ALT) || defined(MOUNT_TYPE_ALTAZM)
// Fork flex
double DFd=dfCor*cosAzm;
#else
Expand Down
2 changes: 1 addition & 1 deletion Command.ino
Original file line number Diff line number Diff line change
Expand Up @@ -639,7 +639,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)
#if defined(MOUNT_TYPE_FORK) || defined(MOUNT_TYPE_FORK_ALT) || 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
2 changes: 1 addition & 1 deletion OnStep.ino
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
#define FirmwareDate __DATE__
#define FirmwareVersionMajor 1
#define FirmwareVersionMinor 15
#define FirmwareVersionPatch "f" // for example major.minor patch: 1.3c
#define FirmwareVersionPatch "g" // for example major.minor patch: 1.3c
#define FirmwareVersionConfig 2 // internal, for tracking configuration file changes
#define FirmwareName "On-Step"
#define FirmwareTime __TIME__
Expand Down
3 changes: 2 additions & 1 deletion addons/Ethernet/Control.ino
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,8 @@ void handleControl() {
if (mountStatus.alignMaxStars()<3) { n=1; sc[0]=1; } else
if (mountStatus.alignMaxStars()<4) { n=3; sc[0]=1; sc[1]=2; sc[2]=3; } else
if (mountStatus.alignMaxStars()<6) { n=3; sc[0]=1; sc[1]=3; sc[2]=4; } else
{ n=3; sc[0]=1; sc[1]=4; sc[2]=6; }
if (mountStatus.alignMaxStars()<8) { n=3; sc[0]=1; sc[1]=3; sc[2]=6; } else
{ n=3; sc[0]=1; sc[1]=3; sc[2]=9; }
for (int i=0; i<n; i++) { char temp2[120]=""; sprintf(temp2,html_controlAlign2,sc[i],sc[i],SIDEREAL_CH); data+=temp2; }
data += html_controlAlign3;
#ifdef OETHS
Expand Down

0 comments on commit e072f77

Please sign in to comment.