Skip to content

Commit e861b8d

Browse files
authored
Tweak GAIN_STEPS calculation in celestronaux.h (#1255)
* Refactor GAIN_STEPS calculation in celestronaux.h Updated GAIN_STEPS to a new calculation based on geometric analysis and testing. * Update GAIN_STEPS calculation in celestronaux.h The factor in here must be inverse to the one in the simulator - so 10125/128 ~ 79 * Fix scaling factor calculations in celestronaux.h
1 parent f15d37b commit e861b8d

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

indi-celestronaux/celestronaux.h

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -507,8 +507,17 @@ class CelestronAUX :
507507
static constexpr double STEPS_PER_HOUR {STEPS_PER_REVOLUTION / 24.0};
508508
static constexpr double HOURS_PER_STEP {24.0 / STEPS_PER_REVOLUTION};
509509

510-
// Measured rate that would result in 1 step/sec
511-
static constexpr uint32_t GAIN_STEPS {80};
510+
// Measured rate that would result in 1 step/sec - only approximate
511+
// static constexpr uint32_t GAIN_STEPS {80};
512+
513+
// Rate based on geometric analysis and testing against SkySafari 7, simulator and real mount:
514+
// Logical unit for guiding commands is 1/1024 arcsec/sec.
515+
// Steps per arcsecond = 16777216 / (360 * 3600) = 16777216 / 1296000
516+
// Scaling Factor (Units -> Steps/sec) = 1024 * (1296000 / 16777216)
517+
// Factor = (1024 * 1296000) / 16777216 = 1327104000 / 16777216
518+
// Simplified Rational Factor = 10125 / 128
519+
// Steps/sec = Value * (10125 / 128) = Value * 79.1015625
520+
static constexpr double GAIN_STEPS {10125.0 / 128};
512521

513522
// MC_SET_POS_GUIDERATE & MC_SET_NEG_GUIDERATE use 24bit number rate in
514523
static constexpr uint8_t RATE_PER_ARCSEC {4};

0 commit comments

Comments
 (0)