Tools: improved quadplane tuning

and shorten GyroFFT log msgs so values can be seen in log
This commit is contained in:
Andrew Tridgell 2020-10-21 15:43:36 +11:00
parent e8f21d3458
commit c7a60f57ad
2 changed files with 11 additions and 6 deletions

View File

@ -68,4 +68,8 @@ SCHED_LOOP_RATE 300
THR_MAX 100
TRIM_ARSPD_CM 2500
LOG_BITMASK 65534
Q_M_THST_EXPO 0.65
Q_M_PWM_MIN 1000
Q_M_PWM_MAX 2000
Q_M_BAT_VOLT_MAX 12.8
Q_M_BAT_VOLT_MIN 9.6

View File

@ -411,9 +411,9 @@ class AutoTestQuadPlane(AutoTest):
freq = psd["F"][numpy.argmax(psd["X"][sminhz:smaxhz]) + sminhz]
peakdb = numpy.amax(psd["X"][sminhz:smaxhz])
if peakdb < dblevel or (peakhz is not None and abs(freq - peakhz) / peakhz > 0.05):
raise NotAchievedException("Did not detect a motor peak, found %fHz at %fdB" % (freq, peakdb))
raise NotAchievedException("No motor peak, found %fHz at %fdB" % (freq, peakdb))
else:
self.progress("Detected motor peak at %fHz, throttle %f%%, %fdB" % (freq, vfr_hud.throttle, peakdb))
self.progress("motor peak %fHz, thr %f%%, %fdB" % (freq, vfr_hud.throttle, peakdb))
# we have a peak make sure that the FFT detected something close
# logging is at 10Hz
@ -512,10 +512,11 @@ class AutoTestQuadPlane(AutoTest):
self.do_RTL()
psd = self.mavfft_fttd(1, 0, tstart * 1.0e6, tend * 1.0e6)
freq = psd["F"][numpy.argmax(psd["X"][ignore_bins:]) + ignore_bins]
if numpy.amax(psd["X"][ignore_bins:]) < -10:
self.progress("Did not detect a motor peak, found %f at %f dB" % (freq, numpy.amax(psd["X"][ignore_bins:])))
peakdB = numpy.amax(psd["X"][ignore_bins:])
if peakdB < -10:
self.progress("No motor peak, %f at %f dB" % (freq, peakdB))
else:
raise NotAchievedException("Detected motor peak at %f Hz" % (freq))
raise NotAchievedException("Detected peak at %f Hz of %.2f dB" % (freq, peakdB))
# Step 4: take off as a copter land as a plane, make sure we track
self.progress("Flying with gyro FFT - vtol to plane")