#$ TITLE: SupaflyFPV Freestyle 3/4 Inch
#$ FIRMWARE_VERSION: 4.5
#$ CATEGORY: TUNE
#$ STATUS: OFFICIAL
#$ KEYWORDS: Supafly, SupaflyFPV, 4S, 6S, Freestyle, 3 inch, 4 inch, 3", 4"
#$ AUTHOR: SupaflyFPV

#$ PARSER: MARKED

#$ DESCRIPTION: <a href="https://supaflyfpv.com"><img src="https://supaflyfpv.com/wp-content/uploads/2022/06/Logo-Cropped192.svg" width="220px" style="margin-left: auto; margin-right: auto; display: block;"/></a>
#$ DESCRIPTION:
#$ DESCRIPTION: <br>
#$ DESCRIPTION:
#$ DESCRIPTION: ### SupaflyFPV 3/4 Inch Freestyle Preset
#$ DESCRIPTION:
#$ DESCRIPTION: <br>
#$ DESCRIPTION:
#$ DESCRIPTION: Pick your options from the drop-down:
#$ DESCRIPTION:
#$ DESCRIPTION: <br>
#$ DESCRIPTION:
#$ DESCRIPTION: * For optimisation and tips [use this custom PID calculator](https://supaflyfpv.com/betaflight-setup/)
#$ DESCRIPTION: * RPM Filtering recommended on compatible ESC or de-select if not available
#$ DESCRIPTION: * Pick your Radio Link or search in presets if not found
#$ DESCRIPTION: * Try some freestyle rates modeled on the 3 main styles...
#$ DESCRIPTION: 
#$ DESCRIPTION: <br>
#$ DESCRIPTION:
#$ DESCRIPTION: Enjoy!
#$ DESCRIPTION:
#$ DESCRIPTION: <br>
#$ DESCRIPTION:
#$ DESCRIPTION: Support, feedback and chat:
#$ DESCRIPTION:
#$ DESCRIPTION: <br>
#$ DESCRIPTION:
#$ DESCRIPTION:*[FACEBOOK SUPPORT/FEEDBACK](https://www.facebook.com/groups/supaflyfpv/)
#$ DESCRIPTION:
#$ DESCRIPTION: <br>
#$ DESCRIPTION:
#$ DESCRIPTION:*[DISCORD SUPPORT/FEEDBACK](https://discord.gg/Gs5nTx4rE2)
#$ DESCRIPTION:
#$ DESCRIPTION: <br>
#$ DESCRIPTION: 

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

# -- Antigravity --

set anti_gravity_gain = 120
set feedforward_transition = 30

#$ OPTION_GROUP BEGIN:PIDs

    #$ OPTION BEGIN (CHECKED):With Action Camera

        set simplified_master_multiplier = 100
        set simplified_i_gain = 90
        set simplified_d_gain = 100
        set simplified_pi_gain = 110
        set simplified_dmax_gain = 0
        set simplified_feedforward_gain = 90
        set simplified_pitch_pi_gain = 115

    #$ OPTION END 

    #$ OPTION BEGIN (UNCHECKED):No Action Camera

        set simplified_master_multiplier = 95
        set simplified_i_gain = 90
        set simplified_d_gain = 100
        set simplified_pi_gain = 110
        set simplified_dmax_gain = 0
        set simplified_feedforward_gain = 90
        set simplified_pitch_pi_gain = 105

    #$ OPTION END

#$ OPTION_GROUP END

# ---- Filters Base Setup -------

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

set dshot_bidir = OFF
set simplified_gyro_filter_multiplier = 160
set gyro_lpf1_static_hz = 0
set gyro_lpf1_dyn_min_hz = 0
set gyro_lpf1_dyn_max_hz = 0
set dyn_notch_count = 3
set dyn_notch_q = 300
set dyn_notch_min_hz = 90
set dyn_notch_max_hz = 800

set simplified_dterm_filter_multiplier = 140
set dterm_lpf1_dyn_min_hz = 0
set dterm_lpf1_dyn_max_hz = 0
set dterm_lpf1_dyn_expo = 0

#$ OPTION_GROUP BEGIN: Filters

    #$ OPTION BEGIN (CHECKED): RPM filtering  - Uncheck for Dynamic Notch Filter Setup
    #$ INCLUDE_WARNING: misc/warnings/en/rpm_filters.txt

        set dshot_bidir = ON
        set motor_pwm_protocol = DSHOT600
        set rpm_filter_harmonics = 3
        set rpm_filter_q = 1000
        set dyn_notch_count = 2
        set dyn_notch_q = 400
        set rpm_filter_fade_range_hz = 100

    #$ OPTION END 

#$ OPTION_GROUP END

#$ OPTION_GROUP BEGIN: Choose RC Link

    #$ OPTION BEGIN (UNCHECKED): Crossfire Dynamic
        #$ INCLUDE: presets/4.3/rc_link/defaults.txt

        feature RX_SERIAL
        set serialrx_provider = CRSF

        set feedforward_averaging = OFF
        set feedforward_smooth_factor = 15
        set feedforward_jitter_factor = 10
        set feedforward_boost = 10

        set rc_smoothing_auto_factor = 45
        set rc_smoothing_auto_factor_throttle = 45

    #$ OPTION END

    #$ OPTION BEGIN (UNCHECKED): Crossfire 50Hz Locked
        #$ INCLUDE: presets/4.3/rc_link/defaults.txt

        feature RX_SERIAL
        set serialrx_provider = CRSF

        set feedforward_averaging = OFF
        set feedforward_smooth_factor = 0
        set feedforward_jitter_factor = 10
        set feedforward_boost = 5

        set rc_smoothing_auto_factor = 45
        set rc_smoothing_auto_factor_throttle = 45

    #$ OPTION END

    #$ OPTION BEGIN (UNCHECKED): Crossfire 150Hz Locked
        #$ INCLUDE: presets/4.3/rc_link/defaults.txt

        feature RX_SERIAL
        set serialrx_provider = CRSF

        set feedforward_averaging = OFF
        set feedforward_smooth_factor = 30
        set feedforward_jitter_factor = 7

        set rc_smoothing_auto_factor = 45
        set rc_smoothing_auto_factor_throttle = 45

    #$ OPTION END

    #$ OPTION BEGIN (UNCHECKED): Tracer/ELRS 250Hz
        #$ INCLUDE: presets/4.3/rc_link/defaults.txt

        feature RX_SERIAL
        set serialrx_provider = CRSF

        set feedforward_averaging = 2_POINT
        set feedforward_smooth_factor = 35
        set feedforward_jitter_factor = 4
        set feedforward_boost = 18

        set rc_smoothing_auto_factor = 45
        set rc_smoothing_auto_factor_throttle = 45

    #$ OPTION END

    #$ OPTION BEGIN (UNCHECKED): ELRS 500Hz
        #$ INCLUDE: presets/4.3/rc_link/defaults.txt
        
        feature RX_SERIAL
        set serialrx_provider = CRSF

        set feedforward_averaging = 2_POINT
        set feedforward_smooth_factor = 65
        set feedforward_jitter_factor = 3
        set feedforward_boost = 18

        set rc_smoothing_auto_factor = 45
        set rc_smoothing_auto_factor_throttle = 45

    #$ OPTION END

#$ OPTION_GROUP END

    #$ OPTION_GROUP BEGIN: Freestyle Rates

    #$ OPTION BEGIN (UNCHECKED): Smooth Medium
    #$ INCLUDE: presets/4.3/rates/defaults.txt

        set roll_rc_rate = 2
        set pitch_rc_rate = 2
        set yaw_rc_rate = 2
        set roll_expo = 40
        set pitch_expo = 40
        set yaw_expo = 40
        set roll_srate = 80
        set pitch_srate = 80
        set yaw_srate = 60
        
    #$ OPTION END

    #$ OPTION BEGIN (UNCHECKED): Smooth Fast
    #$ INCLUDE: presets/4.3/rates/defaults.txt

        set roll_rc_rate = 3
        set pitch_rc_rate = 3
        set yaw_rc_rate = 3
        set roll_expo = 35
        set pitch_expo = 35
        set yaw_expo = 35
        set roll_srate = 105
        set pitch_srate = 105
        set yaw_srate = 90

    #$ OPTION END

    #$ OPTION BEGIN (UNCHECKED): Medium Fast
    #$ INCLUDE: presets/4.3/rates/defaults.txt

        set roll_rc_rate = 25
        set pitch_rc_rate = 25
        set yaw_rc_rate = 25
        set roll_expo = 45
        set pitch_expo = 45
        set yaw_expo = 45
        set roll_srate = 108
        set pitch_srate = 108
        set yaw_srate = 88     
 
    #$ OPTION END

#$ OPTION_GROUP END

simplified_tuning apply