#$ TITLE: DinDrones OZR-5X
#$ FIRMWARE_VERSION: 4.5
#$ CATEGORY: TUNE
#$ STATUS: EXPERIMENTAL
#$ KEYWORDS: ozr, dindrones, 6s, 5 inch, 5", racing, 5in, din
#$ AUTHOR: Benjamin Freelove
#$ FORCE_OPTIONS_REVIEW: TRUE

#$ PARSER: MARKED

#$ DESCRIPTION: <h1>DinDrones OZR-5X tune</h1>
#$ DESCRIPTION: <br>
#$ DESCRIPTION: This 6S racing tune is based on Karate Race 6s 5" (non spicy) by sugarK with very minor changes.
#$ DESCRIPTION: <br>
#$ DESCRIPTION: Tested on DinDrones OZR-5X frame with MPU6000 and ICM42688 flight controllers, and default ESC settings.
#$ DESCRIPTION: <br>
#$ DESCRIPTION:
#$ DESCRIPTION: ## Things to note:
#$ DESCRIPTION: - **YOU HAVE TO USE RPM FILTERING WITH THIS TUNE!** Failure to do so might result in fire 🔥
#$ DESCRIPTION: - Regarding DShot600: if your setup has errors in the motor tab using bidirectional DShot, change to **8k/4k and DShot300**
#$ DESCRIPTION: - Also this should be applied to a clean flash after you've setup your rates, swtiches, vtx tables etc.
#$ DESCRIPTION: - To test arm the quad with props on, it should **sound clean with no grinding**. If it passes that then hover test and check motor temps.
#$ DESCRIPTION: - **If anything is off, don't fly it!!**

#$ INCLUDE_WARNING: misc/warnings/en/rpm_filters.txt

#$ DISCUSSION: https://github.com/betaflight/firmware-presets/pull/471

#$ INCLUDE: presets/4.5/tune/defaults.txt
#$ INCLUDE: presets/4.5/filters/defaults.txt

# -- Gyro lowpass filters --
set gyro_lpf1_static_hz = 0
set gyro_lpf1_dyn_min_hz = 0
set gyro_lpf1_dyn_max_hz = 0
set simplified_gyro_filter = OFF

# -- Gyro Dynamic Notches --
set dyn_notch_count = 1
set dyn_notch_q = 450
set dyn_notch_min_hz = 125
set dyn_notch_max_hz = 650

# -- Dterm filtering --
set dterm_lpf1_dyn_expo = 7

#$ OPTION_GROUP BEGIN: (EXCLUSIVE) Gyro type
    #$ OPTION BEGIN (CHECKED): MPU6000
        # empty on purpose, only ICM needs corrections
    #$ OPTION END
    #$ OPTION BEGIN (UNCHECKED): ICM42688
        set gyro_lpf2_static_hz = 0
        set simplified_dterm_filter_multiplier = 110
    #$ OPTION END
#$ OPTION_GROUP END

# -- RPM filtering --
set dshot_bidir = ON
set rpm_filter_weights = 100,50,100
set rpm_filter_fade_range_hz = 100

# -- Misc --
set throttle_boost = 0

# -- iTerm  --
set iterm_relax_cutoff = 45

# -- PIDsum limits --
set iterm_limit = 500
set pidsum_limit_yaw = 1000

# -- PID values --
set simplified_pids_mode = RP
set simplified_master_multiplier = 90
set simplified_i_gain = 120
set simplified_d_gain = 70
set simplified_pi_gain = 85
set simplified_dmax_gain = 200
set simplified_feedforward_gain = 105
set simplified_pitch_pi_gain = 105

simplified_tuning apply

# -- Feedforward --
set feedforward_max_rate_limit = 100

# -- TPA --
set tpa_rate = 70
set tpa_breakpoint = 1250

#$ OPTION BEGIN (CHECKED): Dshot600
    set dshot_bidir = ON
    set motor_pwm_protocol = DSHOT600
#$ OPTION END

#$ OPTION BEGIN (UNCHECKED): Dshot300
    set dshot_bidir = ON
    set motor_pwm_protocol = Dshot300
#$ OPTION END

#$ OPTION_GROUP BEGIN: Some popular RC Links

    #$ OPTION BEGIN (UNCHECKED): Tracer/ELRS 250Hz
        # Tracer/ELRS 250Hz
        
        feature RX_SERIAL
        set serialrx_provider = CRSF

        #$ INCLUDE: presets/4.3/rc_link/generic/250hz_race.txt

    #$ OPTION END

    #$ OPTION BEGIN (UNCHECKED): ELRS 500Hz
        # ERLS 500Hz
        
        feature RX_SERIAL
        set serialrx_provider = CRSF

        #$ INCLUDE: presets/4.3/rc_link/generic/500hz_race.txt

    #$ OPTION END
    
    #$ OPTION BEGIN (UNCHECKED): ELRS 1000Hz
        # ELRS 1000Hz
       
        feature RX_SERIAL
        set serialrx_provider = CRSF

         #$ INCLUDE: presets/4.3/rc_link/generic/1000hz_race.txt
         
    #$ OPTION END
    
    #$ OPTION BEGIN (UNCHECKED): Ghost 250Hz
        # Ghost 250Hz
      
        feature RX_SERIAL
        set serialrx_provider = GHST

         #$ INCLUDE: presets/4.3/rc_link/generic/250hz_race.txt

    #$ OPTION END

    #$ OPTION BEGIN (UNCHECKED): Ghost 500Hz
        # Ghost 500Hz
       
        feature RX_SERIAL
        set serialrx_provider = GHST

         #$ INCLUDE: presets/4.3/rc_link/generic/500hz_race.txt
    #$ OPTION END

#$ OPTION_GROUP END

#$ OPTION BEGIN (UNCHECKED): MCK rates
    #$ INCLUDE: presets/4.3/rates/MinChan.txt
#$ OPTION END
