OK, what I'd see:
To keep flexibility the functionality should in no way change the current behavior or layout of the firmware. If you don't use it, no change. A compile option to leave it out would be good.
To maintain the openness, make it easier for users and avoid taking too much time form the devlopers, they should be user-definable and shareable.
So:
- A new page, e.g. Custom Functions (name would be more appropriate for that than what it's used for now, let's rename the current one back to Function Switches
).
- Page has a list of a number of custom function slots, with for each a selection dropdown and a name field.
- The dropdown lists a few custom function templates off the flash memory and SD card. Right side of the screen shows an image or text description associated with it to show its purpose while scrolling the list.
- Long press enter opens a screen with the settings. 3 columns, the first with the list of the function's inputs and for each a field to select the source (including none if unused). 2nd column lists the variables or actions with their names (descriptive, e.g. "Throttle->elevator compensation) and an edit field. 3rd column lists the outputs with fields to choose the output channels (including none if that output is not required). Pressing and holding the PAGE key shows the image, highlighting the control surface linked to the actual setting the cursor is on if it's an output.
- In the mixer, channels that receive function outputs have added greyed lines with the CF number as source, and the name. The line can't be deleted, but can be moved (only within the same channel of course). Weight/offset/curve etc can be adjusted like another mix.
Now to the function templates themselves: IMO they should be user-definable with a simple script language, don't know if there are appropriate script languages out there, but something like:
Code: Select all
Delta; // Name
Aileron:input;
Elevator:input;
Aileron Ratio:variable=-100,100,0; // min, max, default value
Elevator Ratio:variable=-100,100,0;
Elevon 1:output1:source=Aileron,ratio=Aileron Ratio/2;source=Elevator,ratio=Elevator Ratio/2; // output[b]x[/b] Number used to highlight control surfaces in the bitmap, can use the grayscales in the bitmap as designators (14 possibilities)
Elevon 2:output2:source=Aileron,ratio=-Aileron Ratio/2;source=Elevator,ratio=Elevator Ratio/2;
This would describe a delta mixer, in a delta.txt file with the matching delta.bmp for visualisation. These could be shared and simply copied to a folder of the SD card.
The strings for the outputs would describe mixers lines with all their attributes (source, ratio, slow, switch,...) that will be entered on the chosen channels.
So basically it changes nothing on the back end, but we have templates that can create a group of mixers while presenting the functions and values with a descriptive parameter name. For example a template could have an "aileron differential" parameter, that will be automatically put where needed in the aileron mixers.
A big advantage is that anybody can make such "interactive templates" without requiring the developers to implement them. However, if one is good it could be added to the firmware itself easily by just adding the description string to an array of such strings, along with the bitmap. Done in minutes, and it uses the same decoder as the SD ones. Internal templates simply appear in the dropdown before the SD templates.
Another advantage is that one can make a "6-channel airplane" template that is interactive i.e. you can visualise the control surfaces and channels you need to connect servos to, retain the choice of source/destination of each control, but simply entering "function-based" parameters in a conveniently labelled parameter box instead of where they actually need to go in the mixer lines.
Of course several CFs can be added to the same outputs. So you might use one CF slot for "3-axis airplane with flaps", then a 2nd for "sequential gear retract".
2 important things that lack on most radios are fulfilled:
- The custom functions page shows in one glimpse what functions are being used.
- The mixer always shows everything that affects every channel.
Hah, took too long to post. Yep, just a more detailed version of Martin's post