Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to identify backhand and forehand shot using accelerometer?

An accelerometer has three values : x, y, z.

Let's imagine a racket has an accelerometer. if I put the racket face up, I know where are the directions of x, y and z. However, if I flip the racket and put it up side down. The value of x, y, z is in opposite directions.

In other word, if I hit the ball to x direction with my backhand, it is possible i can get positive or negative x value. (This is depending on whether I flip the racket or not [Racket has two faces]).

My question is How can the sensor tell me that I am hitting the ball using back hand but not forehand as I can get same accelerometer values for both forehand and backhand.

Thank you, Jimmy

like image 870
Charles Brown Avatar asked Apr 18 '15 05:04

Charles Brown


2 Answers

EDIT: changed my mind about this, following @Sami's comments :)

Imagine the X and Y axes are in the plane of the racket strings (say X is along the line of the handle, Y is up/down), and Z is in the direction of hitting the ball. Then most of the acceleration when you swing & hit will be in the Z axis (+ or - depending on which face of the racket hits the ball); there's a bit of X-axis acceleration if you're swinging in an arc, but it's always in the same direction whichever face is hit. There's a constant Y-axis acceleration upwards.

enter image description here

So you can look at the accelerometer's Z-value to determine which face is hit, and you can look a the Y-value to tell which way up the racket is being held. From that you can tell whether the 'front' or 'back' (relative to which way the racket is oriented) is being hit, and hence tell whether a forehand or backhand shot is being played.

Of course, you'd also have to know whether the player was right or left handed :)

For a given handedness, you could calculate the type of swing as follows:

enter image description here

For the other handedness, the results would be reversed. The '+' and '-' values are relative to which way your accelerometer is installed, so you'd need to calibrate.

like image 115
Richard Inglis Avatar answered Sep 30 '22 12:09

Richard Inglis


There are two coordinate systems at play here: the accelerometer's and the world's. The accelerometer will have fixed x/y/z directions in its world view, but they change in relation to the world coordinates based on the orientation.

If you use the accelerometer's values as is, then you may get positive or negative impulses on hit. But when you convert them to world's coordinate system - that is, down is always towards the center of the Earth - you will always get the same values for backhand and opposite for forehand.

Let's assume that accelerometer's x direction is to the normal of the net, z is parallel to the handle and y is "up" when the racket is its normal sideways position.

Since in tennis the racket is basically on one plane (you don't hit with the net facing down, for example), and unless you're doing an overhead (in which case I think backhand is out of the question), you will always have y pointing to 1 or -1 when the racket is at rest. Simplest (but not the most accurate!) way is to check what sign y has and change x accordingly. This way you won't get the exact vectors, but you will get the information whether it was backhand or forehand.

The problem with this is also that you have to track the racket before the hit also, since if the hit isn't perfectly level (rarely is), the y acceleration will also change when the racket moves up or down while hitting and will not show the orientation of the racket at the moment of impact.

For more accurate readings you would have to determine the difference between the coordinate systems and rotate accordingly.

like image 25
Sami Kuhmonen Avatar answered Sep 30 '22 10:09

Sami Kuhmonen