Results 1 to 9 of 9
  1. #1
    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

    Driving Stepper Motors Vs Link2fs Cycle time

    Hi, I've been trying out steppers for the last week or two. And what I found out from my humble experience so far is: driving steppers as needle gauges require

    a really short cycle time to be set in the connection section of Link2fs ( <=25m/s ). Doing so shall ensure most regular update of the motor with position data and results in a more smooth needle movement. And the opposite- if for some reason
    cycle time increases above certain value, the needle will stars to ‘jump – stop –jump’.And this is not related to the motor step resolution.

    Just imagine the following – during the ‘void loop()’ ,the stepper goes trough two separate phases:
    1- the motor moves - 2 the motors stops and waits for new data to come trough serial port. If phase two is prolonged , that results in an un even, 'jump-ish' needle movement. Well, that negative effect could be significantly reduced in one out of two ways - 1- prolonging phase one (by reducing motor speed) , and 2- shortening phase two ( setting shorter cycle time in Link2fs ). So far so good , one would say - and here is, where the problem comes: It doesn't matter if you preset the shortest possible cycle time, when you 'check' 10 + or more data extractions to be done for one Arduino card, cycle and refresh time increases somehow, above the limit where regular motor update and smooth needle movement is garanteed. Well, you might say - 'just don't check more than 10 extractions per Arduino card' But here is the real problem - it doesn't matter in which card you check that 10 + extractions. You might check only two-tree extractions in card 1 and fifteen or so extractions in card two and leave card two not connected at all ( not pressing connect button for card two ) Nevertheless -that would end up with increasing cycle update time for all Arduino card's working in one joint Link2Fs program window. Alternatively - if we connect one Arduino card per one Link2Fs , the extractions from the card one would't affect the update time for card two and vice versa.
    Finally - to make long thing short:
    1- Smooth movement of stepper Motors ( i bet - Servo's too ) is highly dependant on the shortes possible update time from Link2fs
    2- Short update time is only guaranteed when we connect the stepper motor to a dedicated Arduino card ,set shortes cycle time, and connect the card itself to a second Link2fs window.
    3- If we want to connect steppers to a card working within one Link2fs window together with other cards and extractions, we need to find a way to update the motor with data more regular and how to do that is beyound my level of competence. Any sugestions are most well- come.

    P.S - i hope my explanation was true and clear enough and my software settings and programming 'lack of skills' didn't make me look like a 'loonie' once again.

  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: Driving Stepper Motors Vs Link2fs Cycle time

    Link2fs_WHAT_ versionWHAT ????

    And are you talking normal extractions or the one's thru the 'Experts' area. ??

    There are a lot of things going on here and I can't guess an answer.
    www.jimspage.co.nz/intro.htm
    All this and Liz still loves me ! !

  3. #3
    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: Driving Stepper Motors Vs Link2fs Cycle time

    Hi Jim, and thank you for answering my question.
    I' ll try to explain using an example of what i do. I am running FS 9 and to connect it with Arduino , i use Link2fs_Multi_fs9_v3a or Link2fs_Multi_fs9_v2. It could be my lack of experience or my personal PC setup, but i could't find out where is the problem ( if there is one ), unless some one agrees to repeat the experiment on a different setup:
    Here is what we need to do :
    1- connecting Arduino card to the usb
    2-start FS9 flight sim ( or fs 10 )
    3- start Link2Fs_Multi_fs9 ( or the appropriate one )
    4- In Normal Extractions area check only one extraction ( Vertical Speed )
    In card one communication settings set the Cycle time to the minimum ( 25 m/s or less ) and hit connection button.
    6- Start changing the airplane vertical speed and in Link2Fs observe the traffic going ' To Card ' It goes so fast, you almost can't see the digits.
    7- Now pause the sim and in Link 2fs in Card2 area in the normal extractions area check multiple extractions. Leave Card2 not connected. To observe the effect, it is not necessary the additional card to be connected.
    8- Un-pause Flight Sim , start changing airplane Vertical speed and oserve the traffic ' To Card' for card1 again. And to be more precise - observe with what speed Link2fs is sending the extraction for Vertical speed. In my setup that speed reduces and the traffic becomes ' chopped' , and if i drive stepper motor , the motor needle repeats that behaviour. When digits in ' To Card' area ' jump' to the next value, the needle 'jumps' to next area too, etc. , one would think, the hamster inside the motor is having a panic attack.

    Regards .
    Z. Todorov.

    PS- some update - I did some further experimentation -the phenomenon occur only with normal FSConnect Extractions - if i check too many of them, traffic to card becomes slow and 'choped' . But if i check a lot of experts FSUIPC extractions , traffic speed is good and smooth.
    Last edited by trakon; 10-26-2014 at 07:51 AM. Reason: info update

  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: Driving Stepper Motors Vs Link2fs Cycle time

    Hi again, another update - i installed fsX and Link2fs_Fsx . And when i run it, it doesn't matter how many SimConnect extractions i check, the numbers change fast and smooth. I bet, my first post look like jabberish now. But the problem still exist with FS9-FSConnect-Link2Fs_Fs9 ( when i check too many FSConnect extractions, the numbers start to change very slow and irregular.

  5. #5
    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: Driving Stepper Motors Vs Link2fs Cycle time

    A couple of background things that are in the documentation somewhere.

    The actual extraction timing from FS9 to the Multi is determined by the Card1 "cycle time" period.
    The card1 cycle period is also the "serial out" period for Card1. (Obviously)
    Card2 and 3 cycle periods are for "serial out" only so it's no use having them faster than Card1

    In FS9 all the extractions have to be Polled ,,, that is ,,
    My program sends to FS9 ,, "whats the altitude?" and FS9 sends to my program "12345" (the altitude) so the more extractions required means more request's being sent ,,,, more delays.
    This is why extractions have to be ticked in FS9 for them to show ,, where as in FSX they don't need to be polled.

    Try this using Multi FS9 v3a ,,,
    Set the cycle timer at 25
    Set the refresh timer to 0
    On the main form for card 1 tick "flaps position"
    Also tick "in %" (so the flaps extraction runs from 0 to 100)
    Uncheck everything else in Card1
    Uncheck everything on the Card 2 pages.
    Uncheck everything on the Card 3 pages.
    Connect the serial to something.

    Using the default Baron in FS9 ,,,
    Raise and lower the flaps and you will find (using the serial monitor ) that the output is going from 0 to 100 but sometimes a number may be missed.(rarely)

    Now ,,
    In Card 2 tick everything in the Extractions 1 and Extractions 2 pages ,,, Yes ALL OF THEM.
    There is no need to have Card2 Connected to anything.

    Now do the test again and see what you get.

    Remember ,, this is a pretty savage test having ALL the extractions active.
    If yours is any different then let me know.

    Good luck ,,Jim
    Last edited by Jim NZ; 10-27-2014 at 11:43 PM.
    www.jimspage.co.nz/intro.htm
    All this and Liz still loves me ! !

  6. Thanks trakon thanked for this post
  7. #6
    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: Driving Stepper Motors Vs Link2fs Cycle time

    Rather silly of me !! I done those test's inside the programming environment. (I'll change what I wrote above)

    I retested everything as above using the normal exe just like you have and also put the baron into a spiraling dive to give plenty of data flowing while I worked the flaps ,,, the results are below.

    A lot better than first done.

    G001
    G002
    G003
    G004
    G005
    G006
    G007
    G008
    G009
    G010
    G011
    G012
    G013
    G014
    G015
    G016
    G017
    G018
    G019
    G020
    G021
    G022
    G023
    G026
    G027
    G028
    G029
    G030
    G031
    G032
    G033
    G034
    G035
    G036
    G037
    G038
    G039
    G040
    G041
    G042
    G043
    G044
    G045
    G046
    G047
    G048
    G049
    G050
    G051
    G052
    G053
    G054
    G055
    G056
    G057
    G058
    G061
    G063
    G064
    G065
    G066
    G067
    G068
    G069
    G070
    G072
    G074
    G075
    G076
    G077
    G078
    G079
    G080
    G081
    G082
    G083
    G084
    G085
    G086
    G087
    G090
    G091
    G092
    G093
    G094
    G095
    G097
    G099
    G100
    I had to remove all the < to post it here.


    That is with everything ticked in Card2.

    I do not have FSUIPC so I don't know what will happen there.
    If you can't match the above ,, try renaming FSUIPC to something else (temporary) and see what happens.
    Good luck ,, Jim
    Last edited by Jim NZ; 10-27-2014 at 11:39 PM.
    www.jimspage.co.nz/intro.htm
    All this and Liz still loves me ! !

  8. Thanks trakon thanked for this post
  9. #7
    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: Driving Stepper Motors Vs Link2fs Cycle time

    I did the test. It looks like the problem is related to bad performance of my PC system. Here is the result:

    Only with flaps = 57 out of 100 extractions went trough, the rest was lost.
    G000
    G001
    G004
    G005
    G008
    G009
    G011
    G014
    G015
    G018
    G019
    G022
    G023
    G025
    G027
    G029
    G030
    G032
    G033
    G034
    G036
    G037
    G039
    G041
    G043
    G044
    G047
    G048
    G050
    G053
    G054
    G056
    G058
    G060
    G061
    G064
    G065
    G066
    G068
    G069
    G072
    G073
    G074
    G075
    G077
    G078
    G079
    G082
    G083
    G086
    G087
    G089
    G092
    G096
    G097
    G099
    G100

    After ticking of all extractions in card 2 = 16 out of 100 went to the serial monitor , the rest was lost.
    G001
    G004
    G008
    G011
    G020
    G030
    G044
    G050
    G055
    G059
    G065
    G076
    G087
    G091
    G099
    G100

    I did the test with and without FSUIP installed in modules folder. Being with or without FSUIPC didn't appear to make any difference.

    Then i decided to try the test with FSX and Link2FS_FSX and i was amazed - only 36 out of 100 extractions were successful, ( with and without ticked extractions in card 2), but the loses were more equally allocated along the column(normal-lost-normal-lost-normal...), which made the motor work prety well ( no jumps ) and prevented me from spotting a problem. With FS9 'the loses' were in groups- like this: normal-normal-lost-lost-lost-normal-normal...... , maybe when the program send requsts and waits for result for the normal FSConnect extractions.
    I did't have a faster system, so i did the test to a slower one ( 1Ghz Atlon single core + 1Gb Memory) and then only 12 out of 100 extractions went trough, the rest was lost, (only with flaps extraction ticked ). So - there must be something wrong with the speed of my serial port, i'll research further.
    But there are some good news too - i find a way to get over it by putting time-sensitive extractions ( like motor driving a pointer) in the FSUIPC part of Link2FS, and not so time-sensitive extractions ( like flaps position servo ) to FSConnect part. I suppose -this is the way to get the best performance out of Link2fs_ FS9 , when it works on a slow system like mine.

  10. #8
    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: Driving Stepper Motors Vs Link2fs Cycle time

    Glad you got it sorted Trakon and the problem isn't my software.

    To move on ,,,
    At the moment you are getting a reading and sending the stepper to that position ,,, it's not a good approach.

    In the Arduino code you should be processing the reading by averaging the readings or limiting travel speed or some other trick to smooth things out.
    That way you are not restricting yourself to a fast, accurate data rate.

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

  11. #9
    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: Driving Stepper Motors Vs Link2fs Cycle time

    Hello again,
    It turned out the ‘Target Frame Rate’ in fs2004 to be causing the problem with inconsistent serial data flow . It defaults at 20fps, and when I turned the slider up -to unlimited, now what I get is 100 out of 100 flaps % readings ( similar to Jim’s result). Apparently – if the target frame rate in Flight Sim is
    locked at 20 or so frame/s maximum,
    it won’t matter if Link2Fs cycle time is
    lowered to the lowest possible setting-
    Link2FS just
    won’t be getting data that fast from FS9.
    As a conclusion – Flight Sim ‘Target Frame Rate” slider and
    Link2FS cycle time setting are in a close relation and both determine
    the
    speed one will feed
    data trough com port and link2fs into Arduino .