纪录无人机PID参数配置

P:

|-------------|---|---|---|-----------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| PSC_D_POS_P | 1 | 1 | | 0.50 4.00 | Position (vertical) controller P gain. Converts the difference between the desired altitude and actual altitude into a climb or descent rate which is passed to the throttle rate controller. Previously _POSZ_P. |

|-------------|---|---|---|----------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| PSC_D_VEL_P | 5 | 5 | | 1.0 10.0 | Velocity (vertical) controller P gain. Converts the difference between desired vertical speed and actual speed into a desired acceleration that is passed to the throttle acceleration controller. Previously _VELZ_P. |

|-------------|------|------|---|-------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| PSC_D_ACC_P | 0.05 | 0.05 | | 0.010 0.250 | Acceleration (vertical) controller P gain. Converts the difference between desired vertical acceleration and actual acceleration into a motor output. If upgrading from 4.6 this is _ACCZ_P * 0.1. |

pid的算法函数在

// Runs the vertical (U-axis) position controller.

// Computes output acceleration based on position and velocity errors using PID correction.

// Feedforward velocity and acceleration are combined with corrections to produce a smooth vertical command.

// Desired position, velocity, and acceleration must be set before calling.

void AC_PosControl::D_update_controller()

{

// check for ekf z-axis position reset

D_handle_ekf_reset();

// Check for z_controller time out

if (!D_is_active()) {

D_init_controller();

if (has_good_timing()) {

// call internal error because initialisation has not been done

INTERNAL_ERROR(AP_InternalError::error_t::flow_of_control);

}

}

_last_update_d_ticks = AP::scheduler().ticks32();

参数名称 所属控制器(类成员变量) 核心作用
PSC_D_POS_P 位置环 (P Controller) 对应代码中的 _p_pos_d_m 将位置误差转换为期望速度,代码为 _p_pos_d_m.update_all()
PSC_D_VEL_P 速度环 (PID Controller) 对应代码中的 _pid_vel_d_m 将速度误差转换为期望加速度,代码为 _pid_vel_d_m.update_all()
PSC_D_ACC_P 加速度环 (PID Controller) 对应代码中的 _pid_accel_d_m 将加速度误差转换为电机推力(油门),代码为 _pid_accel_d_m.update_all()
相关推荐
noipp1 小时前
推荐题目:洛谷 P1737 [NOI2016] 旷野大计算
linux·数据结构·算法
枕星而眠1 小时前
Linux守护进程完全指南:从原理到实战
linux·运维·服务器·c++·后端
网络系统管理1 小时前
第八届江苏技能状元大赛选拔赛信息通信网络运行管理项目模块D网络服务与系统运维-Linux样题解析
linux·运维·网络
不会C语言的男孩2 小时前
Linux 系统编程 · 第 2 章:系统调用与库函数
linux·c语言
坤昱2 小时前
cfs调度类深入解刨——psi科普篇
linux·cfs·psi·cfs调度·eevdf·psi详细分析·linux系统资源监控
骑上单车去旅行2 小时前
openEuler 22.03 离线源码编译 Zabbix 7.0.27 完整最终整合手册
linux·运维·服务器·zabbix
向日葵.2 小时前
linux & qnx & git 命令 1
linux·运维·服务器
2023自学中3 小时前
Linux 内核与用户空间 内存管理详解(堆与栈篇)
linux·嵌入式·内存·开发板
似水এ᭄往昔3 小时前
【Linux系统编程】--虚拟地址空间
linux·服务器