Page 3 of 7 FirstFirst 1234567 LastLast
Results 21 to 30 of 65
  1. #21
    25+ Posting Member crashdog's Avatar
    Join Date
    Jun 2010
    Location
    swizerland
    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: "Inner Circle" HSI - SIOC DC Motors Card Script

    Hi Jack,
    maybe a more specific question would be good. I don't think someone will write the code for you
    If I understand right you now have 3 pots connected to a input card (OC or bodnar) and you have one dc motor that should be move according to the pot's position.
    The first thing would be to read the pots and check if one of them is in a range which would make it the active one. You will also need to calibrate the pots (hoping they are linear, logarithmic would be really difficult). When you have the active pot's position you need to calculate the difference from the pot to the fsuipc value and move the motor according to the difference.

    Was that what you needed to know ?
    Hope I could be of any help.
    Gery

  2. #22
    500+ This must be a daytime job Boeing 747 Flyer's Avatar
    Join Date
    Nov 2009
    Location
    England
    Posts
    635
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: "Inner Circle" HSI - SIOC DC Motors Card Script

    Hi Gery,

    The potentiometers are perfectly linear.

    Potentiometer 1, range 127-255, covers the heading range: 180 - 010 Degrees

    Potentiometer 2, range 121-253, covers the heading range: 009 - 179 Degrees

    When the motor reaches 0 degrees, Potentiometer 2 kicks back in again and the process restarts.

    Tests performed anticlockwise. Please note all above readings are anticlockwise.

    Both pots work perfectly and are definitely suitable for this application. I would just like to know how I go about scaling, an example calculation, etc.

    It's just hard because there are literally no scripts/advise for instruments such as heading indicators, which continously rotate.

    Using the above information, can you show me an example calculation involving the offset, motor and pots?

    Jack

  3. #23
    25+ Posting Member crashdog's Avatar
    Join Date
    Jun 2010
    Location
    swizerland
    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: "Inner Circle" HSI - SIOC DC Motors Card Script

    If I understand right, the scale of the instrument is 360 deg, the fsuipc value of $04CE goes from goes from 0 to 359 ?
    If yes, then I would align everything on "0". Means the instrument's needle is at 0 when the pot1 is and also when $04CE is at 0.
    When you move the motor with the pot from 0 to 1 degrees you should read the value that the pot1 shows and that is then the factor between the pots and the fsuipc $04CE value. You then need to choose which value you want to divide or multiply to have simmilar values to compare.
    Example:
    $04CE = 0 (degree) and pot1 = 0 (decimal)
    $04CE = 1 (degree) and pot1 = 64 (decimal)
    64 divided by 64 is 1. So if your pot is linear you should be able to divide all values by 64. Then your pot value is the same as your fsuipc value.

    Then you need to programm something like :
    -- Read pot1 and pot2 value
    -- Check which pot is in active range and assing to a helper variable for example pot = pot1.
    -- if pot_value < $04CE_value then
    move motor negative.
    -- if pot_value > $04CE_value then
    move motor positive.
    -- Else
    stop motor.
    -- End.

  4. #24
    500+ This must be a daytime job Boeing 747 Flyer's Avatar
    Join Date
    Nov 2009
    Location
    England
    Posts
    635
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: "Inner Circle" HSI - SIOC DC Motors Card Script

    Hi Gery,

    I understood most of that, except for the "64 - Decimal" part. What is this "decimal"? Pots values in SIOC are 0-255, so I don't understand that little bit.

    regards,

    Jack

  5. #25
    25+ Posting Member crashdog's Avatar
    Join Date
    Jun 2010
    Location
    swizerland
    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: "Inner Circle" HSI - SIOC DC Motors Card Script

    http://en.wikipedia.org/wiki/Decimal

    Sorry this is the last post for this thread. Can't help you more then this.

    Gery

  6. #26
    500+ This must be a daytime job Boeing 747 Flyer's Avatar
    Join Date
    Nov 2009
    Location
    England
    Posts
    635
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: "Inner Circle" HSI - SIOC DC Motors Card Script

    Quote Originally Posted by crashdog View Post
    http://en.wikipedia.org/wiki/Decimal

    Sorry this is the last post for this thread. Can't help you more then this.

    Gery
    For not knowing why 64 is a decimal?



    To me, a decimal is 13.8, 56.9, etc. 64 is not a decimal?

    Also, you say align Pot 1 at 0. As I said, Pot 1 can never reach 0, it covers the anticlockwise range 180 - 010; it never crosses 0. You mean Pot 2?

  7. #27
    500+ This must be a daytime job kiek's Avatar
    Join Date
    Jan 2007
    Location
    Netherlands
    Posts
    698
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: "Inner Circle" HSI - SIOC DC Motors Card Script

    Hi Jack,
    Quote Originally Posted by Boeing 747 Flyer View Post
    To me, a decimal is 13.8, 56.9, etc. 64 is not a decimal?
    I believe he meant number 64 in the decimal system notation (what we normally use for numbers), not hexadecimal like $04CE
    $64 (in hexadecimal system, base 16) would be 6*16 + 4 = 100 in decimal system notation (base 10) ...
    You understand?

    Nico
    BTW 100 in the binary system (base 2) is the same as 4 decimal and 4 hexadecimal
    Last edited by kiek; 04-17-2011 at 05:15 PM.

  8. #28
    500+ This must be a daytime job Boeing 747 Flyer's Avatar
    Join Date
    Nov 2009
    Location
    England
    Posts
    635
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: "Inner Circle" HSI - SIOC DC Motors Card Script

    Hi Nico,

    I'm not sure I understood all that. Where does the "+4" come from? And the base is what you multiply the value by? Like base 16 = *16 like you said.

    Do I need to know this for the scripting of my HSI? I've done loads of Offsets with SIOC before and have never payed attention to this. 04CE is just standard 0-359.

    Jack

  9. #29
    500+ This must be a daytime job kiek's Avatar
    Join Date
    Jan 2007
    Location
    Netherlands
    Posts
    698
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: "Inner Circle" HSI - SIOC DC Motors Card Script

    Hi Jack,
    You have to study a little bit I'm afraid...

    The base is indeed used to calculate a number,

    in a base 10 system 123 means:
    1 x (10 to the power of 2) + 2 x (10 to the power of 1) + 3 x (10 to the power of 0), so 100 + 20 + 3 = 123

    while in a base 16 system 123 means:
    1 x (16 to the power of 2) + 2 x (16 to the power of 1) + 3 x (16 to the power of 0) = 256 + 32 + 3 = 291

    Note that 10 to the power of 0 = 1

    Nico
    Last edited by kiek; 04-18-2011 at 01:55 AM.

  10. #30
    500+ This must be a daytime job Boeing 747 Flyer's Avatar
    Join Date
    Nov 2009
    Location
    England
    Posts
    635
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: "Inner Circle" HSI - SIOC DC Motors Card Script

    Okay, so in Decimal (base 10), the number 394 is...

    3 x (10 power 2) + 9 x (10 power 1) + 4 x (10 power 0) = 300 + 90 + 4 = 394?

Page 3 of 7 FirstFirst 1234567 LastLast

Similar Threads

  1. DC Motors Card - How to use in SIOC?
    By Boeing 747 Flyer in forum OpenCockpits General Discussion
    Replies: 4
    Last Post: 04-20-2017, 09:11 PM
  2. Expansion card buggy? Shows "ghost" inputs where there aren't...
    By Michael737NG in forum OpenCockpits General Discussion
    Replies: 0
    Last Post: 12-26-2010, 07:02 AM
  3. SIOC "IF" Question
    By Boeing 747 Flyer in forum OpenCockpits General Discussion
    Replies: 89
    Last Post: 08-29-2010, 05:34 PM
  4. FSX "This graphics card does not meet minimum ..." HELP !!!!
    By ibennett in forum Computer Hardware Setup
    Replies: 5
    Last Post: 04-12-2010, 09:46 PM
  5. Replies: 17
    Last Post: 03-05-2008, 12:39 PM