Results 1 to 3 of 3
  1. #1
    500+ This must be a daytime job Jim NZ's Avatar
    Join Date
    Dec 2005
    Location
    New Zealand
    Posts
    764
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Mapping Servo Data

    I had an interesting find yesterday ,, while I was making some demo INO's for my new program I made one to drive a servo indicating the flaps position. All was fine ,,, I though ,, but it was a wee bit jittery in it's swing.

    On digging into this I monitored the servo's input using the built in monitor and noted that instead of sending 1,2,3,4,5,6,7,8 etc ,, it was sending 1,5,8,11,16 etc to the servo after it was "mapped".

    I was using the common "map" method to span the servo to suit the input and I spend a lot of time making sure I had done it right.

    I then just manually fiddled the figure to get "zero" and multiplied the result to get "full span" and the difference in the movement was unreal !!!!
    It now sends every digit and it's smooth.

    Basically ,,,, I found "mapping" to be rubbish. ,, just fiddle it manually.

    I use Arduino IDE version 1.0.1
    The processed data was 0 to 57. (The Barons flaps)

    Here's what I ended up with ,,,
    etc etc
    flaps += getChar();
    flaps += getChar();
    int flapsi = flaps.toInt(); // convert it to an integer (Thanks Phill)
    flapsi = (flapsi + 10);// Manual correction to suit servo zero.
    flapsServo.write(flapsi * 3); // Manual fiddle to get full span of servo.
    //Serial.print(flapsi); // Used for testing

    The above corrections would only suit my "very old" servo ,, yours will be different.
    The "cycle time" in the software also needs to be set to suit.

    So if you don't have smooth travel ,, give this method a try.

    Hope that helps some-one ,,, Jim
    www.jimspage.co.nz/intro.htm
    All this and Liz still loves me ! !

  2. Thanks AK Mongo thanked for this post
  3. #2
    New Member
    Join Date
    Mar 2012
    Location
    New York, New York, United States
    Posts
    2
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Mapping Servo Data

    Hello Jim,

    I was planning to use an Analog Voltmeter turned sideways for this, with your 'link2fs_ Arduino_Uno1' PWM-output for 'Flaps meter'.
    Could that work too?
    I couldn't get that pde working on my Arduino_Mega yet though.

    O'Neil

  4. #3
    500+ This must be a daytime job Jim NZ's Avatar
    Join Date
    Dec 2005
    Location
    New Zealand
    Posts
    764
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Mapping Servo Data

    Yes it should work fine O'Neil as long as you can get full scale deflection with 5 volts and the PWM wound right up.

    Read all the notes supplied with the program and everything on that page in my website ,,, hopefully it covers it all.

    Good luck and have fun ,,, Jim
    www.jimspage.co.nz/intro.htm
    All this and Liz still loves me ! !