In short, a simple project with a simple goal -- to supplement humankind's natural table tennis reflexes with state-of-the-art machinery and thereby do the impossible: build a better ping pong player. Over time, Pong Assist may evolve, but its central tenant is unchanging: To Help the Unskilled Become the Skilled, To Help the Weak Become the Strong.
Saturday, February 23, 2013
Wii Nunchuk Application?
I was browsing through Make Magazine, volume 33 when I came across an article talking about how easy it was to link the Wii Nunchuk with an Arduino, using a software found here: http://www.gabrielbianconi.com/projects/arduinonunchuk. I followed the steps in the magazine, downloaded the software, and am now getting what appear to be accurate readings from a Wii Nunchuk. I'm really excited about this, because I knew I'd need to get an accelerometer at some point (to determine the incoming speed and angle of the Pong Assist paddle and factor them into deflection calculations), and now I've found one that is inexpensive, easy to use, and already within my possession. You don't even have to strip the wires on the Nunchuk to hook it up! The software pulls z, x, and y acceleration data (which is what I'm really interested in) as well as x and y analog information (from the joystick). It also keeps track of whether the c and z buttons on the Nunchuk are being pressed. I don't have a clear idea yet of how I might use this x and y analog or c and z button information, but it's exciting to know I have it just in case a use for it should appear. I plan on sorting through this info in the near future, but because of all the work that still needs to be done with my simulation program, as well as with the motor shield (which is still waiting for additional parts that are taking forever to get), it might be a little while before I work out anything terribly concrete. It's still exciting, though!
Figured Out Ball Deflection!
I'm pretty certain, to my extreme excitement, that I've figured out how a ball will deflect when it hits the paddle face. I built a model of the set-up in SketchUp and I've uploaded it to the SketchUp "3D Warehouse" online. It can be found at this url: http://sketchup.google.com/3dwarehouse/details?mid=7ba4f58e1e339f475e370fe52ecbc42c&prevstart=0. To navigate the model (unfortunately you need to have SketchUp to do so, but it's a free program and great to have anyway), access the model's layers (found under "window") and turn layers on and off as desired to view different steps of the calculation process. I should point out that the model doesn't apply to all velocity calculations that might eventually have to be done, it's just a representation of how deflection would be calculated in a single case. I'm still working on developing a system of equations for determining resultant ball angle from initial ball angle. Once I have that system of equations, I'll run it through Maple 13 (a handy algebra tool I just got and am still learning to use) and (hopefully) derive a single equation that I can then program into my Processing simulation.
Explanation of Model Variables:
Because of the 3D nature of these calculations, the variables used in this model correspond to the spherical coordinate system, a method suggested to me by the teacher of the class I'm doing this for, and a quick description of which can be found here: http://www.youtube.com/watch?v=hLqexFPSV-w
Specifically, the variables I use are:
- initial ball theta (θb): the angle to the x-axis at which the ball encounters the paddle
- initial ball phi (
b): the angle to the z-axis at which the ball encounters the paddle
- paddle theta (θp): the angle to the x-axis at which the paddle tilts
- paddle phi (
p): the angle to the z-axis at which the paddle tilts
- mu (μ): the complimentary angle to b
- final ball theta (θbf): the angle to the x-axis of the ball, with respect to the paddle normal
- final ball phi (
bf): the angle to the paddle normal of the ball
- NOTE: the resultant θ and
of the ball after collision, with respect to the paddle, are indicated to be equal to θbf and
bf, with the assumption that angle of incidence equals angle of reflection
- resultant ball theta (θbR): the angle to the x-axis of the ball after collision with the paddle
- resultant ball phi (
bR): the angle to the z-axis of the ball after collision with the paddle
In this model, the values for these variables are:
- bθ = 0º
- b
= 20º
- pθ = 90º
- p
= 20º
- μ = 70º
- θbf = 45º
-
bf = 27º
- θbR = 119º
-
bR = 43º
The lengths of certain lines are also labeled based upon their length in pixels. They were labeled in pixels and not in cm because pixels are the standard unit for distance in my simulation program.
I also plan to upload a video of my model with an explanation of how it works in the near future, so that it isn't necessary to download SketchUp. However, in the mean time, this is what I've got.
Explanation of Model Variables:
Because of the 3D nature of these calculations, the variables used in this model correspond to the spherical coordinate system, a method suggested to me by the teacher of the class I'm doing this for, and a quick description of which can be found here: http://www.youtube.com/watch?v=hLqexFPSV-w
Specifically, the variables I use are:
- initial ball theta (θb): the angle to the x-axis at which the ball encounters the paddle
- initial ball phi (
- paddle theta (θp): the angle to the x-axis at which the paddle tilts
- paddle phi (
- mu (μ): the complimentary angle to b
- final ball theta (θbf): the angle to the x-axis of the ball, with respect to the paddle normal
- final ball phi (
- NOTE: the resultant θ and
- resultant ball theta (θbR): the angle to the x-axis of the ball after collision with the paddle
- resultant ball phi (
In this model, the values for these variables are:
- bθ = 0º
- b
- pθ = 90º
- p
- μ = 70º
- θbf = 45º
-
- θbR = 119º
-
The lengths of certain lines are also labeled based upon their length in pixels. They were labeled in pixels and not in cm because pixels are the standard unit for distance in my simulation program.
I also plan to upload a video of my model with an explanation of how it works in the near future, so that it isn't necessary to download SketchUp. However, in the mean time, this is what I've got.
Wednesday, February 13, 2013
Paddle Simulation 3D Model
In an attempt to gain some sort of handle on the math that needs to be done to calculate the trajectory and velocity of the ping pong ball after it strikes the paddle, I used Google SketchUp to creat this 3D diagram of the setup used by my simulation program (you'll notice that the axes of the diagram are all labeled in pixels). I haven't gotten a chance to use it much yet, but hopefully it'll help. In terms of the actual math, I'm currently researching spherical coordinates, because I think they're the only way I'm going to be able to account for the three-dimensional nature of the ball deflection. More on that adventure to follow.
Monday, February 11, 2013
More on Pong Assist Simulation
Here's another video of my simulation program, which has some updates (including a very classy intro screen, an ability to input ball approach angles, and the factoring-in of the ball's coefficient of restitution in resultant velocity) but which still lacks the ability to properly deflect the ball. I'm finding vector addition in three dimensions to be rather dicey (I'll be posting the rather long derivation I required just to determine velocity in the Z direction), but as soon as I get that figured out, the program will be well on its way to full functionality. All I'll have left to do is factor in initial paddle velocity, apply kinematics equations, and add additional views. Which is actually kind of a lot, but I'm optimistic!
Wednesday, February 6, 2013
Pong Assist Simulation Program *UPDATE*
For the last week or so, all I've really done is work on my simulation program. I hadn't really done much with processing up until now, so I've been kind of feeling my way through it, but I'm really happy with what I've gotten done so far, so I decided to post an update. A few features I'm really proud of:
- Window is re-sizable (though text isn't, for some reason)
- Motor angle indicators gently fade from full-color to white depending on severity of angle (very classy-looking)
- Ball launches at the same speed (in m/s) regardless of a computer's processing power, as its relative velocity in the program is calculated taking into account the frame-rate the Processing program is running at.
These exciting new features and many more can be seen in the video below!
My intended next step is to get a ball rebound that corresponds to the angle of the paddle, then began taking additional factors (such as initial angle, paddle velocity and the ball's coefficient of restitution) into account. Finally, I'll begin working on additional views, though I think I may organize them differently than I originally intended to.
- Window is re-sizable (though text isn't, for some reason)
- Motor angle indicators gently fade from full-color to white depending on severity of angle (very classy-looking)
- Ball launches at the same speed (in m/s) regardless of a computer's processing power, as its relative velocity in the program is calculated taking into account the frame-rate the Processing program is running at.
These exciting new features and many more can be seen in the video below!
My intended next step is to get a ball rebound that corresponds to the angle of the paddle, then began taking additional factors (such as initial angle, paddle velocity and the ball's coefficient of restitution) into account. Finally, I'll begin working on additional views, though I think I may organize them differently than I originally intended to.
Subscribe to:
Comments (Atom)