Closed okroth closed 4 years ago
Thank you @okroth, I'm looking at this.
@dany93 let me know what you come up with including the feeder tanks. I'll merge any changes if you feel a need to adjust. Thank you @okroth for reporting this.
Thank you @wlbragg. The feeder tanks (3 and 4) should give no noticeable effect. For the rest (main tanks) it's not so simple, I think I will appreciate your help, depending on the solution and options we choose.
For the rest (main tanks) it's not so simple
How come, isn't it just a matter of changing the position in the "fuel" section of c172p.xml?
Looking at them briefly in the code. What the coded position should be is the center of the tank on the x and y, I don't know about the z position, that should either be the bottom of the tank or the center as well. I did a rough measurement of where the center of the "modeled" tank would likely be and it was indeed right around 50-52"
Below is the position being calculated in the code (center of the arrows) which is off by quite a bit. How we never noticed is interesting. Top = Y and Z, Bottom = X.
If we changed the fuel center position in the code to the below numbers, (see the cursor position in the Blender image), I think it would be close enough. Certainly way closer to what it should be.
I just found in the POH, page 6-10 (or page 1-4), that for the C172P there are four tank options:
That would be about here then...
@okroth Yes, I found it yesterday when trying to understand this. BTW, thank you too for having searched and giving us all the details, calculated values. All the more that I never could find the Y location for the wing tanks.
What you are giving in your last message is for the 160 hp. For the 180 hp, I only found total capacity 56 gal, usable 53 gal (p. 1-5, 2-11, 6-12).
The 2 x 129 lbs (43 gal) in the current FDM corresponds to the 160 hp standard tanks. (historical remaining)
Hence my response to @wlbragg
For the rest (main tanks) it's not so simple, I think I will appreciate your help, depending on the solution and options we choose.
We will have to make a choice for the 160 hp tanks. Either 'Long Range' (2 x 27 = 54 gal), almost the same as the 180 hp. The easiest way, we can let a common value in the FDM for 160 and 180 hp, if we accept the approximation. Or we propose the choice between the 3 possibilities for the 160 hp, and I will need the contribution from @wlbragg (I'm not very skilled at system files with switches etc...). Or only integral tanks for the 160 hp, and we will also need a system file for the location and capacity for the 180 hp.
I think that the tank locations are not an issue. We can take @okroth's values IMO, the Z value (59.4 in) can be let as it is.
This is the current setting unless we're changing it elsewhere that I don't know about.
<!-- Tank number 0 -->
<tank type="FUEL">
<location unit="IN">
<x> 56 </x>
<y> -112 </y>
<z> 59.4 </z>
</location>
<capacity unit="LBS">129.43</capacity>
<contents unit="LBS">100.0 </contents>
<type>AVGAS</type>
</tank>
<!-- Tank number 1 -->
<tank type="FUEL">
<location unit="IN">
<x> 56 </x>
<y> 112 </y>
<z> 59.4 </z>
</location>
<capacity unit="LBS">129.43</capacity>
<contents unit="LBS">100.0 </contents>
<type>AVGAS</type>
</tank>
the Z value (59.4 in) can be let as it is.
Why do you think the Z is OK, shouldn't that be in the wing and not a few feet above it as it is now?
For the rest (main tanks) it's not so simple, I think I will appreciate your help, depending on the solution and options we choose.
I have no problem making a system file to manage the fuel tank change to engine change. I know I did it for the J3Cub/PA-18 switch, but that was one center tank to two wing tanks. I'll have to review how I did that and see if that is the approach needed here. I don't know off hand what properties are dynamically exposed for fuel tank location.
it would seem to be more proper to be located in the wing, yes... especially if the FDM engine takes the location and weight into account... not to mention the raised CoG with the tanks being higher than the wing... how high off the ground is the center of the leading edge?
POH, page 6-10 gives a cabin height of 48", which is pretty much the distance from cabin floor to mid of wing height.
that would work in with where is 0,0,0 and is there an offset that comes into affect... but that's more 3D detail stuff that i haven't picked up (yet)...
I was trying to make that clear once more. The axis locations are a nightmare in FG...
The Blender and FDM Z-axes are different. The Blender Z axis is close to the propeller axis (Blender about 0.05 m higher than propeller). Easy to see in Blender. The propeller axis is at Z = 26.6 inches in the FDM. Which makes the FDM Z-axis slighly below the aircraft belly. The Blender and propeller axes are tilted by about 3°.
Looking at Blender and with these values, it makes about 50 inches between the aircraft belly and a tank close to the wing shaft. Hence, a bit more between the FDM Z-axis and the tank.
I think that Z = 59.4 inches (for the initial tanks, but also for the AERORP, line 31in the FDM) is at mid length of the wings. The wing shaft is a bit lower (dihedral angle). 50 to 55 inches for the tanks would be a good approximation.
Difficult to be accurate, but I think that the Blender Z-axis is higher than the FDM Z-axis by about 33 to 35 inches (40 ?) measured at the propeller X location.
@dany93 why then when we determine an animation and need the center coordinates can we take the numbers directly from blender without taking into account the model position z against the blender z? I have never dealt with this conversion as long as I have been doing this. Not on any aircraft. Not even the zposition of the wheels for WOW, all the gear change outs and the ground softness routines I programed. My assumption was the model xyz translated to world xyz one to one?
@gilbertohasnofb @legoboyvdlp we could use some input here when you get a chance! I'd like some more input.
@dany93 I'll admit the original zpositions for the wheels are a bitch to tune, maybe that is why. If so then anyone that makes a model and doesn't position it with the wheels sitting on the Blender Z is a fool and are making nothing but trouble for all those that follow.
The propeller axis is at Z = 26.6 inches in the FDM. Which makes the FDM Z-axis slighly below the aircraft belly.
Why "belly" and not wheel bottom?
Dany, I'm not arguing with you, I'm only trying to understand this so please don't take any questioning the wrong way. I may have been working under false assumptions for awhile now or merely having a brain fart.
OK, stepped back and tried to grasp this, your propeller axis is key here 26.6". But what about CG at 36.5, why are you using propeller axis for reference and not CG? You got me totally confused. I desperately need a refresher course in FDM design, well actually I need a 101 course as I have never had any instruction. Also AERORP and VRP how do they apply here if at all?
The propeller axis is fixed in the plane's coordinate system, CG not. Consume fuel and the z-coordinate of the CG goes down (slightly). CG position is only nice for the FDM as the forces from accelerations (gravitational included) refer to this. The z-coordinate of the empty-weight CG may actually be too high; the Cessna POHs show a location slightly below the propeller axis, whereas the C172P model puts it 10" higher than the prop. Prop above CG creates a nose-down pitching moment being compensated by increased tail effectiveness (propwash), prop below CG would add prop-wash and nose-up pitching moment. I did not find actual values for the z-coordinate of the CG, but I tend to put it near the prop axis, but I keep searching.
AERORP is the point where the forces of the main airfoil attack; usually 25% of the mean airfoil cord; here as well. VRP is used to compute back from the CG coordinates the additional masses and torques from loads.
Found some data about CG positions in a report about three crash tests conducted at the NASA LaRC: https://core.ac.uk/download/pdf/42700089.pdf Vertical CG is 48"+/-2 inch above ground, with crash test dummies, measuring equipment and 75% simulated fuel.
@okroth wrote
VRP is used to compute back from the CG coordinates the additional masses and torques from loads.
I believed it was to make the 3D and FDM axes match? Only for the view.
http://wiki.flightgear.org/JSBSim_Aerodynamics#Metrics
@wlbragg
My mood is here https://github.com/c172p-team/c172p/issues/1327#issuecomment-666337130
The axis locations are a nightmare in FG...
Don't worry, I do not take it the wrong way, and I would like being able to answer your questions. But I am almost as you, and you did many more animations than I did.
Why "belly" and not wheel bottom?
I don't know how it came. The logical would be, in the 3D model (Blender) to locate the Z = 0 axis at the propeller level. Like X = 0 which is located at the manufacturer's DATUM, the best choice.
If I rememember well, I have determined this Z = 0 location mainly by deleting every contact and adding several new ones located at Z = 0. If the test contacts are hard enough to avoid a noticeable spring compression (but not too hard, which would prevent the JSBSim consergence), the aircraft sits on the ground at Z = 0 in the FDM (structural) frame. I would like to redo this for confirmation, but it is a bit long to do.
However, I don't unserstand how it works in the code. The VRP (in the FDM) and offsets (Models/c172p.xml) are here to make the 3D model and the FDM match, but the values are not consistent with my observations (except maybe the 3 deg pitch).
@gilbertohasnofb @legoboyvdlp we could use some input here when you get a chance! I'd like some more input. Really not sure here -- so there are different axises?
In any case moving the tanks on the x and y should be fine?
@dany93: I meant, there are additional masses (pilot, baggage) defined in the vehicle coordinate system which need to be set in relation to the empty aircraft CoG. The 3D model is adjusted in the Models/c172p.xml.
@legoboyvdlp : The x-position is given in the POH, so that's safe, The y-position can be computed using the maintenance manual for the WS positions. That should be safe enough. It would not have that much effect if it is wrong by 2". It was wrong by nearly 80".
OK, I defer the positions to the two of you to determine. I really dislike it when we have to get into these types of offsets. I am willing however to write any code we need to dynamically switch the load positions if necessary as soon as it is determined what direction to go.
So the Y axis should be a one to one match with Blender tank coordinates (even though there really is no modeled tank), X will be related to DATUM and Z will be related to prop axis.
I really wish I understood this well as I have two aircraft that have more complex fuel systems that are dynamic in nature. The AirCrane which is YASim has the position in the fdm as a 1to1 match with the Blender coordinates I believe. I have a feeling the J3Cub may be off as well.
@okroth wrote
Found some data about CG positions in a report about three crash tests conducted at the NASA LaRC:
https://core.ac.uk/download/pdf/42700089.pdf
Seems this video (C172 from 7 mn)
Your criteria
the Cessna POHs show a location slightly below the propeller axis
is much easier to apply.
And the aerodynamics justification that you give is clearly convincing.
The tests were made July 2015: This video : https://www.youtube.com/watch?v=FsRwlr7RDkk shows test #2. I found some more report, and for test #3 I could compute a CG location of x=40.7" and z=34.0" when I subtracted the dummies, fuel simulation, and the data collecting equipment and added the rear bench at a eight of 1430lbs. But that test specimen is (was) a C172M. A 127P or 172R could be slightly different.
@gilbertohasnofb @legoboyvdlp we could use some input here when you get a chance! I'd like some more input.
Sorry team, I've been a bit busy these days. I just took a look at the whole discussion but I am not sure I would have any relevant input to give, FDM is one of those areas I am very uncomfortable with. But I'm happy to test and give feedback on any PRs, as well as review code and merge. Or did you have something more specific in mind @wlbragg?
I'm not far from being ready to propose commits. For a few values, we still have to make decisions.
To summarize: (according to my current understanding)
Empty CG: Z = 26 or 34 inches?
Fuel tanks [0] and [1] (main tanks) 160 hp and 180 hp X = 48 inches, Y = +/-44, Z = 50 to 55? (less than 59.4). For X, I've seen 46 inches (160 hp POH p.6.4, 180hp p.6.5). From 180 hp p.6-12 (moment), X = 48 inches seems more probable.
Capacities: (total for both wing tanks) 160 hp: 54 gallons (2 x 27) 180 hp: 56 gallons (2 x 28) Can we approximate 160 and 180hp at 55 gallons? Otherwise, needs a system file.
Or farther but more complicated: For the 160hp, choice between 3 capacities (total) Standard: 43 gallons Long Range: 54 gallons Integral: 68 gallons ?? (My opinion is that's not worth the extra complication)
Can we approximate 160 and 180hp at 55 lbs? Otherwise, needs a system file.
I think the question is how perceptible the difference in the FDM would be. If we are talking of a barely perceptible difference, it might be worth to generalise the different engines using a single value as you propose.
i agree with that single value generalization for now...
a future feature could be to have tank size selection with the different engine selections...
I'm leaning the opposite way, I think a few pounds is a few pounds and should be accounted for, same with position. I don't know how perceptible it will be but I guess it will change the CG. We do it for the gears and oil weight and accuracy is top order in my opinion. I'm willing to do the code.
To clarify,
160 hp: 54 lbs (2 x 27) 180 hp: 56 lbs (2 x 28)
OK, for the 2 lbs, not so much, but I do like the idea of adding a choice to extend the range with tank size.
?Standard: 43 lbs Long Range: 54 lbs Integral: 68 lbs
That is enough of a change that it could definitely change a flight plan!
I suppose if we wanted to simplify this somewhat we could use one tank type on one engine and a different type on the other. Maybe something like... Long Range: 54 lbs or Integral: 68 lbs on the 180 and Standard: 43 lbs on the 160.
What exactly is Integral, Is it a different configuration or just a different size?
Or did you have something more specific in mind @wlbragg?
@gilbertohasnofb Nope, just some more eyes and opinion.
On 8/1/20 1:29 PM, wlbragg wrote:
I suppose if we wanted to simplify this somewhat we could use one tank type on one engine and a different type on the other. Maybe something like...
yeah, that's the feature thing i was thinking about for later... but if "later" is "now", great! :)
@wlbragg : Integral tanks have no explicit tank built into the wings but just use sufficient sealant to make a part of the wings fuel-tight. I.e. parts of the wings ARE fuel tanks. The standard and extended tanks are actual tank structures that are put into the wings. Benefits of integral tanks: less weight as now additional fuel container is needed, more volume, and last not least, higher stiffness of the wings, as ribs may be placed in the tank area. These have holes to let fuel pass by and work as anti-slush plates too.
Regarding CG positions: the original tanks' CG positions are way off; far behind and too far outboard. This should be noticeable in the simulation, Any vertical CG position seems to be relatively unimportant; Even a position ABOVE high wings is stabilized by the horizontal stabilizer. So I would not put too much effort in that. If it would have a relevant effect, there would be indications in papers and courses.
Integral tanks have no explicit tank built into the wings but just use sufficient sealant to make a part of the wings
Wow, that's interesting, I didn't know they did that on an aircraft like this. But yeah, why not.
I've made the changes, branch: issue-1327 Pull request: #1328
(see this message)
Empty CoG: Z = 34
Main tanks [0] and [1]: X = 48 Y = +/- 44 Z = 55
Feed tanks (float chambers) X = -10 Z = 26
Capacities: I've left 2 x 129.43 lbs, which corresponds to the "standard" (43 = 2 x 21.5 gallons) tanks for the 160 hp (POH 160 hp -1982). "Long Range" and "Integral" tanks (160 hp) need a system file and a choice (option) in the menu. (sorry, I had made a mistake by writing lbs instead of gallons in the tank capacities in my message above)
Notice that, for the 180 hp tanks, (POH 172S 552SP) I only find one capacity: total 56 gallons (2 x 28), total 336 lbs (2 x 168). This one also needs a system file for its capacity.
Ok, thanks @dany93 I'll take a look and see if it is worth it and easy enough to add some options here.
Ok, I looked at this and if I understand it all correctly we're talking about a total of 77.14 lbs difference between the 43 gallon and the 56 gal capacities of the known standard tanks.
Difference between 43 and long range 65.16 lbs
Difference between 43 and integral 149.14 lbs
It sounds like the 180 came with either long range tanks or their own configuration
And then there is an option of Long Range: 54 lbs or Integral: 68 lbs known to be on the 160, not confirmed on the 180.
General aviation fuel @ 6 lb per gal
160 HP 2 x 21.5 = 43 gal 2 x 129.43 = 258.86 lbs COG = 41.07
180 HP 2 x 28 = 56 gal 2 x 168 = 336 lbs COG = 42.21
Options
2 x 27 = 54 gal 2 x 162 = 324 lbs COG = 41.99
2 x 34 = 68 gal 2 x 204 = 408 lbs COG = 42.32
COG was calculated by the Fuel and payload dialog by adding the weight difference to the left and right passenger to get an approximation of what effect it may have.
Would we want the fuel options available for either engine configuration?
Hum, I'm not so enthusiastic after looking at it. The way it is set up now is we have 2 tanks (0 and 1) feeding collector tank 2 for the 160 hp 2 tanks (0 and 1) feeding collector tank 3 for the 180 hp
The Cub/PA-18 has - 1 tank (0) feeding collector tank 3 for the Cub 2 tanks (1 and 2) feeding collector tank 3 for the PA-18
We would have to add 4 more tanks if we wanted 54 gal and a 68 gal options. I would probably remove collector tank 3 as there really doesn't appear to be a need for a separate collector tank for the different engines. There are also several files fuel tanks touch. Is it worth it?
I went ahead and tested this and put the tanks in and the code to switch. These are the actual COG numbers and weight with max fuel loads per tank.
160 hp
Default Weight 1906 COG 41.02
Long Range Weight 1971 COG 41.57
Integral Weight 2055 COG 42.16
180 hp
Default Weight 2081 COG 40.17
Long Range Weight 2146 COG 40.65
Integral Weight 2230 COG 41.22
@wlbragg
I would probably remove collector tank 3 as there really doesn't appear to be a need for a separate collector tank for the different engines.
I would be reluctant to do this.
Not only the collector tanks are used to feed each 160hp or 180 hp engine, but they are also used to simulate failures. In particular, I remember negative gravity.
Which means changing code at several locations, possible issues to come.
Rather than recreating multiple tanks, my initial idea was to just change the tank[0] and tank[1] capacities and contents (and possibly unusable fuel) by the Properties:
/consumables/fuel/tank/capacity-gal_us
/consumables/fuel/tank/level-gal-us
/consumables/fuel/tank/unusable-gal_us
/fdm/jsbsim/propulsion/tank/contents-lbs
/fdm/jsbsim/propulsion//tank/contents-volume-gal
/fdm/jsbsim/propulsion//tank/unusable-volume-gal
Am I correct?
Notice that consumables/fuel/tank/level-gal-us
and consumables/fuel/tank/unusable-gal_us
are set in c172p-set.xml (lines 690 to 708)
I hope that the conversion volume - weight is automatic by the
/consumables/fuel/tank/density-ppg
fdm/jsbsim/propulsion/density-lbs_per_gal
properties. I don't know which one should be set first (volume or weight?).
Mind that there is some possible confusion between 'contents' and 'capacity' in the Property names.
On 8/5/20 9:08 AM, dany93 wrote:
Rather than recreating multiple tanks, my initial idea was to just change the tank[0] and tank[1] capacities and contents (and possibly unusable fuel) by the Properties:
|/consumables/fuel/tank/capacity-gal_us /consumables/fuel/tank/level-gal-us /consumables/fuel/tank/unusable-gal_us /fdm/jsbsim/propulsion/contents-lbs /fdm/jsbsim/propulsion/contents-volume-gal /fdm/jsbsim/propulsion/unusable-volume-gal |
this is what i was thinking of, too...
-- NOTE: No off-list assistance is given without prior approval. Please keep mailing list traffic on the list unless a signed and pre-paid contract is in effect with us.
@wlbragg I agree with your capacities and weights in this message. However,
160 HP 2 x 21.5 = 43 gal 2 x 129.43 = 258.86 lbs COG = 41.07
makes me think that you have done your CG measurements or evaluations with the 'current' ('previous' or 'old', seen from this issue) tank [0] and [1] locations. In particular, X have been changed. With the tank locations proposed in my last merge request issue-1327, I find:
/consumables/fuel/tank/capacity-gal_us /consumables/fuel/tank/level-gal-us /consumables/fuel/tank/unusable-gal_us /fdm/jsbsim/propulsion/contents-lbs /fdm/jsbsim/propulsion/contents-volume-gal /fdm/jsbsim/propulsion/unusable-volume-gal
If these are not "tied" properties, then yes. I didn't look closely at the properties involved. Because a "weightless" tank (tank set to empty) is not part of any calculation it can be done by adding a tank for each configuration. That is what I did on the J3/PA-18, but that is because the configuration of the tanks were totally different. In our case I guess we would go with identical center points or weight points so, I agree, the option you mentioned may be better. Also I had to add some logic that reset the tanks fuel level to a preset amount every time you switch configurations and disable the ability to add fuel to the tanks not being used. This was the least favorable part of doing it that way, but worked well enough. As far as the duplicate float chamber. It really is totally unnecessary and a waist of a few lines of code. If the collector tank was of different size or position, then I could see a use for it. I realize they are used in a few places in the code structure and if I removed the duplicate I would be sure to trace any mention of it in the code and replace it appropriately. It's silly to create a duplicate collector and switch collectors when they do the exact same thing and are the same configuration. In fact the entire fuel system is exactly the same on both engines. There is no need to duplicate anything, It would be just as silly to duplicate the main tanks if not needed. Because I have good numbers now (barring the possible use of the original tank CG number) I can try using the capacity and level properties and doing it that way. If they work I should be able to verify it easily against the number I have now.
I checked the numbers for the Default tank 160hp and yes I used the original and not the new number. The new number was 41.02. Keep in mind these are all using the default gear and one 180 lb pilot, no baggage. I updated the post showing the breakdown. I'm concerned you appeared to have calculated CoG 39.98. The 41.02 I got is what FG calculated.
This is what we get when we do it using multiple tanks. I've already got this working, one collector tank, just needs some configuration checks and limits and code added to the peripheral areas such as failure code and what not. Also an addition in the GUI.
These are tied properties
/consumables/fuel/tank/capacity-gal_us /consumables/fuel/tank/level-gal-us /consumables/fuel/tank/unusable-gal_us
these are not
/fdm/jsbsim/propulsion/contents-lbs /fdm/jsbsim/propulsion/contents-volume-gal /fdm/jsbsim/propulsion/unusable-volume-gal
That may be an issue.
Oh, I think the later group are suppose to be
/fdm/jsbsim/propulsion/tank[0]/contents-lbs /fdm/jsbsim/propulsion/tank[0]/contents-volume-gal /fdm/jsbsim/propulsion/tank[0]/unusable-volume-gal
@dany93 can you find where these are originated or created?
/fdm/jsbsim/propulsion/tank[0]/contents-lbs /fdm/jsbsim/propulsion/tank[0]/unusable-volume-gal /fdm/jsbsim/propulsion/tank[0]/contents-lbs /fdm/jsbsim/propulsion/tank[0]/density-lbs_per_gal
This is one we create in System/fuel.xml (line 47 and 67 (0/1)
/fdm/jsbsim/propulsion/tank[0]/contents-volume-gal
in the c172p.xml file, the CG position of tank 0 and 1 seem to be wrong. The y-position shall be 112" outboard, whereas in reality the tanks are, according to the parts catalogue, positioned between WS38.38 and WS65.125. That would result in a y-position near 51.8 inches. On top the x position is given with 56" aft of firewall, but the POH indicates 48" on page 6-9. The capacity is given with 185lbs eq. to 30.6gallons. Is this correct? Although of minor influence, one should position the float chambers tank 3 and 4 near the engine, about x=-10, y=0, z=26.