+ Reply to Thread
Results 1 to 9 of 9

Thread: Exponential function for RC servos

  1. #1

    Question Exponential function for RC servos

    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%.

  2. #2

    Default Re: Exponential function for RC servos

    Expo just makes the gimbals less responsive or more responsive around center. So (for less responsive) assuming 1500us is center just don't program anything to happen until say 1600us or 1400us more or less. I don't know how you might calculate it. I am sure someone else does though. Expo doesn't change the speed of servos or the throw, just at what position the gimbals are responsive.

    -Ron

    EDIT: See post #4 for a good description by W9GF0 I stand corrected.
    Last edited by RonP; 08-22-2011 at 09:00 AM.
    I like Pizza.

  3. #3

    Default Re: Exponential function for RC servos

    It looks like a gamma function would work: Xout = Pow(Xin , V) where V is the strength of the curve. You'd likely want values of V > 1.

    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).

  4. #4

    Default Re: Exponential function for RC servos

    Quote Originally Posted by RonP View Post
    Expo just makes the gimbals less responsive or more responsive around center. So (for less responsive) assuming 1500ms is center just don't program anything to happen until say 1600ms or 1400ms more or less. I don't know how you might calculate it. I am sure someone else does though. Expo doesn't change the speed of servos or the throw, just at what position the gimbals are responsive.
    This is not correct. What you have described is like making a deadband around center stick. Expo either increases or decreases the sensitivity of the gimbal. Positive expo will make it so that a small deflection of the stick equals an even smaller deflection of the servo, when the stick is near center. The farther the stick is deflected the greater the response of the servo relative to the stick deflection. Positive expo is used when you want very fine control such as the cyclic control of a helicopter.

  5. #5

    Default Re: Exponential function for RC servos

    Quote Originally Posted by W9GFO View Post
    This is not correct. What you have described is like making a deadband around center stick. Expo either increases or decreases the sensitivity of the gimbal. Positive expo will make it so that a small deflection of the stick equals an even smaller deflection of the servo, when the stick is near center. The farther the stick is deflected the greater the response of the servo relative to the stick deflection. Positive expo is used when you want very fine control such as the cyclic control of a helicopter.
    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
    I like Pizza.

  6. #6

    Default Re: Exponential function for RC servos

    Thanks for your response. That is what I am looking for.

    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.

  7. #7

    Default Re: Exponential function for RC servos

    Quote Originally Posted by RonP View Post
    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
    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.

  8. #8

    Default Re: Exponential function for RC servos

    I run 10% in my helicopters cyclic, 20% in my pylon racer aileron and elevator. All other planes just 10%. Works for me.

    -Ron
    I like Pizza.

  9. #9

    Default Re: Exponential function for RC servos

    This is modified from my living room lamp project. TableCount is a constant defined to be the size of the table. ExpoVal is a float for the amount of exponential you want applied, and the "1000" is the maximum value you want to allow in the table.

    Code:
    PUB InitTable(ExpoVal) | index, val, gamma
    
      Table[0] := 0
      repeat index from 1 to constant(TableCount-1)
        val := Flt.FMul( constant(1.0/float(TableCount)) , Flt.FFloat(index) )      'inputs to the pow function are from 0.0 to 1.0
        gamma := Flt.Pow(val , ExpoVal )
        Table[index] := Flt.FTrunc( Flt.FMul( gamma , 1000.0 ) ) <# 1000      'results are from 0 to 1000
    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:

    Code:
      output := -Table[ ||stickValue ]
      if( stickValue < 0 )
        output := -output

+ Reply to Thread

Similar Threads

  1. Exponential function and writing into arrays in ASM
    By crcordill in forum Propeller 1 Multicore Microcontroller
    Replies: 5
    Last Post: 05-07-2008, 09:41 AM
  2. exponential regression?
    By unteer in forum BASIC Stamp
    Replies: 2
    Last Post: 01-30-2008, 07:55 PM
  3. Exponential OP-AMP circuit
    By metron9 in forum General Discussion
    Replies: 1
    Last Post: 04-25-2006, 02:00 AM
  4. Exponential formula
    By metron9 in forum BASIC Stamp
    Replies: 2
    Last Post: 10-18-2005, 12:17 AM
  5. Linear or logarithmic or exponential
    By metron9 in forum BASIC Stamp
    Replies: 2
    Last Post: 09-22-2005, 01:15 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts