CHT & EGT per cylinder

Help creating logic scripts for Air Manager Instruments

Moderators: russ, Ralph

Message
Author
User avatar
Sling
Posts: 5237
Joined: Mon Sep 11, 2017 2:37 pm
Contact:

Re: CHT & EGT per cylinder

#21 Post by Sling »

I agree with Jacques other than to say my hunch is the X-Plane values are hottest not coolest. The only reason for this logic is aircraft only fitted with a single gauge always monitor the cylinder that the manufacturer has tested to be the hottest. Either way what Jacques posted is IMHO the best way to go.

Tony

User avatar
Keith Baxter
Posts: 4674
Joined: Wed Dec 20, 2017 11:00 am
Location: Botswana

Re: CHT & EGT per cylinder

#22 Post by Keith Baxter »

Hi,

I had a look at the two JPI EDM's in the store to get an idea of how they work and the output. Their they use a random timer. I do not like the continuous jumping the random changing causes and I don't think that is how they work. A you-tube search on the JPI EDM850 confirms that the jumping is not realistic

I have done a short research and I am inclined to go along with what Jacques and Tony are saying.

I am almost sure that xplane takes into account the peeking with regards to fflow etc. But I will confirm by recording some data and plotting.

Guys thank you for all the input. I have learnt quite a lot in this process.

Let me play around with it a bit and I will post a video on what I have finally decided.

Keith
AMD RYZEN 9 5950X CPU, Corsair H80I cooler, ASUS TUF GAMING B550-PLUS AMD Ryzen Mother Board,  32Gb ram Corsair Vengeance 3000Mh, MSI GTX960 4G graphics card 

frumpy
Posts: 358
Joined: Sat Jan 30, 2016 12:01 pm

Re: CHT & EGT per cylinder

#23 Post by frumpy »

double post
Last edited by frumpy on Mon Nov 16, 2020 9:50 am, edited 1 time in total.

frumpy
Posts: 358
Joined: Sat Jan 30, 2016 12:01 pm

Re: CHT & EGT per cylinder

#24 Post by frumpy »

Keith Baxter wrote: Sat Nov 14, 2020 3:36 pm I did try the random code you provided (thank you for that) but found that the random changing every second did not reflect a realistic event.
It's because it's no global value and changing every second.


Try this and play with the mixture. It's a complete gauge and runs with the default C172:

Code: Select all

--Random Cylinder temperatures
math.randomseed(os.time()) -- init random
dev = math.random(-8,8) -- global random value between -8 and 8
dev_cyl_row2 = (math.random(1010, 1025)/1000) -- cylinder row 2 will be between 1 to 2.5% hotter than cylinder row 1 

EGT1_1 = txt_add("", "roboto_bold.ttf; size:30; color: black; halign:left;", 0, 0, 200, 200) -- text position definitions
EGT2_1 = txt_add("", "roboto_bold.ttf; size:30; color: black; halign:left;", 0, 50, 200, 200)
EGT3_1 = txt_add("", "roboto_bold.ttf; size:30; color: black; halign:left;", 0, 100, 200, 200)
EGT4_1 = txt_add("", "roboto_bold.ttf; size:30; color: black; halign:left;", 0, 150, 200, 200)

function new_EGT(egt)
txt_set(EGT1_1, (math.floor(egt[1]/5)*5)) -- cyl1 straight from XP, rounded to 5°
txt_set(EGT2_1, (math.floor((egt[1]+dev)/5)*5)) -- cyl2 is -8 to 8° different from cyl1
txt_set(EGT3_1, (math.floor((egt[1]*dev_cyl_row2)/5)*5)) -- cyl3 in row 2 is 1 to 2.5% hotter
txt_set(EGT4_1, (math.floor((egt[1]*dev_cyl_row2+dev)/5)*5))
end

xpl_dataref_subscribe("sim/cockpit2/engine/indicators/EGT_deg_C", "FLOAT[8]", new_EGT) -- I think this is °F

I agree things should not be overdone too much. Perhaps I could give some inspiration, for me it's a learning experience too :)

User avatar
Keith Baxter
Posts: 4674
Joined: Wed Dec 20, 2017 11:00 am
Location: Botswana

Re: CHT & EGT per cylinder

#25 Post by Keith Baxter »

Hi,

Thank you @frumpy for that code.

I think this video tells all.




Keith
AMD RYZEN 9 5950X CPU, Corsair H80I cooler, ASUS TUF GAMING B550-PLUS AMD Ryzen Mother Board,  32Gb ram Corsair Vengeance 3000Mh, MSI GTX960 4G graphics card 

JackZ
Posts: 2262
Joined: Mon Feb 22, 2016 1:02 pm

Re: CHT & EGT per cylinder

#26 Post by JackZ »

From what I see the JPI gauge from the store is also incorrectly displaying the EGT and CHT.
There is some kind of thermal inertia in the temperatures probes (simply because thermal dilatation takes time to propagate in any metal the probes are made with and for the electrical resistance to vary accordingly), hence I really doubt the temps change that fast. Guess that the system gives an average with a set of measure every 5 seconds or so, as Iirc, leaning to try to determine the reach of peak is a slow procedure, ie you slowly decrease the mixture to let the temp stabilize.

Jacques

[edit]The rate of change is higher than 5seconds according to this video, I would say more like two seconds
My YouTube Chanel on the A320 (Real SOPs by an Airline Pilot IRL):
https://www.youtube.com/playlist?list=P ... 0Q6SBASRqJ

User avatar
Keith Baxter
Posts: 4674
Joined: Wed Dec 20, 2017 11:00 am
Location: Botswana

Re: CHT & EGT per cylinder

#27 Post by Keith Baxter »

Hi, @JackZ

Jacques, Thank you for all the attention you are putting into this.

I looked into the dataref callback/change rate for both egt, cht and itt. It is impossible to realistically measure as they change at a vast speed.

Which brings me to another question. @Corjan May have answered this previously. But does AM send a callback with each fine change? millions of them? Or is there some sort of restriction?
Perhaps a control better than a timer, is the ability to restrict the callback rate within the dataref subscribe subscription. %of.1f might be an option to only allow 1/10 callback subscribes or %10f.0f to allow for only 10/1 callback subscribes.

So the question for what we want then is. Is it a timing update or a value update? I am inclined to bend towards value update.

Going to watch that video you posted over and over and others I have already watched to see fi I can find the answer. :)

Keith

NOTE" for @Ralph
The datarefs you are using for you JPI EDM900 change with airframe. Determined in plane maker. So your user defined temp scale option is causing incorrect indications.

Check out with the default Columbia 400 in xplane.

The EGT example

Code: Select all

sim/cockpit2/engine/indicators/EGT_deg_C	float[8]	n	degrees_C_or_F	EGT, deg. Dataref label is wrong, units vary by plane.
AMD RYZEN 9 5950X CPU, Corsair H80I cooler, ASUS TUF GAMING B550-PLUS AMD Ryzen Mother Board,  32Gb ram Corsair Vengeance 3000Mh, MSI GTX960 4G graphics card 

User avatar
Ralph
Posts: 7878
Joined: Tue Oct 27, 2015 7:02 pm
Location: De Steeg
Contact:

Re: CHT & EGT per cylinder

#28 Post by Ralph »

The simulator callback fires every time the simulator indicates that there's new data. There's no cap as far as I know, but I might be mistaking. If you think that the updates are too much, then you'll have to make your own filter with a timer. It wouldn't need any special new API function.

User avatar
Keith Baxter
Posts: 4674
Joined: Wed Dec 20, 2017 11:00 am
Location: Botswana

Re: CHT & EGT per cylinder

#29 Post by Keith Baxter »

Ralph wrote: Mon Nov 16, 2020 4:09 pm The simulator callback fires every time the simulator indicates that there's new data. There's no cap as far as I know, but I might be mistaking.
WOW Ralph.

I also could also be wrong, but I think Corjan must have some sort of "package read" restriction. Imagin 20 -> 30 dataref subscribes in a buss firing off millions of changes every how many micro seconds.

Yes It is easy to apply a dataref var filter in code as you suggest. I am wanting to have control and reduce callbacks/packages received by using a filter at the subscribe level. Not after thousands of sim data changes.

The CPU usage is important for RPI and this instrument is a perfect candidate for that.

I could have it all wrong in my thinking. Comments...

Keith
AMD RYZEN 9 5950X CPU, Corsair H80I cooler, ASUS TUF GAMING B550-PLUS AMD Ryzen Mother Board,  32Gb ram Corsair Vengeance 3000Mh, MSI GTX960 4G graphics card 

User avatar
Ralph
Posts: 7878
Joined: Tue Oct 27, 2015 7:02 pm
Location: De Steeg
Contact:

Re: CHT & EGT per cylinder

#30 Post by Ralph »

As far as I know the cap is the number of FPS. This exactly the reason why you want to keep your subscribes small.

Post Reply