Multiple curves in a mix?

Post Reply
azaz44
Posts: 16
Joined: Mon Oct 01, 2018 8:48 am
Country: -

Multiple curves in a mix?

Post by azaz44 »

Is this possible to apply multiple funcs / curves for one channel, all in the mixing stage? For example CV1 and then CV2, or CV and expo?

What I thought is, I could just add another mixing line, and have it modify the previous line output. But I can't find any way to have the line work on the output of the previous line. Is this somehow possible? Or any other way to apply multiple curves?

I have to have it all in the mixing stage, not inputs.

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

Re: RE: Multiple curves in a mix?

Post by Kilrah »


azaz44 wrote:But I can't find any way to have the line work on the output of the previous line. Is this somehow possible?
That's the default behavior... Each line acts on the sum of the previous ones.

Envoyé de mon 16th en utilisant Tapatalk

azaz44
Posts: 16
Joined: Mon Oct 01, 2018 8:48 am
Country: -

Re: Multiple curves in a mix?

Post by azaz44 »

Hmm can't get it to work. I can make the line to "add" which is default, but it will not apply the function (expo, diff, custom) to the previous result, only to this line input input. Or am I missing something obvious?

What I want to achieve is to apply 2 functions - one with proper characteristics (cv or expo) and another with deadband (another cv).
User avatar
MikeB
9x Developer
Posts: 17990
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: Multiple curves in a mix?

Post by MikeB »

Try using a "multiply" mix.

Mike
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
azaz44
Posts: 16
Joined: Mon Oct 01, 2018 8:48 am
Country: -

Re: Multiple curves in a mix?

Post by azaz44 »

I tried that, but I can't get the result. If I multiply many curves it's not linear anymore, it becomes a square or cube function (feels like a lot of additional expo).

I could possibly use an additional channel. So one channel would have one function, and then it would be used as an input for another mix, which would add another functio ln. But I believe this would result in a delay of one frame.

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

Re: Multiple curves in a mix?

Post by Kilrah »

No there is no additional delay if you reference another channel. But it would behave the same way as on a single channel...

Maybe you should describe what you want to achieve rather than what you think is the solution, along with what you tried and why it didn't work how you wanted.

Http://www.xyproblem.info

azaz44
Posts: 16
Joined: Mon Oct 01, 2018 8:48 am
Country: -

Re: Multiple curves in a mix?

Post by azaz44 »

Kilrah wrote: Sun Jul 21, 2019 10:43 am No there is no additional delay if you reference another channel. But it would behave the same way as on a single channel...

Maybe you should describe what you want to achieve rather than what you think is the solution, along with what you tried and why it didn't work how you wanted.

Http://www.xyproblem.info
Hmm ok, but that's a long story then.. I'm flying helis. And what I'm trying to do is to apply two curves at once for aileron, elevator and rudder channels

- one curve which regulates how channel should respond to stick movement to get the right feel and precision - let me call it stick response curve. For example sth like this:
Screenshot_20190721-235824_Samsung Notes.jpg

- another curve which makes "deadband", like this
Screenshot_20190721-235952_Samsung Notes.jpg
(Hand drawn as I don't have my PC here)

Reasons why I'm trying to separate these 2 things instead of making one custom curve are:

- it's complicated to do these two in one custom curve, because stick response curve needs to be smooth and deadband must be sharp (and OpenTX allows to set smooth/sharp per curve, not per point)

- it would also be easier to maintain for me. Some of my flight controllers include some deadband which cannot be disabled. For this reason I need different deadbands depending on model, but same stick response curves.

- if this would work, I would maybe end up just using "expo" for stick response instead of a custom curve. But deadband can only be made with a custom curve AFAIK.


The reason why I want to apply it all in the mixing stage (and not in "inputs") is SimMatch ( http://rc.a-soft.org/?page_id=68 ). In short, sometimes my input is not a stick (like AIL), but rather its recording, which comes as an output of a mixing script. And I can't make inputs use mixing script outputs. So I want to do this at mixing stage.


I thought the easiest way would be to make mix line output be an input for another mix line, but I can't find any way to do this.

I also tried "multiply", but this makes weird effects as I described.

Another way I think about is to make 2 different mixes. One would apply stick response curve to an input (ie. AIL) and produce - for example - channel 20 (not used by receiver). Another mix would take CH20 as input and apply the deadband curve, to produce channel 1 - to be used by receiver. I have yet to test it. However I think CH20 used as an input for a mix would come from the previous frame, so it would add a delay, wouldn't it?
User avatar
Kilrah
Posts: 11108
Joined: Sat Feb 18, 2012 6:56 pm
Country: Switzerland

Re: Multiple curves in a mix?

Post by Kilrah »

OK, so in this case chaining 2 channels would work (still no delay, OpenTX sees you reference another channel and calculates that first).

But you can totally also use a Multiply mix, you just have to change your deadband curve accordingly, to just be 100% where the other curve must pass through untouched and 0 within the deadband.

Image

Or you could use a logical switch that checks that the source is within your deadband, and use that to enable a line that sets the channel to 0.

But it also seems like for your SimMatch script to work fine you might want to set the deadband in Inputs (so that it doesn't get touched) and have it only match the mixer curve?
azaz44
Posts: 16
Joined: Mon Oct 01, 2018 8:48 am
Country: -

Re: Multiple curves in a mix?

Post by azaz44 »

Thanks for detailed help.

As for delay - this is great to hear. Somehow I assumed it must be delayed, otherwise there would be cyclic dependency issues and quite complexity to solve them (for example channel 20 using channel 6 as input, and then channel 6 using channel 20 as input at the same time). But I guess you have some clever way to deal with that. I will try this way, it should work. Some wasted channels, but should not matter if they are in the high range.

As for reorganizing deadband curve and using multiply - I think this would remove some part of the curve. So for example applying such deadband to a linear curve would result in this:
Sketch_improper.png
instead of this:
Sketch_proper.png
Similar with using an LS.

As for SimMatch - it starts from the LOG file - standard OpenTX log, which contains recording of exact sticks positions without any processing while doing a maneuver. Then it generates a mixing scripts which can play it back as input for mixes, to simulate someone making maneuvers same way. This way one can tune the simulator (or model too) to make same thing as the recorded model did in reality. But adding any processing in Inputs in simulator will then make it behave different again. Additional processing on recorded model would be OK, but the matched model (typically sim) has to have no processing in inputs.
User avatar
Kilrah
Posts: 11108
Joined: Sat Feb 18, 2012 6:56 pm
Country: Switzerland

Re: Multiple curves in a mix?

Post by Kilrah »

azaz44 wrote: Mon Jul 22, 2019 3:04 pm So for example applying such deadband to a linear curve would result in this:

instead of this:
Correct, but basically anything will. What you want would require something like "look at the first value of the curve when exiting the deadband then shift this half of the curve down by that much" but then the top end would be shifted down so you're not reaching full output anymore, and there is no "right" way to automatically decide on how to change points in the middle to interpolate since there's an infinity of ways of doing it.

Only way is to set your curve such that the step at the deadband edge is negligible - which is what you drew and thus seemed you had considered to be OK.
azaz44
Posts: 16
Joined: Mon Oct 01, 2018 8:48 am
Country: -

Re: Multiple curves in a mix?

Post by azaz44 »

I think it will work. Of course the order in which curves are applied changes the results. It works nicely if deadband is applied first, and the result is then sent to expo / stick response curve:

Capture.PNG

Post Reply

Return to “openTx model setup”