Channel Scale.... and Travel Adjust

More
11 Dec 2012 17:54 - 11 Dec 2012 17:55 #3886 by domcars0
Channel Scale.... and Travel Adjust was created by domcars0
Hi,
For me, 'Channel Scale' looks like Travel Adjust (of servo)...
But I think that something important is missing in Deviation.
It's not possible to have a different scale for negative and for positive values of channel (or Left/Right, Up/Down).
You may say that you can do that we the Mixers. Yes ... and No
If you want a EXPo curve with different travel adjust for negative and for positive , I think it will be a nightmare!
On common Tx travel Adjust can be adjust for negative and positive values.

Devo 10 (+7e) owner. It's mine, please don't touch it with your big fingers :angry:
Last edit: 11 Dec 2012 17:55 by domcars0.

Please Log in or Create an account to join the conversation.

More
11 Dec 2012 18:58 #3887 by PhracturedBlue
Replied by PhracturedBlue on topic Channel Scale.... and Travel Adjust
sort of.
There are 2 settings.
scale gives a uniform scaling to the output value (effectively increasing the maximum range of output)
min/max control the hard-limit of how far the servo can move. these are meant to effectively prevent damage to the model by clipping the output value to not move the servo farther than the specified value.

We tried a couple implementations for this while implementing Deviation initially, and setled here, but there's still been a lot of complaint about this implementation.

Here are some of the reasons for the current implementation:

1) things like 'mult', 'add' and 'cyclic' can result in a raw input > 100%. using a travel adjust to scale this will not give the results that are expected in general.
Example:
cyclic can cause the maximum value to be 150% with the scalar set to 100%, but a regular channel will only reach 100%. I do not want to change the limits when changing the mixer template. I'm also concerned about trying to combine the servo travel with the cyclic-mixing.

2) I don't like the idea of having a different scale for positive and negative values. It will result in a non-linear behavior which may not be expected.

That said, I'm open to suggestions on how to improve the system that provide a more intuitive way to do it. If at all possible I want to find a way to provide backwards compatibility so that old models can be automatically converted to any new system that is developed.

Please Log in or Create an account to join the conversation.

More
11 Dec 2012 19:32 #3889 by FDR
Replied by FDR on topic Channel Scale.... and Travel Adjust

domcars0 wrote: If you want a EXPo curve with different travel adjust for negative and for positive , I think it will be a nightmare!


Actually not, because the expo function can be assymmetrical...

While I can see some sense for the assymmetric travel adjust for the centered sticks, it is useless for the throttle, and probably it is for linear sevos too...

Please Log in or Create an account to join the conversation.

More
11 Dec 2012 20:46 - 11 Dec 2012 21:08 #3891 by domcars0
Replied by domcars0 on topic Channel Scale.... and Travel Adjust

FDR wrote:

domcars0 wrote: If you want a EXPo curve with different travel adjust for negative and for positive , I think it will be a nightmare!


Actually not, because the expo function can be assymmetrical...

I think that, yes, the factor of exponential can be assymmetrical, but this factor is not in relation with the travel adjust.

Assymetric travel adjust permit to fine adjust differences due to servos construction which are never exactly the same ...
Futhermore, when we have subtrim ... then having same travel adjust
for pos and neg values result in something physically not symetric :(
See the Bob Finless Videos (helifreaks) about how and why adjust the 'Travel adjust' to understand what I mean (grrr .. sorry to speak so bad english).

[EDIT]Sorry in the actual implementation, having subtrim and same pos & neg travel adjust result in something physically OK ...

Devo 10 (+7e) owner. It's mine, please don't touch it with your big fingers :angry:
Last edit: 11 Dec 2012 21:08 by domcars0.

Please Log in or Create an account to join the conversation.

More
11 Dec 2012 21:36 #3893 by FDR
Replied by FDR on topic Channel Scale.... and Travel Adjust
PB, shouldn't we apply the subtrim after the scaling?
According to the code, it is applyed before the scaling so, it is not a simple final servo centering:

s16 MIXER_ApplyLimits(u8 channel, struct Limit *limit, volatile s16 *_raw,
                      volatile s16 *_Channels, enum LimitMask flags)
{
    s32 value = _raw[NUM_INPUTS + 1 + channel] + get_trim(NUM_INPUTS + 1 + channel);
    if (channel >= NUM_OUT_CHANNELS)
        return value;

    if (flags & APPLY_SUBTRIM)
        value += PCT_TO_RANGE(limit->subtrim) / 10;
    if (flags & APPLY_SCALAR)
        value = (s32)value * limit->servoscale / 100;
    if ((flags & APPLY_REVERSE) && (limit->flags & CH_REVERSE))
        value = -value;
    //degrees / 100msec
    if (_Channels && (flags & APPLY_SPEED) && limit->speed) {
        s32 rate = CHAN_MAX_VALUE * limit->speed / 60 * MEDIUM_PRIORITY_MSEC / 100;
        if (value - _Channels[channel] > rate)
            value = _Channels[channel] + rate;
        else if(value - _Channels[channel] < -rate)
            value = _Channels[channel] - rate;
    }
    if ((flags & APPLY_SAFETY) && MIXER_SRC(limit->safetysw) && switch_is_on(limit->safetysw, _raw)) {
        value = PCT_TO_RANGE(Model.limits[channel].safetyval);
    } else if (flags & APPLY_LIMITS) {
        if (value > PCT_TO_RANGE(limit->max))
            value = PCT_TO_RANGE(limit->max);
        else if( value < PCT_TO_RANGE(-(int)limit->min))
            value = PCT_TO_RANGE(-(int)limit->min);
    } else {
        if (value > INT16_MAX)
            value = INT16_MAX;
        else if (value < INT16_MIN)
            value = INT16_MIN;
    }      
    return value;
}

Please Log in or Create an account to join the conversation.

More
11 Dec 2012 21:48 - 11 Dec 2012 21:51 #3894 by domcars0
Replied by domcars0 on topic Channel Scale.... and Travel Adjust

FDR wrote: PB, shouldn't we apply the subtrim after the scaling?
According to the code, it is applyed before the scaling so, it is not a simple final servo centering:

I think you're right...

And may be could we have :whistle:
if (flags & APPLY_SCALAR)
 value = value > 0 ? (s32)value * limit->servoscale_pos / 100 :(s32)value * limit->servoscale_neg / 100 ;

Devo 10 (+7e) owner. It's mine, please don't touch it with your big fingers :angry:
Last edit: 11 Dec 2012 21:51 by domcars0.

Please Log in or Create an account to join the conversation.

More
12 Dec 2012 00:56 #3900 by PhracturedBlue
Replied by PhracturedBlue on topic Channel Scale.... and Travel Adjust
I do not think splitting scale without solving the max/min issue is a good idea. If I'm going to change the implementation, I want it done in a way that makes the system less confusing and easier to configure.
As for the scaling before the trim, I'll move it.

Please Log in or Create an account to join the conversation.

More
12 Dec 2012 10:45 - 12 Dec 2012 11:20 #3908 by domcars0
Replied by domcars0 on topic Channel Scale.... and Travel Adjust

PhracturedBlue wrote: I do not think splitting scale without solving the max/min issue is a good idea. If I'm going to change the implementation, I want it done in a way that makes the system less confusing and easier to configure.

I agree. But ... where is the issue with max/min?
I think that you can rename
- <Max> to <Travel Adj. Up>
- <Min> to <Travel Adj. Dn>
assign this values to what I named respectivly 'servoscale_pos' and 'servoscale_neg' in mixer.c and finnaly remove the <Scale> factor.
In fact I do not understand what <Max> and <Min> are for?
I think that you want the pilot setup the max/min servo movement? But this can be done via the Travel Adjust which will set the Scale AND the Min/Max.

You may say: Yes but if I apply the subtrim AFTER the TrvAdj we may have value greater than the TrvAdj! Yes ...and NO ...
because pilots first setup the subtrim and then the TrvAdj... So the TrvAdj will still depend of the subtrim (for exemple if there is pos. subtrim, pilot will adjust the TravelAdj to a lower value).

Other Max/Min values (for the coder) are the max/min width of the PPM pulses, which are predefined by the protocol I suppose?

Devo 10 (+7e) owner. It's mine, please don't touch it with your big fingers :angry:
Last edit: 12 Dec 2012 11:20 by domcars0.

Please Log in or Create an account to join the conversation.

More
12 Dec 2012 11:15 #3909 by FDR
Replied by FDR on topic Channel Scale.... and Travel Adjust

domcars0 wrote: In fact I do not understand what <Max> and <Min> are for?

The min and max limit the channel output to a certain value, to protect the servos moving over their limits.
Probably it would be better to call them "Min limit" and "Max limit"...

domcars0 wrote: I think that you want the pilot setup the max/min servo movement? But this can be done via the Travel Adjust which will set the Scale AND the Min/Max

No, the whole point of the min/max limits is to be independent of scaling.
The root cause of it the mixer system itself, because it is possible to configure it to output way more then 100%, so we have to limit it to protect the servos, but in this case you don't want to scale it even more, just to let them move say 150%...

domcars0 wrote: I think that you can rename
- <Max> to <Travel Adj. Up>
- <Min> to <Travel Adj. Dn>

I think you already see, that they are not the same.
However there of course could be a separate scale value for the positive and negative part beside the min/max limits. I think PB only want to avoid the confusions here, but as I see there are enough confusions anyway...

Please Log in or Create an account to join the conversation.

More
12 Dec 2012 11:27 #3910 by FDR
Replied by FDR on topic Channel Scale.... and Travel Adjust

domcars0 wrote: You may say: Yes but if I apply the subtrim AFTER the TrvAdj we may have value greater than the TrvAdj! Yes ...and NO ...
because pilots first setup the subtrim and then the TrvAdj... So the TrvAdj will still depend of the subtrim (for exemple if there is pos. subtrim, pilot will adjust the TravelAdj to a lower value).

Limiting should be applied after everything, that can modify the value, so it should be after the subtrim applied.

Please Log in or Create an account to join the conversation.

More
12 Dec 2012 11:29 #3911 by domcars0
Replied by domcars0 on topic Channel Scale.... and Travel Adjust

FDR wrote: The root cause of it the mixer system itself, because it is possible to configure it to output way more then 100%, so we have to limit it to protect the servos, but in this case you don't want to scale it even more, just to let them move say 150%...

That's what I do not understand .. This is under the responsability of the pilot when he make his setups to look at the servo travels, he has to adjust everything well.
To put a 'Max limit' and 'Min limit' is not an adjustement, it's just a kind of "as I'm unable to setup my heli I fix that the max/min of my servo arms are that". With this kind of security of course you
can not have a well flying heli ... OK you will protect your servos, you will not be able to fly ...
Mixer system can't make the setup for the pilot.

Devo 10 (+7e) owner. It's mine, please don't touch it with your big fingers :angry:

Please Log in or Create an account to join the conversation.

More
12 Dec 2012 11:40 - 12 Dec 2012 11:41 #3913 by domcars0
Replied by domcars0 on topic Channel Scale.... and Travel Adjust

FDR wrote: The root cause of it the mixer system itself, because it is possible to configure it to output way more then 100%, so we have to limit it to protect the servos, but in this case you don't want to scale it even more, just to let them move say 150%...

But, when I setup my heli, if the mixer 'push' the arm servo too high, I will adjust the swashmix or the TrvAdj ... I will not let the mixer 'stop' sundenly the arm, just to protect the servo .. cause it will crash my heli :dry:

Devo 10 (+7e) owner. It's mine, please don't touch it with your big fingers :angry:
Last edit: 12 Dec 2012 11:41 by domcars0.

Please Log in or Create an account to join the conversation.

More
12 Dec 2012 11:54 - 12 Dec 2012 13:01 #3914 by FDR
Replied by FDR on topic Channel Scale.... and Travel Adjust
Actually it does not only protect the servo.
If a servo is overdriven, it can stuck and doesn't return, in which case you will definitely crash.
So it protects the model. It's a safety feature.

There might be situations, in which two or more inputs/effects/mixes act in the same direction. Such is the CCPM mixing with extreme cyclic and collective inputs at once (they could be normal independently), or a delta wing config in which the aileron and elevator are added together and might result in an overdrive if not limited...
But you know this stuff better then me...

I do not argueing against the splitted scale, just trying to expain why the limits are independent of the scale.
Last edit: 12 Dec 2012 13:01 by FDR.

Please Log in or Create an account to join the conversation.

More
12 Dec 2012 13:07 #3915 by Flo38
Replied by Flo38 on topic Channel Scale.... and Travel Adjust
Hi,

On a normal radio you usually have travel adjusts and dual/rate, which are finally the same except that :

- You can switch between two or more scales using D/R
- Travel adj allows you to have an assymmetric course for the servos.

Then I think it is normal that users want to assign max/min and travel adj to the same thing on deviation.

Problem of CCPM swash is also taken into account in other radios that way :

- D/R and travel adj for CCPM mixing
- Travel adj for each servo individually

And I think this feature is really relevant in some cases. For example when for some reasons you have different courses on different servos. And that is typically why I don't like flybarless modules such as ZYX which automatically computes CCPM mixing from a 90 degree swashplate on the radio, and then does not allow this kind of servo by servo settings.

Another example if you want to use a non 3D plane. With two different servos for ailerons, and two different channels, in order not to have the same course up or down, using traval adj (called differential, not sure of the english translation).

And finally, if you use travel adj, you can not overdrive servos... Because it seems to be the same principle as what you wanted to implement on your system.

Bye

Please Log in or Create an account to join the conversation.

More
12 Dec 2012 13:09 - 12 Dec 2012 13:17 #3916 by domcars0
Replied by domcars0 on topic Channel Scale.... and Travel Adjust

FDR wrote: So it protects the model. It's a safety feature.

I'm sorry FDR but I really don't think so. For me it's the opposite. You're trying to protect again bad setups (when a pilot setup his RC machine, it's his reponsability to look at all servo travel when he move sticks).

FDR wrote: If a servo is overdriven, it can stuck and doesn't return, in which case you will definitely crash.

If so then, I can say that your Travel Adjust (or swashmix) setup is bad... No need to implement Min/Max limit to protect again this kind of issue.

Flo38 : +1

Devo 10 (+7e) owner. It's mine, please don't touch it with your big fingers :angry:
Last edit: 12 Dec 2012 13:17 by domcars0.

Please Log in or Create an account to join the conversation.

More
12 Dec 2012 14:13 #3917 by PhracturedBlue
Replied by PhracturedBlue on topic Channel Scale.... and Travel Adjust
So, If I get rid of scale, rename min/max to travel-adjust (and if they are the same they'll be linked such that changing one changes both), and disable these when in Cyclic (where your only control is the swash-mix) then it seems that will solve the issues.
Agreed?

Please Log in or Create an account to join the conversation.

More
12 Dec 2012 14:47 #3918 by FDR
Replied by FDR on topic Channel Scale.... and Travel Adjust

PhracturedBlue wrote: So, If I get rid of scale, rename min/max to travel-adjust (and if they are the same they'll be linked such that changing one changes both), and disable these when in Cyclic (where your only control is the swash-mix) then it seems that will solve the issues.
Agreed?

If I understand well, not just rename, but make it to scale AND limit the channel output...

(In this case the subtrim still will be after that, so it will be possible to overshot the defined travel adjust max with a max subtrim value.)

Please Log in or Create an account to join the conversation.

More
12 Dec 2012 14:49 - 12 Dec 2012 15:05 #3919 by domcars0
Replied by domcars0 on topic Channel Scale.... and Travel Adjust

PhracturedBlue wrote: So, If I get rid of scale, rename min/max to travel-adjust (and if they are the same they'll be linked such that changing one changes both), and disable these when in Cyclic (where your only control is the swash-mix) then it seems that will solve the issues.
Agreed?

Why do you want disable TrvAdj when in Cyclic (but what do you mean when you say 'when in Cyclic')? I think you may have both TrvAdj AND swashMix without any issue.
TrvAdj is a servo setup.
swashMix (cyclic) is a CCPM setup.
In the mixer, TrvAdj is apply after the CCPM calcul.

Imagine than CCPM calcul (through the swashmix values) gives :
AIL servo value= +140%,
ELE servo val = -85% and
COL servo = +90%.

TrvAdj setups are the following
AIL min = -120% , AIL max = +125%
ELE min = -110% , ELE max = 112%
COL min = -110%, COL max = +110%

So the final values will be :
AIL = 140%*125% = 175% (Yes this setup seems to be bad .. this is not the mixer problem.. it MUST NOT try to 'cut' it to any <Max limit>!)
ELE = (-) 85%*110% = - 93.5%
COL = 90%*110% = 99%

But may be there is subtrims (we apply it after the scaling, as suggested by FDR) .. no problems:
subtrims are
AIL = -75% (yes I know it's crazy ;-)
ELE = +10%
COL = -9%

Final values will be :
AIL = 100% (finally not so bad ... but even if this value is crazy, mixer must NOT 'cut' it to a min or max value.)
ELE = -83%
COL = 90%;

All the mixer (code) has to do is to limit the output values to the PPM pulse width limits (I think that PPM pulse can't be infinite?).

And NO TrvAdj and min/max are not the same...
TrvAdj is the same as scale but with different values for neg and pos.

If think you may remove min/max :
if (value > PCT_TO_RANGE(limit->max))
            value = PCT_TO_RANGE(limit->max);
        else if( value < PCT_TO_RANGE(-(int)limit->min))
            value = PCT_TO_RANGE(-(int)limit->min);

Devo 10 (+7e) owner. It's mine, please don't touch it with your big fingers :angry:
Last edit: 12 Dec 2012 15:05 by domcars0.

Please Log in or Create an account to join the conversation.

More
12 Dec 2012 15:02 #3920 by Hexperience
Replied by Hexperience on topic Channel Scale.... and Travel Adjust
I can't get my head around this thread...
To me, subtrim is first. It sets the new 0. All calculations need to come after that. Then scale/rate whatever you want to call it. scale/rate are equal in both directions and not used for end point adjustment. expo is calculated so that the complete expo curve fits inside the scale. Then min/max or travel adjust whatever you want to call it is applied last and simply cuts off the channel at the end point you want.

I don't see where you would multiply the min/max? It should just cut the value.

Long story short, other than having to learn the names of the functions (min/max vs travel adjust or scale/rate) I don't really understand the need to change anything.

Having said all that... I haven't looked at the code of the mixer. If it's not working in that basic way, then yeah it needs to be fixed, but removing scale? or calculating subtrim at the end?? I don't get it... (but I'm not too bright so don't worry about my opinion :| )

There are 10 types of people in this world. Those that understand binary and those that don't.

Please Log in or Create an account to join the conversation.

More
12 Dec 2012 15:11 - 12 Dec 2012 15:16 #3921 by FDR
Replied by FDR on topic Channel Scale.... and Travel Adjust
Subtrim have to be added last if you don't want it to be affected by other settings.
Imagine: a servo arm is a bit off center, but you cannot adjust it finer, so you set some subtrim, say 2%.
If the scaling would occur after the subtrim applied, changing the scale (or travel adjust if you please), would move the center point.
Last edit: 12 Dec 2012 15:16 by FDR.

Please Log in or Create an account to join the conversation.

Time to create page: 0.071 seconds
Powered by Kunena Forum