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

April 27, 2024, 09:06:03 AM

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 5 Guests are viewing this topic.

Mach7

Also, for what i can see...link2fs has only these three box selection options for fuel quantity...

"x" for the left tank in percent
"Y" for the center tank in percent
"z" for the right tank in percent.

Just to make sure I went into the fs9 menu, (QW 146) and you can enter your fuel load either in percent or total pounds. With this information I am sure the output will convert to pounds for display on the gauges...pretty sure this is what jim...the link2fs developer had in mind.

You mentioned bus voltage...once the sim is powered down, and surge bars selected off, all the needles will go to zero as the boards no longer will have power.

Is there a precaution here I should be worried about re gauge life?


_alioth_


If you run the simualtor and qw146 you can see in link2fs which values are you sending, if they are percent or pounds or whatever.
The chart we made before must be done with these units, because they are the units Arduino will receive.

There are some quite complex addons that don't use standard simulator variables. They use some custom variables (called Lvars) and link2fs can not read them in an easy way. It is not the moment to open this can of worms. But if you can't find some variable, you must know that probably it is a Lvar and a total different story.
A2A comanche (the software in my cockpit) use a lot of Lvars... and this was the main reason I migrate everything from link2fs to my own lua scripts in fsuipc. Link2fs and Lvars are a nightmare to manage.
But you are interfacing fuel levels and seems link2fs seems to read the fuel correctly in the qw146. So qw146 is using standard variables here.

Quote from: Mach7 on August 21, 2023, 11:53:23 AMYou mentioned bus voltage...once the sim is powered down, and surge bars selected off, all the needles will go to zero as the boards no longer will have power.

"boards" mean Arduinos here?

If the answer is yes.. imagine this situation:
You have all power switches on, but the aircraft batteries are empty:
-In your Fs9, needles will point to 0 (no energy to drive the gauges)
-In your cockpit, the needles will indicate the fuel level, because you have switches powering on the arduinos and they read the fuel level..

If you power on and off Arduinos with power switches, you may lose synchronization arduino-simulator. You stop the com ports and you will have to power on each arduino in link2fs again.

Your Arduinos shoud have power all the time, and drive the needles with simulator information (in this case.. fuel level and enough voltage in the gauge bus).

Arturo.

Mach7

#152
Yes...in my sim setup once the computer is powered up then the arduino boards will be powered as well through usb com port 3...well before the fs9 or qw 146 boot up.

I think that would be acceptable to prevent gauge damage (?)


_alioth_


Then if you are in a cold and dark situation in qw146...  your arduinos are power on. aren't they?

Mach7

Yes for sure...i am deriving the power from the 5 volt usb port, so once the computer is "on" the port will supply the necessary power.

WHen I shutdown the qw 146 sim...exit fs9..the arduino is still showing that it has power..up until I shutdown the computer.

_alioth_

#155
Quote from: Mach7 on August 21, 2023, 02:22:55 PMYes for sure...i am deriving the power from the 5 volt usb port, so once the computer is "on" the port will supply the necessary power.


So... in a cold and dark situation, qw146 fuel gauges will indicate 0. This is correct.
But your hardware cockpit, will indicate the fuel level, because arduino receives fuel level in the plane. And this is not correct.
In a cold and dark situation, your gauges should indicate 0.

Mach7

So... in a cold and dark situation, qw146 fuel gauges will indicate 0. This is correct.
But your hardware cockpit, will indicate the fuel level, becasue arduino receives fuel level in the plane. And this is not correct.
In a cold and dark situation, your gauges should indicate 0.


Yes...of course they will. they will read zero until the cockpit is powered up...or rather qw 146 is powered up, (batteries on). Regardless of this fact the Arduino board is still receiving power from the usb port if the computer is on....

I think we are talking about the same thing (?)


_alioth_


are you sure will they read zero?

The variables you are reading in link2fs are tank fuel level. Real fuel level. They don't indicate needle gauge level, but tank fuel level.

So, even in cold and dark situation, the fuel level is fuel level, and your gauge will indicate the fuel level, and not zero.

Can you confirm variables fuel level go to zero in link2fs when power off the aricraft?  This wasn't in this way in my link2fs days with the aircrafts I interfaced..



Mach7

ok...well...i don't know yet because I have not hooked the fuel gauges up...not close to that stage in the game at this point.

I do know that I have to boot link2fs up in order for it to interface, so I am thinking that once fs9 is online, the gauges will still indicated zero until link is up and running...but I am of course speculating as I do not, or have not, connected the gauges up as of yet.

ame

#159
Quote from: Mach7 on August 21, 2023, 02:31:27 PMSo... in a cold and dark situation, qw146 fuel gauges will indicate 0. This is correct.
But your hardware cockpit, will indicate the fuel level, becasue arduino receives fuel level in the plane. And this is not correct.
In a cold and dark situation, your gauges should indicate 0.


Yes...of course they will. they will read zero until the cockpit is powered up...or rather qw 146 is powered up, (batteries on). Regardless of this fact the Arduino board is still receiving power from the usb port if the computer is on....

I think we are talking about the same thing (?)



What Arturo is alluding to is that the code in the Arduino should be looking at two data elements. Link2fs needs to export the fuel data (or flaps data) and the power up status of the aircraft. In the Arduino code you can look at the power up status. If the aircraft is off then you can drive the needles to the rest position (thus simulating the power down status). If the aircraft is on then you can drive the needles to their actual position.

It's a very slight increase in complexity, but adds to the sense of realism. It can be added later, if you want.

Mach7

Ok...i understand now.

I was worried that there may be some damage the gauges due to the scenario he was explaining.

_alioth_

The order should be:
- power up pc, so arduinos are alive.
- enter simulator an load the qw 146
- start link2fs and push connect.

I understand you becasue you are thinking in the needle of the software.

But you are reading a variable that tells you how many fuel is in the tank, not the needle position in the software.
And they are different things.

It is not the most important thing now. But you will have to deal with it, and this is the reason I talk about bus voltage.

I didn't want to sound rude. I'm just trying to help!

Arturo.

Mach7

With the qw 146 software, there is a program called "qw dispatcher'. before you boot up fs9, you can basically calculate the required fuel load and wt and balance..(pax cargo etc) for all of your weights.

Once the fs9 qw 146 aircraft is online...then the fuel gauges will indicate what you previously set in the "qw dispatcher'.

My start up would have me bring link2fs online following qw 146 program...not sure what the gauges would read, but according to you guys they will probably read the requested fuel load, regardless if they read zero in the aircraft (sim program) or not.

If this is the case, then it would be more than realistic for this type of aircraft as the fuel gauges will read tank levels under two conditions when the aircraft is powered down (cold and dark).

The first scenario is when the refuel panel switch is selected "on" at the pressure refueiling location, (right side of the wing leading edge). This will allow the aircraft to be fueled without power on the aircrat...it will also make the fuel gauges come alive in the aircraft.

The second scenario is whenever the fuel quantity switch is selected in the flight deck..you can read the total fuel quantity, (gauges come alive) without turning the batteries on.

Mach7

@Arturo,

You don't sound rude at all...i actually appreciate the information and anything you can clarify the better.

I guess I just want to make sure I am not going to damage these gauges by doing something dumb.

so to that point....if for example my startup is as you outlined

1, computer on...arduino board alive
2. boot up fs9/qw 146
3. connect link2fs

now say the fuel gauges run to full fuel...then settle down to whatever fuel load I re enter...will this damage the gauges ?

ame

You can tell what the gauges are going to do by looking at the link2fs output window. In fact, we need to do that next. Just like the flaps position was sent as "<Gnnn", where nnn is a three digit value representing flaps angle, you need to know how link2fs sends fuel data. You can start with one gauge, but you need to know the tag (similar to "<G"), the format of what follows (similar to "000", or "012", but probably more characters), and what it represents (e.g. angle in degrees, with leading zeros, and a range of 000 to 033).

Mach7

#165
@ame, yes...by tags I believe you are referring to the check boxes in link2fs.

I have already mapped those out as "x" "y" and "z"
x being the left main tank, y the center, and z the right main tank,

also the format that link uses seems to be in percent...so not sure what that would look like after <x (y) (z).

Mach7

Right now I am trying to find an opensource code relating to fuel gauge that we can use as a template....so far no success.

_alioth_

Fuel gauges are more likely to damage the arduino than the other way.

You can't send a pwm value bigger than 255 (even if you try). And even 255 is not enough to go to 100% range in the gauge.

Your gauges are safe.

Mach7


ame

I can think of two ways to damage the gauges. First is to apply too large a voltage. The Arduino can only supply 5V, and you have a current limiting resistor in place, which is set to allow fsd at 5V. So, the gauge is safe for any output from the Arduino, up to its maximum.

The second is to have some software that sends full on and full off voltages to the gauge, causing the needle to peg at the top and bottom of its range. Technically that's how PWM works, but it's very fast so the needle can't respond, and instead shows the average voltage. But if you slowed it down to once a second or so you might get some mechanical damage. You're not going to do that on purpose, and it's unlikely that the Arduino software would "go wrong" and do that, so it's not a worry.

More creative people could probably think of more ways to damage the gauges, but in general they'll be fine.

ame

Quote from: Mach7 on August 21, 2023, 03:14:54 PMRight now I am trying to find an opensource code relating to fuel gauge that we can use as a template....so far no success.
No need. We can just write it.

Mach7


ame

Quote from: Mach7 on August 21, 2023, 03:12:21 PM@ame, yes...by tags I believe you are referring to the check boxes in link2fs.

I have already mapped those out as "x" "y" and "z"
x being the left main tank, y the center, and z the right main tank,

also the format that link uses seems to be in percent...so not sure what that would look like after <x (y) (z).
Ok. So in the link2fs output window if you have checked the box for only one fuel gauge you should see <xsomething

Is "something" just a string of digits? How many? What values do you see if the fuel tank is empty, full, and some points in between?

Later you can turn on flaps and all three gauges and you will see <G000<xsomething<ysomething<zsomething. This will all go to one Arduino, which can split up the data and drive four gauges on different pins.

Mach7

ok...i am going to run link2fs and see the values and report back.

I forgot that if I check those boxes i should see some data going out...at least I think i should.

Mach7

Ok...just ran qw 146 (FS9) and check marked the fuel gauge percent boxes, (x) (y) and (z).

it seems that link2fs sends out the information to arduino as a "percentage"...so 10 percent fuel would look something like this  <X010 which would equate to a conversion to 'pounds' on the gauge.

so the monitor would read something like <X088, <Y099, Z088 this would display as full fuel load, (left main tank 8120, center tank 4400, and right main tank at 8120 for a total fuel load of 20640lbs)

Now here is the rub...

The qw 146 platform displays maximum wing tank capacity as 9200 lbs (9192.7) due to the fact that they assume you may one day pay for the upgrade of the installation of extra fuel tanks which feed into the main tank but register on one gauge. These "exta" fuel tanks increase the main tank capacity by 1000 lbs per side. Therefore a 100 percent setting on the fS9 drop down menu equals 9192.7 lbs.

I do not have this option, so if I try and put 100 percent in the FS9 drop down menu, it will give me an alert that I have exceeded the maximum fuel tank capacity or 8120.

so as you can see, the percentage that is placed in the FS9 drop down menu (fuel and payload options) is a percentage of 9200..therefore full tank capacity of 8120 is 88 percent set..(9200 x 88% = 8096..or approx full fuel)

The center tank is the center tank....it holds 4400 pounds maximum so 100 percent is equal to 4400..(in actuallity i have to put a value of 99.9 percent or else I will get a warning that I have exceeded the center tank fuel by 1 or 2 pounds.

If I select qw 146 dispatcher program BEFORE booting up FS9 i can select 100 percent fuel load on the sliding scale...however when I boot qw 146 program and look at the fuel load under "change fuel and payload" drop down menu, it will show 88 percent on the mains, and 99.9 percent on the center.. (88 percent = 8120 lbs of fuel, 99.9 is a bit less than 4399). and everything is fine.

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