Browse Search Popular Register Upload Rules User list Login:
Search:
Laser frequency detector

Image:
screenshot of the scene

Author: KarateBrot

Group: Default

Filesize: 54.63 kB

Date added: 2009-10-15

Rating: 6.1

Downloads: 1262

Views: 1151

Comments: 8

Ratings: 3

Times favored: 0

Made with: Algodoo before v1.8.5

Tags:

Scene tag

Detects the frequency of a laser.

Made for this forum topic

If you download this scene please tell me your displayed laser frequency in the comments. Would be really interesting 8|
Last edited at 2009/10/15 04:44:32 by KarateBrot
Please log in to rate this scene
edit
Similar scenes
Title: Theft Detector Using Weight
Rating: 5
Filesize: 179.14 kB
Downloads: 1108
Comments: 2
Ratings: 1
Date added: 2012/06/09 11:48:18
Made with: Algodoo v2.0.2
Rating: rated 5
download
Title: AN EVEN SIMPLER KEY PRESS/RELEASE DETECTOR!
Rating: 5
Filesize: 16.13 kB
Downloads: 279
Comments: 2
Ratings: 1
Date added: 2013/08/07 04:09:25
Made with: Algodoo v2.1.0
Rating: rated 5
download
Title: Needle Nose Pliers
Rating: 6
Filesize: 40.48 kB
Downloads: 742
Comments: 2
Ratings: 3
Date added: 2011/11/09 03:56:10
Made with: Algodoo v2.0.1 Edu
Rating: rated 6
download
Title: Smoke Detector
Rating: 5
Filesize: 14.03 kB
Downloads: 351
Comments: 0
Ratings: 1
Date added: 2010/06/05 08:07:32
Made with: Phun
Rating: rated 5
download
Title: Gas Op SMG
Rating: 5.625
Filesize: 82.02 kB
Downloads: 895
Comments: 1
Ratings: 2
Date added: 2011/08/18 19:39:02
Made with: Algodoo v1.9.9b
Rating: rated 5.6
download
Title: Frequency
Rating: 5
Filesize: 13.55 kB
Downloads: 279
Comments: 1
Ratings: 1
Date added: 2013/07/01 09:18:07
Made with: Algodoo before v1.8.5
Rating: rated 5
download
mine runs at 66.6662
57.4 even though my monitor/tv is 60hz. this is to do with the refresh rate isnt it ?
jep i also have heard of that i has to do something with the refreshing rate... it was conundrumer who said that i think... i'm not sure anymore. could also be gradyfitz xD

Ah btw my frequency is at 57,14 hz
Last edited at 2009/10/16 15:10:31 by KarateBrot
I get 181 (averaged, peak at about 420, low at about 160).

The averaged code I used is:

(e)=>{ scene.my.t2 = sim.time; scene.my.Frequency = 4.0 / (scene.my.t2 - scene.my.t1); scene.my.t1 = sim.time; Scene.my.CumulativeFrequency = Scene.my.CumulativeFrequency + Scene.my.Frequency; Scene.my.CumulativeSamples = Scene.my.CumulativeSamples + 1.0; Scene.my.AverageFrequency = (Scene.my.CumulativeFrequency / Scene.my.CumulativeSamples) }


I'm pretty sure that the speed is about the FPS:)
--
Grady

EDIT: Thought you may also want the information about my screen settings: 75Hz, 1280x1024, 32-bit.

The information was averaged over a period of 1 hour, 14 minutes and 20 seconds (minimums and peaks weren't formally measured, but they were numbers I caught with my eye). :)
Last edited at 2009/10/16 11:42:41 by gradyfitz
Cool, that's a way faster laser you have :*)

I also let it calculate the average frequency but it was very similar to the current frequency without much fluctuation so I thought it was not necessary. Hmm, but your data is interesting, thanks :)
I noticed just recently that the method you use only allows up to 400 Hz measurement, above 400Hz, the measurement says "+inf".

I measured using my own device, and got an average of about 620 Hz, which happened to be my FPS at the time (doing quite a lot of other things at the time), the codes I used were:

(Laser hits this box)
onHitByLaser = (e)=>{Scene.my.CumulativeFrequency = Scene.my.CumulativeFrequency + 1};

Scene.my.AverageFrequency = {Scene.my.CumulativeFrequency / (Sim.time + 0.0000001)}

(0.0000001 is added to the equation because it is a largely insignificant number, but will prevent the requirement of if structures to protect from division by 0), I think that perhaps why your system goes to "+inf" is because the time difference at 100 Hz is something like 0.01, whereas, if the laser registers 1.25 hits every 0.01 seconds, the number is likely to be divided by 0.

Though, this does line up near exactly with the FPS I have. I ran the system directly as opposed to the system you had (splitting frequency into quarters, then multiplying by 4), this seems to allow me to get a more accurate read on the frequency against the FPS.

As normal, 75Hz, 1280x1024, 1.6.0 (I haven't tested any pre 1.6.0 versions of Algodoo, though it's not too important I suppose).

Based on the information I have gathered, the FPS ~= laser frequency, System.maxFPS does limit the speed of lasers (maxFPS ~= max Laser frequency), The reason it seems that lasers update at a screens refresh rate is that most screens run at 60Hz (normally), this is also the default value of System.maxFPS, the reason the laser frequency fluctuates so much from computer to computer (like the old timers Blue Herring, Danneh and I worked on), is most likely because of different performance of computers (you would expect two perfectly identical computers to run at the same speed), there is little need for extremely high frequency lasers :).

Coincidentally, thyme updates at the same speed as lasers (pure thyme, not onCollide or anything), which has just lead me to another conclusion, perhaps lasers update instantly, but onLaserHit/onHitByLaser events run at the frequency of thyme (which would make sense considering that onLaserHit/onHitByLaser use thyme:)).

Hopefully some of this data is interesting or helpful to you.
Thanks, it is interesting and helpful.
Yep, +inf is the result of dividing float values by zero. Sometimes if the steps are too small there's no difference in time1 and time2 so the difference of those two is 0. This leads to dividing by 0. It's a nice idea to add +0.0000001 to prevent displaying +inf. :)
I got 57.143.....