Slide Ruler. X 5" On today’s menu... What happened with Gravity Noise The tool today ...

29
Slide Ruler

Transcript of Slide Ruler. X 5" On today’s menu... What happened with Gravity Noise The tool today ...

Page 1: Slide Ruler. X 5" On today’s menu...  What happened with Gravity  Noise  The tool today  Fundamental Limitations  Magical Christmas Land  (Where.

Slide Ruler

Page 2: Slide Ruler. X 5" On today’s menu...  What happened with Gravity  Noise  The tool today  Fundamental Limitations  Magical Christmas Land  (Where.

Slide Ruler

? X5"

Page 3: Slide Ruler. X 5" On today’s menu...  What happened with Gravity  Noise  The tool today  Fundamental Limitations  Magical Christmas Land  (Where.

On today’s menu...

What happened with Gravity

Noise

The tool today

Fundamental Limitations

Magical Christmas Land (Where everything is ideal, and

money grows on trees)

Page 4: Slide Ruler. X 5" On today’s menu...  What happened with Gravity  Noise  The tool today  Fundamental Limitations  Magical Christmas Land  (Where.

GravityConquered at last

Page 5: Slide Ruler. X 5" On today’s menu...  What happened with Gravity  Noise  The tool today  Fundamental Limitations  Magical Christmas Land  (Where.

Gravity

++ +-

Earth Coordinates: [0,-g]

Phone Coordinates: [0,-g] Earth Coordinates: [0,-g]

Phone Coordinates: [-g * cosθ, -g * sinθ]

G⃗ 5

θ++

+-G⃗ 5

G⃗ 5x

G⃗ 5y

(Two-Dimensional Example)

Sensor.TYPE_ORIENTATION Returns phone orientation with respect to Earth: θ,φ,ψ

Define Rotation Matrix R(θ,φ,ψ)

R(θ,φ,ψ) Gearth = Gphone

Acceleration – Gphone = True Acceleration

Problem: Sensor.TYPE_ORIENTATION uses the accelerometer to find angles

Therefore, It is impossible to find orientation when phone is in motion.

The sensor assumes accelerometer is gravity. But during motion, the accelerometer is the sum of both motion and gravity. We need gravity to determine the orientation, and we need the orientation to determine gravity.

Page 6: Slide Ruler. X 5" On today’s menu...  What happened with Gravity  Noise  The tool today  Fundamental Limitations  Magical Christmas Land  (Where.

Final Gravity Solution

Notice:

• When the phone is flat, gravity is confined to the z-axis

• If gravity is known and constant the entire time, we may simple subtract this gravity from each measurementSolution:

• Only measure x-axis, theoretically gravity free

• Because the table may be a little slanted, there may be some tiny component of gravity in x-axis. Observe what this value is at rest, then subtract it from each measurement to “zero” gravity out.

++ +-

G⃗ 5Push⃗ 5

A = [P, 0, -G]

++ +-

G⃗ 5Push⃗ 5

A = [P]

Measuring A = [AX, AY,

AZ]

Measuring A = [AX]

Page 7: Slide Ruler. X 5" On today’s menu...  What happened with Gravity  Noise  The tool today  Fundamental Limitations  Magical Christmas Land  (Where.

Tilt Problem

• Started off with no tilt

• Slight tilt of 10-15 degrees

• Steep tilt of 60-75 degrees

Page 8: Slide Ruler. X 5" On today’s menu...  What happened with Gravity  Noise  The tool today  Fundamental Limitations  Magical Christmas Land  (Where.

The Impact

Need gravity to be constant

User may not carry the device. It must be slid.

Introducing:SlideRuler

May only measure 1-dimensional distances

X

These changes improved accuracy significantly

X

Did the tool work?

Page 9: Slide Ruler. X 5" On today’s menu...  What happened with Gravity  Noise  The tool today  Fundamental Limitations  Magical Christmas Land  (Where.

NoWhere does it come from?

ise

Page 10: Slide Ruler. X 5" On today’s menu...  What happened with Gravity  Noise  The tool today  Fundamental Limitations  Magical Christmas Land  (Where.

Noise

WHY the noise? WHAT did we do about it?

Many factors could be responsible

• Phone twists as it slides

• Not all measurements count

• Sometimes silly measurements appear in accelerometer

• Gravity changes per measurement

• Straighten

• Trim

• Flatten

• “Raygun” Calibration

Page 11: Slide Ruler. X 5" On today’s menu...  What happened with Gravity  Noise  The tool today  Fundamental Limitations  Magical Christmas Land  (Where.

Straighten

XX XX X

• Phone should move in a straight line, without rotating

• ...but sometimes, the user may twist the phone as it moves

X

θ

• Using the geomagnetic sensor, this angle can be sensed. (This is the only angle that can be sensed while the phone is in motion).

• Each measurement, X, is straightened into X’:

X’ = X * secant(θ)

XXX

DEPRECATE

D

Page 12: Slide Ruler. X 5" On today’s menu...  What happened with Gravity  Noise  The tool today  Fundamental Limitations  Magical Christmas Land  (Where.
Page 13: Slide Ruler. X 5" On today’s menu...  What happened with Gravity  Noise  The tool today  Fundamental Limitations  Magical Christmas Land  (Where.

Trim

• After Calibration, the accelerometer is taking measurements, but the phone is not in motion yet

• These measurements, below a certain threshold, can be discarded, because they only exist to propagate error through the calculation process • After collection, Trim

goes through the list of measurements and removes all values before the first measurement that is above some threshold (5% of the peak value)

Page 14: Slide Ruler. X 5" On today’s menu...  What happened with Gravity  Noise  The tool today  Fundamental Limitations  Magical Christmas Land  (Where.

Flatten (but wait!)

• Some runs generate data points that are extremely large (i.e. physically impossible)

• Cap values at a reasonable value

• HOWEVER, the source of extremely large data points was found!

Page 15: Slide Ruler. X 5" On today’s menu...  What happened with Gravity  Noise  The tool today  Fundamental Limitations  Magical Christmas Land  (Where.

Raygun Calibration

• Visual cue• Quicker calibrate• Calibrate on each run

Page 16: Slide Ruler. X 5" On today’s menu...  What happened with Gravity  Noise  The tool today  Fundamental Limitations  Magical Christmas Land  (Where.

In spite of these efforts,

Noise remained

Page 17: Slide Ruler. X 5" On today’s menu...  What happened with Gravity  Noise  The tool today  Fundamental Limitations  Magical Christmas Land  (Where.

Noise HandlingHow do we remove it?

Page 18: Slide Ruler. X 5" On today’s menu...  What happened with Gravity  Noise  The tool today  Fundamental Limitations  Magical Christmas Land  (Where.

Noise Handling

HOW to measure the noise? WHAT do we do with this?

If we can somehow “measure” the noise,

we can try to remove it.

• Jitters in data • Smoothing Algorithms

• The phone ends at rest.

• Zero the Velocity

• The less smooth the data appears, the more noise present in each measurement

• The calculated ending velocity gives a measure of noise

Page 19: Slide Ruler. X 5" On today’s menu...  What happened with Gravity  Noise  The tool today  Fundamental Limitations  Magical Christmas Land  (Where.

Smoothing Algorithms

• Thought data was erroneous and needed to be smoothed out

• Implemented a moving average with m=3 algorithm

• Ended up “deadening” data

Page 20: Slide Ruler. X 5" On today’s menu...  What happened with Gravity  Noise  The tool today  Fundamental Limitations  Magical Christmas Land  (Where.

Zero Velocity

X

• Phone should start and stop at rest

Start! Stop!

X

Start! Stop! Wait!

Come back!

• ...but, due to noise, the phone will actually calculate some final velocity that is non-zero

V = 0 V = 0V = V*

• V* = Total noise in velocity• N = Number of measurements• V* / N = Avg. noise acquired per

measurement//Simple Remove Noise://for each measurement v {// v -= (V*/N);//}

• Assumption: small measurements are noisier

• f = factor • close to 0 for large v• close to 1 for small v

//Better Remove Noise://for each measurement v {// v -= f *(V*/N);//}

Page 21: Slide Ruler. X 5" On today’s menu...  What happened with Gravity  Noise  The tool today  Fundamental Limitations  Magical Christmas Land  (Where.

The Tool Today

Page 22: Slide Ruler. X 5" On today’s menu...  What happened with Gravity  Noise  The tool today  Fundamental Limitations  Magical Christmas Land  (Where.

Step Right Up!

Demo!

Findings from testing:

• Accurate to ±2 inches for every foot of the actual object

• Can only measure in a straight line

Page 23: Slide Ruler. X 5" On today’s menu...  What happened with Gravity  Noise  The tool today  Fundamental Limitations  Magical Christmas Land  (Where.

Fundamental Constraints

Page 24: Slide Ruler. X 5" On today’s menu...  What happened with Gravity  Noise  The tool today  Fundamental Limitations  Magical Christmas Land  (Where.

Unavoidable Sources of Error

• Gravity• Small tilt of phone causes gravity to spill into an axis

• Jittery hands• Not a problem for Slide Ruler!• Carrying the phone introduces significant noise

• Hardware Constraints -- Accelerometer• Sampling rate is too slow• Measurements are noisy• This chip was designed for app feedback—not data

analysis

Page 25: Slide Ruler. X 5" On today’s menu...  What happened with Gravity  Noise  The tool today  Fundamental Limitations  Magical Christmas Land  (Where.

Left vs Right

• Sliding the phone to the left vs sliding the phone to the right

Page 26: Slide Ruler. X 5" On today’s menu...  What happened with Gravity  Noise  The tool today  Fundamental Limitations  Magical Christmas Land  (Where.

Ideal Conditions

• Gyroscope• Would allow us to monitor orientation independent

of accelerometer• Allow for perfect removal of gravity

• Significant noise reduction• Phone can move in 3-D

• Industrial-quality Accelerometer• Better sampling rate• More accurate measurements

• Even more time• Bug testing• Algorithm development

Page 27: Slide Ruler. X 5" On today’s menu...  What happened with Gravity  Noise  The tool today  Fundamental Limitations  Magical Christmas Land  (Where.

Conclusion

Page 28: Slide Ruler. X 5" On today’s menu...  What happened with Gravity  Noise  The tool today  Fundamental Limitations  Magical Christmas Land  (Where.

Success?

1. The app utilizes the mobile device’s accelerometer.

2. The app accurately estimates (within ±1% accuracy) the distance

traveled along any path shorter than 5 meters.

3. The app has the ability to calculate the enclosed area of a 2

dimensional shape whose perimeter is less than 5 meters.

4. The app has the ability to measure distance traveled along a

path.

5. The app shall have the ability to measure the cartesian distance

between a starting and ending point.

6. The app can store measurements between sessions.

7. The app displays measurements in both English and S.I. units.

8. The app works with the Android 2.2 (froyo) OS and newer

releases.

Technical Requirements Specification

X

(Closer to ±10%)X

X

Real Question: Can it measure a couch?

Answer: More or less!

Page 29: Slide Ruler. X 5" On today’s menu...  What happened with Gravity  Noise  The tool today  Fundamental Limitations  Magical Christmas Land  (Where.

It can be done!

• Using accelerometer and gyroscope, can create an IMU to track the motion of an object

• Actual application• Difference is quality of

sensors and gyroscope

Direction Cosine Matrix IMU: Theory William Premerlani and Paul Bizardhttp://goo.gl/mm1hA