Skip to content

Commit a22c584

Browse files
committed
Remove sqm_multiplier config - it's a physical constant (-2.5)
1 parent bba29a9 commit a22c584

File tree

3 files changed

+5
-11
lines changed

3 files changed

+5
-11
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,9 @@ Configuration is stored persistently in EEPROM and survives power cycles.
109109

110110
**SQM Calibration:**
111111
- `set sqm_offset <value>` - Set SQM calibration offset (default: 8.5265)
112-
- `set sqm_multiplier <value>` - Set SQM multiplier (default: -2.5)
112+
- This value combines the standard mag zeropoint (12.58) and solid angle correction for the 10° FOV lens
113+
- Adjust this value to calibrate against a reference SQM meter
114+
- The calculation uses fixed Pogson's ratio (-2.5) from the magnitude scale
113115

114116
**Alert Configuration:**
115117

fw/src/config.h

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ struct DeviceConfig {
1818

1919
// SQM calibration parameters
2020
float sqm_offset; // Offset for SQM calculation (default: 8.5265)
21-
float sqm_multiplier; // Multiplier for SQM calculation (default: -2.5)
21+
// Note: sqm_multiplier is always -2.5 (Pogson's ratio) and not configurable
2222
float sqm_dark_cap; // Maximum SQM value for dark sky (default: 23.0)
2323

2424
// Cloud sensor parameters
@@ -63,8 +63,7 @@ class ConfigManager {
6363
config.version = CONFIG_VERSION;
6464

6565
// SQM defaults
66-
config.sqm_offset = 8.5265;
67-
config.sqm_multiplier = -2.5;
66+
config.sqm_offset = 8.5265; // Calculated for 10° FOV: 12.58 + 2.5*log10(Omega)
6867
config.sqm_dark_cap = 23.0;
6968

7069
// Cloud sensor defaults
@@ -133,7 +132,6 @@ class ConfigManager {
133132

134133
// Getters
135134
float getSqmOffset() { return config.sqm_offset; }
136-
float getSqmMultiplier() { return config.sqm_multiplier; }
137135
float getSqmDarkCap() { return config.sqm_dark_cap; }
138136
float getCloudThreshold() { return config.cloud_threshold; }
139137
bool isAlertEnabled() { return config.alert_enabled; }
@@ -148,7 +146,6 @@ class ConfigManager {
148146

149147
// Setters
150148
void setSqmOffset(float value) { config.sqm_offset = value; }
151-
void setSqmMultiplier(float value) { config.sqm_multiplier = value; }
152149
void setSqmDarkCap(float value) { config.sqm_dark_cap = value; }
153150
void setCloudThreshold(float value) { config.cloud_threshold = value; }
154151
void setAlertEnabled(bool value) { config.alert_enabled = value; }
@@ -168,7 +165,6 @@ class ConfigManager {
168165
void printConfig() {
169166
Serial.println("# === Current Configuration ===");
170167
Serial.print("# SQM Offset: "); Serial.println(config.sqm_offset, 4);
171-
Serial.print("# SQM Multiplier: "); Serial.println(config.sqm_multiplier, 4);
172168
Serial.print("# SQM Dark Cap: "); Serial.println(config.sqm_dark_cap, 2);
173169
Serial.print("# Cloud Threshold: "); Serial.println(config.cloud_threshold, 2);
174170
Serial.print("# Alert Enabled: "); Serial.println(config.alert_enabled ? "YES" : "NO");

fw/src/main.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,6 @@ static void processSerialCommand(const char *cmd)
8585
configManager.setSqmOffset(atof(value));
8686
Serial.print("# Set sqm_offset = "); Serial.println(value);
8787
}
88-
else if (strcmp(param, "sqm_multiplier") == 0) {
89-
configManager.setSqmMultiplier(atof(value));
90-
Serial.print("# Set sqm_multiplier = "); Serial.println(value);
91-
}
9288
else if (strcmp(param, "alert_enabled") == 0) {
9389
configManager.setAlertEnabled(atoi(value));
9490
Serial.print("# Set alert_enabled = "); Serial.println(value);

0 commit comments

Comments
 (0)