FlexiFunction questions

97 views
Skip to first unread message

Daniel

unread,
Aug 12, 2012, 7:16:33 AM8/12/12
to uavde...@googlegroups.com

Greetings.

 I'm trying to see if it's possible to program a throttle - elevator mix using FlexiFunction, as suggested...

This is to manage a strong pitch down tendency of airplanes I have with power pods (or pusher prop configuration) that has a top offset position relative to the center of mass, main wing, such as a pic above.  Currently I have dual mix in my TX, one with 17% throttle to elevator mix (switch low position) and another with 22% mix (switch high position, for more aggressive throttle application). This is in addition to the crow/land, variable flap (reflex/speed and camber/thermal mode) mixing..

So a couple of "dumb" questions:

1.  How do I work FlexiFunction to get the mix in?
     -  Does FlexFunc need a live serial connection to create a mix configuration into a UDBx?  Is this a bi-directional on the fly type of connection and
         interaction with the UDBx?
     -  Can I use the serial connection I use with HILSIM for this purpose as well?
     -  Would this work with UDB3 as well? (I have a couple of them in addition to UDB4)

2.  Where do I start programming the mixes in (if possible, step by step, pls.)?  Any "project" file sample?
3.   If possible, could the mixes be conditional on a switch (similar to the LOGO channel switch condition functions) position?

Any suggestions or sample "project" file will be greatly appreciated.

Kindest regards.

Daniel


Daniel

unread,
Aug 12, 2012, 7:23:48 AM8/12/12
to uavde...@googlegroups.com
I forgot to mention that I already have the PyFedit downloaded, installed and running.. All the best.

crashmatt

unread,
Aug 12, 2012, 7:35:03 PM8/12/12
to uavde...@googlegroups.com
Daniel,

Great that you got pyFEdit running.  Did you find the example files?  There is already throttle elevator mix in them.  ThermikV20-5.fep is the latest.

The good news is that you can have any mix rate you like.  There is a 3, 4 and 5 point mixer which is quite useful.

The latest and simplest flexifunction version matches together with the fly-by-wire branch of matrixpilot.  I am still trying to get this branch into good working order, especially since I want to fly my own gliders with it.

Documentation for each function type is non-existent. I need to fix this.

Flexifunctions are UDB4 only.  UDB3 does not have the ram or rom to use it.

You don't need a live mavlink connection but it really helps to speed up the trimming.  If you don't have the live connection then you export the c files to the flexifunction directory and then re-compile.  I think that bit is in the wiki.  Let me know if it isn't.
I don't think there are any good wiki instructions on how to setup the live link.

Probably best to skype each other but I think that you are in a different time zone.  It might have to wait for a weekend.

Regards Matt

Daniel

unread,
Aug 14, 2012, 11:18:34 AM8/14/12
to uavde...@googlegroups.com

Matt.
Tried to play around with ThermicV20-5 settings, and looks pretty complex.  I tried to see if I can find the pattern and logic in what makes this work and looks like a pretty steep learning curve required, to know the workings behind the matrix of: function type, action, the variable-parameters (setting, value and units - user definable, it seems).. There seem to be an entry with the con_throttle (guess control throttle) and throttle with the ThermicV20-5 settings, but I'm having difficulty understanding how this works with defining a mix with elevator... looks like it needs an entry (what? is there a mix function/parameters set?) in the main matrix that aligns row wise?

Also checked the wiki and again must be missing it but didn't find any instructions..

I'm not sure if this is useful but I got this running by including the file in the "tools" section (MxPilot) but still in the dark as to how this compiles. Dumb question: can one use MPLAB IDE to compile (I'm new with Python and I guess the environment has some utility to compile) this together with MP?

All the best.
Daniel

crashmatt

unread,
Aug 16, 2012, 4:29:16 AM8/16/12
to uavde...@googlegroups.com
Daniel,

I need to improve the wiki but here are the basics.

The functions are in rows, run as a list top to bottom.
The registers that the functions work on are the columns
The output resister contains the name of the function
A register that is used as an input to a function is marked in blue

When a function is run, it can either set the output, clear the output or add to the output.  The chosen output type is shown by the text colour of the function name.

Some registers are used as inputs and some as outputs.  If you look at the ELEVATOR register and select the 3rd marked entry in that column (28th row), this is the mix for throttle->elevator.   This is a GAIN_OFFSET mixer which has input and output offset and positive and negative gains.  The negative gain is zero because there should be no response to negative throttle.  Positive throttle has a negative gain to elevator at 35% rate.

If you would like better control of the mix, use a three, four or five point mixer.  An example of this is the mix from CON_BRAKE to ELEVATOR.  This was done because there is a much stronger pitching effect towards the end of the flap deployment.
These multi-point mixes must have rising value in the input values from input1 to inputN.  The output does not matter.

The output mixers need to scale the result to the servo PWM values. The SCALE_TRIM_LIMIT function is used for this.  This looks strange because the output register is also marked blue.  This means that the mixer uses the register as an input and then writes back to the same register.

Note that my transmitter stops the airbrake deployment when throttle is raised.  You can do the same with this mixer by using a conditional mix.  There is an example of a conditional mix in the FLAP_ROLL mix.  This only allows the CON_ROLL to flap mix when flaps are set to speed mode.

Double click on a function to move it to a different register
When a function/row is selected, the function can be changed by double clicking an item in the list of functions on the right.

Hope this helps

Regards Matt

crashmatt

unread,
Aug 16, 2012, 9:00:41 AM8/16/12
to uavde...@googlegroups.com
Daniel,

In the latest fbw branch, the flexifunction mix of throttle is overridden to a safe, hard coded mixer.  It is too risky to have the throttle guided by something you can change easily. 

Regards Matt 

Daniel

unread,
Aug 16, 2012, 12:32:15 PM8/16/12
to uavde...@googlegroups.com
Matt.

Thanks very much for taking the time and all the explanations..

Starting to make sense. I'll work on it and hope that you wouldn't mind having bugged by additional inquiries later.

Kindest regards.
Daniel

crashmatt

unread,
Aug 16, 2012, 5:33:23 PM8/16/12
to uavde...@googlegroups.com
No worries.  I promoted this system so it is only fair to explain it properly.  Now I really do need to get the fbw branch stable. 

/Matt

Daniel

unread,
Aug 23, 2012, 1:44:29 PM8/23/12
to uavde...@googlegroups.com
Hi Matt.
It just dawned on me as mixing is almost always a must for different airplane physics and configurations - Wouldn't it be a lot easier if some of the basic mixing definitions be contained in some kind of mixing_options.h?  Thoughts?
All the best.
Daniel

Crashmatt

unread,
Aug 24, 2012, 1:37:19 AM8/24/12
to uavde...@googlegroups.com
Daniel,

You could with two drawbacks. 

Mixing in UDB needs a live GUI for trimming.  That means either specific mavlink messaging and writing the GUI or adding the parameters to mavlink parameters.
I came to the conclusion a while back that mavlink parameters are not capable of handling enormous number of settings in a usable way.

The fixed options are fixed, ie. when someone wants something slightly different, everything in the system must change.
Example: If you have a simple two point mixer but need a 3 point, the options.h, mavlink messages and GUI must change.

This is why I made a very generic system.  It is not the easiest to use but it will do everything you want.

Ric is using an interesting system that uses a mixer script plus some other great features.  The benefit in this system is that the scripts can be cut and pasted in a text editor so there is the macro functions.

Support for macro functions is the great weakness of my system.  Every mixer setup has to be hand built.

Regards Matt

Daniel

unread,
Aug 24, 2012, 2:04:23 PM8/24/12
to uavde...@googlegroups.com
Matt, thanks very much for the very enlightening clarifications.

If I understood it correctly, both Ric's scripting and your flexifunction are bolt-ons independent app. components  that sit on top of MP, either in between the RX and MP, or the servos and MP, to add on any mixing defined, on the signal or messages that goes across? Would this be a correct understanding?

All the best.
Daniel
Reply all
Reply to author
Forward
0 new messages