Is it possible to configure four servos for ailerons
« on: November 10, 2019, 08:34:06 pm »
Hello,
I'm new here and to Libre Pilot. I've built a flying wing RC plane and I would like to have yaw control. I read about Differential Spoilers and would like to modify my plane to enable this and to get yaw controll. I just don't know if it is posible. Hope you can help me.

Re: Is it possible to configure four servos for ailerons
« Reply #1 on: November 10, 2019, 10:03:31 pm »
Possible?  I think it needs code changes.

Two things to address, plane hardware, and FC setup.

Off the top of my head, I can imagine four ways to set up the plane hardware:
- Split ailerons with two pieces of thin aileron sandwiched together on each side.  You want to yaw left, you open the split up on the left wing.  This is the right way to do it, but more difficult.
- Dual ailerons on each wing, inner and outer.  To yaw left, on the left wing you make one go up and the other go down.  The problem with that is you get a roll effect too with the roll going in the direction of the outer aileron.  That can be trimmed out by making the opposite pair roll a little in the other direction, but then you have remaining a little bit of elevator, which again can be trimmed out in the mixer.  Lots of mixer tweaks to get it right.
- Air brakes on each wing tip.
- Rudders on each wing tip or one in the middle.  This seems to me to be the only way that doesn't require code changes.

I would use a custom mixer to set any of the first three up.  They require some code changes (mixing table) to give you the capability of setting up neutral rudder so that (e.g. #1) both sets of ailerons work with no gaps, but moving rudder spreads one aileron open but does not try to compress the other one farther closed.

The mixing table change would be something like a +-limit per mixer input or a "plus only", "normal", "minus only" (dev note: would "absolute value" or "offset" be useful for other reasons too) per mixer input.  Either of these would be set up to stop the jamming of the two aileron servos per side by allowing the split to open, but not to squeeze it past closed.  For #2 or #3 it would do the same thing, move on one side but not the other.

Since you are already adding the weight of 2 more servos, another way to do it would be to make some kind of air brake on each wing tip, but that would still need the code changes or at least a mechanical method of avoiding servo jamming.

Then there are some ways that are a bit non-standard.  For a single motor, you could use thrust vectoring.  You could make it a twin and use differential thrust.
« Last Edit: November 12, 2019, 09:29:33 am by TheOtherCliff »

Re: Is it possible to configure four servos for ailerons
« Reply #2 on: November 11, 2019, 11:49:52 am »
Thank you for your detailed list of possibilities.
I think I need to look more into everyone and I hope I find a way, which I'm able to pull off ;)
I saw the split ailerons but thought they would be too complex to implement correctly. That's why I would love to use the method with four ailerons, but I didn't think about the roll that they would introduce. And the airbrake sounds promising too. But if nothing works, I will add rudders.
I will start to look into the programming of mixing tables and so on, but do you have a few locations where it would be eaiser to pick up the nessesary basics?
Thank you for your help :)

How the Mixer table works
« Reply #3 on: November 12, 2019, 08:10:29 am »
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.
« Last Edit: November 12, 2019, 08:24:54 am by TheOtherCliff »