Exponential function for RC servos
donnpangy
Posts: 49
I am looking for information on calculating an exponential function for RC servos.
This is a function that is on most RC transmitters, and I would like to incorporate it into my prop projects. I am already able to input servo pulses and then put them back out. What I would like to do is add exponential to the servo pulses before I send it back out. Does anyone know how to calculate this?
Here is a breif explanation of exponential by Hitec.
Per Hitec
It is a radio function that will allow you to change the control response of the control sticks from being a linear response to what is known as an increasing response curve, or exponential. An example of how this feature is commonly used would be the pilot on an extremely responsive aerobatic aircraft using full servo throw travel and does not need much servo input to control the plane in level flight but wants to take full advantage of it's aerobatic capabilities. Therefore, exponential is programmed such that very little servo response is provided when the control sticks are near centered, or neutral. As the sticks are moved farther from the neutral point, more servo response is generated at a rate greater than a straight linear response, allowing for quick and precise maneuvers. Exponential values are available from -100% to +100%.
This is a function that is on most RC transmitters, and I would like to incorporate it into my prop projects. I am already able to input servo pulses and then put them back out. What I would like to do is add exponential to the servo pulses before I send it back out. Does anyone know how to calculate this?
Here is a breif explanation of exponential by Hitec.
Per Hitec
It is a radio function that will allow you to change the control response of the control sticks from being a linear response to what is known as an increasing response curve, or exponential. An example of how this feature is commonly used would be the pilot on an extremely responsive aerobatic aircraft using full servo throw travel and does not need much servo input to control the plane in level flight but wants to take full advantage of it's aerobatic capabilities. Therefore, exponential is programmed such that very little servo response is provided when the control sticks are near centered, or neutral. As the sticks are moved farther from the neutral point, more servo response is generated at a rate greater than a straight linear response, allowing for quick and precise maneuvers. Exponential values are available from -100% to +100%.
Comments
-Ron
EDIT: See post #4 for a good description by W9GF0 I stand corrected.
Have a look at http://en.wikipedia.org/wiki/Gamma_correction for a pretty graph and a better explanation. The In & Out values would need to be normalized for it to work (ie, converted to the range of 0 to 1 as floats, then back again). If you need speed, I'd just generate a look up table whenever the power value changes (which presumably wouldn't be often).
Good description. You are correct.
JR and Spektrum positive + to soften the response. Futaba its negative - to soften response. And I don't know about Hitec and others.
-Ron
Do you know of any spin code that would allow me to setup the response curve?
I would like to be able to set up a list from 0 to 1000, and have a non-linear response curve result.
I have a couple JR transmitters and I love their exponential curve. I typically set all my surfaces (ailerons, rudder, and elevator) to about 40% exponentials.
-Ron
I have not compiled & tested this, so there may be bugs, but that code should be basically what you want. To use the table, look up the absolute stick value in the table, then change the sign of the result if the input was negative, like this: