Sign in to follow this  
Guest

"Auto Light Switch" (just when you thought you'd heard the last!)

Recommended Posts

It appears now that I was a bit premature in announcing 'success' with the Auto Light Switch using Arne's wonderfully complicated L:local_sun_angle,number formula... as the 'other thread' was becoming rather long and unwieldy, I'm starting a new one... :)You see, according to the output, at KIND (Indianapolis), the transition points for night/dawn and dusk/night (the point at which the 'day floods' need to be controled occur at the following times and sun angles:May 4, 2003Night/Dawn 05:11 -30.1055Dusk/Night 20:12 33.2888"Spread" of 63.3943 degreesThis is "bad enough," since there is a huge "spread" between the morning and night "angles" that it makes it impossible to turn ON the lights at one particular 'angle' and OFF at a totally different 'angle,' without resorting to even more convoluted 'logic' in the K_event statement.Worse, as the day of year progresses, the calculated L:local_sun_angle changes drastically, making it impossible to reliably encode the switch logic, as illustrated by the following transition / angle figures:November 5, 2003Night/Dawn 06:45 -48.6001Dusk/Night 18:06 21.6457"Spread" of 70.2458 degreesNow, it is entirely possible that my implementation of Arne's "formula" may still be flawed, so I'd deeply appreciate anyone who's already built a 'gauge' check my figures using the same place, date and times to make sure that I'm not just "all wet..." :)For some reason, my logical take on the situation is that the angle of the sun at the two transition points should be approximately equal!Unless a solution can be found, this has been a fun - but ultimately fruitless - exercise... :)BillAVSIM OmbudsmanFounder and Director,Creative Recycling of Aircraft Partshttp://mtco.com/~rsam/fartslogo.jpg

Share this post


Link to post
Share on other sites
Help AVSIM continue to serve you!
Please donate today!

I do have -3.7 at 2003-05-03 05:11 at KIND with my gauge. The sun is "halfed" at 05:47 and the display on my gauge is 3.6

Share this post


Link to post
Share on other sites

Thanks for checking, Arne. I'll take another stab at figuring out the 'formula' to see if I can get numbers closer to yours.BillAVSIM OmbudsmanFounder and Director,Creative Recycling of Aircraft Partshttp://mtco.com/~rsam/fartslogo.jpg

Share this post


Link to post
Share on other sites

You had (A:PLANE LONGITUDE,degrees) 10 / in your code, it should be (A:PLANE LONGITUDE,degrees) 15 /15

Share this post


Link to post
Share on other sites

>You had >(A:PLANE LONGITUDE,degrees) 10 /> in your code, it should be >(A:PLANE LONGITUDE,degrees) 15 />>15

Share this post


Link to post
Share on other sites

Frather,I did the test too at KIND, LT:4-5-2003; 05:11 =3 degrees4-5-2003; 12:11 =66 degrees4-5-2003; 20:11 =3 degreesJan"Procul Negotiis"

Share this post


Link to post
Share on other sites

>Frather,>>I did the test too at KIND, LT:>4-5-2003; 05:11 =3 degrees>4-5-2003; 12:11 =66 degrees>4-5-2003; 20:11 =3 degreesThanks, Jan. Since I corrected the LONGITUDE divisor I am now getting results consistent with the the values you and Arene are reporting. Funny that we should both copy the same code snippet and not have the same error though! ???BillAVSIM OmbudsmanFounder and Director,Creative Recycling of Aircraft Partshttp://mtco.com/~rsam/fartslogo.jpg

Share this post


Link to post
Share on other sites

The divisor 10 wasn't in my original post it was always 15.The switching of the nav lights with a toggle K:event is always tricky. The reason is that you can't check the state and then immediately toggle, because it takes time to for the K: event to take effect. The result of a toggle will only be seen at the next drawing. BTW (K:TOGGLE_NAV_LIGHTS) without > doesn't make sense.Arne Bartels

Share this post


Link to post
Share on other sites

>The divisor 10 wasn't in my original post it was always 15.I went back to track down where that came from, and you are right... it was always 15. Somehow it morphed into 10 in my formula, and the last email you sent where you'd checked the code and corrected had the 10 as well... :)That just 'shows to go you' that 'pobody's nerfect' :)>The switching of the nav lights with a toggle K:event is>always tricky. The reason is that you can't check the state>and then immediately toggle, because it takes time to for the>K: event to take effect. The result of a toggle will only be>seen at the next drawing. BTW (K:TOGGLE_NAV_LIGHTS) without>> doesn't make sense.>Arne BartelsPerhaps, but (K:TOGGLE_NAV_LIGHTS) ! (>K:TOGGLE_NAV_LIGHTS) does work! :) This prevents the code from repeatedly switching the lights On,Off,On,Off,On... etc.How would you have written the line?Again, thanks for your help.BillAVSIM OmbudsmanFounder and Director,Creative Recycling of Aircraft Partshttp://mtco.com/~rsam/fartslogo.jpg

Share this post


Link to post
Share on other sites

Strange.. I know the effect of permanent toggling, and I usually solve it rather complicated by introducing a timer that makes ure two togglings aren't made directly after another. BUT the permanent toggling has dissapeared! I can just check if the target is different from the desired state and if yes toggle. Something like:(A:Light Nav, bool) (L:local_sun_angle,number) 0 > != if{ (>K:TOGGLE_NAV_LIGHTS) } But I don't know why it works suddenly. Strange. I wanted to try out inserting "(K:TOGGLE_NAV_LIGHTS) !" but I can't any more.Arne Bartels

Share this post


Link to post
Share on other sites

"Funny that we should both copy the same code snippet and not have the same error though! ???"I checked with mine too, and I've used 15 as divisor. Didn't check your airport, but I've checked a little around here with places that have always caused me pain and suffering in the past with my earlier attempts.Sometimes there exist something called a bad "parser", maybe you've been subject to a bad "paster"? ;) Was it a Microsoft tool? :DBill, contact me in private if you find time, I've lost your adress.

Share this post


Link to post
Share on other sites

>Sometimes there exist something called a bad "parser", maybe>you've been subject to a bad "paster"? ;) Was it a Microsoft>tool? :DNo, it was a short in the circuit between the keyboard and my brain! :)>Bill, contact me in private if you find time, I've lost your>adress.I sent you an email, did you receive? I'm not hard to find, click on my "Profile" for further info! n4gix@attbi.comBillAVSIM OmbudsmanFounder and Director,Creative Recycling of Aircraft Partshttp://mtco.com/~rsam/fartslogo.jpg

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