PDA

View Full Version : [Discussion] Wishful Thinking?



trevben1
05-01-2009, 10:44 PM
Hey all,
I am a second year mechanical engineering student and I was considering working on a project with two second year computer engineering students. I have little to no practical experience working with electronics and control systems and they are not to much better at this point. The project is to build a robotic foosball player for one side of the table. The question is do you think its possible for three amatures to take on a project like this?

I love to mess around in my garage and I have the tools available to me. Love to hear your opinions, I know what general sensors and motors I could use and between the three of us we can definitively work out the programming.

Adrenalynn
05-02-2009, 12:51 AM
Welcome to the forum!

Absolutely the three of you could take on that project. I'd be interested what you'd use, I have a few ideas myself, and I'm sure others here would find that the kind of fascinating project that would draw them in.

Sure - by all means you guys would have a blast with that project - I would. :)

Do you have a major deadline? Any budget in mind?

jes1510
05-02-2009, 01:16 AM
I thought I had seen something like this before. Perhaps this could give you a starting point:
http://www.informatik.uni-freiburg.de/~kiro/english/index.html

lnxfergy
05-02-2009, 09:08 AM
Motorizing the foosball controls for one side of the table shouldn't be terribly hard. The part I think you'll find challenging is the control of those motors, how do you propose to keep track of the ball and decide where to place your men? A possible solution I could see is to mount a camera over the table so it gets a world view (similar to what the human competitors get...).

-Fergs

trevben1
05-02-2009, 09:58 AM
Good to hear! I'm much to obsessed with the idea to back down now lol.


Do you have a major deadline? Any budget in mind?

We have no deadline but we are paying our way through university so we'll probably try to keep it fairly cheap. We might just do the goalie and the first defence line to start if it's going to be very expensive. That way we can at least start on the programming.


how do you propose to keep track of the ball and decide where to place your men? A possible solution I could see is to mount a camera over the table

The ball is the biggest problem. From the automated tables I've seen they all use video tracking systems but there is no real competitive automated player out there yet. Here's a video of one finished design, YouTube - Final autonomous foosball demonstrastion.

Does anyone know of a better way to track the ball? Tracking the players can be done with more than enough response time with pots but the ball... I just have no idea lol. Just a shot in the dark though, is there any touch pad/touch screen technology that could be used?


**PS** Is this the right place to be getting advice and discussing a design for this?

Quantum
05-02-2009, 01:15 PM
You could go this route a little more building involved. How about a bed of micro tactile swtches. The smaller they are the more resolution/accurate ball placement. The processor you would use would have plenty of time to react and calculate placement. The thing that would slow you down would be the actual mechanics of the project. The servo/stepper motors speed. A thin sheet can cover the switches with just the nipple part stick up past the floor. This way the ball will still roll smoothly while pressing each switch.

A couple hundred switches. Thats a massive grid to build and software writing task. But would be alot faster that video recognition.

trevben1
05-02-2009, 02:02 PM
hmm... The only concern that I would have with that is the size of each switch would limit the resolution. What kind of hardware could you use to bring all that information into a single position output? Keeping in mind that I'm completely new at this, would you use a seperate I/O board and then send the output to the main I/O board or is there an easier way?

EDIT: Ok I've looked into this and from what I can make of it you use a prototyping board that then sends a signal (digital/analog?) back to the I/0 board. I think...

I also started to look into infared sensors that could be used along the bottom of the playing field beneath the players feet. Ideally with strips of sensors and IR emitters along the x and y axes but I haven't found one yet. Also does anyone know what range of frequency infared sensors operate at?

DC Robotic
05-02-2009, 08:25 PM
Just an idea.
Seems that what you really want to focus on is where the ball is going, not so much where it is. This will be very important to compensate for the time of mechanical traverse of the players. Maybe use a grid of beams beneath the plane of the feet. I don't think you would actually need that many as you could log beam breaks and time and, using some trig, generate a vector and velocity which would tell you where to put the players. You will have to "know" where your players are, so you will be utilizing encoders or some position indicator. The project in the video used dynamixels which you can poll for position. Once you know the speed of your mechanical system you can calculate intercepts to your projected ball position. Basically I think the whole key to the project will be "projecting" or anticipating the ball position.

Adrenalynn
05-02-2009, 09:15 PM
I'm still voting for video. High contrast field, high contrast players, regularly shaped ball.

trevben1
05-02-2009, 11:14 PM
grid of beams beneath the plane of the feet. I don't think you would actually need that many as you could log beam breaks and time and, using some trig, generate a vector and velocity

Seems like a good alternative even if I used IR distance sensors facing horizontally, or length wise on the field at regular intervals. As long as the spacing was small enough that the ball will catch at least one of the distance sensors you'd be able to use an algorithm to figure out the exact placement fairly easily. But again my main concern is speed, are IR sensors quick enough??


I'm still voting for video. High contrast field, high contrast players, regularly shaped ball.

Obviously the motors and servo's from the video that I posted could be upgraded to be faster and the porgram can be modified to run smoothly but I'm still concerned with wether or not the video tracking can react quick enough to follow such a fast paced game.

Adrenalynn
05-03-2009, 12:43 AM
All depends on the camera, frame grabber, and what you have chunking the numbers.

lnxfergy
05-03-2009, 09:39 AM
.... but I'm still concerned with wether or not the video tracking can react quick enough to follow such a fast paced game.

If you can get the frame rate up to 30fps... heck even 20fps, you could compute trajectories of the ball from a few frames of data.... that should be good enough to beat most humans, as our visual systems aren't gonna operate at any higher of a rate.

If you want to make it easier on yourself to build... add feedback for rotation and distance of the human side rods. That way you are only using vision to track the ball, and you already know where the human opponent's men are. Although, at that point, you might end up building a system that you can't beat.

-Fergs

trevben1
05-03-2009, 11:36 AM
Ok I've done a little bit of research and found the human eye percieves a video to be fluid at anywhere from 20-30 fps which is no problem for a video camera. I've also looked at a few of the algorithms (the magic of wikipedia :wink:) for video tracking and am still unconvinced that they will be quick enough. But I'm having trouble finding any numbers on response rates, does anyone know of a site that has the technical information on video tracking products that could work for this project?

gdubb2
05-03-2009, 11:46 AM
Have you looked at RoboRealm??

http://www.roborealm.com/

Gary

Adrenalynn
05-03-2009, 01:34 PM
I respectfully disagree with wikipedia then [snicker].

I'd be willing to pit my experience (~30 years in digital video processing/compression/streaming) against its entire existence. Bonus-points if we can delete that scourge when I win. ;)

trevben1
05-03-2009, 04:02 PM
'm willing to trust your judgment over wikipedia lol but the idea of video tracking is a daunting prospect. Leaving my electronic comfort zone more and more each day lol.

So ok lets assume I take this route, what do I need? Looking at the site Gary suggested (http://www.roborealm.com/) I'd need a decent camera and I just hook that up to a computer and run a tracking program?

trevben1
05-03-2009, 08:33 PM
Ok! Finally have some test data :D
I took apart the table I'm going to be working with and made a 5cm X 5cm grid on the playing field then using a stop watch and a camera was able to go through the video frame by frame and estimate the ball's velocity. There was a huge variance between 3 and 13 m/s but the average was 7m/s. The variance can be associated with the stop watch that only worked in 30 millisecond increments and the camera that was about 40 milliseconds between each frame.

Adrenalynn
05-03-2009, 08:41 PM
40ms per frame? What kinda camera was that, and what was it connected to?

An NTSC camera is about 59.948 fields/sec. A firewire or pure digital camera will be 60 fields/sec for NTSC (drop-frame happens on the back side). ATSC can run up 120 fields/sec or even higher.

trevben1
05-03-2009, 08:49 PM
I was using a run of the mill digital camera, the movie feature is more of an afterthought than a proper feature. I don't really have any electronic resources available to me apart from the basics.

Adrenalynn
05-03-2009, 10:20 PM
Ahh. Yeah, a cheap camcorder and even cheaper frame grabber is definitely the way to go.

trevben1
05-03-2009, 10:35 PM
Oh wow you make me work adrenalynn. But its good the more I look around the easier it gets to interpret all the random information lol. Frame grabber seems to be a pretty straight forward concept. But it's not really neccesary at this point. The point of this test was just to get an idea of what kind of response the ball tracker is going to need.

So assuming 7m/s is an accurate ball speed we could say a maximum of 10m/s if we wanted to be safe and knowing that each line of players can interfer with the balls trajectory every 10cm and block the field of vision of the camera, will the video tracking do the job? And if so what components do I need to start looking for?

Adrenalynn
05-04-2009, 12:22 AM
Sorry - I approved your post. That anti-spam stuff is proving to be pretty obnoxious. Might have to give Alex a shout tomorrow. So far, it's been zero for dozens against real spam, but it's killing legitimate posts left and right...

Right, so, the playing field is about 4' by 2' or so, right? Or about 1.2m by 0.6m? The ball is traveling 7m/s, so it can traverse the entire table in about .17 seconds. If you split the video into fields, you should have a resolution of about .017 sec/field - of course, those need to be reconstructed, but just ride it out with me. That means that in a wost-case scenario you'll get about 10 frames of video for that field traversal. So you should know absolutely where the ball is to within 12cm. So from there, you need to do intraframe prediction. Given that it's a pretty straight-forward vector, that's pretty simple. We only need to "amplify" that precision to about *12 anyway.

Does that sound about right? I'm running late to get to the store before they close so that's all off-the-cuff without a lot of consideration...


Roborealm would be ok for a proof of concept, but unless you throw some hardcore hardware at it, it's not going to be the be-all-end-all. I don't think you can get at the individual fields, only at the frames (30/sec) anyway.

I do motion prediction on non-vector sources to about 1200fps on a quadcore at full D1 resolution. But that's pretty tightly optimized code. If I were doing the project, I'd probably see how much I could offload onto FPGA first... But anywho - yeah, I still think it's entirely doable.

trevben1
05-04-2009, 06:51 PM
:0 I can kind of follow the logic of that, but you lost me in the last bit. Let me read this to you as I see it...

Fields I'm assuming is a breakdown of the playing field into 10 sections (~12cm each) so it would take .017 seconds to cross one field. So then worst case senario I would get 10 frames of video for
option A: the full field?
option B: Each individual field?
Then using vector projection you can calculate the position in between frames.

Next, roborealm will not do the job

Then you lose me. If I had a lets say 4 knowledge level you'd be explaining things at about an 8 right now lol.
FPGA = Field-programmable gate array, so I'd use this to run my program to get the position of the ball?

Here are some dimensions (let me know if there are any others you would like to know):

--> Field is 110cm by 55cm
--> Between each player stick ~ 13.5cm (that is the technical term in case you were wondering)
--> Each player is 6.5cm from the stick down and is 0.5cm off the field when in a vertical position
--> The ball's diameter is 3cm
--> The distance between lines of players that the ball can not be touched by either lines is only about 0.5cm, 3.5cm if you count the ball diameter

I'd assume you'd need smaller fields because for a majority of the playing field the trajectory can be affected.

Adrenalynn
05-04-2009, 09:42 PM
Just a quick response since I'm swamped at this instant - more later:

"Field" is in reference to the video, sorry for the confusion!

NTSC video is made up of two interlaced "fields", a high and a low, each 240 lines. So you have 720x240 high and 720x240 low. That's why a VCR or an early/cheap DVD was only 240 lines of resolution. Each field happens about 29.94 times per second. If you go at the individual fields you halve your resolution but double your rate.

Hope that helps! More later!

trevben1
05-05-2009, 04:49 PM
I think I want to stay away from video tracking for now and try some proof of concept tests with different sensor setups.

There are two that I want to try:

1) I want to try making an arry of mini inductors under the playing field. Then insert a magnet into the ball, theoritically in a world where things I guess at work the magnet will affect the magnetic flux field of the inductor and affect an excitation voltage's output. Since everything is so chaep Im mostly just curious than anything.

2) I also want to try the mini tactile switch idea. It seems like it should work and they are really really cheap. I'm not sure if they the ball will be able to trip the switch at hight speeds though so I want to see if it'll work

lnxfergy
05-07-2009, 10:12 AM
I think I want to stay away from video tracking for now and try some proof of concept tests with different sensor setups.

There are two that I want to try:

1) I want to try making an arry of mini inductors under the playing field. Then insert a magnet into the ball, theoritically in a world where things I guess at work the magnet will affect the magnetic flux field of the inductor and affect an excitation voltage's output. Since everything is so chaep Im mostly just curious than anything.

2) I also want to try the mini tactile switch idea. It seems like it should work and they are really really cheap. I'm not sure if they the ball will be able to trip the switch at hight speeds though so I want to see if it'll work

How do you plan to interface to all those sensors... seems like to have any resolution on your table, you'll have several hundred inputs, maybe more...

-Fergs

trevben1
05-07-2009, 10:43 AM
its definitively going to be a huge array of sensors, but using a breadboard I can connect it all. Both the inductors and the tactile switches will have an analog output and that's pretty much where I draw a blank lol. I know enough basics to know what kind of sensors I could use but I need to depend on both these forums and a few friends and friends of friends in the field that I've been trying to get a hold of to fill in the blanks in between.

lnxfergy
05-07-2009, 10:55 AM
its definitively going to be a huge array of sensors, but using a breadboard I can connect it all. Both the inductors and the tactile switches will have an analog output and that's pretty much where I draw a blank lol. I know enough basics to know what kind of sensors I could use but I need to depend on both these forums and a few friends and friends of friends in the field that I've been trying to get a hold of to fill in the blanks in between.

But that's what I'm saying... that many analog inputs can get quite expensive... If you start using lots of Analog-to-digital multiplexors, you might miss the ball hitting a particular one. A 10x10 grid, is almost no resolution, and is already 100 analog inputs. A few samples of ways to get 100 analog inputs:

3 of these (they have 36 analog ports) http://acroname.com/robotics/parts/R297-SD84.html
thats a whopping 3x$126!

Or for the phidgets crowd out there:
12 of these (they have 8 analog ports) http://www.trossenrobotics.com/store/p/5341-InterfaceKit-8-8-8.aspx
thats a whoppong 12x$62 = 744!

Tactile switches could be digital... but even then, reading that many ports (over USB) could get quite slow, you'll probably have to move the processing down to a microcontroller that can just output the position... but that means you need a micro with 100+ pins (assuming digital inputs), which really means 2+ micros.

I really think you're gonna want to look at the video solution... it really will be cheaper and less time consuming in the long run.

-Fergs

trevben1
05-07-2009, 11:58 AM
Thanks for your input that was very helpful. But there is a possible alternative for the inductor method if the magnet creates enough of a disturbance in the magnetic field to affect multiple inductors at any given point. If you look at the little diagram I made below it represents how you could connect lines of inductors in series in a meshgrid style. By connecting every second inductor in a row in series and then doing the same for each column and measuring just one ouput for every horizontal line and vertical line of inductors you could translate that into a position.

|-|-|-|-|
-|-|-|-|-
|-|-|-|-|
-|-|-|-|-

'-' represents an inductor connected in series horizontally
'|' represents an inductor connected in series vertically

ScuD
05-07-2009, 03:57 PM
I'm wondering if it could be possible to triangulate using say 4 coils, but instead of a magnetic ball, put some beefy magnets in the center of the coils and use a ball bearing or such as a ball. Think of a guitar pick-up system.That's only two analog inputs, though i suspect you'd need a fair amount of amplification at these scales which introduces a bunch of other problems :)

As for the switches, you could use them to switch through a resistor ladder and use an ADC to determine which button was pushed.

jes1510
05-07-2009, 04:07 PM
You could also use compasses or hall effect devices if the ball is magnetic. If it isn't then the set of inductors could all be set up in oscillators and you use a metal ball bearing as a ball. The frequency of the oscillation would change as the ball comes near and changes the inductance.


Honestly in my humble opinion the best bet is a camera. I think that is the only way you are going to get the resolution that you need.

Adrenalynn
05-07-2009, 10:09 PM
I wanna see those "players" spin up and hit a steel ball bearing with enough force to propel it 10m/s. When you find a fraction of the plastic shards that are the remaining pieces of them, take a photo...

I thought table soccer was the goal [no pun] here... Wouldn't that dictate a regulation ball/players/goals/etc?

trevben1
05-08-2009, 06:15 AM
Just found another automated table. The 'foosbot' uses IR sensors like I mentioned earlier, with emitters on one side and recievers on the other, for both axes.

YouTube - Foosbot

Here's a bit of the information on it, http://www.sushi-suzuki.com/designer/files/FoosbotPoster.pdf. Pretty cool and way better than anything I've seen up to date.

Still scared of video lol. the beauty of the magnet and inductor idea is that the inductor should be affected as a function of distance instead of just a switch that is either on or off. The downside of course as Adrenalynn mentioned is that although it may not affect the game to much, the ball would not be regulation weight unless the magnet is really small and I use an alternative plastic to counteract the difference.