Scale the resultant signal of all other mix signals, resultant signal changing sign

openTx has introduced a range of new features, ideas and bling. It is fast becoming the firmware of choice for many users. openTx will run on ALL current hardware platforms, including the gruvin9x and sky9x boards. Work has already started to support the new FrSky X9D radio!
Post Reply
loadlover
Posts: 13
Joined: Sun Mar 25, 2018 8:49 pm
Country: -

Scale the resultant signal of all other mix signals, resultant signal changing sign

Post by loadlover » Fri Oct 05, 2018 4:27 pm

Hi,

Can I use a mix to scale the resultant signal of all other mixed signals *when the resultant signal goes from a negative value to a positive value*?

To clarify further: OpenTx uses signals going from -100 to +100. Scaling a signal would be easy if it were 0 to 100. But it isn't..

The origin is (-100, -100), which should not change.

Thanks :)

rdeanchurch
Posts: 588
Joined: Tue Dec 27, 2011 11:22 pm
Country: -
Location: Rio Vista. CA

Re: Scale the resultant signal of all other mix signals, resultant signal changing sign

Post by rdeanchurch » Fri Oct 05, 2018 11:09 pm

Use a curve on each mix on the channel. The curve would be 0 at -100 and 100 at 100.
Or use an offset of 100 and a weight of 100.
Dean
OldDmbThms: 1. Takeoff, 2. Crash, 3. Repair, GOTO 1

loadlover
Posts: 13
Joined: Sun Mar 25, 2018 8:49 pm
Country: -

Re: Scale the resultant signal of all other mix signals, resultant signal changing sign

Post by loadlover » Sat Oct 06, 2018 8:49 am

I see where you're going by making everything in the positive domain, but surely this will offset the whole channel making my multirotor unflyable..

User avatar
jhsa
Posts: 18129
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: Scale the resultant signal of all other mix signals, resultant signal changing sign

Post by jhsa » Sat Oct 06, 2018 9:09 am

Some radios display 0 to 100 for the full range. Other radios display -100 to 100 for the same range.. the channel output might be the same values on both cases. It is just the way it is displayed that is different, not the way it works.
Well, actually -100 to 100 display the double of the steps. I think I actually prefer it. :)

João
My er9x/Ersky9x/eepskye Video Tutorials
https://www.youtube.com/playlist?list=PL5uJhoD7sAKidZmkhMpYpp_qcuIqJXhb9

Donate to Er9x/Ersky9x:
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YHX43JR3J7XGW

User avatar
Kilrah
Posts: 9666
Joined: Sat Feb 18, 2012 6:56 pm
Country: Switzerland

Re: Scale the resultant signal of all other mix signals, resultant signal changing sign

Post by Kilrah » Sat Oct 06, 2018 9:26 am

Multiply with a 2-point curve that goes from -100,0 to +100,+100?


loadlover
Posts: 13
Joined: Sun Mar 25, 2018 8:49 pm
Country: -

Re: Scale the resultant signal of all other mix signals, resultant signal changing sign

Post by loadlover » Sat Oct 06, 2018 1:24 pm

@Kilrah - I tried that. The problem is that you end up scaling relative to the x-axis - which is fine if there are no negative values. It does not give the desired effect if there are. What I'd like to achieve is scaling relative to a line parallel to the x-axis at y = -100.

I tried simply offsetting all the existing mixes by +100 so that they could then be scaled by a final mix, but this just messes everything up. The offsetting needs to be done before we get to the mixes.. hmm..

User avatar
MikeB
9x Developer
Posts: 15805
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: Scale the resultant signal of all other mix signals, resultant signal changing sign

Post by MikeB » Sat Oct 06, 2018 2:56 pm

Depending on exactly what you are trying to do (e.g. what you wish to scale by, constant or variable), you can use three mixes:
Add Weight(0), offset(100)
Multiply - whatever you need
Add Weight(0), offset(-100)

If, say, using a pot for the scaling, you could try two mixes:
Multiply S1 weight(50) offset(50)
Add S1 weight(50) offset(-50)

Mike
ersky9x/er9x developer
The difficult we do immediately,
The impossible takes a little longer!

loadlover
Posts: 13
Joined: Sun Mar 25, 2018 8:49 pm
Country: -

Re: Scale the resultant signal of all other mix signals, resultant signal changing sign

Post by loadlover » Sat Oct 06, 2018 9:10 pm

MikeB wrote:
Sat Oct 06, 2018 2:56 pm
Depending on exactly what you are trying to do (e.g. what you wish to scale by, constant or variable), you can use three mixes:
Add Weight(0), offset(100)
Multiply - whatever you need
Add Weight(0), offset(-100)

If, say, using a pot for the scaling, you could try two mixes:
Multiply S1 weight(50) offset(50)
Add S1 weight(50) offset(-50)

Mike
Thanks Mike. That works perfectly.

Post Reply

Return to “openTx”