Creating a complex throttle mix, with two safeties

More
07 Jul 2013 11:25 #12031 by myxiplx
Hi folks,

I'm trying to figure out how to do this, with complex mixers and virtual channels I'm sure there's a way to do it, I'm just not sure how.

I want to configure throttle hold for my nitro heli, but I'm after three separate flight modes:

Normal: Full -100 to +100 range, TH goes to -100 and cuts the engine.
Mode1: Normal flight, but ensures I can't drop below a safe idle figure.
Range approx -60 to +100, with TH going to -60 (idle)
Mode2: Idle up. Throttle at 80 or above. TH goes to -60 (idle).

Questions:
1. Can I achieve the above with a complex mixer?
2. Could I 'tune' the idle figure with a trim button or similar?
3. Is this plan completely bonkers?

I'm still learning nitro engines, so I may be misunderstanding, but my feeling is that the idle figure will vary with ambient conditions. I know this can be adjusted by tuning the engine, but I'd like to be able to quickly work out a throttle position for a good idle, and set this as both my minimum stick position, and the TH position for modes 1 and 2, with one setting controlling all of these.

I have a Devo-10 so I could use the AUX4 or AUX5 knobs, but these are a bit too easy to knock by accident. I'd prefer a fixed value that I had a quick and easy way to adjust after I've started the engine. The ideal would be to use a trim button for this, but I don't know if we can use them as standard inputs. Can I set a virtual channel with a trim?

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

More
07 Jul 2013 13:49 #12034 by FDR
Of course you can do it.

Configure one trim to have a virtual channel as the source and increase it's step. Now you can use that virtual channel to be the idle. You probably have to scale it down and offset it a bit to meet the required range.

You should use another virtual channel to have a complex mixer, with which you add two fixed 100% value one with the throttle hold switch, the other with the inverted !FMODE0 (so it worked for both FMODE1 and FMODE2). You can use this virtual channel as a switch for the throttle hold with idle.

Then make a complex mixer for the throttle channel with 5 pages:
1. throttle stick for FMODE0
2. throttle hol switch with fixed -100
3. FMODE1
4. FMODE2
5. your virtual channel 2 for the switch and the Virt1 for the source

all should have replace mux...

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

More
07 Jul 2013 19:38 - 07 Jul 2013 19:38 #12049 by myxiplx
Thanks for the suggestions. I've given it a go, and I think I'm close, but I'm obviously missing something.

I'm troubleshooting the throttle mix one step at a time, starting with the last stage; the idle throttle hold.

The behaviour I'm seeing is that if I put the trim up even a single step, I see this value smoothly increase from -100 to +100 in small steps. And as soon as I put the trim down even a single step below zero, I get the same behaviour in the opposite direction, with the value smoothly dropping to -100.

So I have something I can adjust, but it goes straight to the endpoints.

Would you be able to take a look at my model.ini and let me know where I'm going wrong?

Thanks :)
Last edit: 07 Jul 2013 19:38 by myxiplx. Reason: It lost the attachment

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

More
07 Jul 2013 19:39 #12050 by myxiplx
PS. I can't seem to add an attachment, it's disappearing each time I hit submit.

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

More
08 Jul 2013 04:58 #12064 by FDR
What kind of file did you try to attach?
The forum should allow you to attach the model.ini file directly...

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

More
08 Jul 2013 07:08 #12066 by myxiplx
Just a model.ini file, being uploaded straight from my transmitter. I'm trying again after copying them to my computer.

I'm using the 'insert' button to add a link in here too:

File Attachment:

File Name: model7.ini
File Size:4 KB
Attachments:

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

More
08 Jul 2013 07:29 #12067 by myxiplx
Ok, I had a play this morning, while your suggestion should work great for the throttle hold, I also want this same value to be the minimum I can take the throttle to while in FMODE1 or FMODE2.

So I've added a 'max' mixer to keep this up, and had a play. I've definitely messed something else up now, but spotted something different with the trim behaviour:
  • When I start, the trim is at 101.
  • I can increase the trim all the way up to 200 in steps of 1, setting the value anywhere I like.
  • I can then decrease the trim down to 100.
  • As soon as I go one step beyond that, the value scrolls smoothly down to -101.
  • From there I can go all the way down to -200 in steps of 1, setting the value anywhere I like.
  • If I go back up, -100 is the midpoint of the trim, and going a single point above that causes it to scroll to +101 again.

  • It'
s close, but it's doing weird stuff lol.

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

  • rbe2012
  • rbe2012's Avatar
  • Offline
  • So much to do, so little time...
More
08 Jul 2013 08:41 #12070 by rbe2012
I haven't looked into the config too deep but I had a similar behavior before. It seems to be that the output of the mixer is used as input (maybe not directly but via some other mixers) so every time the screen is refreshed and a new value is calculated it changes magically without intervention until it reached a stable state.
So I believe the range from -100 to 100 is unstable - somewhere is an offset which moves the active ranges to -200...-101 and +101 to +200 instead of -100 to -1 and +1 to 100 with an unstable range at 0.
I have no tx/emulator here so I can't check this but maybe this helps.

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

More
08 Jul 2013 09:46 #12073 by myxiplx
Aaah, thanks rbe, I think that makes sense.

I do have virt1 as the input for virt1. And I'm guessing that as soon as I add a trim to virt1, it's going to output slightly higher or lower than its current value... Which will then change its value... And so a +1 will just keep the value climbing until it hits the upper limit.

I've created a feedback loop... D'oh!!

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

  • rbe2012
  • rbe2012's Avatar
  • Offline
  • So much to do, so little time...
More
08 Jul 2013 10:09 #12074 by rbe2012
I have tested yet. The easiest way to have a proper behavior is setting the mixer type to "None" for Virt1. This will prevent the loop.

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

More
08 Jul 2013 10:11 #12075 by FDR
So here is my first try...

I ruined your main page, because I diplayed the Virt1 and Virt2 to see if they work properly.
Now the Virt1 uses the left vertical trim, and has a range -100..+100
Somehow the virtual channels didn't have a default zero value in the emulator, so I made the Virt1 to use a fixed 0 value.

However I was wrong about the Virt2, because we need it true if both RUD_DR1 and !FMODE0 is true, so I made it a 3 page complex mixer, which starts with a fixed -100, and both of them adds 100 to it, so it will be above zero (i.e. true) if both switches are on.
Attachments:

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

More
08 Jul 2013 11:12 #12076 by myxiplx
Thanks, I'll try that.

I thought we needed both, my thinking was to use multiply rather than adding twice, so I setup a 3 part mixer for virt2. Would this have worked?

Page 1: Set initial value to fixed -100
Page 2: If RUD_DR1, replace to fixed +100
Page 3: Multiply, using a !FMODE0 as input, with a curve of -100 to +100
(so multiply by positive in FMODE1 or FMODE2)

Am I correct in thinking that multiply treats +100 as 1? Do we get this behaviour:

100 x 100 = 100
100 x -100 = -100
100 x 0 = 0

Thanks :)

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

More
08 Jul 2013 11:45 #12077 by FDR
The Virt2 with those multiplications were wrong, because it was true while only the RUD_DR1 was on: -100 was replaced with +100 (because of the RUD_DR1) and the third page was ignored, in case of FMODE0.
(BTW the !FMODE0 was the switch, not the input...)

While your multiplication examples are correct, it is harder to make a proper AND function if the arguments are optional depending on the switch.
However you can try to make it work if you make a 2 page complex mixer like this:
Page1: Switch=None, (Mux=replace), Src=RUD_DR1, Curve=Zero/Max, Scale=100, Offset=0
Page2: Switch=None, Mux=mult, Src=!FMODE0, Curve=Zero/Max, Scale=100, Offset=0

This implementation is closer to the definition: Virt2 = RUD_DR1 && !FMODE0

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

More
08 Jul 2013 12:00 #12079 by myxiplx
Many thanks for all the explanations, it's helping loads.

There are definitely still bits I'm not understanding though. I can see you used an offset and a scale to get the trims working, and I was able to copy that approach to use Virt3 for Channel 5 too. I've not got a nice easy way to tune the gain on my giro when I set it up next week :)

Coming back to the throttle settings, throttle hold now works perfectly, and I have a full -100 to +100 curve on normal mode. I also have a MAX mixer added in so neither FMODE1 or FMODE2 can go below the idle that's been saved in Virt1.

However, the throttle in FMODE1 now won't go above 47, and FMODE2 is now outputting 27. The lower limits are correct, but it's had an unexpected side effect on the high end.

It feels like the MAX mixer I've added in is also acting to scale or multiply the end result (although I could be guessing completely wrong).
Attachments:

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

More
08 Jul 2013 13:48 - 08 Jul 2013 13:49 #12085 by FDR
You are right!
You need the idle in the FMODE1 operation too, so it will simplify things, because you won't need the Virt2 at all, just this 5 page complex mixer for Ch3:

[channel3]
failsafe=-100
min=-100
template=complex
[mixer]
src=THR
dest=Ch3
usetrim=0
[mixer]
src=THR
dest=Ch3
switch=FMODE1
usetrim=0
[mixer]
src=AIL
dest=Ch3
switch=FMODE2
curvetype=fixed
scalar=80
usetrim=0
[mixer]
src=THR
dest=Ch3
switch=RUD DR1
curvetype=fixed
scalar=-100
usetrim=0
[mixer]
src=Virt1
dest=Ch3
switch=!FMODE0
scalar=20
offset=-70
muxtype=max


EDIT: of course you should customize the scale and offset of the idle to meet the range you need...
Last edit: 08 Jul 2013 13:49 by FDR.

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

More
08 Jul 2013 15:02 #12089 by myxiplx
Don't you need to re-order that in order for the Throttle hold on FMODE0 to work.

[channel3]
failsafe=-100
min=-100
template=complex
[mixer]
src=THR
dest=Ch3
usetrim=0
[mixer]
src=THR
dest=Ch3
switch=RUD DR1
curvetype=fixed
scalar=-100
usetrim=0
[mixer]
src=THR
dest=Ch3
switch=FMODE1
usetrim=0
[mixer]
src=THR
dest=Ch3
switch=FMODE2
curvetype=fixed
scalar=80
usetrim=0
[mixer]
src=Virt1
dest=Ch3
switch=!FMODE0
scalar=20
offset=-70
muxtype=max


Loving this though, nobody else in my club knows a thing about this controller (they're all Spektrum or JR), but I'm getting to know this pretty well now and there's not much you can't do once you've worked it out.

Could I just ask how the scalar and offsets work with the trims. I understand they're needed, but I really don't know what they are doing, or how they interact with each other.

Also, what does usetrim=0 mean, does it prevent that mixer being effected by any trims?

And finally, did a find a bug in the MAX mux? What was causing those weird upper end scaling effects?

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

More
08 Jul 2013 15:20 #12090 by FDR
No need to reorder, because my config works this way:
Page 1: THR for FMODE0 (note there is no switch configured);
Page 2: THR for FMODE1 (BTW if you will always use the same 1-to-1 as for the FMODE0, then this page can be deleted);
Page 3: fixed THR for FMODE2;
Page 4: a generic throttle hold (this gives you the throttle hold for all three flight modes);
Page 5: the idle correction for only FMODE 1 and 2.

The scale (or scalar in the ini) is a multiplication to the output, while the offset is added to it.
The scale narrows or widens the range of the output value, while the offset moves the range up or down...

Yes, the "usetrim=0" is the "No Trim" option on the pages.
I used it just in case...

I'm not sure what was wrong, but this is a cleaner design, and I had some weird channel outputs in the emulator, probably because unwanted trim effects.
It still have some quirks, but that very well might be how the emulator works, because there are no real stick inputs...

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

More
08 Jul 2013 15:32 #12091 by myxiplx
Aaah, I got it. :)

Regarding the scales, I should have been more precise. I understand the concepts, but what I don't know is:

- What is the normal range for the trims? -100 to +100?
- What effect does scale 20 have? Is that 20%, 2x, 20x?
- Which is applied first, scale or offset? (ie. is the offset scaled too?)
- Why do we need to scale and offset these? Is that just a workaround for the feedback loop?

It's a great feature though, using trim buttons for virtual channels is such a neat solution for setting idle and gain figures :)

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

More
08 Jul 2013 16:24 #12094 by myxiplx
Ok, I installed your new throttle settings, and we definitely have an offset here.

In FMODE1, with the stick at 100, I get 47% throttle.
In FMODE2, which is hard set to 80, I get 27% throttle.

In FMODE1 and FMODE2, changing the idle setting with the trim changes the available throttle range.

I think the !FMODE0 mixer is applying an offset to the whole throttle range, not just it's own output, and there's some interaction with the trim here too.

Is there any way round that while retaining the trim functions to adjust the idle?

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

More
08 Jul 2013 17:49 #12100 by myxiplx
Hmm, odd. If I remove the scale and the offset, and set the trim figure to zero F1 has a range of 0 to 100, and F2 is correctly set to 80.

If I take the trim down to -48, the upper bounds drop by -24. So F1 gets a range of -48 to 76, and F2 ends up at 56.

I think the scroll problem was due to Virt1 having itself as an input, the problem now seems to be odd behaviour of the MAX mux.

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

Time to create page: 0.069 seconds
Powered by Kunena Forum