Board index FlightGear Development Aircraft Systems

Oil Temp always 60°F at start?  Topic is solved

Modeling aircraft systems, like electrical stuff, hydraulics, pneumatics? Feel free to ask support.

Oil Temp always 60°F at start?

Postby benih » Wed Sep 20, 2017 9:39 pm

Hello,
today i noticed that the oil temp is always initialized to about 60°F at start.
Is this hardcoded in jsbsim? or can i change that at the aircraft-side?

I would expect the engine oil temp to initialize at outside temperature when starting the sim on the ground...


To reproduce, a very cold day:
Code: Select all
fgfs --airport=KFSO --metar="KFSO 202020Z 26005KT 9999 -SHRA SCT045TCU SCT080 M10/08 Q1023 NOSIG" --prop:browser=/engines/engine
benih
 
Posts: 96
Joined: Tue Aug 15, 2017 9:34 am

Re: Oil Temp always 60°F at start?

Postby wlbragg » Wed Sep 20, 2017 10:04 pm

Which aircraft?
Kansas(2-27-15)/Ohio/Midwest scenery development.
KEQA (2-27-15), 3AU, KRCP Airport Layout
User avatar
wlbragg
 
Posts: 4930
Joined: Sat Aug 25, 2012 11:31 pm
Location: Kansas (Tornado Alley), USA
Callsign: WC2020
Version: next
OS: Win10/Debain/nVGT640

Re: Oil Temp always 60°F at start?

Postby benih » Thu Sep 21, 2017 4:49 pm

It happens with c182s, but also with the default one (hence the lacking param for reproduction)
benih
 
Posts: 96
Joined: Tue Aug 15, 2017 9:34 am

Re: Oil Temp always 60°F at start?

Postby benih » Thu Oct 12, 2017 7:13 pm

Anything new here? Is this a bug?
If yes, should i open a bug report (and where?)

[edit] after some investigation, it looks like maybe a problem in flightgears initialization code OR in jsbsim itself.
What to do now?
Last edited by benih on Thu Oct 12, 2017 7:30 pm, edited 1 time in total.
benih
 
Posts: 96
Joined: Tue Aug 15, 2017 9:34 am

Re: Oil Temp always 60°F at start?

Postby wlbragg » Thu Oct 12, 2017 7:26 pm

I would expect the engine oil temp to initialize at outside temperature when starting the sim on the ground...
I'm not educated with that particular property and how it is derived, whether natively or if it is only created through the developer.

If I had to venture a guess I would say this would be dependent upon the aircraft developer to implement. I don't think the FDM source could easily poll the weather system to obtain that starting value. So either it is a hard coded starting point, or not set until created by the developer.

I do know however the weather system takes at least a couple minutes to settle down as we have tried to use it to set an initial starting value for fog and frost while developing the c172p. To date there is an issue with the starting value of the fog and frost system that has not been solved yet.
Kansas(2-27-15)/Ohio/Midwest scenery development.
KEQA (2-27-15), 3AU, KRCP Airport Layout
User avatar
wlbragg
 
Posts: 4930
Joined: Sat Aug 25, 2012 11:31 pm
Location: Kansas (Tornado Alley), USA
Callsign: WC2020
Version: next
OS: Win10/Debain/nVGT640

Re: Oil Temp always 60°F at start?

Postby benih » Thu Oct 12, 2017 7:39 pm

So either it is a hard coded starting point

I conclude from a quick view that it is a problem by jsbsim initializing with 60° fixed value. Flightgear seems to just copy this value out of jsbsim.
I think i have no means to overwrite this property, at least i failed on several attempts even using nasal code.

There is a neightbouring thread about the property which may be related:
viewtopic.php?f=4&t=28303&start=225

The conclusion there was, that the jsbsim values are only roughly calculated and aircraft developers should implement an own system if needed. That seems to be the case here; at least unless the property could be initialized to ambient air temperature in the flightgear base code.
benih
 
Posts: 96
Joined: Tue Aug 15, 2017 9:34 am

Re: Oil Temp always 60°F at start?

Postby wlbragg » Thu Oct 12, 2017 9:13 pm

I think i have no means to overwrite this property, at least i failed on several attempts even using nasal code.

You can either bypass it and create your own oiltemp. Leaving it a property in the tree that is not used. Or you can write some nasal or JSB using the existing property as a starting point. Not sure why you would want to use it to start with. But beware, your going to run into an issue trying to get a valid air temperature right of the bat. If you solve that issue I'd like to know.
Kansas(2-27-15)/Ohio/Midwest scenery development.
KEQA (2-27-15), 3AU, KRCP Airport Layout
User avatar
wlbragg
 
Posts: 4930
Joined: Sat Aug 25, 2012 11:31 pm
Location: Kansas (Tornado Alley), USA
Callsign: WC2020
Version: next
OS: Win10/Debain/nVGT640

Re: Oil Temp always 60°F at start?

Postby Thorsten » Fri Oct 13, 2017 4:44 am

I would expect the engine oil temp to initialize at outside temperature when starting the sim on the ground.


I'm not sure it can - FDM is initialized pretty early, I'm not sure when Basic Weather is initialized, but Advanced Weather is initialized much later, so I suspect there's only a standard atmosphere for the FDM to work with at init time.

You can either bypass it and create your own oiltemp.


Yepp - just implement whatever model you want for your own. You're in no way obliged to even use native JSBSim engine simulations - you can code your own from scratch in JSBSim and let it act via external forces in the end.

Anything new here? Is this a bug?


No - the simulation is only realistic up to a point, but since the model can be extended by you, that's what you need to do if you need more. JSBSim is a simulation development toolkit, not some finished thing you just use.
Thorsten
 
Posts: 11138
Joined: Mon Nov 02, 2009 8:33 am

Re: Oil Temp always 60°F at start?  

Postby benih » Thu Dec 14, 2017 10:10 am

Hello, i want to conclude this thread with the solution i come up with after all your suggestions.
I implemented it with some nasal, and a kinematic.
The nasal script runs every second and calculates the difference of the environment temp and the oil temp. If the engine was never started in the simulation, the offset is applied in full to the jsbsim temp, yielding effectively the environment temp.
When the engine starts for the first time, a kinematic goes from 1.0 to 0.0 in about 2 minutes and reduces the ammount of the applied offset (this has the effect of a slightly shortened warm-up period in cold weather that should be compensated for).
After no more offset is applied for the remainder of the session, only the jsbsim value is considered and this value already adapts to the environment temp.

This is also upwards compatible, should jsbsim be initialized at the environment temp in the future, since the offset would be 0.

See the following commit in the c182s: https://github.com/HHS81/c182s/pull/201 ... a27ff39fe6
benih
 
Posts: 96
Joined: Tue Aug 15, 2017 9:34 am

Re: Oil Temp always 60°F at start?

Postby wlbragg » Thu Dec 14, 2017 4:27 pm

Well done!

How did you get around the fact that the environmental/air/temp/degc/f property needs time to "settle down" upon initialization or airport changes via the GUI?

I looked at your code and see nothing to indicate that you took that into consideration.

I only ask because in the frost/fog effect implemented in the c172p and the j3Cub it is a real issue and that the work around for that required a startup "seed value" (for lack of better term) of 0 instead of being able to rely on the startup environmental/air/temp/degc property value. Which still throws the whole thing off but allows the user to start with defrosted and de-iced windows.

My point is you can't be getting what you think your getting if your basing the initial startup temperature value of the engine block on a faulty air temperature value.
Last edited by wlbragg on Sat Dec 16, 2017 4:29 pm, edited 1 time in total.
Kansas(2-27-15)/Ohio/Midwest scenery development.
KEQA (2-27-15), 3AU, KRCP Airport Layout
User avatar
wlbragg
 
Posts: 4930
Joined: Sat Aug 25, 2012 11:31 pm
Location: Kansas (Tornado Alley), USA
Callsign: WC2020
Version: next
OS: Win10/Debain/nVGT640

Re: Oil Temp always 60°F at start?

Postby benih » Sat Dec 16, 2017 10:03 am

It is adjusted for implicitely, because as long as the engine was not started, the offset is calculated every second as difference between env and jsbsim_oil. That means, as long as env temp settles down, engineoil will settle also.
[Edit] it should even consider real weather changes after start.
benih
 
Posts: 96
Joined: Tue Aug 15, 2017 9:34 am


Return to Systems

Who is online

Users browsing this forum: No registered users and 1 guest