What I have is a pendulum (golf club suspended from a low friction bearing) and what I'm trying to do is determine the mean time period to complete a full swing.
My thought is to place an emitter / receiver break beam sensor off to one side of plumb vertical (probably ~15*) to trigger a count / start function. From here I have two divergent ideas about how to calculate & therefore program. Which is simpler, while still effective:
A.) count how many breaks there were in a set time window (say 60 seconds or roughly 40 cycles), but I would need the count to timer to latch on the last break to eliminate and partial cycles in the time window.
B.) actually count time from break to (every other) break, but this method will need to calculate the mean for me, or spit out a record of breaks for me to calculate them myself.
I have never used an arduino. I have done very basic PIC work many years ago, and have done alot of wiring & circuitry trouble shooting more recently.
Both approaches are valid but the first approach works better when the period of the signal being captured is small compared to the capture duration; the second one works better when the period is long relative to the capture duration. Here I'm envisaging the period being relatively long, and the swinging decaying fast enough to limit the number of cycles you can measure. In that case the second approach would be more promising.
If you want to end up with an average over a whole number of cycles then you can measure the elapsed time of each cycle just using millis(), and then maintain a cumulative average of the result (i.e. the sum of the periods captured divided by the number of periods).
njcook:
B.) actually count time from break to (every other) break, but this method will need to calculate the mean for me, or spit out a record of breaks for me to calculate them myself.
I would go with B. Further, I would go with a sensor that is right on the plumb vertical. As your pendulum approaches minimum swing, your sensor will eventually not see an event within the pendulum swing time. If your pendulum swings one full cycle every two seconds, for example, you can time swings until you don't get a change of state from your sensor for say, 3 seconds.
The actual swing amplitude at that point in time will depend on the width of the beam iterrupter,
The program itself will be quite simple. See the Blink Without Delay example in the example directory that came with the IDE for an idea of how to time the events using millis() or micros().
lar3ry:
I would go with B. Further, I would go with a sensor that is right on the plumb vertical. As your pendulum approaches minimum swing, your sensor will eventually not see an event within the pendulum swing time. If your pendulum swings one full cycle every two seconds, for example, you can time swings until you don't get a change of state from your sensor for say, 3 seconds.
The actual swing amplitude at that point in time will depend on the width of the beam iterrupter,
The program itself will be quite simple. See the Blink Without Delay example in the example directory that came with the IDE for an idea of how to time the events using millis() or micros().
How about using a hall sensor at plumb centre and a small magnet on the club? I know that the magnet may affect the pendulum's period, but a small (about 1 - 2 gram) magnet wouldn't affect it by much.
I definitely cannot add anything to the club, as the idea is to measure / calculate the MOI of the thing, so I cannot use a mechanical counter either... which leads me back to break beam.
I'm lost here. This is a given club, hanging some distance from an ideal pivot (Ideal Pivot Company, Ft. Worth WN) and you want to know the period without touching the club? You don't need a computer or have to actually swing it to know that. Measure the distance to center of mass from the pivot and do the math. Easier and much more accurate.
If, OTOH, there's a man in here somewhere, doing what they do best (screwing up an otherwise simple problem.....) that's a whole other deal. You can't just sense time at some point and know anything of value. If energy is being added and subtracted in real time you need to measure true position or perhaps acceleration and do some fancy math? You probably want instantaneous velocity at any point??? And averaging out stuff with people in it is not trivial as well.
Classically this is done in a darkened room with a high speed camera or flash and multiple exposures. Such data capture is past Arduino of course.
So what, exactly, are you up to? If it's to measure the 'free period' of the pendulum you don't need a computer really. If you need to include the golfer, you'll need more computer.......pack a lunch.
RetiredGuy:
I'm lost here. This is a given club, hanging some distance from an ideal pivot (Ideal Pivot Company, Ft. Worth WN) and you want to know the period without touching the club? You don't need a computer or have to actually swing it to know that. Measure the distance to center of mass from the pivot and do the math. Easier and much more accurate.
That's all fine if you KNOW where the centre of mass is.
I imagine this project may be academic instead of practical. In intro physics labs, we do either hand counting with a stop watch or using a photo gate system (break the beam) to count. Calculating with center of mass, total mass, and distance (theory), will be easy but that gives a student a different set of experience than actually counting the period (even better, comparing this period with the theory). This depends on the intent of the person that sets up this exercise, that is, if it is academic.