#$ TITLE: MinChan 2022 Race 6s 5"
#$ FIRMWARE_VERSION: 4.4
#$ CATEGORY: TUNE
#$ STATUS: EXPERIMENTAL
#$ KEYWORDS: 6S, race, world champion, 5 inch, 5", mck, minchan, kim, 2022, multigp
#$ AUTHOR: MinChan Kim

#$ PARSER: MARKED

#$ DESCRIPTION:
#$ DESCRIPTION: <img src="https://user-images.githubusercontent.com/2925027/198938547-053e2f86-5491-4006-9205-c5eadc6a3df1.png" width="220px" style="display: block; float: left; margin-right: 10px; margin-top: 10px;"/>
#$ DESCRIPTION:
#$ DESCRIPTION: This is a 6S 5'' racing tune by MinChan Kim (aka MCK) from 2022 MultiGP Champs, where he took first place,
#$ DESCRIPTION: proving again that he is the fastest racer in the world.
#$ DESCRIPTION:
#$ DESCRIPTION: <br>
#$ DESCRIPTION:
#$ DESCRIPTION: Original tune comes from 4.3 (KAACK mod), but 4.4 tuning parameters are identical to 4.3, except Anti Gravity.
#$ DESCRIPTION: This tune leaves AG gains at defaults.
#$ DESCRIPTION:
#$ DESCRIPTION: <br>
#$ DESCRIPTION:
#$ DESCRIPTION: This tune is pretty aggressive and there are chances it's not going to work well on your average drone.
#$ DESCRIPTION: <br>**YOU HAVE TO USE RPM FILTERING WITH THIS TUNE!**
#$ DESCRIPTION: <br>Failure to do so might result in fire 🔥
#$ DESCRIPTION:
#$ DESCRIPTION: ## MCK setup:
#$ DESCRIPTION: - Five33 LightSwitch
#$ DESCRIPTION: - Five33 Foxeer Predator V5
#$ DESCRIPTION: - Five33 2207 2070KV Champions edition
#$ DESCRIPTION: - Foxeer F722 V2 and V4 (20x20)
#$ DESCRIPTION: - Foxeer Reaper F4 Slim 60A esc
#$ DESCRIPTION: - Gemfan MCK 51466 V2
#$ DESCRIPTION: - Lumenier AXII antenna on quads , Five33 AXII
#$ DESCRIPTION: - Dogcom MCK 6S 1380mah
#$ DESCRIPTION: - Rush TinyTank VTX
#$ DESCRIPTION: - ImmersionRC Ghost Duo Hybrid V2 board
#$ DESCRIPTION: - ImmersionRC Ghost TX
#$ DESCRIPTION: - ImmersionRC Rapid fire
#$ DESCRIPTION: - ORQA V2 Goggle
#$ DESCRIPTION: - Radiomasters MCK Edition
#$ DESCRIPTION:
#$ DESCRIPTION: <br>
#$ DESCRIPTION:
#$ DESCRIPTION: According to MinChan, he did not like how BMI gyro flies, but this tune supposed to be similar on that gyro as well. Use DSHOT300 option for FCs with BMI gyro, and for STM32F4 chips. This tune is provided as-is from MCK drone diff.

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

#$ INCLUDE_WARNING: misc/warnings/en/dshot.txt
#$ INCLUDE_WARNING: misc/warnings/en/rpm_filters.txt
#$ INCLUDE: presets/4.4/tune/defaults.txt
#$ INCLUDE: presets/4.3/filters/defaults.txt

set motor_pwm_protocol = DSHOT600

# -- Gyro Dynamic Notches --
set dyn_notch_count = 1
set dyn_notch_q = 600
set dyn_notch_min_hz = 250
set dyn_notch_max_hz = 650

# -- Dterm filtering --
set simplified_dterm_filter = OFF
set dterm_lpf1_dyn_min_hz = 150
set dterm_lpf1_dyn_max_hz = 750
set dterm_lpf1_static_hz = 150
set dterm_lpf2_static_hz = 70

# not needed, but to be authentic:
set simplified_dterm_filter_multiplier = 200

# -- RPM filtering --
set dshot_bidir = ON
set rpm_filter_min_hz = 200
set rpm_filter_fade_range_hz = 100

# -- Throttle boost
set throttle_boost = 2

# -- Yaw lowpass --
set yaw_lowpass_hz = 0

# -- iTerm  --
set iterm_relax_cutoff = 20
set iterm_limit = 500

# -- PIDsum limits --
set pidsum_limit_yaw = 1000

# -- PID values --
set simplified_pids_mode = OFF
set p_pitch = 45
set i_pitch = 92
set d_pitch = 40
set f_pitch = 150
set p_roll = 43
set i_roll = 90
set d_roll = 37
set f_roll = 155
set p_yaw = 39
set i_yaw = 85
set f_yaw = 150
set d_min_roll = 20
set d_min_pitch = 22
set d_max_gain = 25
set d_max_advance = 0

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

# -- Feedforward --
set feedforward_max_rate_limit = 100
set feedforward_boost = 12

# -- Gyro lowpass filters --
set simplified_gyro_filter_multiplier = 150
# Applying simplified tuning for gyro filters only
simplified_tuning apply

#$ OPTION BEGIN (UNCHECKED): Dshot300 (F4 or BMI)
    set motor_pwm_protocol = Dshot300
#$ OPTION END

#$ OPTION BEGIN (UNCHECKED): Min/max check 1000/2000
    set min_check = 1000
    set max_check = 2000
#$ OPTION END

#$ OPTION_GROUP BEGIN: Some racing RC_LINK presets
    #$ OPTION BEGIN (UNCHECKED): 150hz link
        #$ INCLUDE: presets/4.3/rc_link/generic/150hz_race.txt
    #$ OPTION END

    #$ OPTION BEGIN (UNCHECKED): 250hz link
        #$ INCLUDE: presets/4.3/rc_link/generic/250hz_race.txt
    #$ OPTION END

    #$ OPTION BEGIN (UNCHECKED): 500hz link
        #$ 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
