Jump to content
Sign in to follow this  
Guest fbnweoghnwd

Offsetting numbers in a radar altimeter

Recommended Posts

Guest fbnweoghnwd

I'm making a digital radar altimeter for FSX. I've got vertical strips containing the digits; the code for the "ones" and "tens" column looks like this (there are also columns for 100s, 1000s, and 10000s): 00.000,00.000True-64.000,197.000True0.000,22.0000.00010.00000.000,00.000True-50.000,197.000True0.000,22.0000.00010.000It's working fine, except that when I'm at ground level, it displays the height as 3 ft. Is there a way to offset it by 3 feet so that it reads "0" when it's sitting on the ground? A 747 pilot might not care, but this is for a chopper, so the difference isn't trivial!

Share this post


Link to post
Share on other sites

Well, you could subtract 3 from the value, but realize that is the way that they are supposed to work!The 3' is the height of the antenna above ground! :)


Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator

Share this post


Link to post
Share on other sites

The 3' is the height above ground your 'sensor' is in the chopper. I believe there's a way to zero it with the aircraft.cfg, but I don't remember off the top of my head.


Ed Wilson

Mindstar Aviation
My Playland - I69

Share this post


Link to post
Share on other sites

Hello Try (A:SIM ON GROUND,bool) if{ (A:Radio height, feet) (>L:radalt,feet) } %((A:Radio height, feet) (L:radalt,feet) - )%!d! Works for any aircraft.


Paul EGLD

Share this post


Link to post
Share on other sites
Guest fbnweoghnwd

>>that is the way that they are supposed to work!That's what I suspected. If I were a rw chopper pilot, this would keep me awake all night long!>>The 3' is the height above ground your 'sensor' is in the>>chopper. I believe there's a way to zero it with the>>aircraft.cfg, but I don't remember off the top of my head.I think the number offset comes from the static_cg_height, but I would think that changing this will screw up my contact points. I'll try it and see what happens. I'll also try your code, pve.I guess what I need to do first is decide whether to keep the offset (wacky but rw), or get rid of it (much more useful but not rw).

Share this post


Link to post
Share on other sites

>I guess what I need to do first is decide whether to keep the>offset (wacky but rw), or get rid of it (much more useful but>not rw). Realize that forcing the value to be zero when on ground might "look pretty," but until actual touchdown, the radar altimeter will STILL BE REPORTING 3' AGLThe digital readout will simply drop from 3' AGL to 0' instantly... :-roll If it really, really bothers you all that much, it would be more consistent to simply subtract 3.0 from your displayed value... all the time!You could then state that your radar altimeter has been "calibrated" to compensate for the reflector's height above ground... :-beerchug


Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator

Share this post


Link to post
Share on other sites
Guest fbnweoghnwd

>>If it really, really bothers you all that much, it would be more consistent to simply subtract 3.0 from your displayed value... all the time!How would I go about doing that, Bill? I tried putting a subtraction operand on the RADIO HEIGHT value, but couldn't get it working.

Share this post


Link to post
Share on other sites

(P:Units of measure,enum) 2 == if{ (A:RADIO HEIGHT, meters) 0.91439 - } els{ (A:RADIO HEIGHT, feet) 3 - }


Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator

Share this post


Link to post
Share on other sites
Guest fbnweoghnwd

Works great Bill...thanks yet again!And thanks to WarpD and pve as well.:-cool

Share this post


Link to post
Share on other sites
I'm making a digital radar altimeter for FSX. I've got vertical strips containing the digits; the code for the "ones" and "tens" column looks like this (there are also columns for 100s, 1000s, and 10000s):
			<Element id="Altitude Display - 1s">				<FloatPosition>00.000,00.000</FloatPosition>				<Image id="radalt_numbers.bmp" Name="radalt_numbers.bmp">					<Transparent>True</Transparent>					<Axis>-64.000,197.000</Axis>					<Bright>True</Bright>				</Image>				<MaskImage id="radalt_mask.bmp" Name="radalt_mask.bmp">				</MaskImage>				<Shift id="Shift">					<Scale>0.000,22.000</Scale>					<Expression id="Expression">						<Minimum>0.000</Minimum>						<Maximum>10.000</Maximum>						<script>(P:Units of measure, enum) 2 == if{ (A:RADIO HEIGHT, meters) } els{ (A:RADIO HEIGHT, feet) } abs 99999 min 0 max 10 % 1 / flr</Script>					</Expression>				</Shift>			</Element>			<Element id="Altitude Display - 10s">				<FloatPosition>00.000,00.000</FloatPosition>				<Image id="radalt_numbers.bmp" Name="radalt_numbers.bmp">					<Transparent>True</Transparent>					<Axis>-50.000,197.000</Axis>					<Bright>True</Bright>				</Image>				<MaskImage id="radalt_mask.bmp" Name="radalt_mask.bmp">				</MaskImage>				<Shift id="Shift">					<Scale>0.000,22.000</Scale>					<Expression id="Expression">						<Minimum>0.000</Minimum>						<Maximum>10.000</Maximum>						<script>(P:Units of measure, enum) 2 == if{ (A:RADIO HEIGHT, meters) } els{ (A:RADIO HEIGHT, feet) } abs 99999 min 0 max 100 % 10 / flr</Script>					</Expression>				</Shift>			</Element>

It's working fine, except that when I'm at ground level, it displays the height as 3 ft. Is there a way to offset it by 3 feet so that it reads "0" when it's sitting on the ground? A 747 pilot might not care, but this is for a chopper, so the difference isn't trivial!


Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator

Share this post


Link to post
Share on other sites

Bill, I used something like this, it recalibrates once the aircraft is on the ground. The problem is that it does not calibrate for suspension squish quite as I like it..

<Macro Name="RAD">(P:Units of measure, enum) 2 == if{ (A:RADIO HEIGHT, meters) } els{ (A:RADIO HEIGHT, feet) }</Macro><Update>(A:SIM ON GROUND, bool) (G:Var1) 1 == @RAD (L:RADCALIBRATE, enum) - 0 == ! and and if{ 0 (>G:Var1) }(A:SIM ON GROUND, bool) (G:Var1) 0 == and if{ @RAD (>L:RADCALIBRATE, enum) 1 (>G:Var1) }(A:SIM ON GROUND, bool) ! (G:Var1) 1 == and if{ 0 (>G:Var1) }</Update>!-- Use this value --><Value>@RAD (L:RADCALIBRATE, enum) - </Value>

PS - I see this is an old thread --- Oh well.Roman


20AUG21_Avsim_Sig.png?dl=1  FS RTWR   SHRS F-111   JoinFS   Little Navmap 
 

 

Share this post


Link to post
Share on other sites
PS - I see this is an old thread --- Oh well.Roman
No problem, Roman!Actually, I meant to add a bold comment at the top to indicate that this was a "necroed thread."You see, since the forum software change, XML script examples shared in the past are now "invisible!"So, whenever I have to search the forums for any reason and notice some "working example" posted, I "resurrect the dead" and encapsulate the XML script in

Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Tom Allensworth,
    Founder of AVSIM Online


  • Flight Simulation's Premier Resource!

    AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!

    Click here for more information and to see all donations year to date.
×
×
  • Create New...