What is RadioClone and how to get it?

Radio Clone is currently the only alternative 9X firmware that does not share it's roots with the firmware released by Thus.
Post Reply
Rafit
Posts: 15
Joined: Sun Jan 08, 2012 8:25 pm
Country: -
Location: Poland
Contact:

What is RadioClone and how to get it?

Post by Rafit » Sun Jan 08, 2012 9:54 pm

RadioClone is custom firmware for Eurgle/FlySky/Imax/Turnigy 9x r/c Transmitter. It can be downloaded from http://radioclone.org or http://sourceforge.net/projects/radioclone/

RadioClone was written after Thus Th9X, but it was started before I found his project.
In fact RadioClone don't share code, or even main concept of Th9X - so it different from other firmwares (like Er9X, Gruvin9X ...), but as far I know there are some little influences between RadioClone and Er9x (both sides) ;)

At start I wanted to create extremal flexible firmware. You can set almost everything, not only mixers, inputs and outputs, but also PPM signal, stick names, timers and display are configurable. I add so many configuration possibilities that memory needed to "save" single model configuration takes almost all EEPROM. That is the reason why I RadioClone holds only one model. To overcome this, I added SD card solution for model handling. With SD card, You can have as many configuration as you want.

Now some technical specifications:

RadioClone has 2-level mixers. It's unique, and maybe sometimes hard to grab at first moment, but it simplify some tasks.

The main reason was to ensure, that some values can be calculated before using it. For example: We have aileron on right stick (mode 2) which has DR 50% and EXPO 40. This drive two servos (or maybe even four in some configurations). Now we have 3 flight modes... which has different DR settings. In "classical approach" there is need to put definition of "flight modes" in every mixer connected to "channel". In RadioClone is different.

Code: Select all

  1-level:
      (if f.mode1) AIL -> MAIL  DR 50%, EXPO 40
      (if f.mode2) AIL -> MAIL  DR 70%, EXPO 60
      (if f.mode3) AIL -> MAIL  DR 100%, EXPO 0
   2-level
       MAIL -> OUT1    DR 100%
       MAIL -> OUT4    DR -100%
       MAIL -> OUT5    DR 100%
       MAIL -> OUT6    DR -100%

As You can see, there is a special "variable" called here MAIL (mixered AIL, this can be configured of course) which holds "temporary" value. Than in 2-level mixers this value is used to drive output channels (model servos and engines). You can think about 2-level mixers as model mechanic descriptions. It should hold connection between internal variables as "mAIL" to output channels like 1,4 in reverse, 5, 6 in reverse...
You don't need to worry that this cause latency, because of different computation model, it is opposite - RadioClone is the fastest firmware.

Probably it's enough for first time (there is many more). If anyone will be interested I can describe more.

---
BTW I don't have any talent to write manuals for my own creations. For me it everything obvious... Maybe there is someone who will write a simple manual for RadioClone? Of course I can provide any information and help.


Rafit
Posts: 15
Joined: Sun Jan 08, 2012 8:25 pm
Country: -
Location: Poland
Contact:

Re: What is RadioClone and how to get it?

Post by Rafit » Mon Jan 09, 2012 9:33 pm

Time for next part. I try to describe mixers which can be used in RadioClone.

Basic concept was that mixers should be so simple as possible, but as much flexible as possible ;)
Every mixer has a condition which must be meet to run it. This condition can be set over any switch position for example:
Run mixer when:
  • - Gear is off
    - SAil is on
    - SEle is on AND Gear is off
    - TCut is on AND Gear is off AND Sail is on AND SEle is on
OR

instead of real switches you can set condition on virtual switches (there are 7 of them). Rules are that same as with regular switches.

OR

force mixer to run always or don't start at all.


First mixer I wrote was Curve mixer "Cur" You can say, it's nothing, every transmitter has curve mixers... But curves in RadioClone are bit different. It can have from 2 to 10 points, and only two of them (first and last) are fixed to X-axis. It means that for example only 4 points curve can do more than others with 9-fixed-points curve!
For example: you want to limit your Throttle a little over +80% so it will reach only +90% at full throttle.
This looks simple, but it can't be done in classic approach because than you need 10 point curve!
In Radioclone only three points are needed for this task (-100,-100), (80,80) (100,90)

Second mixer is Copy mixer "Cpy/Rev"
This is classic mixer know from any other transmitter. It translate input to ouptut with two parameters: first one is Input%, second is Expo.

Input% is nothing else as D/R, or in simple words how much decrease input (50% means if inputs equals 100, then outputs equals 50)
Expo is exponential change, you can make transition flat line (expo = 0) or like x^3 (when expo=100). You can see this on graph when values are set.

When Input%=100 and Expo=0 then mixer is called "CPY" (copy mixer) When Input%=-100 and Expo=0 then mixer is called "REV" (reverse mixer) when any other value is set, mixer is named from Input% value ("-25" for example)


Delay mixer (DEL)
This mixer limits change it's change to output. You can think about this mixer as copy mixer, but it takes old value of output, and moves it into direction of input, but no more as its limit. You can set independent delays when value increases and decreases.

Values means how long it takes to change value from 0 to 100

0 means - instant change 1 means 0.1 sec 10 means 1 sec ...

Proportional mixer (PRO)

(inspired by reading MC4000 documentation) It is a variant of copy/reverse mixer, but instead of values for Input% and Expo parameters, it takes other variables. Those variables can be almost anything: inputs, mixer variables, model variables, outputs ...

With this mixer it is easy to adjust Dual Rate or expo value even during flight! You can use for example: knob (input) or THR value after applying some special curve (mixer variable), or even it can be changed via trims! (model variable)

Proportional delay mixer (PDe)

It's like delay mixer, but instead fixed values it uses variables (like proportional mixer). For example this mixer I used to control robokitty walking speed (see my youtube demos).


---
As I write this description I make corrections for radioclone.org wiki. So if you have any questions or I write something unclear - please ask questions.

Rafit
Posts: 15
Joined: Sun Jan 08, 2012 8:25 pm
Country: -
Location: Poland
Contact:

Re: What is RadioClone and how to get it?

Post by Rafit » Tue Jan 10, 2012 11:52 pm

For now that was nothing special (I know that you are probably familiar with Er9X ;))
Difference is that RadioClone allows 30 mixers per every level, and has parametric mixers (especially delay).

But than only beginning. Now I want to tell something about "State Machine". This options is set of rules which are executed after mixer calculation which can do different things:
  • change state of virtual switches (switch them off or on)
  • set value to almost any variable (including outputs)
  • copy one variable value to another one (its like parametric mixer...)
  • Reset clock (there are 4 internal clock /it's like timers in other transmitters/)
  • Start clock
  • Stop clock
  • Cycle clock (toggle it mode running / stop)
  • Emit sounds (beep)
  • Slow changes output (something like delay mixer, but it can be applauded only for a moment, like for 2 second after flight mode change)
  • Trim connect (allows use trims for changing model variables - there are 10 of them)
  • Trim connection reset (recover standard trim configuration)
Every state machine rule can have two conditions which determine when it can be executed:
- First is that same condition which is used in Mixers. So it can allows execute a rule when certain switches or virtual switches are on/off. (see my previous post in this thread)

- Second condition is a simple math compare (equal, greater, lower) between a number (-100 to 100) any variable used in software (that includes inputs, outputs, timers, clocks,...)

There is more. Specially for state machine "timers" are introduced. There are four of them, and they count always down to 0 (every 0.1 second). So when you set value for timer to 15, then 1 second later it will have 5.

One more future, in addition to variables for switches, there are extra variables for switches transitions. They are normally set to 0, but when switch state changes, then it value is set to 100 (for switch enable) or -100 (for switch disable). This allows add rules for change switch position.

Probably now you don't know how to use it for now, but here is few examples:

Simple Throtle Cut:
only one rule needed:

Code: Select all

        condition               rule   
  (if switch TCUT is off)  SET    OUT3 = -100
because state machine rules are executed AFTER mixers, SET rule overwrite any variable configured via mixers.


Flight modes (use virtual switches as flight mode flags)

Code: Select all

  (if switch F_MODE_N is on)   STATE  Virt.Sw 5 ON,  Virt.Sw 6 OFF, Virt.Sw 7 OFF
  (if switch F_MODE_1 is on)   STATE  Virt.Sw 5 OFF, Virt.Sw 6 ON,  Virt.Sw 7 OFF
  (if switch F_MODE_2 is on)   STATE  Virt.Sw 5 OFF, Virt.Sw 6 OFF, Virt.Sw 7 ON
of course you can change that names "Virt.Sw 5" for anything else you want as long it has up to 8 letters (like "Fmode N")

Some moves sequence (like landing gear with doors):
It can be started via flipping Gear switch (this is only one way, and for sequence example only)

Code: Select all

  (Always ON)  (TGEA >  000)  SET  Tim1=31   (after flipping set timer to 3.1 sec, it will count down)
  (Always ON)  (Tim1 = 31)     SET OUT6=100                             // open gear doors
  (Always ON)  (Tim1 = 21)     SET OUT7=100                             // 1 second later, lower gear
  (Always ON)  (Tim1 = 11)     SET OUT6=-100                            // 2 second later, close gear doors
This solution is not good, because sequence can be interrupted. Of course there is a bit more complicated configuration which works ok
- but that next time.

User avatar
Rob Thomson
Site Admin
Posts: 4543
Joined: Tue Dec 27, 2011 11:34 am
Country: United Kingdom
Location: Albury, Guildford
Contact:

Re: What is RadioClone and how to get it?

Post by Rob Thomson » Wed Jan 11, 2012 9:00 pm

Thanks for getting all this information in.

It provides a valuable insight into your firmware.

I will have to find some time to install it sometime!

Rob
Slope Soaring, FPV, and pretty much anything 'high tech'
...........if you think it should be in the wiki.. ask me for wiki access, then go add it!

Rafit
Posts: 15
Joined: Sun Jan 08, 2012 8:25 pm
Country: -
Location: Poland
Contact:

Re: What is RadioClone and how to get it?

Post by Rafit » Wed Jan 11, 2012 11:52 pm

But that is not all ;)

RadioClone has 4 clocks/Timers (menu Timers). It's works like timers in other transmitters.
It count 1 per second to to 9 hours.
  • Every timer can be start/stop independently (via autostart option or state machine)
  • It can count up or down (from preset value)
  • It can emit sound when 0:00:00 (when count down) or when alarm time is set (when counting up)
  • Timer can reload after alarm (to 0 or preset value which depends from counting direction)


There are 4 clock types:
  • Always ON, counts always when started (1 tick per second)
  • "<" or ">" counts only when selected variable is less/greater than chosen value (for example when Out3 > -80, so when engine is running)
  • "State" counts only when condition is meet (it that same condition type like in mixers), so you can chose virtual or real switches
  • "Proport." - proportional clock. This clock ticks with speed proportional to selected variable. When variable is +100 clock ticks 1/second, when -100 - clock stop ticking. For example, when variable is set to Out3 (engine default), then clock ticks proportional to engine speed

Display
As I mentioned before, you can configure freely how you main screen should like. If you delete all default settings, then it can even remain empty!

The idea behind screen config is very easy. Display is "dived" into 16 "modules" from 0 to H

Code: Select all

   |          0        |         8          |
   |-------------------|--------------------|
   |          1        |         9          |
   |-------------------|--------------------|
   |          2        |         A          |
   |-------------------|--------------------|
   |          3        |         B          |
 G |-------------------|--------------------|  H
   |          4        |         C          |
   |-------------------|--------------------|
   |          5        |         D          |
   |-------------------|--------------------|
   |          6        |         E          |
   |-------------------|--------------------|
   |          7        |         F          |
every module can show:
  • Free text (up to 9 chars)
  • any variable value with 4 letter text description
  • Clock (1-4)
  • Trim ... this is "tricky" because it is only presentation as "bar". You can show that way any variable.
  • Battery voltage
  • "States" - which shows position of all internal switches
  • "Debug" - which show 2 values (how much PPM frames are send per second and how fast main loop calculates /iterates per second/)
  • "Name" - name of current model (loaded file name)
To make screen more "dynamic" every module has a parameter - condition like every mixer. So you can easy put 2 or more rules for one screen module which has different text on it.
For example I can show: F.Mod N / F.Mod 1 / F.Mod 2 depending from virtual switches position.


Naming
Many times in this description i referred to "variable" and then wrote someting like "AIL", "MAIL" or "TCUT", or I wrote "virtual switch" like "Virt.sw 3" or "Fmode 1".
That are all names of things used in mixers / state machine / display definition ...
But who wants using it like 'Virt. Sw 3" ? It meaningless. So you can redefine name of every virtual switch (up to 7 chars). You can redefine names of all inputs (sticks, knobs, switches) with up to 4 chars names. There are mixer variables (that things used to pass values between 1level and 2-level mixers) and internal model variables, which names can be redefined too (up to 4 chars).

It can be done via "model -> names" menu.
That names are model specific and are introduced only to make model programing easier and more elegant :)
Changing name don't change anything else (no behavior change).

Modes
For me something like "transmitter mode" like (mode1 or mode2 ...) should not exist. But don't worry, I know that different people want's to use different sticks for other porpoises. But what to do, if we get perfect configuration for our model (a configuration file), but we want's to use THR not on left but on right stick?
It's no problem anymore. I added simple way to reconfigure which physical stick/knob/switch are connected to which variable name!
Via "rearrange inputs" option, you can swap any stick or switch. All configuration will be altered (this option is model specific)


Post Reply

Return to “radioclone”