#$ TITLE: Squirrel 3.5 tune
#$ FIRMWARE_VERSION: 4.5
#$ CATEGORY: TUNE
#$ STATUS: EXPERIMENTAL
#$ KEYWORDS: rubberquads, squirrel, 3.5, pid, tune,
#$ AUTHOR: Volker Göschl-Covrljan
#$ DISCUSSION: https://discord.gg/RqbQBuh7pu

#$ PARSER: MARKED
#$ DESCRIPTION: <br>
#$ DESCRIPTION: <img src="https://www.rubberquads.com/static/rubberquads/RQ-logo_header.png" width="200px" style="margin-left: auto; margin-right: auto; display: block;"/>
#$ DESCRIPTION:
#$ DESCRIPTION: # Base-tune for the Squirrel 35
#$ DESCRIPTION: Works just fine in combination with the squirrel filter preset
#$ DESCRIPTION: If you run bigger motors than the 3quack5 (1604/4040kV) reduce the master multiplier to 0.85 and raise from there;
#$ DESCRIPTION: If you run a small motors like 1404s you might need to raise thrust linearisation to 0.2 and start with a master-multiplier of 1.2
#$ WARNING: Please load the adequate preset for your control-link and hit save
#$ DESCRIPTION: otherwise feed-forward will not be happy

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


# -- PIDS with ze sliders
set simplified_pids_mode = RPY
set simplified_master_multiplier = 95
set simplified_i_gain = 100
set simplified_d_gain = 115
set simplified_pi_gain = 90
set simplified_dmax_gain = 40
set simplified_feedforward_gain = 80
set simplified_pitch_d_gain = 95
set simplified_pitch_pi_gain = 95

simplified_tuning apply

# motor idle and linearity compensation 
set thrust_linear = 18
set throttle_boost = 0
set dyn_idle_min_rpm = 34

# more fancy tuning stuff
set iterm_rotation = OFF
set iterm_relax = RP
set iterm_relax_type = SETPOINT
set iterm_relax_cutoff = 18
set iterm_windup = 85
set tpa_mode = D
set tpa_rate = 60
set tpa_breakpoint = 1400
set tpa_low_rate = 20
set tpa_low_breakpoint = 1050
set tpa_low_always = OFF

set vbat_sag_compensation = 80
set anti_gravity_gain = 65
set anti_gravity_cutoff_hz = 5
set anti_gravity_p_gain = 70

#$ OPTION BEGIN (UNCHECKED): I want to arm upside down
    set small_angle = 180
#$ OPTION END
