iNavFlight / inav

INAV: Navigation-enabled flight control software
https://inavflight.github.io
GNU General Public License v3.0
3.2k stars 1.49k forks source link

Remove 500hz gyro limit on F1 targets. #1468

Closed WaspFPV closed 7 years ago

WaspFPV commented 7 years ago

For people who know what they are doing. The 500hz synced default is pretty safe. When using Asynchronous mode on F1 targets, it is theoretically possible to set the gyro faster than 500Hz. I have succesfully done so, with gps. However, iNav has a hardcoded gyro limiter on F1 targets that limits the gyro to 500hz with gps enabled. I removed it and enabled asynchronous mode on a custom Naze build. Could this limiter be removed from future versions so that we can fly F1 targets in asynchronous mode with GPS enabled? my settings: async mode all gyro 1khz pid 500hz acc 500hz attitude 250hz i2c overclock on all notch filters enabled I attached my custom 1.6.1 build. I removed gyro limiter and blackbox, added async mode and notch filters, and cli task statistics. edit: new version. Just removed blackbox, added rest back in. output of tasks:

Task list         rate/hz  max/us  avg/us maxload avgload     total/ms
 0 -       SYSTEM       9       7       4    0.5%    0.5%         5
 1 -          PID     497     697     468   35.1%   23.7%     30840
 2 -         GYRO     980     345     237   34.3%   23.7%     28734
 3 -          ACC     496     194     183   10.1%    9.5%     11181
 4 -     ATTITUDE     245     344     329    8.9%    8.5%     10007
 5 -           RX      49     124     113    1.1%    1.0%       690
 6 -       SERIAL      99   74124      54  734.3%    1.0%       300
 7 -      BATTERY      49      23      10    0.6%    0.5%        66
 8 -       BEEPER      98      20       7    0.6%    0.5%        87
 9 -          GPS      24     457      97    1.5%    0.7%       301
10 -      COMPASS       9     144     138    0.6%    0.6%       170
11 -         BARO      43     144      97    1.1%    0.9%       502
12 -    TELEMETRY     228     116       6    3.1%    0.6%       166
Task check function             9       5                        31
Total (excluding SERIAL)                    97.5%   70.7%

inav_1.6.1_NAZE_no_blackbox.zip

oleost commented 7 years ago

Aren't async mode removed from F1 as well?

digitalentity commented 7 years ago

That limit is imposed by the fact that F1 board will be incapable of maintaining 1kHz gyro AND GPS modes activated. However you can try actually flying AltHold + PosHold with your config and post a BB log so we can confirm that 1kHz on F1 is viable.

However I don't think we should try to keep F1 up to date for much longer. They are obviously EOL.

WaspFPV commented 7 years ago

I was just playing with custom builds and ran into this. However, 1500 looptime (666Hz) is still possible in synced mode with i2c_overclock on and gyro_lpf = 256Hz. (that is on standard 1.6.1 build with limiter removed) Here's my config I was running on this build. No BB logs unfortunately. It was only an attempt to get the gyro up to 1k on a racer quad with GPS.

# diff
# INAV/NAZE 1.6.1 Mar 24 2017 / 11:22:52 ()
feature SOFTSERIAL
feature GPS
feature TELEMETRY
feature PWM_OUTPUT_ENABLE
serial 0 1 115200 57600 0 115200
serial 1 2 115200 57600 0 115200
serial 30 4 115200 57600 9600 115200
serial 31 0 115200 57600 0 115200
aux 0 0 0 1100 2100
aux 1 1 0 1500 2100
aux 2 2 0 1300 1500
aux 3 4 0 1600 2100
aux 4 3 0 1600 2100
aux 5 9 0 1700 1900
aux 6 8 0 1900 2100
aux 7 17 0 1600 2100
set gyro_sync = ON
set gyro_sync_denom = 1
set gyro_hardware_lpf = 188HZ
set gyro_lpf_hz = 70
set gyro_notch1_hz = 172
set gyro_notch1_cutoff = 129
set gyro_notch2_hz = 86
set gyro_notch2_cutoff = 43
set acc_hardware = MPU6500
set acc_lpf_hz = 10
set acczero_y = -16
set acczero_z = -15
set accgain_x = 4087
set accgain_y = 4087
set accgain_z = 4073
set align_mag = CW90
set mag_hardware = HMC5883
set magzero_x = -183
set magzero_y = -326
set magzero_z = -106
set mag_hold_rate_limit = 250
set baro_hardware = BMP280
set min_check = 1020
set max_check = 1980
set rssi_channel = 6
set blackbox_rate_denom = 32
set blackbox_device = SPIFLASH
set min_throttle = 1040
set max_throttle = 2000
set motor_pwm_rate = 2000
set motor_pwm_protocol = ONESHOT125
set failsafe_procedure = DROP
set imu_dcm_ki_mag = 50
set gps_sbas_mode = EGNOS
set gps_dyn_model = AIR_4G
set inav_w_z_gps_p =  0.000
set inav_w_xy_gps_v =  1.000
set nav_disarm_on_landing = ON
set nav_use_midthr_for_althold = ON
set nav_extra_arming_safety = OFF
set nav_user_control_mode = CRUISE
set nav_max_speed = 500
set nav_manual_climb_rate = 500
set nav_rth_alt_mode = FIXED
set nav_rth_abort_threshold = 5000
set nav_rth_altitude = 2000
set telemetry_inversion = ON
set i2c_overclock = ON
set debug_mode = NOTCH
set async_mode = ALL
profile 1

set mc_p_pitch = 60
set mc_i_pitch = 50
set mc_d_pitch = 55
set mc_p_roll = 45
set mc_i_roll = 40
set mc_d_roll = 45
set mc_p_yaw = 90
set max_angle_inclination_rll = 450
set max_angle_inclination_pit = 450
set yaw_lpf_hz = 0
set dterm_notch_hz = 129
set dterm_notch_cutoff = 43
set rate_accel_limit_yaw = 0
set nav_mc_vel_z_p = 125
set nav_mc_vel_z_d = 12
set rc_yaw_expo = 65
set roll_rate = 80
set pitch_rate = 80
set yaw_rate = 65
set tpa_rate = 10
set tpa_breakpoint = 1650
WaspFPV commented 7 years ago

Here is a blackbox with 1k gyro, 500hz pid, 500hz acc, 250hz attitude and i2c_overclock on Naze. Logging rate was 100%, so I only got a minute of log but it contains poshold and RTH. Which logging rate would you suggest for my next log? blackbox_log_2017-03-28_211904.TXT

fiam commented 7 years ago

I guess we can close this one now that F1 targets are out

digitalentity commented 7 years ago

Targets based on F1 chip are no longer supported. Closing.