SparkFun Forums 

Where electronics enthusiasts find answers.

Have questions about a SparkFun product or board? This is the place to be.
By visible noise
#137477
Hey,
As the title reads I'm trying to make a system that will take Racquetball (well a modified version friends and i play) to a new level.
What i want the system to do is keep track of points, ball location, and project that information onto the play wall. I have a few ideas on how to archive this but they all have holes in them, so maybe you guys can help with the design, ideas and general brainstorming.

if i need to better explain any idea, the rules of the game or anything please ask!

wii idea:
as some of you may know the wiimote is very versatile and can be used to track objects (that emit IR light) by a computer. The plan here would be to use the wii remote to track the location of the Racquetball ball. I would make a ball that has a high power IR LED inside, this would be tracked by the software created by Johnny Chung Lee here http://johnnylee.net/projects/wii/, and then a program would be created to take those hit events and count them as points.
Problems here are that this setup would not be able to detect the difference between the ball hitting; the ground, a racquet, a wall, or players. All of those hits would be counted as points, but i only need the ball hitting the wall counted as a point. I'm not even sure how i would go about tracking the hit event on the ball, the best idea i have come up with is to take the insides of those light up bouncy balls and replace the led, then put that into a new ball. This way every time the ball is hit it would turn the led on for a second. Also this whole system relies on line of sight between the remote and ball.

wireless mouse:
take the guts of a small wireless mouse and stuff it into a racquetball ball, as the ball is hit a mouse button would be activated. Mice are very quick to respond so no hit or bounce would go unnoticed to the system(eliminating the line of sight issue). But all of the previously mentioned location of the hit event problems are still present.

so what i need is a way to detect ball on wall hit at the least. The wall will change, so i can not modify the wall very much, but the racquet and ball can be modified. I would also like to track who hit the ball (the game can be played in teams or by just 2).
I have a large projector that can easily cover the play wall (40 by 40 feet), this is how i plan to add the augmented reality aspect. When the ball hits the wall a graphic will display over the area where it bounced (imagine arcade fighting game style obnoxious display). I can do/learn some coding and am fairly handy with the animation and graphics for the AR.

any input you guys have would be appreciated. sorry for such a long post
By Chanler
#137530
Could you use a microphone or transducer attached or simply touching the wall to register the sound of the ball hitting to score the point? Maybe 1 on each side so you can tell if a hit is on the front wall instead of a side wall?

I think an acclerometer on the racquet might work to detect the hit, but it could also pick up scraping the edge of it as a hit as well. I'm not sure how to correct for that yet.
By visible noise
#137532
i could probably attach something to the wall to pick up hits (not sure how well this would work as the area that needs to be measured might be bigger than 40x40 feet).... but that would count every hit on the wall, from players bouncing into it (its a semi-contact sport so it gets messy sometimes) and racquets hitting the wall in an attempt to hit the ball.

Accelerometers could work, but like you point out they would not be able to differentiate what the racquet struck.

thank you very much for the reply and interest though! seems like few others are interested in my project


Maybe i should clear up the setup of the game court. its pretty much just a slab of concrete with one wall in front (the play wall) there is no other wall. the court you stand on is probably 40X25 and the vertical wall in front of that is 40x40. very simple.
By Chanler
#137614
Ok, I was thinking of a regular indoor racquetball court. A 4 story tall wall is an incredibly large surface! :) The only other thought I've had is maybe a piezo electric source in the ball that could generate a small current and be picked up on the racquets, maybe by some conductive thread or wire on the webbing.
By Mee_n_Mac
#137620
Chanler wrote:Ok, I was thinking of a regular indoor racquetball court.
As was I. This modified court simplfies things a bit. Let me muse aloud ...

Putting a sensor in a special ball isn't that hard. A system could be devised to know when the ball was hit or hit something (optical or RF). Ditto for the raquet, and I mean a hit on the strings. I'm less sure how this might be done, I can envision a couple of ways ... more if special stringing is allowed. So combining the timing of 2 such hits (ball + raquet) might be a good indication of a hit of a raquet on the ball (separating ball bounces and raquet strikes on other things). Knowing that the ball hit the front (and only) wall is a bit more difficult but it could be done if the court can be rigged (meaning you can't play this on any court). A wire mesh strung across the wall could and be used to detect a front wall hit. Then a simlar timing of ball + wall would tend to eliminate false indications. The question is how many $$s does this need to come in under to be worth doing ?
By visible noise
#137686
Chanler wrote:Ok, I was thinking of a regular indoor racquetball court. A 4 story tall wall is an incredibly large surface! :) The only other thought I've had is maybe a piezo electric source in the ball that could generate a small current and be picked up on the racquets, maybe by some conductive thread or wire on the webbing.
yeah, its pretty awesome to play on it. crazy game.

I thought a network of the ball and racquet too, But i have no idea how my computer would coordinate/manage/watch 6 points at the same time, wirelessly, and with out braking my tiny bank.
Mee_n_Mac wrote:Putting a sensor in a special ball isn't that hard. A system could be devised to know when the ball was hit or hit something (optical or RF). Ditto for the raquet, and I mean a hit on the strings. I'm less sure how this might be done, I can envision a couple of ways ... more if special stringing is allowed. So combining the timing of 2 such hits (ball + raquet) might be a good indication of a hit of a raquet on the ball (separating ball bounces and raquet strikes on other things). Knowing that the ball hit the front (and only) wall is a bit more difficult but it could be done if the court can be rigged (meaning you can't play this on any court). A wire mesh strung across the wall could and be used to detect a front wall hit. Then a simlar timing of ball + wall would tend to eliminate false indications. The question is how many $$s does this need to come in under to be worth doing ?
the (ball + raquet) within certain time limit is good. Id rather not restring the racquet, although they are owned by the players it seems like the string might come undone or pop from the tension.
Using a net is a good idea. but that's probably more than i can modify the wall. also probably out of my budget (1600 sq feet of conductive thread netting!)

both of you, thanks for the good ideas!

maybe i could use a very cheap [shock sensor + wireless transmitter] attached to the rim or handle of all the racquet's, and another in the ball. then on the wall place a sinlge Surface Transducer http://www.sparkfun.com/products/10975 or guitar pick up. turn the sensitivity wayyy up and the use the logic (racquet-shock + ball-shock + wall-shock)= point.
just thought of a problem here though; what if two players go for the ball, one hits it on to wall, logically this will equal a score. But through the logic there could be 3 results: score for both players, score for the player that didn't hit the ball, or a score for the player that did hit the wall. also what if a player randomly strikes an object while at the same time the ball bounces on the ground then onto the wall?

best thing would be if i could create a tinfoil ball, racquet, and wall. makes contact with tinfoil racquet then makes contact with tin foil wall = score. every hit would be properly accounted for. bounces (which are unlimited in the rules) would not even be part of the equation. also tinfoil of racquet + other tinfoil racquet + that racquet hits wall would not be be exploitable since each racquet hit would be accounted for. too bad everything isn't made of tinfoil

EDIT!:
it just hit me! cellular Bluetooth ear pieces can be found for cheap (propbaly). this could easily be the entire wireless backbone for the whole system. its small, light weight, and has a adequate bandwidth/responsetime.
By Mee_n_Mac
#137694
Again thinking aloud ... RFID is a short enough range system that you could embed an RFID chip in the ball and have a reader on the raquest activate when it detects a hit. It then reads the ball and if it gets a response it "knows" it was the ball the hit the raquest. The raquet then relays this data to the PC. However this now leaves open the questions on how to make the wall do likewise. The wall is too big for any single RFID reader and using many is probably too many $$s. I also wonder how small the reader/relay could be made. RFID is nice though in that the ball is only slightly modified but I think you want to record all ball bounces, not just those on raquets and the front wall ?

How are points scored in this game ?
By visible noise
#137707
very nice quick reply!

I probably should have a range of about 60 feet for good measure, can rfid do this? Bluetooth headsets can do about 30 feet max, which is about as low as i want to go.
how bulky would a reader be? Many seem to have a full arduino attached (which would add weight and bulk) and this might be slightly expensive. all the processing can be done on the computer so i would rather not have an arduino on every racquet ($$$!)

I don't really know if all bounces need to be recorded.

ill explain some of the rules
There are two players or two teams. (so 2 pr 4 people) each team has a front man and a rear player. the player in the rear is the server. The game is heavily based on combo's. When the server serves the ball it has to hit the wall, it can bounce only one time before hitting the wall. This initial wall hit is not counted as a point, it only establishes that the ball is now in play. Now any player from either team can hit the ball. Once the ball is hit it starts a combo, the number of times the team has the ball in their position and consecutively bounces the ball between them and the wall is the points value awarded for that combo. as soon as the ball goes out of bounds (very easy since there is only one wall) the combo is finished. as soon as the other team takes the ball and bounces it on the wall the combo is finished.
-also every time the ball goes out of bounds the team not at fault (the team that didnt touch the ball last) gains a single point.
-if the ball bounces more than once before it hits the wall the player who caused the multiple bounce is forbidden from hitting the ball until another player (from any team) touches the ball.
-the number of bounces off the ground is unlimited after it bounces off the wall.
-as long as the ball does not go out of bounds and does not hit the wall because the apposing team the combo is still open. (the other team can gain control of the ball, but as long as they don't hit the wall with it that team gains no points and the other team can regain control and keep adding to their combo)
-Players can block other players or the ball with their body or racquet, you can shove other people and racquet throwing is also legal, as long as no one is hurt.

scenario:
I serve the ball, and my forward partner bounces the ball 3 times and then hits it way too hard so it goes out of bounds. There would be a total of 4 ball+wall bounces. 1 from the serve (not part of the combo) and a 3 bounce combo. my team would earn 3 points and the opposing team would earn 1 point.

i probably didn't explain this very clearly.
By Mee_n_Mac
#137711
visible noise wrote:I probably should have a range of about 60 feet for good measure, can rfid do this? Bluetooth headsets can do about 30 feet max, which is about as low as i want to go.
No, RFID is generally good for inches, which was why I was thinking of it as a means to discern a raquet hit on ball combo akin to your "tin foil ball" above. However now I think more is needed anyway. See below.
visible noise wrote:I don't really know if all bounces need to be recorded.
ill explain some of the rules
...
-if the ball bounces more than once before it hits the wall the player who caused the multiple bounce is forbidden from hitting the ball until another player (from any team) touches the ball.
So do you want the PC to declare a fault or indicate the prohibition above is in effect (in real time) ? If so doesn't that mean (multiple) floor bounces must be detected and counted somehow ? IOW this means knowing more than raquet+ball and wall+ball hits. And such ball on floor hits must be detecable and reportable to the PC all over the 40x25 court.
By visible noise
#137728
yeah, you're right floor bounces might need to be accounted for as well. Or maybe we will just change the rules to allow unlimited bounces in every situation and is the serve is double bounced then the game will not know the difference anyway, or a key to clear the last point(s) can be pressed
By Philba
#137734
Interesting problems here. Kind of fun idea. Probably not terribly practical though...

One thing I've been wondering about is wall hits. How to tell where the ball hit? You have a 2D surface and a strike anywhere creates a circular wave front with a certain propagation speed. I believe the speed is probably in teh vicinity of the speed of sound in something like concrete but it's probably not critical. 4 sensors at each edge of the surface will detect the wave at different times based on where the strike occurred. You should be able to determine the position of the strike based on the relative timings. Hopefully the actual wall is of fairly homogeneous construction. but even a few imperfections may be ok. The math isn't coming to me right away so I'll have to think about.

The sensors could be piezo though I don't know enough about them to be certain.
By Philba
#137737
turns out it wasn't that hard using a little trig. (rule of cosines and defn of sin and cos)

You do have to determine the speed of propagation as you need to know the propagation distance between sensors.
Philba wrote:Interesting problems here. Kind of fun idea. Probably not terribly practical though...

One thing I've been wondering about is wall hits. How to tell where the ball hit? You have a 2D surface and a strike anywhere creates a circular wave front with a certain propagation speed. I believe the speed is probably in teh vicinity of the speed of sound in something like concrete but it's probably not critical. 4 sensors at each edge of the surface will detect the wave at different times based on where the strike occurred. You should be able to determine the position of the strike based on the relative timings. Hopefully the actual wall is of fairly homogeneous construction. but even a few imperfections may be ok. The math isn't coming to me right away so I'll have to think about.

The sensors could be piezo though I don't know enough about them to be certain.
By visible noise
#137740
good stuff their Philba!
problem is that i have no idea how i would place 2 out of 4 of the sensors. its a huge bar wall, with a ladder to the roof on one side which i could use to place the first two sensors. the other side has no way to be scaled. on top of that the wall seems to be built in sections metal strips are run horizontally across the wall every 10-15 feet

also, i have no idea where to start coding an algorithm like that in and then implement it in the flash video.

i think that if i can get multiple angles using wii remotes, directly above the play wall facing down and another on the ground facing the wall the computer could more accurately tell where the ball hit...maybe?
By Philba
#137741
visible noise wrote:good stuff their Philba!
problem is that i have no idea how i would place 2 out of 4 of the sensors. its a huge bar wall, with a ladder to the roof on one side which i could use to place the first two sensors. the other side has no way to be scaled. on top of that the wall seems to be built in sections metal strips are run horizontally across the wall every 10-15 feet

also, i have no idea where to start coding an algorithm like that in and then implement it in the flash video.

i think that if i can get multiple angles using wii remotes, directly above the play wall facing down and another on the ground facing the wall the computer could more accurately tell where the ball hit...maybe?
After playing with it a bit, I think you could do it with 2 sensors. The math is that once you know length of all three sides of a triangle, you can figure out the angles (cosine rule and then sine rule). take a look at this http://www.teacherschoice.com.au/maths_ ... ig_sss.htm Once you know the angle and length of a line segment, you can figure the x and y position of the end point (based on the definition of sine and cosine). You'd have to measure the speed of propagation to determine the distance based on time but that should be pretty easy.

You could build a little device (small arduino would work) that reads the sensor data and sends the cruched position data to be further processed.
By Mee_n_Mac
#137753
Philba wrote:
visible noise wrote:After playing with it a bit, I think you could do it with 2 sensors.
I'm pretty sure you need 3 sensors to find the solution. Since you don't know when the hit happened but only the time difference of the arrival of the pressure wave at the sensors, and nothing about the angle of arrival, three shall be the number of thy counting**. :mrgreen: Now if you had a monopulse system for each of your 2 sensors ... Think of it this way ... plot all the points on a plane that could have the same difference in arrival times for any 2 sensors at any 2 points in that plane. It'll be a line and not a point.

In any case this does raise an interesting question re: the construction of the wall. Were it to be a wood wall (or something that carried a raquet ball hit vibrations well), you could do what these guys did. Similarly there was a retail 3 sensor system, that I shamelessly copied (but using 4 mics for simplicity), that did mostly the same thing (years ago) for a rifle range target. It listened to the supersonic shockwave of a bullet passing btw the microphones. This general concept might work for determining where (precisely) some hit on the wall happened, but it doesn't seem to distinguish btw ball hits and player or raquet strikes. And that's what I'm pondering how to do now, given the desire to know ball hits on the floor as well as those on the raquet and front wall. This may take a few beers !

** http://www.youtube.com/watch?v=xOrgLj9lOwk