Trim allocation and cross trim issue

Post Reply
BenZoFly
Posts: 41
Joined: Sat Oct 10, 2015 11:38 am
Country: -

Trim allocation and cross trim issue

Post by BenZoFly »

Hello,

I just maiden a boosted funjet plane and now that I start flying quite fast planes, I realise that I cannot afford to remove a finger from the stick to reach the trim button. And that's why crosstrim is there I believe, so I tried to implement it. However, I have a few issues with this (I'm running OpenTX 2.2.3 on a Taranis X9D first, old version):

1/ to enable cross-trim, I need to have trims in the first place. Seems obvious, but I have programmed all my planes so that the throttle stick is only active after I have "activated" the engine (via a sticky logical switch). This is a second protection on top of a "throttle hold" switch. And I never noticed that, but it seems that when the Throttle stick is not active in the mixer (could not find yet the exact programmatic condition), the throttle trim function is disabled and the vertical THR trim bar is not displayed on the screen. Consequently, the THR trim button is inactive and even if I assign it to the ELE stick, it does nothing of course. On the other hand, I have the ELE trim always showing (because the ELE stick is always active in the mixer?), but it does nothing as I don't need trim for the THR channel. I like the idea that a trim bar is removed if the trim function is disabled, but it seems is not consistently applied to all trims.

2/ For AIL and RUD cross trim, it happens that the Funjet has no rudder, but contrary to the throttle, no having any definition of the RUD stick for this model does not remove the trim bar display. And the RUD trim button is also active. This is not fully coherent with the THR trim management so it seems that there's something specific to the THR trim that is not documented ? I think I read in earlier posts that there's specific code for the THR trim to enable a low-end trim only for gas engines, that is not compatible with cross trim. Could this be the reason of the difference of display?

3/ When I assign RUD trim to the AIL stick, it does adjust the trim of the AIL channel (finally it does what I expect !), however the display of the trim is still showing on the RUD trim. I understand that this is programatically correct, however I think it is not functionally accurate when you are on the field and you need non-ambiguous data feedback. And it needs also a continuous logic all over the trims. I would expect that the trim bar displayed next to the stick relates to the stick trim itself, regardless of which button controls it. I would not expect that the bar relates to the trim button next to it, regardless what stick it controls. But I suppose that it is a relative opinion and people may prefer to have the choice.

I'd appreciate any feedback on this topic, either on how to do it with the current firmware (I may have missed a programming option) or if there is space for proposing an improvement in the roadmap to the version 2.3 of the firmware if it is a currently known limitation of the firmware.

Many thanks in advance!
B.

EDIT: I added screenshots and model file. Please note that in flight mode 1 (take off) I use the THR trim buttons to activate / deactive the throttle channel. Not sure if it has an impact.

EDIT 2: I realise that for flight mode 0 the throttle trim was set to "Trim disabled" and for flight mode 1 the throttle trim was set to "Use trim from FM0". Don't know if all that makes sense, but I start to see the issue behind my points 1 and 2.
Attachments
THR trim displayed and but trim not active
THR trim displayed and but trim not active
Flight mode 1 - THR trim displayed.png (3.33 KiB) Viewed 5672 times
THR trim not displayed and trim not active
THR trim not displayed and trim not active
flight mode 0 - no THR trim displayed.png (3.3 KiB) Viewed 5672 times
funjet model sample.otx
the model where I spotted the issues
(1.03 KiB) Downloaded 269 times

BenZoFly
Posts: 41
Joined: Sat Oct 10, 2015 11:38 am
Country: -

Re: Trim allocation and cross trim issue

Post by BenZoFly »

I found this piece of code in view_main.cpp

Code: Select all

void drawTrims(uint8_t flightMode)
{
  for (uint8_t i=0; i<4; i++) {
 
    [...]

    if(getRawTrimValue(flightMode, i).mode == TRIM_MODE_NONE)
      continue;
      
which explains at least why a trim bar is not displayed for a certain flight mode when the "trim disabled" is selected for that trim for that flight mode. So I think in first analysis that when the trim is disabled in FM0, and this trim is references in another FM, there is a slight issue that the trim is disabled in the other FM by inheritance of FM0 however the display status code do not inherit from FM0 but thinks that in the other FM the trim is not disabled. Workaround is that the trim must be set explicitly to "trim disabled" in all FMs where the trim should be disabled AND not displayed.
BenZoFly
Posts: 41
Joined: Sat Oct 10, 2015 11:38 am
Country: -

Re: Trim allocation and cross trim issue

Post by BenZoFly »

For those interested I post an example how I solved my cross-trim problem temporarily.

I'm still looking through the code to see if, with the same config, the trim bars could be displayed on the other side of the screen but I looks quite complex as the trim bars seem associated with their trim buttons not with the stick they relate to. I suppose that it makes sense as one trim value can be associated with several sticks, however it's not logical to me visually.

If I find a clean way I'll propose it in Github.

Cheers,
B.
trims displayed on the left for the right stick axis
trims displayed on the left for the right stick axis
model with trims on the left.png (3.22 KiB) Viewed 5616 times
Attachments
funjet model sample.otx
(978 Bytes) Downloaded 1062 times
User avatar
Kilrah
Posts: 11108
Joined: Sat Feb 18, 2012 6:56 pm
Country: Switzerland

Re: Trim allocation and cross trim issue

Post by Kilrah »

Yes it is normal and intended that display stays linked to the physical buttons since the trims can be used for anything, not just sticks.
BenZoFly
Posts: 41
Joined: Sat Oct 10, 2015 11:38 am
Country: -

Re: Trim allocation and cross trim issue

Post by BenZoFly »

Yes this is excellent for being able to make -anything- with the trims, it's extremely flexible, no doubt, however I'm wondering it that doesn't go too far maybe. How many people want to trim something that is not a stick and needs adjustment on every flight? I don't see the use case there to be honest. But I only fly planes and helis. Maybe on gliders ?

At least I see in the code that changing the relationship between trim buttons / trim displays / control is enormous, it touches the heart of the control engine. So I'll have to live with that I believe...

On a side note: In my example I've set the right trims to "disabled" in the flight mode config, and assigned the left trims buttons to the right stick (I fly with Throttle on the left). However I have been capable to assign my custom "engine on/off" function to the right vertical trim (initially the ELE trim) in the logical switch config, regardless if the trim button (and its display bar) was disabled or not. If I don't disable it the trim button has at the same time a "trim" function and a "switch" function, that's questioning: everytime I would switch on the engine (trim up) I would also change the trim up!

In a future release of OpenTX, I would see a test of mutual exclusion between the trim button being used as a trim (and then assign it to a control and manage the display well if that control is a stick) or as a switch (then disable the trim bar display). Or something like this.

Or am I also going too far ?

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

Re: Trim allocation and cross trim issue

Post by Kilrah »

On FPV models I use a trim as camera centering adjustment. On quads for gain settings.

The trim being also available as a switch allows things like playing a custom sound when you trim, being used in logic that triggers everytime you trim... No chance for mutual exclusion.

OpenTX is all about flexibility, it's your job to use it appropriately.

Post Reply

Return to “openTx for FrSky radios”