Thursday, December 6, 2012

Role of the Kinect

So I realized I haven't talked much yet about how I'm planning on using the Xbox Kinect in my project, so I'll get into that a bit now. The purpose of the Kinect is going to be to track the ping pong ball's speed and track its progress and velocity so that I can determine the trajectory and speed of the ball. This will be one of the components (along with the paddle accelerometer) that helps the paddle decide which angle to move to. To program the Kinect to do this, I've decided to use a combination of Processing and the SimpleOpenNI package, which will grant me access to the depth data and some of the tracking capabilities of the Kinect. Because there's very little beginner information on this type of programming available online, I actually purchased a book (Making Things See: 3D vision with Kinect, Processing, Arduino, and MakerBot) by Greg Borenstein) to get me started. I'm a ways into it now and finding it to be a great book for beginners like me. It moves at a steady pace, covers interesting and applicable topics and is extremely thorough in its explanations, which is great for someone like me, who has almost no idea what's going on otherwise.

Paddle Components Compiled

So I've put the two components of the new paddle together and have it hooked up to the paddle face. At first I was worried about how the two were going to cross over each other, but my cs teacher suggested I just make the arms a little longer on one, which made sense to me and didn't require any major changes to the mechanics of the system, so that's what I did. Then I hooked the two up perpendicular to each other and gave it a go. Unfortunately, I found the system was just too stiff to be moved as intended by the motors (my motors are pretty cheap and have very little torque) so I switched to a smaller center gear to increase the gear ration between the motor and the lever arms. It was still too stiff though, so I shaved some plastic off of the housing of each of my ball joints, which helped enough that the system now moves. However, I'm still not happy with the range of motion I'm getting or with the amount of torque it takes to produce that motion. I've spent a fair amount of time trying different combinations of lever shapes and angles for the arms, but so far nothing has made much improvement at all. Finally, I also added a system on to hold the motors in place, and I'm now just about ready to give the system a try, albeit with the disappointing range of motion.

Pictures:







New Paddle Components

So here is a prototype of the new paddle design. I used roughly the system outlined in the diagram from my last post, but found I had to add an extra section to each sub-arm in order to get the proper range of motion. In addition, I used pieces of varying curves / angles to ensure that the moving arm components would always be pulling at at least a slight angle against their counterparts and, thus, have the torque required to make the system move. I've included some pictures of the various components, as well as embedded a couple videos of those components functioning.

Pictures




Two Motor Setup

So I did some thinking about the movement of my paddle face, and I figured out that there are basically only two ranges of motion, as illustrated below:




The board really only moves in the basic directions A, -A, B, -B, and all other movements are compounds (A)(B) (A)(-B) (B)(-A) (-B)(-A) so as a result, it really doesn't make very much sense to use four motors for two degrees of motion. Keeping this in mind, I came up with this idea for how to move two arms with one motor. In theory, there would be two of these controlling the four arms. Note: gears are represented by circles in the below diagram:



Adafruit Motor Shield

So, while searching for a way to power my motors externally, I read about the Adafruit motor shield, which allows me to use a separate power source for my motors than for my arduino, hopefully eliminating any strange, uncontrollable motor movements (as I have had problems with motors drifting in the past) while also allowing me to use only one Arduino to control my system. While this is really pretty heartbreaking given how much time I put into my i2c setup (for more proof of that see photos of i2c setup below), I figure its a good decision, given how much it will simplify communication to let everything be handled by one board. In addition, it will solve my i2c problems, mostly  because I won't be using i2c anymore. Still, its possible that I might need i2c later on if I find that one Arduino can't handle all the calculations fast enough to respond to the kinect data, so the research and construction I did could still end up proving useful.

The one drawback of the Adafruit motor shield is that it only allows you to use two servo motors at onec (and 4 DC motors and 2 stepper motors). Obviously, as my current setup uses four motors, I'm going to have to make some major re-designs.

Tuesday, December 4, 2012

Starting Over / Pictures


Well, I've realized through some research a number of things that basically sums to me recreating most of my paddle and wiring setup. There'll be more on why I'm doing that and how I'm going to do it later, but in the mean time I just wanted to include some pictures I took of where the project's at now before I pretty much rip the entire thing apart and re-construct it. So it goes.

Front Overview


Front Closeup


Side Overview


Mechanism Closeup


Back Overview


i2c Setup Board Overview



i2c to Paddle Connections



Full Setup



i2c Wiring



Component Wiring



Components


i2c Setup Schematic


Depicted below is a schematic of my i2c communication setup that I made using the Arduino modeling program Fritzig. The i2c is basically being used to distribute the four servo motors and various other components between a number of different Arduinos with different power supplies, because the servos draw so much energy that I can't run more than one or two of them off of one board at any time. I'm having a lot of issues, though, with the Arduino program hanging every time I try to call a wire.write fuction. Although I've confirmed that the i2c setup works when the other components are disconnected and that the other components work when the i2c is disconnected and that all of my code is sound, I just can't seem to get rid of the hang. I posted the problem here on Stack Overflow, but the feedback I've gotten has been discouraging and suggests that the problem might be the Arduino library I'm using. This is pretty much a disaster because its far beyond my programming abilities to use a different, less intuitive library. I did, however, get some help on the Arduino forum here that suggests that the problem could be that I'm not splitting power for the motors. As a result, I think I'm going to have to look into external power for my motors if I want any chance of this working.


Logo

At one point I wanted to work on my project but didn't really feel like doing to much thinking. This Pong Assist logo was the result:


Since then I've been putting it on pretty much every part of my project, including the background of the blog, so plenty will be seen of it.

Sunday, December 2, 2012

Introduction / Mission Statement


Table tennis, sometimes know as ping pong, is one of the world's most popular games, known and played to some degree of expertise by roughly 300 million people worldwide. However, despite its popularity, one of the chief difficulties of the sport, as with any game of skill and reflexes, is that a superior player struggles to feel excitement playing with a person of lesser talent and a less-talented player suffers continual humiliation and discontent at their own lack of ability. Pong Assist is an attempt to solve, or at least mediate, this problems of unequal skill balance in the playing of table tennis. Through a combination of human reflexes, synchronized motors, and the Xbox Kinect, Pong Assist enables a weak player to gain a leg up in controlling ball direction and trajectory when playing against a stronger opponent. The systems functions in a number of discreet steps. First,the opposing player hits the ball. After it passes the net, the Xbox Kinect begins to track it. Next, based upon the numbers detected by the Kinect, the ball's final trajectory and speed are predicted. The Pong Assist user then moves to hit the ball. Their movement speed is determined by an accelerometer. This value is then added to the equations being computed. Finally, based upon the predicted trajectory, predicted speed and user's own movement, the angle of the Pong Assist paddle is altered by a system of coordinated motors so that the ball will be hit squarely back onto the other side of the table. The main effect of this system is to reduce the number of factors a player must focus on when playing, allowing the to instead concentrate their energies simply on getting the paddle in front of the ball. In this way, the supplemental mechanics neutralize natural physical advantages. Pong Assist will also have an option for reducing sensitivity, so that as a player improves, they can be slowly weaned from mechanical assistance to rely only upon their improving physical abilities.

Tuesday, November 6, 2012

Hello

Welcome to the official blog of Pong Assist, a project to create a robotic table tennis paddle to aid players facing more skilled opponents. I started this project months before this blog, but I'm still going to post all my steps and discoveries leading up to the present in an attempt to document all the many varieties of my successes and mistakes. As a result, it will look like I'm making really rapid progress for a while based upon the post dates, but I assure you that I'm not. I'm just making up for lost documentation time. Still, eventually my posts will catch up to the present. With all that said, I hope you find the site helpful or intriguing at the very least.

       -BP