#$ TITLE: Freedom Spec 460 - 500g
#$ FIRMWARE_VERSION: 4.4
#$ CATEGORY: TUNE
#$ STATUS: EXPERIMENTAL
#$ KEYWORDS: sugarK, limon, ctzsnooze, freedom, freedom spec, headsup, five33, 533, racing, race, 5"
#$ AUTHOR: Ivan Efimov (Limon)

#$ PARSER: MARKED

#$ DESCRIPTION:
#$ DESCRIPTION: <img src="https://user-images.githubusercontent.com/2925027/156102810-87aadfd2-5910-4381-8930-189ff7aa4e87.png" width="250px" style="margin-left: auto; margin-right: auto; display: block;"/>
#$ DESCRIPTION:
#$ DESCRIPTION: Important
#$ DESCRIPTION: ----------
#$ DESCRIPTION: 1.  This tune works ONLY with **bidirectional** DSHOT 600/300. If your FC can't handle DSHOT600, pelase select DSHOT 300 in the options here.
#$ DESCRIPTION: 2.  Please, use corresponding preset from RC link category on top of this preset.
#$ DESCRIPTION: 3.  **Do NOT** try to fly this tune on any battery besides 3S!
#$ DESCRIPTION:
#$ DESCRIPTION: Information
#$ DESCRIPTION: -----------
#$ DESCRIPTION: Freedom spec most recent rules are listed [here](https://freedomspec.com/about-1).
#$ DESCRIPTION:
#$ DESCRIPTION: This tune prioritizes clean motor traces at full throttle to make sure your quad flies as fast as possible without loosing energy for heating the motors.
#$ DESCRIPTION: The less noise the faster your quad flies at full throttle. Make sure your frame is solid, all screws are tight, RC link/OpenTX/EdgeTX is up to date.
#$ DESCRIPTION:
#$ DESCRIPTION: This preset is not done yet and there is some room for more impromements. Stay tuned!
#$ DESCRIPTION:
#$ DESCRIPTION: Credits:
#$ DESCRIPTION: -------
#$ DESCRIPTION: *  [sugarK](https://github.com/sugaarK)
#$ DESCRIPTION: *  [ctzsnooze](https://github.com/ctzsnooze)

#$ DISCUSSION: https://github.com/betaflight/firmware-presets/pull/116
#$ 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

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

# -- Gyro lowpass filters --
set gyro_lpf1_static_hz = 0
set gyro_lpf1_dyn_min_hz = 0

# -- Gyro Dynamic Notches --
set dyn_notch_count = 2
set dyn_notch_q = 600
set dyn_notch_min_hz = 180
set dyn_notch_max_hz = 360

# -- RPM filtering --
set dshot_bidir = ON
set rpm_filter_harmonics = 2
set rpm_filter_fade_range_hz = 100

# -- Dterm filtering --
set dterm_lpf1_dyn_expo = 7
set dterm_lpf1_type = BIQUAD
set dterm_lpf1_static_hz = 0

# -- PID Sliders --
set simplified_i_gain = 80
set simplified_d_gain = 145
set simplified_pi_gain = 140
set simplified_dmax_gain = 50
set simplified_feedforward_gain = 130

# -- TPA --
set tpa_rate = 60

# -- Feedforward --
set feedforward_max_rate_limit = 100

# -- Dyn Idle --
set dyn_idle_min_rpm = 30

# -- Antigravity --
set anti_gravity_gain = 50

#$ OPTION BEGIN (UNCHECKED): Noisy frames
    set dyn_notch_count = 3
    set dyn_notch_min_hz = 100
#$ OPTION END

#$ OPTION BEGIN (UNCHECKED): Force LiPo cell count = 3
    set force_battery_cell_count = 3
#$ OPTION END

simplified_tuning apply
