Page 1 of 3 123 LastLast
Results 1 to 10 of 23
  1. #1
    25+ Posting Member
    Join Date
    Jun 2014
    Location
    france
    Posts
    42
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Simple throttle control using potentiometer

    Hello to all the forum .
    Ive search on the fs2link forum but didnt find the way to simple use a potentiometer to control the throttle level.
    Maybe easy for some of you to explain it clearly with a minimum code .
    Thanks to all =)

  2. #2
    75+ Posting Member
    Join Date
    Apr 2014
    Location
    Tampa, FL, USA, Earth..umm
    Posts
    77
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Simple throttle control using potentiometer

    I don't think that is a function of Link2fs which is what this forum section is about.

    However, to answer your question, I was able to do this with an Arduino by converting the Arduino Mega to a "joystick" controller card. Search Google for that. It worked ok but I changed the Mega back to regular Arduino mode.

    After reading some more, I learned the Arduino may not be the best option as a joystick controller so eventually I ordered the Leo Bodnar joystick card.

  3. #3
    25+ Posting Member
    Join Date
    Jun 2014
    Location
    france
    Posts
    42
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Simple throttle control using potentiometer

    Thanks Mike for the answer -)
    So ok lets say i cant do that ..( will buy a servo motor so ) anyway do you think i can control for example the dimmer light on the 737 ngx ??

  4. #4
    25+ Posting Member
    Join Date
    May 2014
    Location
    Bulgaria and United Kingdom
    Posts
    56
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Simple throttle control using potentiometer

    Hi Xflight,
    I believe, the main problem with using Arduino as a joystick control is not the software itself
    but the hardware –if you consider using potentiometers, you need to connect them to analogue inputs. And – unless you are intending to use Duemilanove version, with the UNO, Mega versions you are going to come across the problem with the reduced analogue inputs resolutions – it means – if you use potentiometers for joystick, radio, dimmers, Kohlman setting, etc, and you map the input like that :

    int outcome=map(analogRead(0), 0, 1024, 0, 100); Serial.print(outcome);

    , from time to time you will get a lot of noise coming from potentiometers and going through serial , overloading it and messing up your flight sim. It doesn’t mean you can’t use potentiometers at all,but use them for stuff’s and switches requiring few positions ,not hundred positions and map the pot’s outcome in a more conservative way likethat:

    int outcome = map(analogRead(0), 0, 1024, 0, 5); , etc..

    For the rest of stuff’s , like radios, Gauge settings, etc., needing hundreds or thousands of positions use encoders.

  5. Thanks xflight38 thanked for this post
    Likes Mikeb1028 liked this post
  6. #5
    75+ Posting Member
    Join Date
    Apr 2014
    Location
    Tampa, FL, USA, Earth..umm
    Posts
    77
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Simple throttle control using potentiometer

    I agree with trakon. Use rotary encoders for the knobs in the aircraft - dimmers, radios, etc. I have a 12-position rotary switch to control the auto brake. Those will work with the Arduino.

    For potentiometer inputs, use some other interface. Have an unused USB joystick lying around? For my throttle, yoke and rudder pedals, I'm using linear pots with the Leo Bodnar card. It's easy to setup and no programming.

  7. Thanks xflight38 thanked for this post
  8. #6
    75+ Posting Member



    Join Date
    Sep 2013
    Location
    California, USA
    Posts
    109
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Simple throttle control using potentiometer

    There is a relatively easy way to get 12-bit resolution into your Arduino without turning it into a joystick. Here is a 12-bit, 8 channel analog-to-digital converter which communicates with any Arduino via I2C.
    http://www.gravitech.us/i2c128anco.html

  9. Thanks xflight38 thanked for this post
  10. #7
    25+ Posting Member
    Join Date
    Jun 2014
    Location
    france
    Posts
    42
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Simple throttle control using potentiometer

    Hello ,
    Thanks all for the reply. ( i ve undestand the basic concept why not using potentiometer with fs2link )
    By the way , im try to control the throttle level with an encoder but i must admit i dont undestand how ..
    i try on the expert section to add this on Y01 for example :AXIS_THROTTLE_SET 65765
    so in YO1 i add #65765 but it didnt seems to work with my encoder set to YO1
    any explanation or any code to help ?
    Thanks =)

  11. #8
    75+ Posting Member



    Join Date
    Sep 2013
    Location
    California, USA
    Posts
    109
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Simple throttle control using potentiometer

    Xflight,
    Youre making this much more difficult than it needs to be. Its almost impossible to use an encoder for throttle unless you are a true wizard at programming, you should be using a potentiometer and enjoying the project. The easiest option is to live with the available 10bit resolution on most arduinos, this is what almost everybody does, and its where you should start.

    If you really need the additional resolution, you can either: a) Invest in an external 12bit A/D converter, b) bypass the arduino entirely with something like the Leo Bodner card or the DesktopAviator 2312 card, or c) use the Duemilanove version of arduino, which has 12bit onboard.

  12. Thanks xflight38 thanked for this post
  13. #9
    75+ Posting Member vikingsraven's Avatar
    Join Date
    Dec 2012
    Location
    UK
    Posts
    89
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Simple throttle control using potentiometer

    if you sample the pot value multiple times then average out the value you'll get a more regular value. I use 5 samples on test kit at work and its pretty smooth.
    output = sample1 + sample 2 + sample 3+ sample 4 + sample5 / number of samples (5 I this case)

  14. Thanks xflight38 thanked for this post
  15. #10
    75+ Posting Member



    Join Date
    Sep 2013
    Location
    California, USA
    Posts
    109
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Simple throttle control using potentiometer

    Mark, that's an excellent point. It won't get you any greater resolution but it will certainly filter out a lot of the random noise and stabilize the readings.

  16. Thanks xflight38 thanked for this post
Page 1 of 3 123 LastLast