Skip to content

Commit 68161e9

Browse files
committed
Merge branch 'master' into head-tracker
# Conflicts: # html/vrx_index.html
2 parents 50d73f5 + cfeb404 commit 68161e9

File tree

7 files changed

+75
-16
lines changed

7 files changed

+75
-16
lines changed

hardware/targets.json

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -156,19 +156,19 @@
156156
"product_name": "Jumper T-12 Max Internal TX Modules",
157157
"firmware": "ESP_TX_Backpack",
158158
"platform": "esp8285",
159-
"upload_methods": ["uart", "wifi"]
159+
"upload_methods": ["etx", "wifi"]
160160
},
161161
"t15": {
162162
"product_name": "Jumper T-15 Internal TX Modules",
163163
"firmware": "ESP_TX_Backpack",
164164
"platform": "esp8285",
165-
"upload_methods": ["uart", "wifi"]
165+
"upload_methods": ["etx", "wifi"]
166166
},
167167
"t20": {
168168
"product_name": "Jumper T-20 Internal TX Modules with Backpack extension",
169169
"firmware": "ESP_TX_Backpack",
170170
"platform": "esp8285",
171-
"upload_methods": ["uart", "wifi"]
171+
"upload_methods": ["uart", "etx" ,"wifi"]
172172
}
173173
}
174174
},
@@ -292,6 +292,12 @@
292292
"firmware": "ESP_TX_Backpack",
293293
"platform": "esp8285",
294294
"upload_methods": ["etx", "wifi"]
295+
},
296+
"nomad": {
297+
"product_name": "RadioMaster Nomad Xrossband TX",
298+
"firmware": "ESP32C3_TX_Backpack",
299+
"platform": "esp32-c3",
300+
"upload_methods": ["passthru", "wifi"]
295301
}
296302
}
297303
},

html/scan.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,10 @@ function updateAatConfig(config)
7878
_('azim_center').value = config.aat.azim_center;
7979
_('azim_min').value = config.aat.azim_min;
8080
_('azim_max').value = config.aat.azim_max;
81+
_('azim_sff').checked = config.aat.azim_sff === 1;
8182
_('elev_min').value = config.aat.elev_min;
8283
_('elev_max').value = config.aat.elev_max;
84+
_('satmin').value = config.aat.satmin;
8385
aatAzimCenterChanged();
8486

8587
// VBAT
@@ -417,6 +419,7 @@ function aatLineElementChanged()
417419
body: new URLSearchParams({
418420
'bear': _('bear').value,
419421
'elev': _('elev').value,
422+
'azim_sff': _('azim_sff').checked ? 1 : 0,
420423
})
421424
});
422425
}

html/vrx_index.html

Lines changed: 30 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,8 @@ <h2>RTC Update via NTP</h2>
149149
<form action="/aatconfig" id="aatconfig" method="POST" class="mui-form">
150150
<div class="mui-panel">
151151
<fieldset><legend>Servo maximum speed</legend>
152-
Use the slider to limit the maximum rotational speed of the servo. Note that when the azimuth servo
153-
must flip from one side to the other, the servo always will move at full speed.
152+
Use the slider to set a limit on the servo's maximum rotational speed. Note that when the azimuth servo
153+
needs to flip from one side to the other, it may move at full speed if the 'Fast Flip' option is enabled.
154154
<input type="range" id="servosmoo" name="servosmoo" list="servosmoo_markers" value="5" min="0" max="9" step="1" style="width: 100%;"/>
155155
<datalist id="servosmoo_markers">
156156
<option value="0" label="Fast" title="Lickedy Speed"></option>
@@ -179,7 +179,7 @@ <h2>RTC Update via NTP</h2>
179179
</div>
180180
<div class="mui-panel">
181181
<fieldset><legend>Azimuth servo</legend>
182-
Enter the micrsecond (us) values for the min and max position of the horizontal servo, using the slider to test positions.
182+
Enter the microsecond (us) values for the min and max position of the horizontal servo, using the slider to test positions.
183183
<input type="range" id="bear" name="bear" class="aatlive" list="azim_markers" value="0" min="-180" max="180" step="45" style="width: 100%;"/>
184184
<datalist id="bear_markers">
185185
<option value="-180"></option>
@@ -205,9 +205,15 @@ <h2>RTC Update via NTP</h2>
205205
<input id="azim_max" type="number" name="azim_max" min="500" max="2500"/>
206206
<label for="azim_max">Max</label>
207207
</div>
208+
<div class="mui-checkbox mui-col-xs-12">
209+
<label>
210+
<input id="azim_sff" type="checkbox" name="azim_sff" value="1">
211+
Fast Flip (If the azimuth servo needs to move more than 80% of the distance, jump immediately)
212+
</label>
213+
</div>
208214
</fieldset>
209215
<fieldset><legend>Elevation servo</legend>
210-
Enter the micrsecond (us) values for the min and max position of the vertical servo, using the slider to test positions.
216+
Enter the microsecond (us) values for the min and max position of the vertical servo, using the slider to test positions.
211217
<input type="range" id="elev" name="elev" class="aatlive" list="elev_markers" value="45" min="0" max="90" step="15" style="width: 100%;"/>
212218
<datalist id="elev_markers">
213219
<option value="0" label="0"></option>
@@ -233,7 +239,7 @@ <h2>RTC Update via NTP</h2>
233239
</div>
234240
<div class="mui-panel">
235241
<fieldset><legend>Battery voltage</legend>
236-
Battery voltage is calculated using the formula <strong>VBAT = (ADC - offset) / scale</strong>. If voltage is reading too high, increase scale.
242+
<div>Battery voltage is calculated using the formula <strong>VBAT = (ADC - offset) / scale</strong>. If voltage is reading too high, increase scale.</div>
237243
<div class="mui-textfield mui-col-xs-6">
238244
<input id="vbat_scale" type="number" name="vbat_scale" min="1" max="1000"/>
239245
<label for="vbat_scale">Scale</label>
@@ -244,6 +250,25 @@ <h2>RTC Update via NTP</h2>
244250
</div>
245251
</fieldset>
246252
</div>
253+
<div class="mui-panel">
254+
<fieldset>
255+
<legend>Home position settings</legend>
256+
Define the minimum number of satellites required to establish the home position.
257+
<input type="range" id="satmin" name="satmin" list="satmin_markers" min="5" max="21" step="2"
258+
style="width: 100%;" />
259+
<datalist id="satmin_markers">
260+
<option value="5" label="5" title="Less precise"></option>
261+
<option value="7" label="7"></option>
262+
<option value="9" label="9"></option>
263+
<option value="11" label="11"></option>
264+
<option value="13" label="13"></option>
265+
<option value="15" label="15"></option>
266+
<option value="17" label="17"></option>
267+
<option value="19" label="19"></option>
268+
<option value="21" label="21" title="More precise"></option>
269+
</datalist>
270+
</fieldset>
271+
</div>
247272
<input type="hidden" name="commit" value="1"/>
248273
<input type="submit" id="aatsubmit" value="Save" class="mui-btn mui-btn--primary"/>
249274
</form>

lib/config/config.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@ VrxBackpackConfig::SetDefaults()
164164
m_config.aat.project = 0xff;
165165
m_config.aat.servoSmooth = 5;
166166
m_config.aat.centerDir = 0; // N
167+
m_config.aat.azimuthServoFastFlip = 1;
167168
m_config.aat.servoEndpoints[0].low = 500; // AZIM
168169
m_config.aat.servoEndpoints[0].high = 2500;
169170
m_config.aat.servoEndpoints[1].low = 1000; // ELEV
@@ -243,6 +244,12 @@ VrxBackpackConfig::SetAatServoSmooth(uint8_t val)
243244
CONFIG_MOD_CHECK(m_config.aat.servoSmooth, val);
244245
}
245246

247+
void
248+
VrxBackpackConfig::SetAatAzimuthServoFastFlip(uint8_t val)
249+
{
250+
CONFIG_MOD_CHECK(m_config.aat.azimuthServoFastFlip, val);
251+
}
252+
246253
void
247254
VrxBackpackConfig::SetAatServoLow(uint8_t idx, uint16_t val)
248255
{
@@ -279,6 +286,12 @@ VrxBackpackConfig::SetAatServoMode(uint8_t val)
279286
CONFIG_MOD_CHECK(m_config.aat.servoMode, val);
280287
}
281288

289+
void
290+
VrxBackpackConfig::SetAatSatelliteHomeMin(uint8_t val)
291+
{
292+
CONFIG_MOD_CHECK(m_config.aat.satelliteHomeMin, val);
293+
}
294+
282295
/**
283296
* @brief: Validate that the endpoints have a valid range, i.e. low/high not the same
284297
*/

lib/config/config.h

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -88,13 +88,14 @@ typedef struct {
8888
#endif
8989
#if defined(AAT_BACKPACK)
9090
struct __attribute__((packed)) tagAatConfig {
91-
uint8_t satelliteHomeMin; // minimum number of satellites to establish home
92-
uint8_t servoSmooth; // 0-9 for min smoothing to most smoothing
93-
uint8_t centerDir; // Direction servo points at center position 0=N 2=E 4=S 6=W (can hold 45 degrees but only 90 is supported)
94-
uint8_t project; // FUTURE: 0=none, 1=projectAzim, 2=projectElev, 3=projectBoth
95-
uint8_t units; // FUTURE: 0=meters, anything else=also meters :-D
96-
uint8_t servoMode; // 0=2:1, 1=clip180, FUTURE: 180+flip servo
97-
// Also maybe invertAzim / invertElev servo bit or just swap low/high
91+
uint8_t satelliteHomeMin; // minimum number of satellites to establish home
92+
uint8_t azimuthServoFastFlip; // 0=off, 1=on
93+
uint8_t servoSmooth; // 0-9 for min smoothing to most smoothing
94+
uint8_t centerDir; // Direction servo points at center position 0=N 2=E 4=S 6=W (can hold 45 degrees but only 90 is supported)
95+
uint8_t project; // FUTURE: 0=none, 1=projectAzim, 2=projectElev, 3=projectBoth
96+
uint8_t units; // FUTURE: 0=meters, anything else=also meters :-D
97+
uint8_t servoMode; // 0=2:1, 1=clip180, FUTURE: 180+flip servo
98+
// Also maybe invertAzim / invertElev servo bit or just swap low/high
9899
struct __attribute__((packed)) tagServoEndoint {
99100
uint16_t low;
100101
uint16_t high;
@@ -143,6 +144,9 @@ class VrxBackpackConfig
143144

144145
#if defined(AAT_BACKPACK)
145146
uint8_t GetAatSatelliteHomeMin() const { return m_config.aat.satelliteHomeMin; }
147+
void SetAatSatelliteHomeMin(uint8_t val);
148+
uint8_t GetAatAzimuthServoFastFlip() const { return m_config.aat.azimuthServoFastFlip; }
149+
void SetAatAzimuthServoFastFlip(uint8_t val);
146150
uint8_t GetAatServoSmooth() const { return m_config.aat.servoSmooth; }
147151
void SetAatServoSmooth(uint8_t val);
148152
uint8_t GetAatServoMode() const { return m_config.aat.servoMode; }

src/devwifi_proxy_aat.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ void WebAatAppendConfig(ArduinoJson::JsonDocument &json)
77
{
88
auto aat = json["config"].createNestedObject("aat");
99
aat["satmin"] = config.GetAatSatelliteHomeMin();
10+
aat["azim_sff"] = config.GetAatAzimuthServoFastFlip();
1011
aat["servosmoo"] = config.GetAatServoSmooth();
1112
aat["servomode"] = config.GetAatServoMode();
1213
aat["project"] = config.GetAatProject();
@@ -28,6 +29,10 @@ void WebAatConfig(AsyncWebServerRequest *request)
2829
// Servos
2930
if (request->hasArg("servosmoo"))
3031
config.SetAatServoSmooth(request->arg("servosmoo").toInt());
32+
if (request->hasArg("azim_sff"))
33+
config.SetAatAzimuthServoFastFlip(request->arg("azim_sff").toInt());
34+
else
35+
config.SetAatAzimuthServoFastFlip(0);
3136
if (request->hasArg("servomode"))
3237
config.SetAatServoMode(request->arg("servomode").toInt());
3338
if (request->hasArg("azim_center"))
@@ -50,6 +55,9 @@ void WebAatConfig(AsyncWebServerRequest *request)
5055
vrxModule.overrideTargetBearing(request->arg("bear").toInt());
5156
if (request->hasArg("elev"))
5257
vrxModule.overrideTargetElev(request->arg("elev").toInt());
58+
// Satellite Config
59+
if (request->hasArg("satmin"))
60+
config.SetAatSatelliteHomeMin(request->arg("satmin").toInt());
5361

5462
const char *response;
5563
if (request->arg("commit").toInt() == 1)

src/module_aat.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -578,7 +578,7 @@ void AatModule::servoUpdate(uint32_t now)
578578
int32_t maxDiff = (10 - config.GetAatServoSmooth()) * SMOOTHNESS_US_PER_STEP;
579579
// If the distance the servo needs to go is more than 80% away
580580
// jump immediately. otherwise smooth it
581-
if (idx == IDX_AZIM && (abs(diff) * 100 / range) > 80)
581+
if (config.GetAatAzimuthServoFastFlip() && idx == IDX_AZIM && (abs(diff) * 100 / range) > 80)
582582
{
583583
// Prevent the servo from flipping back and forth around the 180 point
584584
// by only allowing 1 flip ever Xms. Just keep pushing toward the limit

0 commit comments

Comments
 (0)