Heli 120 Swashmix issue

More
02 Dec 2012 18:56 - 02 Dec 2012 22:55 #3520 by domcars0
Heli 120 Swashmix issue was created by domcars0
In the HELI swashmix 120 it's impossible to have differents values for COL Mix
and for ELE Mix? This issue is in the emu_devo10 and in the real Devo 10.
If we put a value in the ELE Mix (65 by example) , then when we put the cursor
on the COL Mix his value change to ... 65!! Same when we change the COL Mix value (let be 50) then when we put the cursor on the ELE Mix his value change magically to ... 50!!...
Further when we read the code (mixer.c) concerning the swashmix we can see
cyc[0] = collective - elevator;
cyc[1] = collective + elevator/2 + aileron;
cyc[2] = collective + elevator/2 - aileron;
I think this is false?
cyc[0] = collective - elevator;
cyc[1] = collective + elevator + aileron;
cyc[2] = collective + elevator - aileron;
are the good functions I think.
Am I wrong?

Another problem in the code is the 'normalize' value...
Using this value we can see that when we change the Mix % on a channel , this will affect the other :-(
Let see, we have:
int normalize = Model.swashmix[0] + Model.swashmix[1] + Model.swashmix[2];

Imagine we put 60% for each Mix channel (channel is not the right word), and imagine that, with this values, everything is ok for the beginner, so we have normalize=180.

Now a better pilot want to change the front flip rate, so he will put a higher
value for ELE Mix, imagine he set 80%.
Now we have : normalize = 60 + 60 + 80 = 200.
As in the code there is
aileron = Model.swashmix[0] * aileron / normalize;
elevator = Model.swashmix[1] * elevator / normalize;
collective = Model.swashmix[2] * collective / normalize;
So the collective and the aileron will be affected by this new value of ELE Mix percentage ? Is it normal?

(sorry for my frenglish ;o)

Devo 10 (+7e) owner. It's mine, please don't touch it with your big fingers :angry:
Last edit: 02 Dec 2012 22:55 by domcars0.

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

More
03 Dec 2012 12:37 - 03 Dec 2012 12:46 #3557 by suvsuv
Replied by suvsuv on topic Heli 120 Swashmix issue
The bug is actually caused by the model_config.c, so you are look at wrong file. It is fixed now, you can check it out from my repo
Last edit: 03 Dec 2012 12:46 by suvsuv.

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

More
03 Dec 2012 14:42 - 03 Dec 2012 16:09 #3567 by domcars0
Replied by domcars0 on topic Heli 120 Swashmix issue
Hi,
Thanks suvsuv. I've made the modification and it's ok now.

I knew that the bug was'nt in the mixer.c
When I spoke of mixer.c it was not about the ELE/COL Mix value bug, but about something which seems wrong about servo moves in the swashmix algorithm.
I've a lot of problems to setup my RX2702V (walkera RX which include FBL module, and need a swashmix 120), and I think that this is due to this algo.

Really sorry for my frenglish :-(

Devo 10 (+7e) owner. It's mine, please don't touch it with your big fingers :angry:
Last edit: 03 Dec 2012 16:09 by domcars0.

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

More
03 Dec 2012 16:10 - 03 Dec 2012 16:15 #3576 by domcars0
Replied by domcars0 on topic Heli 120 Swashmix issue
Hi,
Trying to explain what I mean, please, have a look on this simple Heli 120 swashmix config:
[channel1]
template=cyclic1
[channel2]
template=cyclic2
[channel6]
template=cyclic3
..
[virtchan1]
template=simple
[mixer]
src=AIL
dest=Virt1
usetrim=0

[virtchan2]
template=simple
[mixer]
src=ELE
dest=Virt2
usetrim=0

[virtchan3]
template=simple
[mixer]
src=THR
dest=Virt3
usetrim=0

Use this config in the emulator, put the LEFT_V (THR) to 0%, then you will
have Ch1 = Ch2 = Ch6 = 0% which is correct (pitch 0°).
Ch1 is Elev Servo, Ch2 is Ail servo and Ch6 is Col servo.
Now put the the RIGHT_V to 100% you will have :
Ch1 = -33% and Ch2 = Ch6 = 16.66%

which for me is not correct. Because in this case the collective pitch is no more at 0°. Ail and Col servos have to be higher.
We must have Ch1 = -33% and Ch2 = Ch6 = 33%

What do you think about that? Am I wrong?

Devo 10 (+7e) owner. It's mine, please don't touch it with your big fingers :angry:
Last edit: 03 Dec 2012 16:15 by domcars0.

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

  • rbe2012
  • rbe2012's Avatar
  • Offline
  • So much to do, so little time...
More
03 Dec 2012 18:12 #3586 by rbe2012
Replied by rbe2012 on topic Heli 120 Swashmix issue
If you look at the geometry of the swashplate (only 120°!) you will see that the elevator servo ball at the swashplate is twice as much away from the middle axis than the two other servos - reduced to the head-tail-axis of the heli. Look at from the side at it and you will see.
This is why the elev has to move twice as much as the other ones and the middle of the swashplate will stay at the same height as before - only inclined. The two servos have to move the same way, otherwise the heli will roll.

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

More
03 Dec 2012 19:35 - 03 Dec 2012 19:54 #3588 by domcars0
Replied by domcars0 on topic Heli 120 Swashmix issue
Yes, thank you, you're right and I'm wrong, I forget that cos(120°) = -0.5
Sorry :blush:

Devo 10 (+7e) owner. It's mine, please don't touch it with your big fingers :angry:
Last edit: 03 Dec 2012 19:54 by domcars0.

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

More
03 Dec 2012 22:07 - 03 Dec 2012 22:10 #3594 by domcars0
Replied by domcars0 on topic Heli 120 Swashmix issue
Hey,
I comeback again about the swashmix algorithm :blink:
Something disturb me. When we configure an HELI swashmix 120,
the output channels (AIL, ELE & COL) will never reach 100%.
To reach this values, we have to set scale on those channels.
120 on COL & AIL channel and 150 on the ELEV channel.
In fact, I think that it will be better to apply this scales in the swashmix code.
aileron = Model.swashmix[0] * aileron / normalize;
elevator = Model.swashmix[1] * elevator / normalize;
collective = Model.swashmix[2] * collective / normalize;

cyc[0] = (collective - elevator)*1.5; /* 3/2 */
cyc[1] = (collective + elevator/2 + aileron)*1.2; /* 3/2.5 */
cyc[2] = (collective + elevator/2 - aileron)*1.2; /* 3/2.5 */

With this scales, if user set same values for swashmix channels, output channels will reach 100% by default.
Of corse this is for the 120, for other swashplate types (140, 90...) there is other scale to apply.

What do you think about that?

Devo 10 (+7e) owner. It's mine, please don't touch it with your big fingers :angry:
Last edit: 03 Dec 2012 22:10 by domcars0.

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

  • rbe2012
  • rbe2012's Avatar
  • Offline
  • So much to do, so little time...
More
04 Dec 2012 07:36 #3610 by rbe2012
Replied by rbe2012 on topic Heli 120 Swashmix issue
Just a short look on it: did you remember that the values could be less than 0?
With coll=-60%, elev=60%:
cyc[0] = coll - elev = -60% - 60% =-120%
...

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

More
04 Dec 2012 07:57 #3612 by domcars0
Replied by domcars0 on topic Heli 120 Swashmix issue
Hi rbe2012,
You forget that in the Deviation code,there is a normalization factor (normalize) which 'normalize' the values of the inputs.
Here is the full code with normalization :

int normalize = Model.swashmix[0] + Model.swashmix[1] + Model.swashmix[2];
aileron = Model.swashmix[0] * aileron / normalize;
elevator = Model.swashmix[1] * elevator / normalize;
collective = Model.swashmix[2] * collective / normalize;
cyc[0] = collective - elevator;
cyc[1] = collective + elevator/2 + aileron;
cyc[2] = collective + elevator/2 - aileron;

so in your example (if ail = 0 ) normalize = 120.

Have studied the swashmix output on my WK2801 and it seems that there is no normalization in this RX (nor the factors 1.5 and 1.2 and I gave yesterday)

Devo 10 (+7e) owner. It's mine, please don't touch it with your big fingers :angry:

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

  • rbe2012
  • rbe2012's Avatar
  • Offline
  • So much to do, so little time...
More
04 Dec 2012 08:23 #3614 by rbe2012
Replied by rbe2012 on topic Heli 120 Swashmix issue
Hi domcars0,
seems as you are right this time...
I don't have much time now. A short look into the devo8-emulator with the unchanged 6-ch-template has shown that max. +/-83% are reachable.
I have to think about the necessity to reach 100% at my swashplate - normally I have too long servo ways so I cut slightly below 100% to reach the inclination I need.
I will spend some more time in the evening and try to reproduce and understand this.

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

More
04 Dec 2012 08:50 - 04 Dec 2012 08:54 #3615 by domcars0
Replied by domcars0 on topic Heli 120 Swashmix issue
On the WK2801 when we set the swashmix to 50% on the 3 channels,
we can clearly see (on the TX monitor page) that, when moving the sticks,
the AIL & COL outputs reach 125% and the ELE reach 100%.
If we set the swashmix to 40% on the 3 channels then AIL & COL outputs reach 100% and the ELE reach 80%.

This means than, at least on the WK2801 the algorithm is :

aileron = Model.swashmix[0] * aileron ;
elevator = Model.swashmix[1] * elevator ;
collective = Model.swashmix[2] * collective ;
cyc[0] = collective - elevator;
cyc[1] = collective + elevator/2 + aileron;
cyc[2] = collective + elevator/2 - aileron;

There is no normalization factor. Without this factor, changing the swashmix value of a channel does not interfere on the scale movement of other channels, I think it's much better .. How is it on other TX like Spektrum?

Devo 10 (+7e) owner. It's mine, please don't touch it with your big fingers :angry:
Last edit: 04 Dec 2012 08:54 by domcars0.

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

More
04 Dec 2012 13:57 #3617 by PhracturedBlue
Replied by PhracturedBlue on topic Heli 120 Swashmix issue
The normalization factor is wrong.
It should be:
int normalize = 100 * (Model.swashmix[0] + Model.swashmix[1] + Model.swashmix[2]) / 180;
As far as whether or not there should be normalization at all, I don't know.
With values at 60% you (will, once the bug is fixed) get a maximum throw of 150% which is the default. With values at 100% you would get throw of 250% (which would result in clipping to your min/max value)
I don't know how other transmitters do it, but normalizing seemed safer to me.
But if there's agreement you don't want the normalization, I'm ok with that, and will remove it.
More info on how other Tx work would be helpful here.

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

More
04 Dec 2012 14:21 #3619 by domcars0
Replied by domcars0 on topic Heli 120 Swashmix issue
Hi PB,
One thing which disturb me with the normalization is the fact that when we change a channel swashmix scale, it affect the others ...
I fount that very strange and disapointing...

About the algorithm change : If you make a change in this algo you have to Warn users which already use swashmix configuration with previous releases, cause modify this algo will modify how the heli fly. They have to checkup swashmix models settings.

And yes, It would be very interesting to know how works other TX (I've had a DX6i but I don't remember problems about swashmix setup and then I don't known which algo is used by Spektrum).

Devo 10 (+7e) owner. It's mine, please don't touch it with your big fingers :angry:

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

More
04 Dec 2012 21:12 - 04 Dec 2012 21:13 #3633 by domcars0
Replied by domcars0 on topic Heli 120 Swashmix issue
Hi,
May be, this (swashmix normalization) can be configurable?
In the TX config we can ask the user if he want or not a normalization factor
on the swashmix? By default it can be set to Yes (to be compatible with previous releases.
Or, as it's not an usual parameter for TX, this could be configurable only in the TX config file (and documented of course).

Devo 10 (+7e) owner. It's mine, please don't touch it with your big fingers :angry:
Last edit: 04 Dec 2012 21:13 by domcars0.

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

More
05 Dec 2012 04:17 #3648 by coaster
Replied by coaster on topic Heli 120 Swashmix issue
Hi

domcars0 proposal would be very fine for me.
In the 1.2 Firmware i had limited the servo output
for AIL,ELE & PIT to obtain a collective 12° and a cyclic 8°
and my T-Rey with flybarless 3GX and satellite, had no
problems at all.
Actually i go back to 1.2 because with the 2.0 swashplate mix
i can't adjust my T-Rex to obtain the right values.

cheers
Graziano

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

More
05 Dec 2012 08:10 #3650 by domcars0
Replied by domcars0 on topic Heli 120 Swashmix issue
Hi,
After "coaster" post I've take a look to the 1.2 release mixer.c code , and in fact this normalization did'nt exist in this stable release!
Some people may have been surprise with the V2 as their heli doesn't fly like with the previous release!
I though that it was introduce in the very early codes. So now, I thing that it's better to remove this normalization factor or at least, if it's not too much work, to be able to configure it.

Devo 10 (+7e) owner. It's mine, please don't touch it with your big fingers :angry:

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

More
05 Dec 2012 13:07 #3653 by PhracturedBlue
Replied by PhracturedBlue on topic Heli 120 Swashmix issue

domcars0 wrote: Hi PB,
One thing which disturb me with the normalization is the fact that when we change a channel swashmix scale, it affect the others ...
I fount that very strange and disapointing...

About the algorithm change : If you make a change in this algo you have to Warn users which already use swashmix configuration with previous releases, cause modify this algo will modify how the heli fly. They have to checkup swashmix models settings.

I'm sorry, but this was just a bug plain and simple. The intended effect was for there to be no change between 1.2 and 2.0 for the same configuration (everything at scale=60). This has been resolved in the current code and will be in the next release.
Removing the normalization is a different question, and unrelated to the existing bug.

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

More
05 Dec 2012 14:10 #3655 by PhracturedBlue
Replied by PhracturedBlue on topic Heli 120 Swashmix issue

suvsuv wrote: Attached are CCPM source codes from a commercial TX

Sorry, I've deleted this post. Unless you can confirm the copyright on that code can be freely distributed, it can't be used as a basis for anything in Deviation.

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

More
05 Dec 2012 15:17 - 05 Dec 2012 15:18 #3658 by domcars0
Replied by domcars0 on topic Heli 120 Swashmix issue

PhracturedBlue wrote: I'm sorry, but this was just a bug plain and simple. The intended effect was for there to be no change between 1.2 and 2.0 for the same configuration (everything at scale=60). This has been resolved in the current code and will be in the next release.
Removing the normalization is a different question, and unrelated to the existing bug.

Hi PB,
I've well understand effects of the bug.
But about the normalize factor, I think that, for lots of people, to learn that : setup the swashmix to 1/1/1 will be exactly the same than setup it to 100/100/100, is really disappointing.
To know that, setting the col_mix to 100 has not the same effect on the collective if ail_mix is set to 20 or if it's set to 80 will disturb me a lot more.
That's why I don't think that the normalization factor is a good idea.
I've not seen the CCPM source code provided by suvsuv, but is it possible to know if there is a normalization factor in it?

Devo 10 (+7e) owner. It's mine, please don't touch it with your big fingers :angry:
Last edit: 05 Dec 2012 15:18 by domcars0.

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

More
05 Dec 2012 18:56 - 05 Dec 2012 18:56 #3675 by PhracturedBlue
Replied by PhracturedBlue on topic Heli 120 Swashmix issue

domcars0 wrote: I've not seen the CCPM source code provided by suvsuv, but is it possible to know if there is a normalization factor in it?

I cannot allow any discussion of the contents of that firmware here. From using actual transmitters, it should not be hard to determine what is the most common use. I've already seen one point about a WK2801. What about the Devo Tx, or Spektrum? there must be folks who can hook up a regular Rx, and describe how the mix functions.
Last edit: 05 Dec 2012 18:56 by PhracturedBlue.

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

Time to create page: 0.062 seconds
Powered by Kunena Forum