leet hacker![]() Member Posts: 118 From: Hobbiton, Shire, Middle-Earth Registered: 07-30-2007 |
in an earlier thread, i said i was doing a lego mindstorms physics project. now i have the code working, and the ball-dropper working. the ball hits the arm which presses the touch sensor and stops the timer. i do have to squeeze the two walls the arm goes between though. the only problem is that the time it gives back is not consistent. like first it gives the time as 200 (milliseconds i think), and then the next time it gives it as 85, even though it was dropped from the same height as the first. here are pix that i made with mlcad (a very crude representation): here is the program i used:
i can't figure out if the problem is me, the apparatus, or the program. if you think you know what the problem is, please tell me. if i can't get a solution (from you or me), i think maybe i'll just scrap the project. ------------------ "By the way, what does BTW stand for?" - IRC message Über-Geek |
|
JeTSpice Member Posts: 433 From: La Crosse, Wisconsin, USA Registered: 06-10-2006 |
Does it consistantly give a time of 200 and then 85? Like every single time you reboot/start up the system, the first result is always 200 and the second is always 85? If you drop the ball many times, are a majority of those times closer to 200 or closer to 85 or neither? Or do they consistently drop off, like 200, 85, 70, 64, 62, etc. i.e., more data |
|
leet hacker![]() Member Posts: 118 From: Hobbiton, Shire, Middle-Earth Registered: 07-30-2007 |
quote: it sort of averages around like 130 or something like that, but it does drop constantly, like 275, 200, 115, 110, 85, 65 (that's similar to some earlier results i got). ------------------ "By the way, what does BTW stand for?" - IRC message Über-Geek |
|
supercoder![]() Member Posts: 37 From: Registered: 08-20-2007 |
u could add wait(50) after AddToDatalog to debounce sensor, may be helps ------------------ |
|
JeTSpice Member Posts: 433 From: La Crosse, Wisconsin, USA Registered: 06-10-2006 |
Hmm, it sounds like there is an issue with a capaciter in the electronics. It's been while since my electronics' days but a capacitor has a recharge time. Think of a camera where the flash has to build up before it's ready. It sounds like something like that. (This is a physical construction, not a virtual one, right?) A round about way of agreeing with Supercoder. Is there another type of sensor available in mindstorm? |
|
leet hacker![]() Member Posts: 118 From: Hobbiton, Shire, Middle-Earth Registered: 07-30-2007 |
quote: so are you saying that maybe i should wait a while between ball-drops? quote: yes, it's a physical construction quote: if you mean a physical sensor, the only one that could do anything would be a rotation sensor (also there's a temperature sensor). if you mean a virtual sensor, there's just a counter (like every time you do something it adds 1 to the counter). ------------------ "By the way, what does BTW stand for?" - IRC message Über-Geek |
|
ArchAngel Member Posts: 3450 From: SV, CA, USA Registered: 01-29-2002 |
When dealing with sensors, especially low-grade sensors, there is a lot of noise in the signal. That was one of the biggest difficulties at my internships. It's frustrating for a computer science guy to deal with all the uncertainty of real life. What would be nice is to see a sample of your readings, along with some statistical data, like mean and standard deviation. But, one question you doneed to ask yourself: how accurate do you need the numbers to be? ------------------ |
|
JeTSpice Member Posts: 433 From: La Crosse, Wisconsin, USA Registered: 06-10-2006 |
Wow--great models, 1337!
I second that -- how accurate do you need it to be? Since the system is physical, and made out of plastic, it can also vary the results. Temperature will shrink/expand the blocks, causing small deviations in the results. Slight differences in the arm's hinge will cause it to fall at different rates, depending on it's weight and angle just before it falls. These are just possibilities and looking at your readings can help before you make any changes. [This message has been edited by JeTSpice (edited October 12, 2007).] |
|
leet hacker![]() Member Posts: 118 From: Hobbiton, Shire, Middle-Earth Registered: 07-30-2007 |
quote: it has a tower with a claw on top (i'm assuming you mean by dropping at different heights that i'm doing it by hand); as soon as the claw moves, the timer starts. the ball falls and hits the arm which stops the sensor. i could be squeezing at different amounts of pressure, or the arm is at different heights, but that shouldn't make a 100-millisecond difference. quote: hehe, i wonder why i didn't think of that? i'll try that. quote: this is experiment is mainly to find out the average speed of the falling ball and the average acceleration. so, they need to be very accurate. i will post the data soon. ------------------ "By the way, what does BTW stand for?" - IRC message Über-Geek |