From e072f778580b7c27da5e5b8f24e391b06a76bf83 Mon Sep 17 00:00:00 2001 From: Howard Dutton Date: Tue, 30 Oct 2018 09:08:58 -0400 Subject: [PATCH] Fixes to GTA alignment Most significantly a fix to how the df term is handled. --- AlignEq.ino | 11 ++++++----- AlignHor.ino | 12 ++++++------ Command.ino | 2 +- OnStep.ino | 2 +- addons/Ethernet/Control.ino | 3 ++- 5 files changed, 16 insertions(+), 14 deletions(-) diff --git a/AlignEq.ino b/AlignEq.ino index 414531c30..92ee0c451 100644 --- a/AlignEq.ino +++ b/AlignEq.ino @@ -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; @@ -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); // ------------------------------------------------------------ @@ -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 @@ -267,7 +268,7 @@ void TGeoAlign::autoModel(int n) { // figure out the average HA offset as a starting point ohe=0; - for (l=1; lPI) h1=h1-PI*2.0; if (h1<-PI) h1=h1+PI*2.0; @@ -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; diff --git a/AlignHor.ino b/AlignHor.ino index 03931dcbc..dc1f79d2f 100644 --- a/AlignHor.ino +++ b/AlignHor.ino @@ -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; @@ -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); // ------------------------------------------------------------ @@ -281,7 +281,7 @@ void TGeoAlignH::autoModel(int n) { // figure out the average Az offset as a starting point ohe=0; - for (l=1; lPI) z1=z1-PI*2.0; if (z1<-PI) z1=z1+PI*2.0; @@ -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; @@ -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 diff --git a/Command.ino b/Command.ino index 64c899a94..2aee29afb 100644 --- a/Command.ino +++ b/Command.ino @@ -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 diff --git a/OnStep.ino b/OnStep.ino index 46cfcd16a..f561665b7 100644 --- a/OnStep.ino +++ b/OnStep.ino @@ -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__ diff --git a/addons/Ethernet/Control.ino b/addons/Ethernet/Control.ino index 4a89f4b6a..84ada9230 100644 --- a/addons/Ethernet/Control.ino +++ b/addons/Ethernet/Control.ino @@ -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