- Posts: 390
Heli 120 Swashmix issue
- domcars0
- Topic Author
- Offline
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
Please Log in or Create an account to join the conversation.
- suvsuv
- Offline
- Posts: 268
Please Log in or Create an account to join the conversation.
- domcars0
- Topic Author
- Offline
- Posts: 390
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
Please Log in or Create an account to join the conversation.
- domcars0
- Topic Author
- Offline
- Posts: 390
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
Please Log in or Create an account to join the conversation.
- rbe2012
- Offline
- So much to do, so little time...
- Posts: 1433
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.
- domcars0
- Topic Author
- Offline
- Posts: 390
Sorry
Devo 10 (+7e) owner. It's mine, please don't touch it with your big fingers
Please Log in or Create an account to join the conversation.
- domcars0
- Topic Author
- Offline
- Posts: 390
I comeback again about the swashmix algorithm
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
Please Log in or Create an account to join the conversation.
- rbe2012
- Offline
- So much to do, so little time...
- Posts: 1433
With coll=-60%, elev=60%:
cyc[0] = coll - elev = -60% - 60% =-120%
...
Please Log in or Create an account to join the conversation.
- domcars0
- Topic Author
- Offline
- Posts: 390
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
Please Log in or Create an account to join the conversation.
- rbe2012
- Offline
- So much to do, so little time...
- Posts: 1433
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.
- domcars0
- Topic Author
- Offline
- Posts: 390
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
Please Log in or Create an account to join the conversation.
- PhracturedBlue
- Offline
- Posts: 4402
It should be:
int normalize = 100 * (Model.swashmix[0] + Model.swashmix[1] + Model.swashmix[2]) / 180;
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.
- domcars0
- Topic Author
- Offline
- Posts: 390
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
Please Log in or Create an account to join the conversation.
- domcars0
- Topic Author
- Offline
- Posts: 390
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
Please Log in or Create an account to join the conversation.
- coaster
- Offline
- Posts: 50
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.
- domcars0
- Topic Author
- Offline
- Posts: 390
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
Please Log in or Create an account to join the conversation.
- PhracturedBlue
- Offline
- Posts: 4402
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.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.
Removing the normalization is a different question, and unrelated to the existing bug.
Please Log in or Create an account to join the conversation.
- PhracturedBlue
- Offline
- Posts: 4402
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.suvsuv wrote: Attached are CCPM source codes from a commercial TX
Please Log in or Create an account to join the conversation.
- domcars0
- Topic Author
- Offline
- Posts: 390
Hi PB,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.
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
Please Log in or Create an account to join the conversation.
- PhracturedBlue
- Offline
- Posts: 4402
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.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?
Please Log in or Create an account to join the conversation.
- Home
- Forum
- News, Announcements and Feedback
- Feedback & Questions
- Heli 120 Swashmix issue