当前位置:网站首页>VTOL in Px4_ att_ Control source code analysis [supplement]
VTOL in Px4_ att_ Control source code analysis [supplement]
2022-07-07 22:16:00 【r1ch4rd】
VTOL Source code analysis supplement
The last article roughly analyzed PX4 For in the VTOL Control strategy :
The above figure is taken from the developer Roman Bapst A piece of The notes
Among them VTOL Controller The last part also makes a more detailed illustration :
Add :
fill_actuator_outputs():
Composite model (Standard)
The function is mainly used in various models , Calculate all kinds of flight_mode Under the actuator Output .
multirotor controls:
// roll
_actuators_out_0->control[actuator_controls_s::INDEX_ROLL] =
_actuators_mc_in->control[actuator_controls_s::INDEX_ROLL] * _mc_roll_weight;
// pitch
_actuators_out_0->control[actuator_controls_s::INDEX_PITCH] =
_actuators_mc_in->control[actuator_controls_s::INDEX_PITCH] * _mc_pitch_weight;
// yaw
_actuators_out_0->control[actuator_controls_s::INDEX_YAW] =
_actuators_mc_in->control[actuator_controls_s::INDEX_YAW] * _mc_yaw_weight;
// throttle
_actuators_out_0->control[actuator_controls_s::INDEX_THROTTLE] =
_actuators_mc_in->control[actuator_controls_s::INDEX_THROTTLE] * _mc_throttle_weight;
_actuators_mc_in
yes mc_att_control
Calculated results of , The above function is used to recalculate the expected output value according to the weight , The same applies to fixed wing mode .
Each output update_transition_state() Calculated mc The weight
_mc_roll_weight = mc_weight; _mc_pitch_weight = mc_weight; _mc_yaw_weight = mc_weight; _mc_throttle_weight = mc_weight;
In rotor mode, the input quantity is multiplied by each weight : When switching modes , The weight of the rotor represents the proportion assigned by the rotor motor under the composite model ; In full rotor mode ,mc The weight of 1, Fixed wing motor off .
fixed wing controls:
// roll
_actuators_out_1->control[actuator_controls_s::INDEX_ROLL] =
-_actuators_fw_in->control[actuator_controls_s::INDEX_ROLL];
// pitch
_actuators_out_1->control[actuator_controls_s::INDEX_PITCH] =
_actuators_fw_in->control[actuator_controls_s::INDEX_PITCH];
// yaw
_actuators_out_1->control[actuator_controls_s::INDEX_YAW] =
_actuators_fw_in->control[actuator_controls_s::INDEX_YAW];
_actuators_out_1->control[actuator_controls_s::INDEX_AIRBRAKES] = _reverse_output;
- Aileron locked : Set all outputs to zero
_actuators_out_1->control[actuator_controls_s::INDEX_ROLL] = 0.0f; _actuators_out_1->control[actuator_controls_s::INDEX_PITCH] = 0.0f; _actuators_out_1->control[actuator_controls_s::INDEX_YAW] = 0.0f; _actuators_out_1->control[actuator_controls_s::INDEX_AIRBRAKES] = 0.0f;
- Ailerons not locked : Do not change the yaw output , Only roll and pitch outputs
// roll
_actuators_out_1->control[actuator_controls_s::INDEX_ROLL] =
-_actuators_fw_in->control[actuator_controls_s::INDEX_ROLL];
// pitch
_actuators_out_1->control[actuator_controls_s::INDEX_PITCH] =
_actuators_fw_in->control[actuator_controls_s::INDEX_PITCH];
_actuators_out_1->control[actuator_controls_s::INDEX_YAW] = 0.0f;
_actuators_out_1->control[actuator_controls_s::INDEX_AIRBRAKES] = 0.0f;
Tailstock type (Tailsitter)
Pay attention to two points under the tailstock :
- In rotor mode, the aileron is used to control the yaw angle :
// NOTE: There is no mistake in the line below, multicopter yaw axis is controlled by elevon roll actuation!
_actuators_out_1->control[actuator_controls_s::INDEX_ROLL] =
_actuators_mc_in->control[actuator_controls_s::INDEX_YAW]; //roll elevon
_actuators_out_1->control[actuator_controls_s::INDEX_PITCH] =
_actuators_mc_in->control[actuator_controls_s::INDEX_PITCH]; //pitch elevon
The picture above shows the tailstock VTOL, Observe to understand the principle , That is, the differential pressure is changed through the differential aileron , Make the body yaw .
Inverse conversion TRANSITION_TO_MC
Motor mixed control at :
// in transition engines are mixed by weight (BACK TRANSITION ONLY)
_actuators_out_0->timestamp = _actuators_mc_in->timestamp;
_actuators_out_1->timestamp = _actuators_mc_in->timestamp;
_actuators_out_0->control[actuator_controls_s::INDEX_ROLL] = _actuators_mc_in->control[actuator_controls_s::INDEX_ROLL]
* _mc_roll_weight;
_actuators_out_0->control[actuator_controls_s::INDEX_PITCH] =
_actuators_mc_in->control[actuator_controls_s::INDEX_PITCH] * _mc_pitch_weight;
_actuators_out_0->control[actuator_controls_s::INDEX_YAW] = _actuators_mc_in->control[actuator_controls_s::INDEX_YAW] *
_mc_yaw_weight;
_actuators_out_0->control[actuator_controls_s::INDEX_THROTTLE] =
_actuators_mc_in->control[actuator_controls_s::INDEX_THROTTLE];
// NOTE: There is no mistake in the line below, multicopter yaw axis is controlled by elevon roll actuation!
_actuators_out_1->control[actuator_controls_s::INDEX_ROLL] = -_actuators_fw_in->control[actuator_controls_s::INDEX_ROLL]
* (1 - _mc_yaw_weight);
_actuators_out_1->control[actuator_controls_s::INDEX_PITCH] =
_actuators_mc_in->control[actuator_controls_s::INDEX_PITCH] * _mc_pitch_weight;
// **LATER** + (_actuators_fw_in->control[actuator_controls_s::INDEX_PITCH] + _params->fw_pitch_trim) *(1 - _mc_pitch_weight);
_actuators_out_1->control[actuator_controls_s::INDEX_THROTTLE] =
_actuators_fw_in->control[actuator_controls_s::INDEX_THROTTLE];
Tilting (Tiltrotor)
- In rotor mode :
Recalculate the motor output according to the weight
_actuators_out_0->timestamp = _actuators_mc_in->timestamp;
_actuators_out_0->control[actuator_controls_s::INDEX_ROLL] = _actuators_mc_in->control[actuator_controls_s::INDEX_ROLL] * _mc_roll_weight; _actuators_out_0->control[actuator_controls_s::INDEX_PITCH] = _actuators_mc_in->control[actuator_controls_s::INDEX_PITCH] * _mc_pitch_weight; _actuators_out_0->control[actuator_controls_s::INDEX_YAW] = _actuators_mc_in->control[actuator_controls_s::INDEX_YAW] * _mc_yaw_weight;
- Fixed wing mode :
_actuators_out_1->timestamp = _actuators_fw_in->timestamp;
_actuators_out_1->control[actuator_controls_s::INDEX_ROLL] =
-_actuators_fw_in->control[actuator_controls_s::INDEX_ROLL];
_actuators_out_1->control[actuator_controls_s::INDEX_PITCH] =
(_actuators_fw_in->control[actuator_controls_s::INDEX_PITCH] + _params->fw_pitch_trim);
_actuators_out_1->control[actuator_controls_s::INDEX_YAW] =
_actuators_fw_in->control[actuator_controls_s::INDEX_YAW]; // yaw
_actuators_out_1->control[4] = _tilt_control;
vtol_type.cpp:
VtolType::update_mc_state() Copy the virtual attitude expectation to the actual attitude expectation
void VtolType::update_fw_state()
// copy virtual attitude setpoint to real attitude setpoint
VtolType::check_quadchute_condition()
Fixed wing mode uses tecs Track tracking , Used during conversion local_pos_sp
边栏推荐
- South China x99 platform chicken blood tutorial
- Display optimization when the resolution of easycvr configuration center video recording plan page is adjusted
- NVR硬盤錄像機通過國標GB28181協議接入EasyCVR,設備通道信息不顯示是什麼原因?
- How to write an augmented matrix into TXT file
- How does win11 time display the day of the week? How does win11 display the day of the week today?
- MIT6.S081-Lab9 FS [2021Fall]
- Jerry's test box configuration channel [chapter]
- 嵌入式开发:如何为项目选择合适的RTOS?
- The cyberspace office announced the measures for data exit security assessment, which will come into force on September 1
- Validutil, "Rethinking the setting of semi supervised learning on graphs"
猜你喜欢
【Azure微服务 Service Fabric 】因证书过期导致Service Fabric集群挂掉(升级无法完成,节点不可用)
用语雀写文章了,功能真心强大!
The new version of onespin 360 DV has been released, refreshing the experience of FPGA formal verification function
Customer case | China law network, through observing the cloud, greatly shortens the time of fault location
An overview of the latest research progress of "efficient deep segmentation of labels" at Shanghai Jiaotong University, which comprehensively expounds the deep segmentation methods of unsupervised, ro
L2:ZK-Rollup的现状,前景和痛点
Validutil, "Rethinking the setting of semi supervised learning on graphs"
Ternary expressions, generative expressions, anonymous functions
Paint basic graphics with custompaint
648. Word replacement
随机推荐
NVR硬盘录像机通过国标GB28181协议接入EasyCVR,设备通道信息不显示是什么原因?
Ternary expressions, generative expressions, anonymous functions
The maximum number of meetings you can attend [greedy + priority queue]
解决uni-app中uni.request发送POST请求没有反应。
[colmap] sparse reconstruction is converted to mvsnet format input
How much does it cost to develop a small program mall?
建立自己的网站(18)
Jerry's initiation of ear pairing, reconnection, and opening of discoverable and connectable cyclic functions [chapter]
What if the win11u disk does not display? Solution to failure of win11 plug-in USB flash disk
Virtual machine network configuration in VMWare
Open source OA development platform: contract management user manual
L2: current situation, prospects and pain points of ZK Rollup
Reinforcement learning - learning notes 9 | multi step TD target
null == undefined
客户案例|华律网,通过观测云大幅缩短故障定位时间
使用 BlocConsumer 同时构建响应式组件和监听状态
NVR硬盤錄像機通過國標GB28181協議接入EasyCVR,設備通道信息不顯示是什麼原因?
[开源] .Net ORM 访问 Firebird 数据库
Tupu digital twin coal mining system to create "hard power" of coal mining
双塔模型的最强出装,谷歌又开始玩起“老古董”了?