Trims and things

More
29 Aug 2012 13:51 - 29 Aug 2012 13:53 #1286 by PhracturedBlue
Trims and things was created by PhracturedBlue
I've been thinking a lot about how to implement trims without sacrificing the flexibility of the mixer system.

I went through many usage cases to see what capabilities we needed

below, where you see 'servo-adj' it implies:
servo-scaling, apply sub-trims, apply-reverse, apply hard-limits
  • Simplest case: tx-input goes through the mixer
    servo = tx-input->curve->mult->offset->trim->servo-adj
  • Dual rates/expo:
    m1 = tx-input->curve1->mult1->trim
    m2 = tx-input->curve2->mult2->trim
    m3 = tx-input->curve3->mult3->trim
    servo = sw0:m1 or sw1:m2 or sw2:m3 -> servo-adj
  • CCPM Mixing: mix collective, aileron, elevator
    m1 = aileron-stick->curve1->mult1->trim
    m2 = elevator-stick->curve2->mult2->trim
    m3 = throttle-stick->curve3->mult3 (normal)
    m4 = throttle-stick->curve4->mult4 (idle-up sport)
    m5 = throttle-stick->curve5->mult5 (idle-up 3d)
    m6 = fmode0:m3 or fmode1:m4 or fmode2:m5 (collective)
    servo1 = m6 + m2/2 - m1 -> servo-adj
    servo2 = m6 + m2/2
    servo3 = m6 + m2/2 + m1 -> servo-adj
  • Throttle on 6ch gas heli
    m1 = 0%->offset->trim
    m2 = throttle-stick->curve1->mult1->offset1 (normal)
    m3 = throttle-stick->curve2->mult2->offset2 (idle-up sport)
    m4 = throttle-stick->curve3->mult3->offset3 (idle-up 3d)
    servo = m1 + !thold: (fmode0:m1 or fmode1:m2 or fmode3:m3)
  • V-tail:
    m1 = aileron-stick->curve1->mult1->trim
    m2 = elevator-stick->curve2->mult2->trim
    servo1 = m1 + m2
    servo2 = m1 - m2

If things are implemented as above it means:
1) The cyclic stuff has to be redone completely
2) The trim needs to be part of the mixer and cannot be applied at the servo-stage like sub-trim. This means separating the trims for the 2401 is still difficult. I want to try my 'fixed-point' implementation 1st, but if it doesn't work, we could special case it since the 2401 doesn't have CCPM, the trim can be moved to the end of the chain.
3) The 'trim' value will be part of the value displayed on the main screen (when the trim is enabled) because it is part of the mixer
4) The trim is 'attached' to a input (like a Tx stick) but is selectively applied by the mixer. We need a new control to toggle the trim on/off per-mixer
5) I assume above that I separate servo-scaling and the servo hard-limits
6) The mixer output can be greater than 100% since the trim is applied as part of it.

A few notes from the other thread:
CCPM is used with flybarless systems. The only difference seems to be that the gyro compensates the servos directly rather than the flybar/linkages adjusting the swash-plate

The nitro guys need the ability to apply trims to throttle, but only for idle adjustment.
Last edit: 29 Aug 2012 13:53 by PhracturedBlue.

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

More
29 Aug 2012 14:32 - 29 Aug 2012 15:09 #1287 by FDR
Replied by FDR on topic Trims and things

PhracturedBlue wrote: CCPM is used with flybarless systems. The only difference seems to be that the gyro compensates the servos directly rather than the flybar/linkages adjusting the swash-plate

Of course it is used!
It's just applied in the receiver (=all-in-1) not in the tx, at least for all the new Walkera CP helis, that I'm aware of. They all should be setup for swash type normal (=1 servo).

But you can try to be sure (I don't have a separate receiver and servos):
connect three servos to the RX1201's elevator, aileron and pitch output, and use the original DEVO 8 fw with the swash type set to normal. Do all three servos move on pitch change?

EDIT: Can you bind to the RX1201 with the original fw at all?
Last edit: 29 Aug 2012 15:09 by FDR.

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

More
29 Aug 2012 15:16 #1288 by PhracturedBlue
Replied by PhracturedBlue on topic Trims and things

FDR wrote: Of course it is used!
It's just applied in the receiver (=all-in-1) not in the tx, at least for all the new Walkera CP helis, that I'm aware of. They all should be setup for swash type normal (=1 servo).

Sorry I misunderstood.
I used to be able to bind my RX1202 (before it got bound to a fixed-id). theoretically, I can still bind it to my Devo8 (but not Devo10) by using the same fixed-id. Assuming I calculated everything correctly. I will try it and see how the servos work in the different swash-modes

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

More
29 Aug 2012 15:33 #1289 by FDR
Replied by FDR on topic Trims and things
Other have difficulty to clear the fixed id too, but you can try this:
devo12s and RX1202 binding instructions

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

More
31 Aug 2012 02:52 #1295 by PhracturedBlue
Replied by PhracturedBlue on topic Trims and things
I have checked in a large rework of the mixer to properly support trims and cyclic as per the above description. I have not yet added support for extended range in any of the protocols.

Changes:
There is a new 'Trim' toggle button on each of the mixer page. this controls whether the trim is applied to this mixer (it is applied as the last step of the mixer). I just shoved it where it would fit. Feel free to move it around.

The max/min buttons have been removed from the mixer page. They are available on the 'channel' page only.

The channels are divided into 'real' and 'virtual' channels. The number of 'real' channels is limited by the number of channels selected on the model page. Virtual channels do not have any limits (reverse, max/min, servo-scale, sub-trim)

The cyclic is now applied as a template (past 'Complex'). When cyclic is used, the 1st 3 virtual channels will be the Cyclic source, and will be renamed appropriately

This was a large code rework, so there are probably many bugs still.

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

More
31 Aug 2012 11:40 #1297 by FDR
Replied by FDR on topic Trims and things
To be honest, I don't fully understand even the OP, so I have some difficulty with the implementation too...

Here is for example your DR definition:

PhracturedBlue wrote: m1 = tx-input->curve1->mult1->trim
m2 = tx-input->curve2->mult2->trim
m3 = tx-input->curve3->mult3->trim
servo = sw0:m1 or sw1:m2 or sw2:m3 -> servo-adj

Why do you want to apply trims for each mixer, when they form a complex mixer, and replace each other for sure, while the trim value is the same.
You could apply it once at the end of the complex mixer:
m1 = tx-input->curve1->mult1
m2 = tx-input->curve2->mult2
m3 = tx-input->curve3->mult3
servo = sw0:m1 or sw1:m2 or sw2:m3 -> trim -> servo-adj

The Walkera fw has an option to use (and store) separate trim values for each flight mode, but we don't, do we?


Now we can set if the mixer applies the trim value. But which one?
Trims are still bound to stick values, but a complex mixer doesn't necessarily bound to one stick input.


About the nitro idle: I see they cannot use the security feature for the throttle hold, because it gives a constant value, which the trim doesn't effect, however the could use a complex mixer with the throttle hold as the last page, which could use the trim value as source (scaled as needed).
But we don't have the trim values listed in the sources so far.
It would be useful elsewhere too...

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

More
31 Aug 2012 12:45 - 31 Aug 2012 12:47 #1298 by PhracturedBlue
Replied by PhracturedBlue on topic Trims and things

FDR wrote: To be honest, I don't fully understand even the OP, so I have some difficulty with the implementation too...

Here is for example your DR definition:

PhracturedBlue wrote: m1 = tx-input->curve1->mult1->trim
m2 = tx-input->curve2->mult2->trim
m3 = tx-input->curve3->mult3->trim
servo = sw0:m1 or sw1:m2 or sw2:m3 -> servo-adj

Why do you want to apply trims for each mixer, when they form a complex mixer, and replace each other for sure, while the trim value is the same.
You could apply it once at the end of the complex mixer:
m1 = tx-input->curve1->mult1
m2 = tx-input->curve2->mult2
m3 = tx-input->curve3->mult3
servo = sw0:m1 or sw1:m2 or sw2:m3 -> trim -> servo-adj

Because this doesn't work at all when you have a channel with multiple sources. I needed a solution that would work within the framework of the mixer we already have, and this is the best I could do.

Now we can set if the mixer applies the trim value. But which one?
Trims are still bound to stick values, but a complex mixer doesn't
necessarily bound to one stick input.

trims are bound to a stick. so a complex mixer could have multiple trims in play if it has multiple sources. remember that a complex mixer is actually made up of a bunch of simple mixers.

About the nitro idle: I see they cannot use the security feature for the throttle hold, because it gives a constant value, which the trim doesn't effect, however the could use a complex mixer with the throttle hold as the last page, which could use the trim value as source (scaled as needed).
But we don't have the trim values listed in the sources so far.
It would be useful elsewhere too...

Actually, they can use the safety feature, but they have to configure it in the ini file for now (to change the limit. Also, the trim can affect a constant value.
If you select 'src = THR' and 'curve = fixed' the trim will alter the constant.
Last edit: 31 Aug 2012 12:47 by PhracturedBlue.

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

More
31 Aug 2012 13:15 #1299 by FDR
Replied by FDR on topic Trims and things
Aha, so each mixer applies (or not) the trim appropriate to it's source.
Then it would be better if the button was not visible when there is no trims configured for that source...

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

More
31 Aug 2012 13:52 #1300 by PhracturedBlue
Replied by PhracturedBlue on topic Trims and things

FDR wrote: Aha, so each mixer applies (or not) the trim appropriate to it's source.
Then it would be better if the button was not visible when there is no trims configured for that source...

I can disable that easily enough. I am still not sure where to put the button for the expo_dr page though. We're basically out of room there.

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

More
31 Aug 2012 16:17 #1303 by FDR
Replied by FDR on topic Trims and things
Yep, that page is quite full. I'll see what can I do...

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

More
31 Aug 2012 16:51 - 31 Aug 2012 16:53 #1307 by FDR
Replied by FDR on topic Trims and things

FDR wrote: Yep, that page is quite full. I'll see what can I do...


Well, I moved it down on the simple and complex pages, but there is really no place on the expo page...
(EDIT: pushed...)

Do we need this setting on the simple and (relatively simple) expo page?
These are simplified versions of the full power complex page, which you can use instead, if you need.
The simple and expo page would always use trims if the source has one defined...
Last edit: 31 Aug 2012 16:53 by FDR.

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

More
01 Sep 2012 12:38 #1322 by FDR
Replied by FDR on topic Trims and things
So, do you think we need to define if trims are applied on all the mixer types?

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

More
01 Sep 2012 12:52 - 01 Sep 2012 12:55 #1323 by PhracturedBlue
Replied by PhracturedBlue on topic Trims and things

FDR wrote: So, do you think we need to define if trims are applied on all the mixer types?

So you would propose to use the complex page for the throttle and collective on 6ch electric helis?
Or just unmap the throttle trim
Last edit: 01 Sep 2012 12:55 by PhracturedBlue.

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

More
01 Sep 2012 12:55 #1324 by FDR
Replied by FDR on topic Trims and things
Yep. Setting up a CCPM 6ch heli would require to use the complex mixer.
No big deal.

I used to use it for much simpler setups too...

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

More
01 Sep 2012 13:02 #1325 by PhracturedBlue
Replied by PhracturedBlue on topic Trims and things

FDR wrote: Yep. Setting up a CCPM 6ch heli would require to use the complex mixer.
No big deal.

I used to use it for much simpler setups too...

I've disabled it for now. We can put it back if it doesn't work out

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

More
06 Sep 2012 19:41 #1377 by FDR
Replied by FDR on topic Trims and things
A question:
I couldn't use any trim value as source of a channel. I understand, that they cannot be selected as a source, but I thought that if I select a source, and make the mixer function constant some way (with fixed or curve), and select that channel as the trim source, than it will affect it, but it does not.
Can it be achieved somehow?

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

More
07 Sep 2012 02:26 #1379 by PhracturedBlue
Replied by PhracturedBlue on topic Trims and things

FDR wrote: A question:
I couldn't use any trim value as source of a channel. I understand, that they cannot be selected as a source, but I thought that if I select a source, and make the mixer function constant some way (with fixed or curve), and select that channel as the trim source, than it will affect it, but it does not.
Can it be achieved somehow?

Why would you want to? Is this for the 2402 still? My current implementation won't let you control the trims for the 2402 this way since it is now coded as a 12biyt value instead.

However, I verified that what you asked does work:

Set Ch1:
Src=THR, Curve=Fixed, scale=0
Set Trim-Step = for Trim LV+/- (set stick to THR)
Go to channel page and see the trim change the channel output.

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

More
07 Sep 2012 05:02 #1384 by FDR
Replied by FDR on topic Trims and things
No, it's not about the 2401 thing.
I just wanted to use trims for controlling other channels. I know, that it should work for the standard channels, zhat's why I tried to configure it to an other one to use the upper trims...

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

Time to create page: 0.060 seconds
Powered by Kunena Forum