SMALL - espritmodel.com SMALL - Telemetry SMALL - Radio
Reply
Thread Tools
Old Jun 20, 2012, 02:40 AM
Registered User
Joined Apr 2012
5 Posts
Help!
who know the algorithm for exponential curve in RC.

Hi, guys:
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.
StallManeuver is offline Find More Posts by StallManeuver
Reply With Quote
Sign up now
to remove ads between posts
Old Jun 20, 2012, 11:11 AM
Registered User
Thud_Driver's Avatar
Joined May 2004
157 Posts
http://www.rcgroups.com/forums/showt...ight=thud_driv
Thud_Driver is offline Find More Posts by Thud_Driver
Reply With Quote
Old Jun 20, 2012, 09:09 PM
Registered User
Joined Apr 2012
5 Posts
Thud_Driver:
Thank you very much! I am about to have a try!
StallManeuver is offline Find More Posts by StallManeuver
Reply With Quote
Old Jun 22, 2012, 03:47 AM
Registered User
Joined Apr 2012
5 Posts
Here is my test reoprt after reading the theads given by Thud_Driver

Hi!
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.
linear: 1.50,1.60,1.70,1.80,1.90,2.00
+100%: 1.50,1.50,1.53,1.59,1.71,2.00
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

data.

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

same range)

My conclusion:
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.
Name: expo curves.jpg
Views: 54
Size: 19.9 KB
Description:
StallManeuver is offline Find More Posts by StallManeuver
Reply With Quote
Old Jun 27, 2012, 08:48 PM
Got shenpa?
flieslikeabeagle's Avatar
Los Angeles
Joined May 2004
10,940 Posts
Quote:
Originally Posted by StallManeuver View Post
<snip>
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 same range)
Wow, I didn't expect to see that formula re-surface on RCG! It's been a long time!

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.
Quote:
Originally Posted by StallManeuver View Post
Formulas can be used in some case, but they don't fit the real data perfectly, take it or leave it.
Attachment 4956620
It looks to me like you need higher order terms to get a formula that matches your example of real data from a real transmitter (note the tighter curvature of the "real data" curve, corresponding to a higher order term in the polynomial).

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.

-Flieslikeabeagle
flieslikeabeagle is offline Find More Posts by flieslikeabeagle
Last edited by flieslikeabeagle; Jun 29, 2012 at 04:40 PM. Reason: Got sinh() and tanh() interchanged by mistake in one place.
Reply With Quote
Old Jun 27, 2012, 11:35 PM
Registered User
Thud_Driver's Avatar
Joined May 2004
157 Posts
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.
Thud_Driver is offline Find More Posts by Thud_Driver
Reply With Quote
Old Jun 28, 2012, 06:10 PM
Got shenpa?
flieslikeabeagle's Avatar
Los Angeles
Joined May 2004
10,940 Posts
Quote:
Originally Posted by Thud_Driver View Post
I thought the "simplified" 3rd order polynomial was good enough.
I agree, I can't see that the exact shape of the curve matters all that much, especially when you already have one variable (the amount of "expo") to tweak the curve to suit pilot preference.

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.

-Flieslikeabeagle
flieslikeabeagle is offline Find More Posts by flieslikeabeagle
Reply With Quote
Old Jun 29, 2012, 10:11 AM
Registered User
RCvertt's Avatar
Joined Aug 2007
4,153 Posts
Quote:
Originally Posted by StallManeuver View Post
...Establishing a lookup table using measurements data is another option...
Thanks for posting the info.

If it help, the MultiWii has some expo control called RC rate in the GUI. It also uses a look up table last time I heard.
RCvertt is offline Find More Posts by RCvertt
RCG Plus Member
Latest blog entry: Chupacabra sighting !!!
Reply With Quote
Reply


Thread Tools

Similar Threads
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