Physics 101

40
Physics 101 September 4, 2014 001

description

Physics 101. 001. September 4 , 2014. First, a weighty matter. Weight is a Force. OUCH!. Force = mass * acceleration. Strain = function( Δ X). Inertia. - PowerPoint PPT Presentation

Transcript of Physics 101

Page 1: Physics 101

Physics 101

September 4, 2014

001

Page 2: Physics 101

Click to edit Master title styleFirst, a weighty matter Weight is a Force

OUCH!

Strain = function(ΔX)

Force = mass * acceleration

Page 3: Physics 101

Inertia• Newton defined it as (translated from Latin)

“The vis insita, or innate force of matter, is a power of resisting by which every body, as much as in it lies, endeavours to preserve its present state, whether it be of rest or of moving uniformly forward in a straight line.”

• Or as the commercials say today:“A body at rest tends to stay at rest while a body in motion tends to stay in motion”

• Newton further defined it in his 1st law of motion as:“Unless acted upon by a net unbalanced force, an object will maintain a constant velocity.”

• In F=m*a, the mass m is a quantitative measure of a body’s inertia.The acceleration a is a measure of the change in velocity of the body.So a = F/m is the more useful formulation.

• Another form of inertia is rotational inertia in which a rotating body maintains its state of uniform rotational motion.

– Its anguluar momentum is preserved unless an external torque is applied

– Torque is generated from coupled forces

– The Coupling cancels the linear force

Page 4: Physics 101

Inertia• Newton defined it as (translated from Latin)

“The vis insita, or innate force of matter, is a power of resisting by which every body, as much as in it lies, endeavours to preserve its present state, whether it be of rest or of moving uniformly forward in a straight line.”

• Or as the commercials say today:“A body at rest tends to stay at rest while a body in motion tends to stay in motion”

• Newton further defined it in his 1st law of motion as:“Unless acted upon by a net unbalanced force, an object will maintain a constant velocity.”

• In F=m*a, the mass m is a quantitative measure of a body’s inertia.The acceleration a is a measure of the change in velocity of the body.So a = F/m is the more useful formulation.

• Another form of inertia is rotational inertia in which a rotating body maintains its state of uniform rotational motion.

– Its anguluar momentum is preserved unless an external torque is applied

– Torque is generated from coupled forces

– The Coupling cancels the linear force

Page 5: Physics 101

Click to edit Master title styleA Gedankenexperiment

Let’s Fly an FA-18 Hornet

for fun

1 8 15 22 29 360

0.51

1.5

Z Axis Accelera-tion

Z Axis Ac-celeration

1 8 15 22 290

50100150200

Z Axis Velocity

Z Axis Veloc-ity

Page 6: Physics 101

Click to edit Master title styleIntegrate acceleration to get velocity

Page 7: Physics 101

Click to edit Master title styleMEMs Accelerometers

Page 8: Physics 101

Click to edit Master title styleAccelerometer data is very noisy!

Z

tap

SOUND WHACKING

Gravitational force

Page 9: Physics 101

Click to edit Master title styleMagnitude of Acceleration Vector

9.80665 m/s2 or 32.174 ft/s2

IMPORTANT: We can remove the gravitational acceleration from the magnitude of the acceleration.

Page 10: Physics 101

Click to edit Master title styleWhat do linear accelerometers measure?

In general, gravity and motion can’t be separated by linear accelerometers alone

is the vector sum of gravitational acceleration + motion acceleration.

Page 11: Physics 101

Click to edit Master title styleTilt Measurement for Tablets & Phones

linear accelerometers alone are good at this, just check your iPad Also good at determining “which way is UP”

Page 12: Physics 101

Click to edit Master title styleEnter the Gyroscope

Euler Angles

Page 13: Physics 101

Click to edit Master title styleRemoving gravity from measured accel.

Page 14: Physics 101

Click to edit Master title styleZero G Offset ==0 in a Rate-Gyro

What if Vx is not zero in the presence of zero rotation?

Integration

One Integration step

1 4 7 10 13 16 19 22 25 28 31 34

-25

-20

-15

-10

-5

0

5

10

15

20

25

Gyro Vx Sample

Gyro Vx Sample

1 4 7 10 13 16 19 22 25 28 31 340

5

10

15

20

25

30

35

40

45

Rotational Position

Rotational Position

Page 15: Physics 101

Click to edit Master title styleZero G Offset !=0 in a Rate-Gyro

1 4 7 10 13 16 19 22 25 28 31 34

-25

-20

-15

-10

-5

0

5

10

15

20

25

Gyro Vx Sample

Gyro Vx Sample

1 4 7 10 13 16 19 22 25 28 31 340

10

20

30

40

50

60

70

Rotational Position

Rotational Position

1 4 7 10 13 16 19 22 25 28 31 340

5

10

15

20

25

30

35

40

45

Rotational Position

Rotational Position

The bad news with any gyro is that not only does it have a zero G offset different from zero, but the offset drifts over time & temperature. Algorithms have to recalibrate on the fly.

1 4 7 10 13 16 19 22 25 28 31 34

-25

-20

-15

-10

-5

0

5

10

15

20

25

Gyro Vx Sample

Gyro Vx Sample

Page 16: Physics 101

Click to edit Master title styleInertial Measurement Unit (IMU)

The Original Apollo IMU

An IMU is a device that measures and reports on velocity, orientation and gravitational direction based on accelerometers (3DOF) and in navigation applications a 3 axis rate-gyro (6DOF). In addition a full blown IMU includes a 3 axis magnetometer (9DOF).

The IMU in today’s fitness bands only contain accelerometers.

Accelerometer data is very noisy so the main processing they do is a sharp cut off low pass filter. Recall that without a gyro you can’t really separate gravity from motion.

Page 17: Physics 101

Click to edit Master title styleFrames of Reference (coordinate systems)

The Global Frame of Reference is usually an earth related frame:1. Earth Centric UTC (LAT,LONG)2. Earth related, origin at current postion.

The Body frame is what the IMU (INS) is strapped to.

What we want to know is the coordinate

transformation needed to move the Body

Frame into the Global Frame.

This is very similar to the geometric transformation used in huge

volumes in 3D graphics systems.

IMU

Page 18: Physics 101

Click to edit Master title styleApollo Style Stable Platform IMU

The goal here is to keep the stable platform always oriented to the Global Frame of Reference and measure with the angle pickoffs how that differs from the Body

Frame

Feedback Control Loop

Now we have an inertial navigation system (INS)

because we have determined both our orientation and our

position.

Obviously fitness bands are not going to use the stable platform approach to INS applications!!!

analog

analog analog

Page 19: Physics 101

Click to edit Master title styleStable Platform vs Strapdown Systems

Page 20: Physics 101

Quaternion Math Tutorial

• Fasten your seatbelts and raise your tray tables to their upright and locked position and brace for impact!

– Quaternions scare all manner of mice and men

– They go bump in the night

– They are the reason your math teach gave you an F

• OK they really are quite simple as we shall see.

• Quaternions are composed of two things:

– A 3 dimensional vector (X,Y,Z)

– And a scalar value (W) representing the amount of rotation around the vector

• Quaternion Q = (W,X,Y,Z) = W, X*i + Y*j + Z*k

– Where (i,j,k) are 3D unit vectors defining a 3D frame of reference

– And W, X, Y and Z are all real numbers

Page 21: Physics 101

Whew that wasn’t so bad!!!

• Quaternion Q = (W,X,Y,Z) has a magnitude

– Magnitude = sqrt(W2 + X2 + Y2 + Z2)

– For all of our computations, we can ignore (i,j,k) provided we just keep the dimensionality straight.

• There are unit Quaternions just as there are unit vectors.

– And they are computed in the same way

• Unit W = W/magnitude

• Unit X = X/magnitude

• Unit Y = Y/magnitude

• Unit Z = Z/magnitude

– All Unit Quaternions map to the surface of a unit 4D Hyper-sphere

WARNING: That one WILL hurt your head if you try to visualize it.

Page 22: Physics 101

Quaternion Math Tutorial Continued

• Unit Quaternions are important for several reasons

– In the absence of accumulated errors, say from integration, computations on unit quaternions yield unit quaternions.

– The components of unit quaternions correspond to direction cosines.

– Computation of sines and cosines are reduced.

• Periodically one checks computational results to see if a result needs to be renormalized to a unit quaternion.

– Usually it doesn’t, saving the 4 painful divisions.

– And you can skip the painful sqrt() when testing for renormalization.

• Net net: using quaternions saves computational complexity.

• Now I need to tell you that (i,j,k) are also multiplied by sqrt(-1)

– Look up quaternions or Hamiltonians as they are sometimes known for more info

• This is important when we look at multiplying two quaternions together.

• But with care, we don’t need to do anything fancy provided we account for the sign changes.

Page 23: Physics 101

Multiplying Two Quaternions

• Let Q1 = (w1, x1, y1, z1) and Q2 = (w2, x2, y2, z2)

• Let Q = Q1 * Q2

• IMPORTANT: Q1 * Q2 != Q2 * Q1

• We define the multiplication as:(Q1 * Q2).w = w1w2 - x1x2 - y1y2 - z1z2

(Q1 * Q2).x = w1x2 + x1w2 + y1z2 - z1y2

(Q1 * Q2).y = w1y2 - x1z2 + y1w2 + z1x2

(Q1 * Q2).z = w1z2 + x1y2 - y1x2 + z1w2

First observation: quaternion math involves a lot of:Multiply with Add and Multiply with Subtract.

These are both special cases of multiply accumulate. And the accumulator has to be larger than 32-bits for 16 bit samples.Also floating point may be required/desired in many cases.

Page 24: Physics 101

OK it does get a little more complicated

• Let QC = Current Rotation and QT = Rotation for 1 Time Step

• Then QC = QT * QC (remember not commutative)

• Suppose QC holds the working rotation from the initial gravity

• Starting with an axis of rotation and an angle, we compute QT as:

(QT).w = cosf(fAngle/2)

(QT).x = axis.x * sinf(fAngle/2)

(QT).y = axis.y * sinf(fAngle/2)

(QT).z = axis.z * sinf(fAngle/2)

QC gets initialized to (1,0,0,0)

Page 25: Physics 101

One more step!!!

• We need to convert our quaternion into a 4x4 rotation matrix, M, so we can transform vectors into a new reference frame.

• Then Ax,y,z can be rotated to A’x,y,z by the following: A’x,y,z = Ax,y,z * M

• Where M is given by:1-2y2-2z2 2xy-2wz 2xz+2wy 02xy+2wz 1-2x2-2z2 2yz+2wx 02xz-2yw 2xz+2wy 1-2x2-2z2 0 0 0 0 1

Thus the mathematics for accelerometer & gyro sensor fusion is almost all linear algebra and primarily multiply accumulate or multiply subtract

Page 26: Physics 101

Click to edit Master title styleAHRS Big Picture

Page 27: Physics 101

Click to edit Master title styleKalman Filter Mathematical View

Page 28: Physics 101

Click to edit Master title styleKalman Filter Software View

Page 29: Physics 101

Click to edit Master title styleComplimentary Filter

Page 30: Physics 101

Click to edit Master title styleComplimentary Fusion Filter

Accelerometer data is very noisy

And gyro data drifts

Page 31: Physics 101

Click to edit Master title styleThe Gold Standard in Research

This is what everyone seems to be implementing now.

Page 32: Physics 101

Click to edit Master title styleApple’s 2013 rollout of the M7 motion chip

Chip analysts have deduced that the M7 is simply a cortex M3 base LPC1800 MCU from NXP

Quoted at 0.6W at 60MHz & 2.2W at 180MHz

Various writers were surprised to find that it continues to run even after the “battery is dead”!!

Page 33: Physics 101

Switching Gears not toContext Tracking

Page 34: Physics 101

Click to edit Master title style

Page 35: Physics 101

Click to edit Master title style

Page 36: Physics 101

Click to edit Master title styleMotion Recognition

Human motion recognition systems composed of wirelessly connected sensor motes (equipped with accelerometers and gyroscopes) attached to different bodysites enable a variety of applications such as rehabilitation, sports science/medicine, geriatric care, and health/fitness monitoring.

For example, such a system can be used to measure the effectiveness of active physiotherapy, to perfect techniques of sport persons, to remotely monitor andtrigger emergency response for the elderly, and to help people lose weight by providing accurate estimates of their expended calories.

Page 37: Physics 101

Separate Activity from Movement Recognition

• Activity:

– Lasts for many seconds up to several hours

– Comprised of many Body Movements often repeated over time

– For example, a “walking” activity would comprise several short leg movements, balance changes and torso motions.

• Body Movements or Micro-Activities:

– Lasts for several milliseconds up to a few seconds

– A body posture or gesture or single motion

Page 38: Physics 101

Pattern Recognition & Machine Learning• The literature is full of reports of trying pretty much every PR & ML

approach to recognizing motions and activities.

• All of these approaches involve feature extraction then some form of dimensional reduction.

• Principal Component analysis is a statistical procedure involving orthogonal transforms (eigenvectors/values) to produce linear uncorrelated values called principle components.

– The first component will be the dimension with the largest variance

– Allows dimensional reduction of “non-principal” components.

– Also goes under the names: Karhunen-Loeve Transform, singular value decomposition(SVD) and eigenvalue decompostion (EVD).

– A long used and standard staple of the PR community

– Reveals the underlying structure in the data & provides a weighted component value for estimation.

– You still need to classify the action or motion but classification is easier

Page 39: Physics 101

Support Vector Machines (SVM)

• Currently the gold standard in research for classification for activities and motions.

• Feature sets extracted from sensors include:

– Linear accelerometer data

– Rate gyro data

– Computed features include: Mean, standard deviation, Maximum, peak-to-peak, RMS and correlation between accelerometer and gyro samples

• These features are viewed as a P dimensional vector

• The objective is to separate such points using a (P-1) dimensional hyper-plane

• The mathematics are basically that of finding enough features to “support” determining on which side of the hyper-plane the current window’s samples lie. Transformations & Polynomial Root finding.

“Human motion recognition using a wireless sensor-based wearable system”John Paul Varkey • Dario Pompili • Theodore A. Walls

Page 40: Physics 101

Raise Your Hand if you have an Android smart phone

Lower Your Hand if you have NEVER ssh logged into your Android smart phone