|Jun 20, 2012, 02:40 AM|
Joined Apr 2012
who know the algorithm for exponential curve in RC.
I'm building a radio control transmitter, software is going to be finished. But i encounter a hurdle. I don't know the algorithm for exponential cruve. In RC system, when we input a number that range from -100% to + 100%,we can see a exp curve in the LCD screen, can anybody impart the exponential algorithm to me? Thank you very much.
|Jun 22, 2012, 03:47 AM|
Joined Apr 2012
Here is my test reoprt after reading the theads given by Thud_Driver
Here is my test reoprt after reading the theads given by Thud_Driver, thank Thud_Driver.
At first, I used pmackenzie's measurements data to plot a 6 points curve(just for test, no so smooth). His data is
from his 9303 and a Datamaster servo tester. This time I only test 100% Expo value. Here is pmackenzie's data, the
unit is ms.
I think it is the curve from real product's raw data. so I use it as a standard for comparing later. Green curve is
Then, I used 4 main formulas from relevant threads to plot 4 curves. To my surprise, these 4 curves from diffrent
formulas almost coincide. They coincide very very well, so for a clear plotting, I only plot a red curve representing
all 4 formula results. Below are 4 formulas:
1. Thud_Driver's formula:
Y = (Exp/10)E-05X^3 - 1E-16X^2 + (1 - Exp/100)X + 2E-13
(Where x = stick throw, 0 to 100 and y = output, 0 to 100 and Exp = the expo in units (i.e., 25% = 25) )
2. mmormota's formula:
y = (x*x*x * (k-1) + x ) / k
(Where -1 < x < +1, k = 1, 1.5, 2, 3, 5...100)
3. Gord_W's formula:
y = a * x^3 + (1-a) * x
(Where 0 <= a <= 1
4. flieslikeabeagle's formula
t_out = 1.5 + A*(t_in - 1.5) + B*(t_in - 1.5)^3 ----->(1)
B = 4(1-A) ------->(2)
A = 1 - 0.25*B -------->(3)
(Where t_in is the incoming pulse width (varying between 1 mS and 2 mS), t_out is the output pulse width with the
Curves from formulas and curve from measurements data coincide in some ranges.
Formulas can be used in some case, but they don't fit the real data perfectly, take it or leave it.
Establishing a lookup table using measurements data is another option.
|Jun 27, 2012, 08:48 PM|
FYI, I was looking for the simplest function that would look like the generic graphs we've all seen showing what "expo" does. Keeping in mind that this might be implemented on low-powered hardware and math functions would likely have to be implemented from scratch, I decided to simplify exponential functions to only the lowest order terms, i.e. linear and cubic.
As hardware (microcontrollers) continue to get more and more powerful, it is probably now practical to implement more sophisticated functions. In particular, I think the tanh() and sinh() functions are worth investigating. It looks to me as though the sinh function is what we want for "soft around the centre" exponential, and tanh looks like the way to get the opposite behaviour.
It would be interesting to represent sinh and tanh as polynomials, keep only the first two or three terms, and see what comes out of that.
Most likely including the x^5 term in addition to the x and x^3 terms I used would do the trick.
As a corollary, I think the reason why all the formulae you looked at agreed with each other is this: all of them are essentially cubic representations (i.e to order x^3) of exponential functions with the same boundary conditions.
|Jun 27, 2012, 11:35 PM|
Actually, I tried higher order fits when curve fitting the data I took from the transmitter and the 3rd order fit nicely enough. In fact, I just went back to the original spreadsheet and did a 5th order fit and it was some improvement on some of the data. Considering that taking data from the Tx doesn't get data as precise as you'd like, I thought the "simplified" 3rd order polynomial was good enough.
|Jun 28, 2012, 06:10 PM|
Actually my personal preference is for no "expo" at all. I simply adjust the full-deflection control throws to give the model the roll, yaw, and pitch rates I want. With no expo, the controls feel much more precise and linear to me, and this approach works well for the kind of flying I do, though I have no doubt it wouldn't work for extreme 3D flying.
|Jun 29, 2012, 10:11 AM|
|Category||Thread||Thread Starter||Forum||Replies||Last Post|
|Yippee!||RC Karts : Who's going to Battlefield RC in Georgia for TERC kart races?||CeriJonston||Large Scale Cars||141||Feb 09, 2013 01:10 PM|
|Help!||Noob looking for gift for boyfriend who loves RC helicopters||mrod13||Fuel Heli Talk||8||Apr 27, 2012 07:07 PM|
|Discussion||Switching Plantraco HFX vs 2 transmitter in/out of exponential mode?||scharlach||Scratchbuilt Indoor and Micro Models||2||Nov 21, 2011 09:30 PM|
|Help!||HELP: Who has information on a Historic RC Club in San Marcos, CA||flyandi||Chit Chat||3||Oct 29, 2011 04:06 AM|
|Discussion||Anybody know of any rc events in the south central PA area coming up or anual events.||skarface||Electric Flight Events||10||Oct 20, 2011 07:29 PM|