PX4混控器文件理解

1 简单混控器

以固定翼的混控文件为例,文件位于

Firmware/ROMFS/px4fmu_common/mixers/fw_generic_wing.main.mix

Generic wing mixer
===========================
This file defines mixers suitable for controlling a delta wing aircraft.
The configuration assumes the elevon servos are connected to servo
outputs 0 and 1 and the motor speed control to output 3. Output 2 is
assumed to be unused.

Inputs to the mixer come from channel group 0 (vehicle attitude), channels 0
(roll), 1 (pitch) and 3 (thrust).

See the README for more information on the scaler format.

Elevon mixers
-------------
Three scalers total (output, roll, pitch).

On the assumption that the two elevon servos are physically reversed, the pitch
input is inverted between the two servos.

The scaling factor for roll inputs is adjusted to implement differential travel
for the elevons.

M: 2
S: 0 0  -8000  -8000      0 -10000  10000
S: 0 1   6000   6000      0 -10000  10000

M: 2
S: 0 0  -8000  -8000      0 -10000  10000
S: 0 1  -6000  -6000      0 -10000  10000

Output 2
--------
This mixer is empty.

Z:

Motor speed mixer
-----------------
Two scalers total (output, thrust).

This mixer generates a full-range output (-1 to 1) from an input in the (0 - 1)
range.  Inputs below zero are treated as zero.

M: 1
S: 0 3      0  20000 -10000 -10000  10000

简单混控器里面的

这里是一个舵的输出,由两个输入相加得到,即控制组0,的通道0和1
M: 2
S: 0 0  -8000  -8000      0 -10000  10000
S: 0 1   6000   6000      0 -10000  10000

表示一组输出,就是输出到一个执行机构,按照px4的开发者向导的解释,该组理解为,其中一个执行机构的输入为控制组0中的通道0和通道1相加得到,混控文件里面也说明了控制组0是姿态控制,通道0是roll,通道1是pitch,通道3是thrust。 -8000表示缩放值,前面是输入为负数缩放系数,后面是输入为正数的时候的缩放系数。接着后面的0是偏移量,后面两个是限幅值。假设现在输入一个顺时针滚转的指令0.2,则第一个输出组得到的结果为0.2*(-8000)=-400,第二个输出得到的也是0.2*(-8000)=-400。也就是左右两个舵机各往反方向打一定的角度,看到是打相同的角度,作用结果不是使飞机的pitch角改变了吗? 其实不然,混控文件里面有这样一句说明:

On the assumption that the two elevon servos are physically reversed, the pitch
input is inverted between the two servos.

混控文件里面说明了,两个舵机是反向安装的,这样的结果就是,给舵机相同的指令,例如上面计算出来的-400,舵机确实会往相同的方向打一定角度,但是由于是反向安装的,打相同方向角度的作用结果是使飞行器的舵面往想反方向打了,也就是实现了滚转运动。这就对应起来了,输入0.4的roll指令,飞行器进行滚转运动。

2 多旋翼混控器

纯多旋翼

因为纯多旋翼,例如四旋翼,六旋翼,八旋翼这些飞行器,他们的输出方式是固定的,例如x型四旋翼,向前俯仰运动一定是前面两个增加,后面两个减。所以定义混控文件的时候,只需要告诉飞行器类型就可以了,px4里面有一下几种类型

4x - quadrotor in X configuration
4+ - quadrotor in + configuration
6x - hexacopter in X configuration
6+ - hexacopter in + configuration
8x - octocopter in X configuration
8+ - octocopter in + configuration

例如一个四旋翼的混控文件为:

文件信息:Firmware/ROMFS/px4fmu_common/mixers/quad_x.main.mix

R: 4x 10000 10000 10000 0
M: 1
S: 3 5  10000  10000      0 -10000  10000
M: 1
S: 3 6  10000  10000      0 -10000  10000

第一行可知指出了是4x型的飞行器。

  • 0
    点赞
  • 12
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值