Results 1 to 4 of 4
  1. #1
    Our new friend needs to reach 10 posts to get to the next flight level
    Join Date
    Jun 2010
    Location
    SFO
    Posts
    6
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Guidance designing code for autothrottle

    I started working on an autothrottle with stepper motor within Link2FS and wanted some guidance how to best design the code up for the most realistic experience.

    I see the "u" metric to determine if Autothrottle is active
    I see the "V"
    What I was expecting to see is a parameter showing what the throttle joystick axis is indicating. See sample psuedo-code below:

    if "V" greater than current joystick throttle position
    stepThottleHandleBack() // Move handle back
    else
    stepThottleHandleForward() //Move handle forward to equal value in simulator

    (Sorry couldn't get the code tag to format correctly)

    My issue id I need to tell where the physical throttle handle is. Does anybody know how to do this based on Link2FS code? Is there a more elegant way to handle autothrottle? Would appreciate any guidance or psuedocode. I'll post working examples back tot he forum once I'm off and running.

    Thanks

  2. #2
    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: Guidance designing code for autothrottle

    Hi DJ ,,, First of all, I haven't actually built one yet but I do plan to one day when I get onto it.

    You are on the right track ,,, the "Auto throttle active" is what it says and would be used to indicate and also to power or de-power the motor/stepper etc.

    The "Throttle Position" is where FSX see's (and sets) the throttle within FSX. The easy way to see this is to set the autothrottle going and watch the levers in FSX ,,,, that is the figure extracted in the "Multi".

    Now ,,,, putting this together ,,,

    Yes you do need to sense where the physical levers are (the one's you actually move)

    There are 2 ways to do this ,,,,,
    Add another pot inside the throttle housing and bring that out to the Arduino.
    Hook it up to an analog read pin,, read it, manipulate it, and then compare it to the FSX reading from the Multi.

    or ,,,,

    Warning ,, you need to know your stuff and be lucky with what throttle gear you have to do this,,,,

    Actually use the pot that is already inside the throttle (for feeding info to FSX) ,, so it is now being read by FSX and the Arduino.

    This method would only work if ,,,
    It's an analog system and not a digital one.
    One end of the pot was at earth potential. (You join it's earth to the earth on the Arduino)
    The voltage on the pot was never over 5 volts at it's extreme as the slider on the pot gets hooked to the Arduino as an analog input.
    You would have to check that there was no interaction and no "loading" when you hook them together.

    So now you have ,,,
    The throttle position as FSX see's it.(from the Multi)
    The physical throttle position.(the actual handles)
    All that needs done is to make the code so it slowly drives the handles to the correct position as FSX see's it ,, that's when the autothrottle is active. (if it's not active then the steppers are de-powered)
    Well that's what I intend to do at any-rate

    I haven't a clue as to code for this but it wouldn't be too complicated ,,, it also depends on what type of stepper you are using. (How many wires etc)
    I've never played with steppers so hopefully some other Guys may be able to help you on that one but I thought it best to sort out a direction first.

    Cheers and good luck ,,, Jim
    Last edited by Jim NZ; 01-30-2014 at 03:36 PM.
    www.jimspage.co.nz/intro.htm
    All this and Liz still loves me ! !

  3. #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: Guidance designing code for autothrottle

    I should have added but I thought I have rambled on enough ,, for my build I haven't actually decided on what driving system I'm going to use ,,, there are still plus's in using a modified servo motor.

    My project is in the "one day Ill get onto it" category ,, and it wont be soon.

    Cheers ,, Jim
    www.jimspage.co.nz/intro.htm
    All this and Liz still loves me ! !

  4. #4
    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: Guidance designing code for autothrottle

    if your going for a stepper motor ive found these to be really good, Step Stick.
    They do micro stepping up to 16 values per step ( ~5700 per revolution on a 1.8 degree stepper) and you only need 2 pins to operate them dir and step.


    they are tiny as well 16 x 20 x 10 mm, thats with the heat sink! they can run up to 2Amp motors.
    you can use them with unipolar and bipolar motors as well!
    these are the ones used on the reprap 3d printer and open source so you make your own!
    http://reprap.org/wiki/StepStick
    ill have a look at some code to point you in the right direction! later today