Page 1 of 5 12345 LastLast
Results 1 to 10 of 48
  1. #1
    75+ Posting Member
    Join Date
    Aug 2015
    Location
    Montreal
    Posts
    106
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Arduino driven VOR

    I had a couple Narco VOR instruments, and spent some time figuring out how they work, then some more time to figure out how to control them from Arduino, and ended up with quite a nice result that I wanted to share:



    Both the CDI needle and to-from indicators work the same way, and its like bi-directional voltmeter indicator, where if the two reference pins have a certain differential the indicator goes on one side, and if they have the opposite differential they go the other side.

    The OBS ring was quite harder to understand, and then even harder to figure out what to do with them in order to get the OBS bearing value. Literally, its like there are four potentiometer, where there is a common reference, and a reference at 0, 90, 180 and 270 degrees.

    Using that I could read three points on the scale, that each gives good reading on +- 90 degrees. Using them combined gives the whole 360 degrees with a certain precision; and then it is used with the bearing received (via flight sim, trough link2fs, to the arduino board) from the simulated VOR station, and reacts accordingly, interacting with the user's OBS knob value.

    Its actually quite fun to play with.

  2. Likes hyamesto liked this post
  3. #2
    150+ Forum Groupie
    Join Date
    Feb 2007
    Location
    Argentina
    Posts
    204
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Arduino driven VOR

    Great. Can you post a squematic of your connections? Just for curiosity....
    I have one similar, but the OBS internal wiring is broken. (by my mistake).
    What is your "certain precision?
    3 years earlier I follow this post about the same instrument.
    The error goes from 4,5 to 6,23 degrees (too much for real flying)

    You can see in:

    http://www.mycockpit.org/forums/showthread.php?t=25328

    Regards.
    Horacio.

  4. Likes SimSupervisor liked this post
  5. #3
    75+ Posting Member
    Join Date
    Aug 2015
    Location
    Montreal
    Posts
    106
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Arduino driven VOR

    I didn't find that thread when I searched the forum for VOR information. Would have given me a headstart and be helpful.
    Still, I had a damaged unit that I unmounted (and will likely use the frame for another instrument) so I had a good idea of the internals. But, I would have liked to have seen that thread!

    here's my notes on the internal wiring. Its mainly a huge potentiometer, with taps at every 90 degrees.



    for me, it was all linear. So, what I decided to do was to use all the pins. One GND, and 3 OUTPUT signals. I programmed them on a timer, but essentially what happens is that you set one output pin HIGH, the other ones LOW, and wait a certain time - about 100ms with my current timer. I think it could be quite lower (faster) but didn't experiment much on it, this seems to work. Then you read (analog input) the wiper pin. Repeat for the next pin, keep measuring continually.



    The value is linear, and gives a good appreciation of the 90 degrees from the point of that pin. Farther than that and the arduino's HIGH signal is too dim to be read properly (value is not zero, but very very low) - Which isn't a problem, as you are measuring 3 pins at 3 different points on the 360 degrees ring...
    So, at any point in the 360 degrees, you can combine the valid info from the 3 tap points you are measuring, into a unique manner -> using the higher value as linear measurment and the two others to know directions around the central angle of that reference pin.



    It works good for me. The imprecision is rather small. I assumed this is caused mechanically by the hardware and would be pretty much the same with the real circuitery.


    I still have one of the CS-3B that is intact, not dismantled, and the pins all read good (but it is rather discolored by age) - I'll trade it with you if its of any interest to you.
    Attached Images Attached Images

  6. Thanks iwik thanked for this post
  7. #4
    75+ Posting Member
    Join Date
    Aug 2015
    Location
    Montreal
    Posts
    106
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Arduino driven VOR

    The thread you posted makes a rather valid point, which explains a few things...

    Quote Originally Posted by forty-2 View Post
    Rob,
    Are you using the same gauge as we are? I tried the approach I think you described and I finally realized something: The distances between the numbers on the gauge isn't linear.
    30 to 60 is less then 0 to 30. In fact, it appears that 30 to 45 is the same as 0 to 30. This pattern repeats around the dial, you can see it in my first photo.
    I was surprized to not have to correct the analog reading values to have corresponding angles, but I think this makes the magic happen instead of a correction equation.
    Nevertheless, I would have to take better measurments, but when I did the initial tests, I compared my readings with the actual numbers on the OBS ring gauge (there's one number every about 30 degrees) and they all matched up within the degree if the TO arrow was on the gauge mark.
    That said, the marks are THICK, and there is only markings ever about 5 degrees. I don't think we can get more precision out of this form of hardware.

    For what its worth, with my schematics I get a value between 0 and 1005, where 5-to-1005 maps a 90 degree angle around the reference point (with the 0-to-5 being the non-conclusive value passed the 90 degrees, that requires being read from another reference point)

  8. Thanks iwik thanked for this post
  9. #5
    150+ Forum Groupie
    Join Date
    Feb 2007
    Location
    Argentina
    Posts
    204
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Arduino driven VOR

    If only we were closer, but 8804 km = 5470 milles
    is to much for send or receive solenoids, trade instruments (custom duties, tax, shipping costs) and the policies of my country on import, make that impossible (i must pay 3 times more than real value including shipping, tax, etc)....
    Can you explain or make a diagram of how you connect the needle or to-from flag, to obtain negative values from arduino? and the sketch, please....
    I have an idea to implement a better reading of the OBS, but i need your schematics (4 PWM outputs and 1 Analog input and some sketch idea)..... 3 years earlier i have not and arduino to make tests....

    About the error, itīs a mistake than an older instrument has no good resolution. The max error is ą 1,4°, but the normal is ą 0,35°.
    Remember, every dot in scale represent 2š, thatīs 10š full deflection to one side (20š full scale), in VOR.
    As ILS, every dot is 0.5š (2.5š full deflection in either direction or 5š full scale) for localizer, and ILS glidepath is 0.14 degrees per dot Full scale deflection 0.7 degrees

    A good reading:

    http://www.csobeech.com/files/KI209A_Maintenance.pdf



    Regards.
    Horacio.

  10. #6
    75+ Posting Member
    Join Date
    Aug 2015
    Location
    Montreal
    Posts
    106
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Arduino driven VOR

    I do not think we get imprecision from the instrument itself, but from the low resolution of the scale used to dial in. With about 5 degrees between markings, its impossible to be precise to the fraction of a degree when entering OBS. That said, the reading I get when straight on the numbers are always consistent. I could run more tests if you want to.

    BTW we don't use miles in Canada, we work the metric system.

    It is sad the import laws of your country make it hard to get anything shipped to you, as I would have gladly sent some your way.

    For the needle, and to get negative value, I cheated a bit. We have two wires for each indicator. One I placed on about 2.5V as the center reference. To achieve that on the arduino, I used a potentiometer as a voltage divider between the 5V and GND, so I could tweak it. Each need to have their own divider, because you do not want indicator 1 influence indicator 2.

    For the other pin, I used an PWM from arduino. they run from 0 to 255 so 127 is the center. I had to reduce the output of the PWM to gain resolution, and made that by adding a 3k ohm resistor between the arduino output and the instrument pin.

    here's a quick reference drawing if it can help



    To address the needle all you need is a PWM in arduino.



    On the OBS side, there's no more schematics than what I posted. I interface the OBS ring directly to the arduino pins as mentionned in previous post. You need to light up one of the pins, wait, and read. Repeat with the next one. That way, you always have a recent value to use in computation.


    I admit, arduinos are awesome to help with quick prototyping. It opens up microcontrollers rather well, and even those knowledgeable in microcontrollers enjoy its ease of use. It makes prototyping easier and funier.
    Attached Images Attached Images

  11. Thanks hyamesto thanked for this post
    Likes hyamesto liked this post
  12. #7
    150+ Forum Groupie
    Join Date
    Feb 2007
    Location
    Argentina
    Posts
    204
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Arduino driven VOR

    You donīt need "a fraction of a degree when entering OBS". The Radial selected is ever a whole number.
    If you get a correct reading in every point of the OBS, thatīs fine.

    My idea in theory (like the real VOR operation) was to connect 4 PWM to the OBS (not 3 and ground as you), and simulate a sine and cosine signals. (with this 4 PWM outputs, you can feed 2 instruments OBS, like VOR1/ILS and VOR2). Later, the wiper must sum the values, but you need some sort of voltage divider (like you implement in the needle) to read the values and make some calculations.......

    For the needle, i must
    congratulate you on your simple solution.

    For the To-From Flag, why not use 2 digital outs to not waste PWM outputs?
    If both Outs are low or high, the flag is centered, and other state makes flag go To or From, depending on which output is active. Only need 1 resistor.

    Great Work!!!
    Regards.
    Horacio.

  13. #8
    75+ Posting Member
    Join Date
    Aug 2015
    Location
    Montreal
    Posts
    106
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Arduino driven VOR

    For the to-from, you need three values. Low, high, and you also need the OFF position.

    Now that you mention it, you could do that with two appropriately tweaked digital out with voltage dividers.
    So, one pwm and one potentiometer, or two digital and two potentiometer?

    I might change for digital, pwm are not that many.

  14. #9
    150+ Forum Groupie
    Join Date
    Feb 2007
    Location
    Argentina
    Posts
    204
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Arduino driven VOR

    No, you need two positions only, TO and FROM.
    OFF or NAV is default with no signal (Flag at restl). Except that the indicator is uncalibrated.

    Regards.
    Horacio

  15. #10
    75+ Posting Member
    Join Date
    Aug 2015
    Location
    Montreal
    Posts
    106
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Arduino driven VOR

    Yes, you actually need the microcontroller to be able to send the correct values for the physical indicator to display it... So, you need zero (off), low (lower than zero) and high (higher than zero).


    Forget real life, the microcontroller needs to be able to output the proper results
    With only 0 and 5v how do you tell the Arduino to display off?

Page 1 of 5 12345 LastLast