Adjustable 'centre' for mini-quad throttle curve - during flight

Post Reply
loadlover
Posts: 14
Joined: Sun Mar 25, 2018 8:49 pm
Country: -

Adjustable 'centre' for mini-quad throttle curve - during flight

Post by loadlover »

Radio: QX7S running OpenTx 2.2.1

Hi all,

At the moment, I set up a simple custom 5 point curve for my mini-quad throttle. The middle three points form a line with a 'flattened' gradient, just as if I'd chosen a traditional expo curve.

What I want to do is assign one of the control knobs to be able to raise and lower these middle three points all together, leaving the first point (0% throttle) and the last point (100% throttle) alone.

This will allow me to hover the quad, neither climbing nor descending, at a throttle stick position of my choosing (usually middle) depending on what I'm doing / the payload of the quad.

I would love to hear of your ideas on how I can accomplish this. I'm a bit of a beginner, but very happy to get into some Lua scripting if needed.

Thanks guys

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

Re: Adjustable 'centre' for mini-quad throttle curve - during flight

Post by MikeB »

The following looks to work. Rather than trying to modify a curve, this generates the required output using mixes. I'm using throttle on CH3.

CH3: +40% Thr
+30% S1
* 100% Thr Curve(c1) (MULTIPLY mix)
+100% Thr Curve(c2)
C1 set to 0, 100, 100, 100, 0
C2 set to -100, 0, 0, 0, 100 (edited to change the first value to -100)

The 40% Thr sets the slope of the "flattened" output.
The 30% S1 moves this up and down
The multiply mix uses these over the middle 50% of the throttle movement, and "fades" them out outside that range.
The 100% Thr "fades" in the throttle to reach to +100% and -100% output at the ends.

I would not use LUA for controlling any major flight function.

Mike
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
loadlover
Posts: 14
Joined: Sun Mar 25, 2018 8:49 pm
Country: -

Re: Adjustable 'centre' for mini-quad throttle curve - during flight

Post by loadlover »

Hi Mike,

That looks great! I won't be able to try it till the weekend, but I'm looking forward to it!

I studied up on Lua last night (just introductory stuff), but it seems to be quite a simple scripting language. Yes, I saw the warnings about execution not being guaranteed, so I guess that's not a great idea, unless there's an auto-fallback throttle function (which is mentioned in the documentation). Anyway, roll on the weekend :)

Many thanks for your help.
loadlover
Posts: 14
Joined: Sun Mar 25, 2018 8:49 pm
Country: -

Re: Adjustable 'centre' for mini-quad throttle curve - during flight

Post by loadlover »

Hi again Mike,

I'm having difficulty programming it into the radio. I'm confused about.. umm.. quite a lot of things. Could you possibly provide me with a file of it programmed so I can examine it to see exactly what's going on?

Sorry about this, but I'm pretty new to programming the mixes.
User avatar
MikeB
9x Developer
Posts: 17990
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: Adjustable 'centre' for mini-quad throttle curve - during flight

Post by MikeB »

I may be able to, by using Companion. I assume you have Companion installed on your Computer.

I develop and use ersky9x firmware, rather than use openTx.

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

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

Re: Adjustable 'centre' for mini-quad throttle curve - during flight

Post by loadlover »

I do, yes.
User avatar
MikeB
9x Developer
Posts: 17990
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: Adjustable 'centre' for mini-quad throttle curve - during flight

Post by MikeB »

Try this.
It seems Companion (2.2.1) doesn't have an option to save just the model!
Open this .otx file in Companion and drag and drop the model into the otx read from your radio.

Mike
Attachments
Thr1.zip
(500 Bytes) Downloaded 312 times
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
loadlover
Posts: 14
Joined: Sun Mar 25, 2018 8:49 pm
Country: -

Re: Adjustable 'centre' for mini-quad throttle curve - during flight

Post by loadlover »

That's fantastic. Thanks Mike. Very much appreciated!

I could graph this manually (throttle stick deflection on x (horizontal) axis v. channel 3 output on the y (vertical) axis, but is there a quicker way? Perhaps this is where some Lua could come in handy.

Thanks :)

Post Reply

Return to “openTx model setup”