Y3垂起标准配置文件解析()
全文代码:
diff all# version
# INAV/SPEEDYBEEF405WING 7.1.2 Jun 1 2024 / 00:47:23 (4e1e59eb)
# GCC-10.3.1 20210824 (release)# start the command batch
batch start# reset configuration to default settings
defaults noreboot# resources# Timer overrides
timer_output_mode 0 SERVOS
timer_output_mode 1 MOTORS# Outputs [servo]
servo 1 700 2050 1375 100
servo 2 800 2250 1525 100
servo 3 1000 2000 1500 -100
servo 4 1000 2000 1500 -100
servo 5 900 2000 1470 100
servo 6 1300 2000 1670 -100# safehome# Fixed Wing Approach# features
feature GPS
feature LED_STRIP
feature PWM_OUTPUT_ENABLE
feature FW_AUTOTRIM# beeper# blackbox
blackbox -NAV_ACC
blackbox NAV_POS
blackbox NAV_PID
blackbox MAG
blackbox ACC
blackbox ATTI
blackbox RC_DATA
blackbox RC_COMMAND
blackbox MOTORS
blackbox -GYRO_RAW
blackbox -PEAKS_R
blackbox -PEAKS_P
blackbox -PEAKS_Y# Receiver: Channel map# Ports
serial 4 33554432 115200 115200 0 115200# LEDs
led 0 0,0::CTO:8
led 1 1,0::CTO:8
led 2 2,0::CTO:8
led 3 3,0::CTO:8
led 4 4,0::CTO:8
led 5 5,0::CTO:8
led 6 6,0::CTO:8
led 7 7,0::CTO:8
led 8 8,0::CTO:8
led 9 9,0::CTO:8
led 10 10,0::CTO:8
led 11 11,0::CTO:8
led 12 12,0::CTO:8
led 13 13,0::CTO:8
led 14 14,0::CTO:8
led 15 15,0::CTO:8
led 16 0,1::CTO:8
led 17 1,1::CTO:8
led 18 2,1::CTO:8
led 19 3,1::CTO:8
led 20 4,1::CTO:8
led 21 5,1::CTO:8
led 22 6,1::CTO:8
led 23 7,1::CTO:8
led 24 8,1::CTO:8
led 25 9,1::CTO:8
led 26 10,1::CTO:8
led 27 11,1::CTO:8
led 28 12,1::CTO:8
led 29 13,1::CTO:8
led 30 14,1::CBE:8
led 31 15,1::CBE:8# LED color# LED mode_color# Modes [aux]
aux 0 0 0 1700 2100
aux 1 1 1 1700 2100
aux 2 12 1 1300 1700
aux 3 11 2 1300 1700
aux 4 10 2 1700 2100
aux 5 3 2 1300 1700
aux 6 21 8 1700 2100
aux 7 62 4 1275 2100
aux 8 63 4 1300 1700# Adjustments [adjrange]# Receiver rxrange# temp_sensor# Mission Control Waypoints [wp]
#wp 0 invalid# OSD [osd_layout]
osd_layout 0 0 23 0 H
osd_layout 0 1 42 9 V
osd_layout 0 2 0 0 V
osd_layout 0 3 8 6 V
osd_layout 0 4 8 6 V
osd_layout 0 7 24 15 V
osd_layout 0 11 42 11 V
osd_layout 0 12 42 12 V
osd_layout 0 13 14 9 V
osd_layout 0 14 36 6 V
osd_layout 0 15 34 10 V
osd_layout 0 20 1 0 V
osd_layout 0 21 1 1 V
osd_layout 0 22 26 12 V
osd_layout 0 23 24 13 V
osd_layout 0 24 25 1 V
osd_layout 0 25 31 8 V
osd_layout 0 26 35 11 V
osd_layout 0 27 13 11 V
osd_layout 0 28 42 16 V
osd_layout 0 30 12 16 V
osd_layout 0 32 42 10 V
osd_layout 0 34 23 0 V
osd_layout 0 40 7 14 V
osd_layout 0 45 0 0 V
osd_layout 0 46 3 10 V
osd_layout 0 50 24 13 H
osd_layout 0 51 12 2 V
osd_layout 0 85 14 10 V
osd_layout 0 100 7 16 V
osd_layout 0 109 36 4 V
osd_layout 0 110 36 5 V
osd_layout 0 119 41 0 V
osd_layout 0 144 41 1 V# Programming: logic
logic 0 1 -1 22 0 0 0 0 0
logic 1 1 -1 1 2 38 0 1 0
logic 2 1 1 4 1 11 0 0 0
logic 3 1 1 5 1 11 0 0 0
logic 4 1 1 6 1 11 0 0 0
logic 5 1 1 42 0 1 0 0 0
logic 6 1 4 42 0 3 0 0 0# Programming: global variables# Programming: PID controllers# OSD: custom elements# master
set gyro_main_lpf_hz = 30
set dynamic_gyro_notch_q = 250
set dynamic_gyro_notch_min_hz = 30
set gyro_zero_y = -8
set gyro_zero_z = 4
set ins_gravity_cmss = 977.727
set acc_hardware = ICM42605
set acczero_y = -4
set acczero_z = 10
set accgain_x = 4087
set accgain_y = 4093
set accgain_z = 4089
set align_mag = CW270FLIP
set mag_hardware = NONE
set baro_hardware = DPS310
set pitot_hardware = VIRTUAL
set blackbox_rate_denom = 32
set motor_pwm_protocol = DSHOT300
set failsafe_procedure = RTH
set align_board_roll = 20
set servo_pwm_rate = 330
set small_angle = 180
set applied_defaults = 3
set gps_provider = UBLOX7
set gps_sbas_mode = AUTO
set airmode_type = STICK_CENTER_ONCE
set nav_wp_radius = 800
set nav_wp_max_safe_distance = 500
set nav_rth_allow_landing = FS_ONLY
set nav_rth_altitude = 5000
set nav_fw_control_smoothness = 2
set nav_fw_launch_motor_delay = 100
set nav_fw_launch_max_altitude = 5000
set nav_fw_launch_climb_angle = 25
set osd_video_system = AVATAR
set osd_crosshairs_style = AIRCRAFT
set osd_left_sidebar_scroll = SPEED
set osd_right_sidebar_scroll = ALTITUDE
set i2c_speed = 800KHZ# mixer_profile
mixer_profile 1set platform_type = AIRPLANE
set has_flaps = ON
set model_preview_type = 14
set motorstop_on_low = ON
set mixer_pid_profile_linking = ON# Mixer: motor mixermmix resetmmix 0 1.000 0.000 0.000 0.000
mmix 1 1.000 0.000 0.000 0.000
mmix 2 -1.000 0.000 0.000 0.000# Mixer: servo mixer
smix resetsmix 0 3 0 100 0 -1
smix 1 4 0 100 0 -1
smix 2 5 1 100 0 -1
smix 3 6 2 100 0 -1
smix 4 1 29 60 0 -1
smix 5 2 29 -60 0 -1
smix 6 1 0 -20 0 4
smix 7 2 0 -20 0 4
smix 8 1 1 20 0 4
smix 9 2 1 -20 0 4
smix 10 3 1 50 0 4
smix 11 4 1 -50 0 4# mixer_profile
mixer_profile 2set platform_type = TRICOPTER
set has_flaps = ON
set model_preview_type = 1
set mixer_pid_profile_linking = ON# Mixer: motor mixermmix resetmmix 0 1.000 1.000 -0.667 0.000
mmix 1 1.000 -1.000 -0.667 0.000
mmix 2 1.000 0.000 1.333 0.000# Mixer: servo mixer
smix resetsmix 0 3 0 100 0 -1
smix 1 4 0 100 0 -1
smix 2 5 1 100 0 -1
smix 3 6 2 100 0 -1
smix 4 1 29 -68 0 -1
smix 5 2 29 68 0 -1
smix 6 1 2 -40 0 -1
smix 7 2 2 -40 0 -1
smix 8 1 38 50 0 -1
smix 9 2 38 -50 0 -1
smix 10 3 38 -50 0 -1
smix 11 4 38 50 0 -1
smix 12 3 29 90 0 -1
smix 13 4 29 -90 0 -1# profile
profile 1set fw_p_pitch = 23
set fw_i_pitch = 22
set fw_d_pitch = 14
set fw_ff_pitch = 45
set fw_p_roll = 18
set fw_i_roll = 16
set fw_d_roll = 14
set fw_ff_roll = 44
set fw_p_yaw = 12
set fw_i_yaw = 0
set fw_d_yaw = 8
set fw_ff_yaw = 42
set max_angle_inclination_rll = 450
set max_angle_inclination_pit = 450
set dterm_lpf_hz = 10
set fw_turn_assist_pitch_gain = 0.400
set nav_fw_pos_z_p = 25
set nav_fw_pos_z_d = 8
set nav_fw_pos_xy_p = 55
set d_boost_min = 1.000
set d_boost_max = 1.000
set fw_level_pitch_trim = 2.000
set rc_expo = 30
set rc_yaw_expo = 70
set roll_rate = 60
set pitch_rate = 60
set yaw_rate = 40# profile
profile 2set mc_p_pitch = 60
set mc_i_pitch = 50
set mc_d_pitch = 26
set mc_p_roll = 72
set mc_i_roll = 43
set mc_d_roll = 33
set mc_cd_roll = 82
set mc_p_yaw = 80
set mc_i_yaw = 34
set mc_d_yaw = 45
set fw_p_pitch = 15
set fw_i_pitch = 5
set fw_d_pitch = 5
set fw_ff_pitch = 80
set fw_p_roll = 15
set fw_i_roll = 3
set fw_d_roll = 7
set fw_p_yaw = 50
set fw_i_yaw = 0
set fw_d_yaw = 20
set fw_ff_yaw = 255
set max_angle_inclination_rll = 450
set dterm_lpf_hz = 10
set fw_turn_assist_pitch_gain = 0.400
set nav_fw_pos_z_p = 25
set nav_fw_pos_z_d = 8
set nav_fw_pos_xy_p = 55
set d_boost_min = 1.000
set d_boost_max = 1.000
set rc_expo = 30
set rc_yaw_expo = 70
set roll_rate = 60
set pitch_rate = 60
set yaw_rate = 40# profile
profile 3set fw_p_pitch = 20
set fw_i_pitch = 25
set fw_d_pitch = 11
set fw_ff_pitch = 44
set fw_p_roll = 20
set fw_i_roll = 25
set fw_d_roll = 11
set fw_ff_roll = 43
set fw_p_yaw = 16
set fw_i_yaw = 6
set fw_d_yaw = 7
set fw_ff_yaw = 53
set max_angle_inclination_rll = 450
set dterm_lpf_hz = 10
set fw_turn_assist_pitch_gain = 0.400
set nav_fw_pos_z_p = 25
set nav_fw_pos_z_d = 8
set nav_fw_pos_xy_p = 55
set d_boost_min = 1.000
set d_boost_max = 1.000
set fw_level_pitch_trim = 3.000
set rc_expo = 30
set rc_yaw_expo = 70
set roll_rate = 60
set pitch_rate = 60
set yaw_rate = 40# battery_profile
battery_profile 1set throttle_idle = 5.000# battery_profile
battery_profile 2set throttle_idle = 5.000# battery_profile
battery_profile 3set throttle_idle = 5.000# restore original profile selection
mixer_profile 1
profile 1
battery_profile 1# save configuration
save#
📌 文件头信息
# INAV/SPEEDYBEEF405WING 7.1.2 Jun 1 2024 / 00:47:23 (4e1e59eb)
# GCC-10.3.1 20210824 (release)
固件版本:INAV 7.1.2
目标板:SPEEDYBEEF405WING(F405 飞控板)
编译器:GCC 10.3.1
⚙️ 初始化命令
batch start
defaults noreboot
batch start:开始配置批处理
defaults noreboot:重置配置为默认,但不重启
⏱️ 定时器输出模式
timer_output_mode 0 SERVOS
timer_output_mode 1 MOTORS
定义定时器的用途:
Timer 0 → 舵机
Timer 1 → 电机
🔧 输出(伺服行程设置)
servo 1 700 2050 1375 100
servo 2 800 2250 1525 100
servo 3 1000 2000 1500 -100
...
格式:
servo <编号> <最小> <最大> <中位> <方向>
定义舵机行程范围和反向
✈️ 功能启用
feature GPS
feature LED_STRIP
feature PWM_OUTPUT_ENABLE
feature FW_AUTOTRIM
GPS 功能
LED 灯带支持
PWM 输出使能
固定翼自动配平
📊 Blackbox(黑匣子数据记录)
blackbox NAV_POS
blackbox NAV_PID
blackbox MAG
...
选择要记录的传感器和控制器数据
部分是
-GYRO_RAW
(禁用原始陀螺仪)
🔌 串口配置
serial 4 33554432 115200 115200 0 115200
串口 4,功能是 GPS 或其他外设
波特率 115200
💡 LED 配置
led 0 0,0::CTO:8
led 30 14,1::CBE:8
...
定义 LED 矩阵布局(位置、颜色模式)
CTO / CBE 是灯效模式
🎮 飞行模式开关(AUX 通道)
aux 0 0 0 1700 2100
aux 1 1 1 1700 2100
aux 2 12 1 1300 1700
...
AUX 通道对应飞行模式/功能
比如:
aux 0 → ARM(解锁电机)
aux 1 → ANGLE 模式
aux 4 → RTH(返航)
aux 7 → 自动导航
aux 8 → 启动任务
📺 OSD 布局
osd_layout 0 0 23 0 H
osd_layout 0 1 42 9 V
...
OSD 元素在屏幕上的坐标 (x, y)
V/H 表示竖直/水平显示
🤖 逻辑编程
logic 0 1 -1 22 0 0 0 0 0
logic 1 1 -1 1 2 38 0 1 0
...
INAV 的逻辑开关设置,比如“如果通道 + 高度条件成立 → 触发”
类似于可编程的飞控逻辑判断
📐 传感器 & 滤波
set gyro_main_lpf_hz = 30
set dynamic_gyro_notch_min_hz = 30
set acc_hardware = ICM42605
set baro_hardware = DPS310
set pitot_hardware = VIRTUAL
陀螺仪低通滤波 30Hz
IMU:ICM42605
气压计:DPS310
空速管:虚拟
🚨 Failsafe & GPS
set failsafe_procedure = RTH
set gps_provider = UBLOX7
set nav_rth_altitude = 5000
失控保护:返航 (RTH)
GPS 使用 UBLOX7 协议
返航高度:50m(单位是 cm)
🛠️ Mixer(混控器)
有两个配置文件:
Mixer profile 1 → 固定翼 (AIRPLANE)
set platform_type = AIRPLANE
mmix 0 1.000 0.000 0.000 0.000 # 电机
smix ... # 舵面分配
控制面:副翼、升降舵、方向舵分配
Mixer profile 2 → 三旋翼 (TRICOPTER)
set platform_type = TRICOPTER
mmix 0 1.000 1.000 -0.667 0.000
mmix 1 1.000 -1.000 -0.667 0.000
mmix 2 1.000 0.000 1.333 0.000
三旋翼电机推力分配
伺服控制尾桨偏航
🎛️ PID 配置(三个 profile)
profile 1:固定翼 PID(比较稳重)
profile 2:多旋翼 + 固定翼混合
profile 3:另一组固定翼 PID(调得更灵敏)
🔋 电池配置
battery_profile 1
set throttle_idle = 5.000
电机怠速油门 = 5%
三个电池配置文件都相同
✅ 结尾
mixer_profile 1
profile 1
battery_profile 1
save
恢复默认启用 固定翼配置
默认 PID 使用 profile 1
默认电池配置文件 1
📌 总结:
这份配置主要是为 SPEEDYBEEF405WING 飞控板设置的,支持两种平台:
固定翼(默认启用,profile 1)
三旋翼(备用配置,profile 2)
开启了 GPS、返航、LED、黑匣子
PID 有三套(方便不同飞行模式切换)
默认返航高度 50m
怠速油门固定 5%
LED 配置了完整的矩阵灯效
要不要我帮你 画一张示意图(比如哪个 servo 控哪个舵面、电机分布)?这样你能更直观理解配置作用。