请选择 进入手机版 | 继续访问电脑版

发现者模型阵地

 找回密码
 立即注册
查看: 6857|回复: 1
收起左侧

OpenPilot MixerSetting introduction

[复制链接]

20

主题

22

帖子

88

积分

注册会员

Rank: 2

积分
88
发表于 2019-11-21 17:59:13 | 显示全部楼层 |阅读模式
There are inputs (that come from the RC transmitter sticks in Manual mode or come from stabilization+control code in other modes) and there are actuators (outputs like motors and servos).

The mixer table connects the inputs to the actuators in the most flexible way possible.

Think of each input as a number between -1.0 and +1.0 (inclusive).  It so happens that roll right, pitch up, yaw right, and throttle up are all positive numbers.  E.g. +1.0 is full right roll while -0.5 is half left roll.  The throttle RC channel input is special in that lowest throttle stick produces -1.0, but the tiniest bit higher than that quickly gets up to zero, so the normal range of the throttle stick produces basically 0.0 to +1.0.

Throttle is also special in that the throttle input goes through a throttle curve function (the default curve doesn't curve it at all) and the curved value (still in the range -1.0 to +1.0) is used instead of the input.  Further, there are two curves supported, but the second one is usually turned off by setting the weight (described below) to 0.0.

The mixer table has a set of 5 numbers (in a column if looking at the Vehicle -> Custom page) for each of the 12 actuators.  For any particular actuator, each of these 5 numbers is a weight (factor, strength or multiplier) for that input for that particular actuator.  For any particular actuator, each input gets multiplied by it's associated weight and the resultant set of products is added together to create that actuator output value.

Weights are integers in the range -128 to +127.  Generally that -128 is only set to -127, but it isn't critical as far as I know.  A sum of +127.0 (+128.0 actually, but you don't need to worry about it) or higher means actuator full on, motor full on, full right roll, full back pitch, or full right yaw.  A sum of 0.0 puts actuators in the center (more precisely stated, at neutral, which may not be center, recall for instance that multicopter motor neutral is idle speed).  For a particular actuator, you can see that a weight of zero on some input says that moving that input does not affect that actuator.

On the Custom mixer page, the actuators are labeled Ch1 - Ch12 and the weights are in a column of 5 numbers (Curve 1, Curve 2, Roll, Pitch, and Yaw) under each Ch label.  On the System page (Settings->MixerSettings) the actuators are Mixer1Vector through Mixer12Vector with each MixerVector being a list of 5 input weights (ThrottleCurve1, ThrottleCurve2, Roll, Pitch, and Yaw).

Talking about how the mixer makes an X quad work will help you understand mixers.  Think about the northwest motor on an X quad, that motor actuator needs to increase for any of:
- roll right
- pitch back (stick) / up (nose)
- yaw left (CW prop rotation causes CCW=left torque)
- throttle higher
so these 4 weights all need to be positive numbers except for yaw which must be negative (positive makes right yaw but we need left yaw).  First of all, throttle weight must be +127 so that the motor puts out full power at full throttle (input=+1.0), even if roll, pitch and yaw inputs are all neutral (0.0) so they don't currently contribute to the output.  Limiting the other weights to +-64 is a compromise.  Obviously full throttle mixed with any of right roll, back pitch, or left yaw would add to higher than 127 (overflow), so for motor type actuators (multicopters) there is some code that automatically reduces (increases) throttle if it detects overflow (underflow).  You can still get overflow e.g. on the NW motor actuator even at idle throttle, if you go full right roll, full back pitch, and full left yaw.  If you limit those +-64's to +-42 instead, you will remove the possibility of overflow (considering that throttle gets reduced or increased if needed to avoid overflow), but you won't be able to flip and pirouette as fast (since e.g. full right roll input will only command 42 out of max 127, not 64 out of max 127).

That 64 comes from the multiplying 128 by the "Mixer" or "Mix Level" sliders on the Vehicle page.

For an airplane, it's pretty simple.  The aileron actuator, which is a servo, has zeros in the list of input weights for everything but the roll stick.

Imagine what you would have to do to the mixing table to make a set of airplane elevons (there is a setting for that so you don't have to do it this way).  First you need two separate actuators (aileron outputs).  Most wing servo pairs are installed as if looking in a mirror, so say the servo shaft points inward toward the fuselage on both the left and right wing servos.  It is done mirrored like this so you can just use a Y cable if you only want ailerons.  If one servo is moving forward, the other is moving back.  In that mounting, the left servo mixer might be +64 roll and +64 pitch, while the right servo mixer would be +64 roll and -64 pitch.  Now most flying wings I have need more elevator throw and less aileron throw, so you might make it say +56 roll +72 pitch and +56 roll -72 pitch.

Got an airplane that rolls a little when you hit the rudder and you want to remove that?  For each of your aileron actuators, just add a small amount of opposite sign yaw input (opposite sign as compared to the roll input for that actuator).  This says that whenever you move the yaw stick you will get a small amount of opposite aileron.
回复

使用道具 举报

20

主题

22

帖子

88

积分

注册会员

Rank: 2

积分
88
 楼主| 发表于 2019-11-21 17:59:33 | 显示全部楼层
有时间再翻译,先留着。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|静修| 发现者模型 ( 粤ICP备2021018702号 备案查询:https://beian.miit.gov.cn )

GMT+8, 2022-8-12 03:52 , Processed in 0.045538 second(s), 17 queries .

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表