• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

FSXA Engine gauge needle animation

euroastar350

Resource contributor
Messages
826
Country
us-delaware
Hi guys,

I've been having some issues with a couple of engine needles that work somewhat or not work at all

1.) Engine cylinder temperature: Should read between 150° min to 250° max, but it pegs along all the way to 300°C which by that time, the engine(s) is overheating. The code for those needles....

Code:
<PartInfo>
  <Name>BN2A_needle_cht_01</Name>
    <AnimLength>300</AnimLength>
     <Animation>
      <Parameter>
       <Code>
    (A:ENG CYLINDER HEAD TEMPERATURE:1, farenheit) 2 /
       </Code>
       <Lag>40</Lag>
       </Parameter>
  </Animation>
 </PartInfo>

2.) Oil temperature: Should read between 60° min to 250° max, but I'm sure that the keyframes I set in 3DS Max aren't properly set. I have them at 0-40-60-80-100-120. Keyframes 0-40 don't have any animation, although this maybe incorrect. The code for those needles....

Code:
<PartInfo>
  <Name>BN2A_needle_oil_temp_01</Name>
    <AnimLength>120</AnimLength>
     <Animation>
      <Parameter>
       <Code>
    (A:General Eng1 oil temperature,farenheit)
       </Code>
       </Parameter>
  </Animation>
 </PartInfo>

3.) Oil pressure: Should read between 60psi to 90psi, but the needles moves to 60. The code for those needles....

Code:
<PartInfo>
  <Name>BN2A_needle_oil_pressure_01</Name>
    <AnimLength>120</AnimLength>
     <Animation>
      <Parameter>
       <Code>
    (A:GENERAL ENG OIL PRESSURE:1, psi)
       </Code>
       <Lag>25</Lag>
       </Parameter>
  </Animation>
 </PartInfo>

4.) Fuel pressure: Should read between 20psi to 40psi with 30psi being the normal setting, but it doesn't get anywhere above the redline. The code for those needles....

Code:
<PartInfo>
  <Name>BN2A_needle_fuel_pressure_01</Name>
    <AnimLength>80</AnimLength>
     <Animation>
      <Parameter>
       <Code>
    (A:GENERAL ENG1 FUEL PRESSURE, PSI)
       </Code>
       </Parameter>
  </Animation>
 </PartInfo>

render_042.jpg


render_040.jpg


5.) Carburetor temp: This one isn't animated or coded yet, I'm looking at the best possible way to do this. All 3 carburetor temperatures are read by the same needle, there is a switch/knob in the cockpit that allows to select either carburetor/temperature reading, the same goes for the EGT gauge (which is animated from 0-100) next to it.

The old FS2004 Trislander model has this function, but in a 2D gauge and I would like to translate it into 3D form. The code from the 2D gauge(s)....

Code:
<Gauge Name="ATri_EGT.xml" Version="1.0">
   <Image Name="ATri_EGT_Bg.bmp"/>
   <Element>
      <Position X="100" Y="167"/>
      <Image Name="A_Needle_TypA.bmp" PointsTo="North" >
         <Axis X="2" Y="118"/>
      </Image>
      <Rotate>
         <Value Minimum="-20" Maximum="1020">(L:EngSel, enum) s0 -1 == if{ (A:ENG1 EXHAUST GAS TEMPERATURE,celsius) } els{ l0 1 == if{ (A:ENG2 EXHAUST GAS TEMPERATURE,celsius) } els{ (A:ENG3 EXHAUST GAS TEMPERATURE,celsius) } }</Value>
         <Nonlinearity>
            <Item Value="0" X="24" Y="77"/>
            <Item Value="500" X="99" Y="50"/>
            <Item Value="1000" X="175" Y="77"/>
         </Nonlinearity>
         <Delay DegreesPerSecond="20"/>
      </Rotate>
   </Element>
   <Element>
   <Image Name="ATri_EGT_Fore.bmp" />
   </Element>
</Gauge>

Code:
<Gauge Name="ATri_Carbtemp.xml" Version="1.0">
   <Image Name="ATri_CarbTemp_Bg.bmp"/>
   <Element>
      <Position X="100" Y="167"/>
      <Image Name="A_Needle_TypA.bmp" PointsTo="North" >
         <Axis X="2" Y="118"/>
      </Image>
      <Rotate>
         <Value Minimum="-41" Maximum="41">(L:EngSel, enum) s0 -1 == if{ (A:Recip carburetor temperature:1,celsius) } els{ l0 0 == if{ (A:Recip carburetor temperature:3,celsius) } els{ (A:Recip carburetor temperature:2,celsius) } } </Value>
         <Nonlinearity>
            <Item Value="-40" X="24" Y="77"/>
            <Item Value="0" X="99" Y="50"/>
            <Item Value="40" X="175" Y="77"/>
         </Nonlinearity>
         <Delay DegreesPerSecond="32"/>
      </Rotate>
   </Element>
   <Element>
   <Image Name="ATri_CarbTemp_Fore.bmp" />
   </Element>
</Gauge>

render_041.jpg


I know this is quite a handful, but I'm looking at recreating a realistic model of the BN2A MKIII-2 Trislander (with FSX limitations of course). I am also planning on implementing a failure module (RealEngine, custom code, etc), so I would like at least for the needles to function of have correct values/readings before I add this feature. As always, any help is greatly appreciated.
 
Messages
917
Country
indonesia
for temperature, you have to deal with air file.
but if you want to use air file as is. just multiply max value that get from aircraft parameter to get desire value.
i.e engine cylinder temperature max indication 300°C, desire value 250°C. max desire value = max indication * 0.833

Code:
       <Code>
    (A:ENG CYLINDER HEAD TEMPERATURE:1, Celsius ) 0.833 *
       </Code>
just to be note with unit you are using.
that trick aren't work when want to make certain range of temperature i.e 150 min - 250 max. it must be set in air file.
 

n4gix

Resource contributor
Messages
11,674
Country
unitedstates
that trick aren't work when want to make certain range of temperature i.e 150 min - 250 max. it must be set in air file.
That "trick" doesn't really translate well into 3d gauge needles.

Yes, if your range begins with 40 (or any other number), the easiest way set a key at frame 0 and frame 40 with no rotation at all. Only rotate/animate from 40 up to the highest index mark. Let's examine the first CHT and the rest should be easy to fix.

You posted this:
Code:
<PartInfo>
  <Name>BN2A_needle_cht_01</Name>
    <AnimLength>300</AnimLength>
     <Animation>
      <Parameter>
       <Code>
           (A:ENG CYLINDER HEAD TEMPERATURE:1, farenheit) 2 /
       </Code>
       <Lag>40</Lag>
       </Parameter>
  </Animation>
 </PartInfo>
The first problem is that your gauge is "Celsius" not "farenheit" so I'm not surprised it's 'pegging the needle'.

The single most important thing to remember is the formula:
SIM: Converts simvar to keyframes: simvar * scale + bias = keyframes
Now there are two different ways to approach this, one of which requires a "bias" value and no "scale" at all.

Since you've presumably already key-framed this needle with 0 to 100 no movement, and 100 to 300 animated, all you need is a correct "formula" for your needle:
Code:
<PartInfo>
  <Name>BN2A_needle_cht_01</Name>
    <AnimLength>300</AnimLength>
     <Animation>
      <Parameter>
       <Code>
             (A:ENG CYLINDER HEAD TEMPERATURE:1, celsius)
       </Code>
       <Lag>40</Lag>
       </Parameter>
  </Animation>
 </PartInfo>
The other method would be to ignore the values of 0 to 100 entirely, reducing your total animation length to 200 frames. In that case the forumula would be:
Code:
<PartInfo>
  <Name>BN2A_needle_cht_01</Name>
    <AnimLength>200</AnimLength>
     <Animation>
      <Parameter>
       <Code>
           (A:ENG CYLINDER HEAD TEMPERATURE:1, celsius) 100 -
       </Code>
       <Lag>40</Lag>
       </Parameter>
  </Animation>
 </PartInfo>
Note that the "bias" of 100 - is how we tell it to ignore 0 to 100 by offsetting the reported temp by -100 degrees Celsius.
 

euroastar350

Resource contributor
Messages
826
Country
us-delaware
Appreciate the help gents, I got all my primary engine needles working by changing the units to celsius and by adjusting parameters in the "AIR" file to match the real world specifications of the Lycoming O540-E4C5 engine as used in the Islander and Trislander aircraft. Just need need to figure out the best way to code the EGT and carb temperature needles which will complete the engine parameter needles.
 

euroastar350

Resource contributor
Messages
826
Country
us-delaware
Another question,

Does these codes look ok? It's basically the code from the 2D gauge, but used in 3D form for the last 2 remaining needles. I haven't tested them out yet, just need to know if they'll work as is or do I need to modify it.
Code:
<PartInfo>
    <Name>needle_voltamp</Name>
    <AnimLength>100</AnimLength>
    <Animation>
      <Parameter>
        <Code>(L:EngSel, enum) s0 -1 == if{ (A:Recip carburetor temperature:1,celsius) } els{ l0 0 == if{ (A:Recip carburetor temperature:3,celsius) } els{ (A:Recip carburetor temperature:2,celsius) } }</Code>
        <Lag>200</Lag>
      </Parameter>
    </Animation>
  </PartInfo>

Code:
<PartInfo>
    <Name>needle_voltamp</Name>
    <AnimLength>100</AnimLength>
    <Animation>
      <Parameter>
        <Code>(L:EngSel, enum) s0 -1 == if{ (A:ENG1 EXHAUST GAS TEMPERATURE,celsius) } els{ l0 1 == if{ (A:ENG2 EXHAUST GAS TEMPERATURE,celsius) } els{ (A:ENG3 EXHAUST GAS TEMPERATURE,celsius) } }</Code>
        <Lag>200</Lag>
      </Parameter>
    </Animation>
  </PartInfo>

What the code basically does, it reads the carb temperature or exhaust gas temperature from all 3 engines on a same needle, but readings from each engine can be selected via an engine selector knob on the panel which is a 3 position knob (E1-E3-E2).

The needle animation for the EGT is very easy to do, it's the carb temperature which has me stumped. It ranges from -40° to 40°, so I'm not sure what would be the ideal way to animate that particular needle.
render_041.jpg


Any input is greatly appreciated.
 
Messages
917
Country
indonesia
I take simple way, as I didn't understand much with xml code. sometimes 2D gauge xml aren't work in modeldef.xml take code as simple as it can for animation.
Code:
<Code>
(L:EngSel, enum) 0  ==  if{ (A:ENG1 EXHAUST GAS TEMPERATURE,celsius) }
(L:EngSel, enum) 1  ==  if{ (A:ENG2 EXHAUST GAS TEMPERATURE,celsius) }
(L:EngSel, enum) 2  ==  if{ (A:ENG3 EXHAUST GAS TEMPERATURE,celsius) }
</Code>
 

n4gix

Resource contributor
Messages
11,674
Country
unitedstates
The needle animation for the EGT is very easy to do, it's the carb temperature which has me stumped. It ranges from -40° to 40°, so I'm not sure what would be the ideal way to animate that particular needle.

Any input is greatly appreciated.
Okay, remember the SIM formula I mentioned above? This is a perfect example of the use of the "bias" parameter value.

The total animation range is 80 frames. You will need to offset the needle's neutral (0) position by +40 frames such that the needle will point at zero (0) at rest. For example:

if{ 40 (A:Recip carburetor temperature:1,celsius) + }

If carb temp = -40c, then -40 + 40 = frame zero (0)
If carb temp = -10c, then -10 + 40 = frame thirty (30)
If carb temp = +40c, then +40 + 40 = frame eighty (80)

Voila! :teacher:
 
Top