Welcome to Cockpitbuilders.com. Please login or sign up.

April 27, 2024, 02:11:36 PM

Login with username, password and session length

PROUDLY ENDORSING


Fly Elise-ng
460 Guests, 0 Users
Members
  • Total Members: 4,154
  • Latest: xyligo
Stats
  • Total Posts: 59,641
  • Total Topics: 7,853
  • Online today: 514
  • Online ever: 582
  • (January 22, 2020, 08:44:01 AM)
Users Online
Users: 0
Guests: 460
Total: 460

COUNTDOWN TO WF2022


WORLDFLIGHT TEAM USA

Will Depart in...

Recent

Welcome

flap indicator interface with Fs9

Started by Mach7, August 03, 2023, 04:23:14 PM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

ame

Quote from: Mach7 on August 10, 2023, 06:51:29 PM@ame, I don't think it is an air core gauge, but rather closer to a Desynn Type Position Indicator. The fuel gauges are the same construct as well.

With respect to the flap gauge, it does not travel a full 360 degrees, but rather closer to 250 degrees, (0 degree flap angle to 33 flap angle on the dial).
Ok. I am googling Desynn now. Soon I will know as much as the world knows.

I can see that the needle does not rotate 360 degrees, but a mechanism that does does not need to use the full range.

Hopefully it is possible to generate a variable voltage which translates to a variable deflection angle of the needle. If it's more complicated it's going to take a while to figure out.

ame

Like this?

https://www.sphaera.co.uk/position.htm

It requires three connections with variable voltages with respect to each other. It ought to be possible to generate the appropriate signals, but I don't know how just now.


Mach7

lol...i was just reading the same site as you...(scotchbott).

I was hoping there would be more markings on the gauge itself...it does say it's a 5 volt gauge max that's about it.

I do know that the fuel gauges..which have the same internal construct, can be manipulated to there full range, (which is about 300 degrees) using a 5 volt power source and manipulated through a potentiometer.

I am pretty confident that if i connected this gauge directly to 5 volts it would go off scale.

ame

Quote from: Mach7 on August 10, 2023, 07:26:47 PMlol...i was just reading the same site as you...(scotchbott).

I was hoping there would be more markings on the gauge itself...it does say it's a 5 volt gauge max that's about it.

I do know that the fuel gauges..which have the same internal construct, can be manipulated to there full range, (which is about 300 degrees) using a 5 volt power source and manipulated through a potentiometer.

I am pretty confident that if i connected this gauge directly to 5 volts it would go off scale.

Ok. The Arduino PWM output will be 0V when the PWM value is 0, and 5V when the PWM value is 255. It is the same as hooking up a 5V supply directly to the instrument, but the current from the GPIO pin may be insufficient.

If you believe a single signal line varying from 0 to 5V will move the needle across its full range then you can test it independently from the Arduino (carefully) with a variable bench power supply varying from 0 to 5V. That would be a d'Arsonval movement, such as you would find in a moving coil meter.

If it's a Desynn Type position indicator then it's a little more complicated than a single signal on a single wire, but in true internet tradition you can copy someone else's work and give yourself a head start.

Mach7

I am going to try...very carefully...applying a direct voltage to the gauge and see if I can get the required deflection at 5 volts...stay tuned more to come.

ame

Quote from: Mach7 on August 10, 2023, 07:50:09 PMI am going to try...very carefully...applying a direct voltage to the gauge and see if I can get the required deflection at 5 volts...stay tuned more to come.
Fingers crossed.

You could use rechargeable AA batteries. Each one is nominally 1.2V, so you could get four indicative positions, with the last one being 4.8V (or a little over 5V if they are fully charged).

Mach7

and the answer is yes...i can get full + deflection with 5 volts connected directly to the gauge...

I had to be careful not to exceed the needle travel, so I just tapped the positive terminal on and off and was able to determine without a doubt that 5 volts would be more than sufficient to drive the needle off scale.

Mach7

@ame in fact...now using a combination of 1.5 volt batteries...i can move the needle from 0 to 18 degree mark on the dial with two batteries connected in series (3 volts), and with three batteries hooked in series (4.5 volts) I can just about reach the 33 mark on the gauge. I am pretty confident that it would indicate exactly at the 33 mark at 5 volts.

ame

Sounds ideal. So it would seem that the current for fsd at 5V is larger than the Arduino GPIO pin can provide.

Does the gauge needle respond rapidly (instantly) to the applied voltage?

Can you measure the resistance of the coil? Basically the two wires you are using to drive the meter. From the resistance we can calculate the current requirement for fsd.

Next, how do you want to buffer the signal? Do you have a uln2803a? An op-amp? Some simple transistors? I don't know how extensive your junk box is.

_alioth_

#35
I have seen the youtube video and I think you don't get full deflection with pwm arduino PIN because you are feeding 5v in the Barrel Jack Connector.
Arduino needs 7v to 12v in this jack (see arduino specs), because it is before the regulated circuit. So you probably don't have more than 3v in 5vPIN and HIGH level pins.
You can use 5v if connected to 5v arduino pin (you must regulated voltage perfectly well or you will destroy arduino), or usb power.

I think you should just connect the usb cable to pc, and thats all. Probably you will get the full deflection with PWM PIN in this way. And you will end connecting the arduino uno to PC because you need the data transfer from FS9. Therefore, it is better to connect the arduino to the pc from the beginning. You don't need any extra power supply.

I still say you should measure current when the needle is at full deflection. Or as Ame said, give the resistance value to calculate the amperage.
If the Arduino hasn't died already, it probably won't die. But it's better to be safe than to buy another Arduino.


About data transfer:

1.- My adviced would be try to start with Link2fs software.
Link2fs is a small piece of software where you check some boxes of simulator data you want to be sent to a serial port (the arduino serial port). Then you write the code in arduino to read that data, process it and send the pwm signal needed to move the needle.
Sure it is not the best way to do it, but it is "easy" and works just fine.

2.- A second plan, would be write a Lua script using FSUIPC that reads the data from simulator and sends it to arduino through serial port. You have better control of everything with this method. but it is not as easy.
link2fs is much easier to start with.

3.- If you were using FSX you could use mobiflight software. It is easy and you don't have to write code. But I think fs2004 is not officialy supported. I don't even know if it works with fs2004.

Arturo.

Mach7

@ame, yes, the needle move very fast when connected directly to the battery(s), but at a slower pace, (and not full deflection) when connected to Arduino.

My junkbox is limited, so all I have is a handful of Arduino UNO's and NANO's :(.


@Arturo. What you say makes a lot of sense to me with respect to the 5 volt barrel jack connector.

Connecting the USB to the PC should kill two birds with one stone...supplying power to the gauge and allowing for data transfer at the same time.

I was actually reading up on the Link2ks software and I agree with you that this may be the simplest method to successfully accomplish this project...I will do more research today which will no doubt generate more questions.

Jim


Mach7

@Arturo,

I am leaning towards using my (existing and installed) FSUIPC and,(somehow with help), writing a LUNA script as you suggested to operate the flap gauge.

The only problem I can see using Link2fs is that it might interrupt or offset something I already have working within my flight sim environment.

I know this may sound a bit paranoid, and the read me file does state that it should not have an impact on any other systems, but I have downloaded some pretty innocent FS9 addons then spent the day trying to reverse the process as something went array in my simpit.

Here is an exerpt form the read me file that bothers me a bit that I think may have an issue with my main computer;

You must do this ,,,,
=================================================
There is an attached file call FSConnect.dll ,,, it MUST be
put into FS9's module folder.  (My program wont work if it's not there)
=================================================

What do you think...is my aforementioned paranoia warranted, or will downloading this .dll have zero effect on the other subsystems and fs9 itself.


Mach7

Side note...

I connected the Arduino directly to the usb (for power), (no dry cell batteries involved),  and ran the "Fade" program once again.

The needle moved from 0 to the 33 mark back and forth as anticipate!!


ame

Quote from: Mach7 on August 11, 2023, 07:21:16 AMSide note...

I connected the Arduino directly to the usb (for power), (no dry cell batteries involved),  and ran the "Fade" program once again.

The needle moved from 0 to the 33 mark back and forth as anticipate!!


This is not just a side note. This is precisely what you set out to achieve!

Next step is software.

ame

Quote from: _alioth_ on August 11, 2023, 02:29:32 AMI have seen the youtube video and I think you don't get full deflection with pwm arduino PIN because you are feeding 5v in the Barrel Jack Connector.
Arduino needs 7v to 12v in this jack (see arduino specs), because it is before the regulated circuit. So you probably don't have more than 3v in 5vPIN and HIGH level pins.
Well spotted!

Mach7

@ame & Arturo,

So been researching Link2fs and FSUIPC interface senario's...and it seems to me Link2fs is the most viable option, (regardless of my misgivings about changing or adding fcconnect.dll to the fs9 program)...i suppose I can always remove it if it interferes with other aspects of my simpit.

Regardless, I do not see another workable avenue to get my program (payware QW146) to communicate to arduino to display selected flap position following seletion through the flap pot and 836x.

I am finding that the tutorial information on Link2fs is a bit thin...i have watched a number of YouTube vids...but most deal with setting up switches or lights...also a bit confused as to the programming of the arduino chip....

For what i gather, you make a selection in Link2fs..so does this selection automatically write or download to arduino?.It can't be as simple as that...can it?

Mach7

I found a link to "Arduino cards and Link2fs" on mycockpit.org...but the link seems to be dead or outdated.

I used to be a member on that site, so I am trying to resend my (forgotten) password...but it appears more difficult than expected...so I tried to re-register and now waiting on an email activation invite...that was an hour ago.

ame

I can't find a comprehensive reference to link2fs. Is it originally from jimspage.co.nz? If so, the original has gone.

Doesn't really matter. Again, working backwards, you can now drive the needle to any arbitrary position by setting a PWM value from 0-255. Next is how to get the data out of the sim that tells you "this is the current flap position in degrees". Maybe link2fs will do this, or you may find an alternative. If link2fs is your preference then we can focus on that, so if you have some links for the package and documentation that would be great.

Mach7

#44
@ame...here is a link to "Link2fs"

https://web.archive.org/web/20190329143140/http://www.jimspage.co.nz/Link2fs_Multi_FS9.htm

Not an easy site to find....

ame

What happened to SIOC?

I will download the link2fs Multi zip file and take a look. There are some Arduino examples in there. It seems that link2fs extracts the nominated data from the simulator (somehow) then sends it in a defined format out of a serial port to an attached Arduino. Then, a program on the Arduino parses the data and does whatever is necessary on its GPIO pins. I think it works the other way too, so that the Arduino can detect switch presses or pot changes and send stuff back to update the sim.

It seems to me that there are several similar solutions that do the same thing as link2fs, although from my research nothing really stands out as the "best". I'd be a bit concerned that the author's website is no longer active, but then again, if you have a consistent snapshot of the technology at the time then all the pieces should work together as they did, and continue to work if nothing else changes.

Mach7

Yes..it was very difficult to get to the site or even find it for that matter. That sortof tells me it is not all it's marked up to be.

Mach7

And like I said earlier...mycockpit.org had a whole section devoted to Arduino and Link2fs...but it no longer exists...or at least I cannot access it.

Mach7

So another question...can you download a SIOC script into arduino?

ame

Well your other problem is that whatever you choose must remain compatible with FS9 and your OS, so using something older like link2fs might be appropriate.

Early on you said "I am currently using a modified dc servo motor gauge using  opencockpits DC servo motor board programed through SIOC."

So, currently, there is a data path from the sim to SIOC to a servo controller board to a servo motor. Is that right?

Would it be possible to go sim -> SIOC -> Arduino -> gauge?

If you are really keen on link2fs then that's fine, but unless you are averse to SIOC would it not be better to keep using it? Either way it's your choice, but I thought I'd at least ask the question.

Like the Website ?
Support Cockpitbuilders.com and Click Below to Donate