In the followings we shall reproduce the algorithm described in

Similar documents
Mechanics lecture 7 Moment of a force, torque, equilibrium of a body

Time Domain and Frequency Domain Techniques For Multi Shaker Time Waveform Replication

Solving Simultaneous Equations and Matrices

Lecture L3 - Vectors, Matrices and Coordinate Transformations

Figure 1.1 Vector A and Vector F

A vector is a directed line segment used to represent a vector quantity.

December 4, 2013 MATH 171 BASIC LINEAR ALGEBRA B. KITCHENS

Solutions to Math 51 First Exam January 29, 2015

Review Jeopardy. Blue vs. Orange. Review Jeopardy

Structural Analysis - II Prof. P. Banerjee Department of Civil Engineering Indian Institute of Technology, Bombay. Lecture - 02

13 MATH FACTS a = The elements of a vector have a graphical interpretation, which is particularly easy to see in two or three dimensions.

11.1. Objectives. Component Form of a Vector. Component Form of a Vector. Component Form of a Vector. Vectors and the Geometry of Space

Comparison of the Response of a Simple Structure to Single Axis and Multiple Axis Random Vibration Inputs

Solving Systems of Linear Equations Using Matrices

Notes on Orthogonal and Symmetric Matrices MENU, Winter 2013

Introduction to Matrix Algebra

When the fluid velocity is zero, called the hydrostatic condition, the pressure variation is due only to the weight of the fluid.

2x + y = 3. Since the second equation is precisely the same as the first equation, it is enough to find x and y satisfying the system

Force on Moving Charges in a Magnetic Field

3. KINEMATICS IN TWO DIMENSIONS; VECTORS.

MATRIX ALGEBRA AND SYSTEMS OF EQUATIONS

Eigenvalues and Eigenvectors

Linear Algebra: Vectors

[1] Diagonal factorization

8 Square matrices continued: Determinants

Torgerson s Classical MDS derivation: 1: Determining Coordinates from Euclidean Distances

Recall that two vectors in are perpendicular or orthogonal provided that their dot

Linear Algebra Notes for Marsden and Tromba Vector Calculus

Adding vectors We can do arithmetic with vectors. We ll start with vector addition and related operations. Suppose you have two vectors

MATRIX ALGEBRA AND SYSTEMS OF EQUATIONS. + + x 2. x n. a 11 a 12 a 1n b 1 a 21 a 22 a 2n b 2 a 31 a 32 a 3n b 3. a m1 a m2 a mn b m

3 Orthogonal Vectors and Matrices

VELOCITY, ACCELERATION, FORCE

THREE DIMENSIONAL GEOMETRY

Unified Lecture # 4 Vectors

ASEN Structures. MDOF Dynamic Systems. ASEN 3112 Lecture 1 Slide 1

State of Stress at Point

Continued Fractions and the Euclidean Algorithm

Operation Count; Numerical Linear Algebra

Vector Math Computer Graphics Scott D. Anderson

Vector Algebra II: Scalar and Vector Products

SYSTEMS OF EQUATIONS AND MATRICES WITH THE TI-89. by Joseph Collison

Structural Axial, Shear and Bending Moments

Advanced Structural Analysis. Prof. Devdas Menon. Department of Civil Engineering. Indian Institute of Technology, Madras. Module

Section 10.4 Vectors

Similarity and Diagonalization. Similar Matrices

Typical Linear Equation Set and Corresponding Matrices

Problem Set 5 Due: In class Thursday, Oct. 18 Late papers will be accepted until 1:00 PM Friday.

Lab #4 - Linear Impulse and Momentum

Lab 8: Ballistic Pendulum

Let s first see how precession works in quantitative detail. The system is illustrated below: ...

G U I D E T O A P P L I E D O R B I T A L M E C H A N I C S F O R K E R B A L S P A C E P R O G R A M

Lecture 5: Singular Value Decomposition SVD (1)

MATHEMATICS FOR ENGINEERING BASIC ALGEBRA

Chapter 11 Equilibrium

Solution of Linear Systems

LINEAR EQUATIONS IN TWO VARIABLES

MATH10212 Linear Algebra. Systems of Linear Equations. Definition. An n-dimensional vector is a row or a column of n numbers (or letters): a 1.

Using row reduction to calculate the inverse and the determinant of a square matrix

Mechanics 1: Conservation of Energy and Momentum

Lateral Acceleration. Chris Garner

1 Determinants and the Solvability of Linear Systems

FREE FALL. Introduction. Reference Young and Freedman, University Physics, 12 th Edition: Chapter 2, section 2.5

Physics Midterm Review Packet January 2010

Unit 11 Additional Topics in Trigonometry - Classwork

Chapter 18 Static Equilibrium

Chapter 17. Orthogonal Matrices and Symmetries of Space

Basic numerical skills: EQUATIONS AND HOW TO SOLVE THEM. x + 5 = = (2-2) = = 5. x = 7-5. x + 0 = 20.

3D Tranformations. CS 4620 Lecture 6. Cornell CS4620 Fall 2013 Lecture Steve Marschner (with previous instructors James/Bala)

by the matrix A results in a vector which is a reflection of the given

Physics 235 Chapter 1. Chapter 1 Matrices, Vectors, and Vector Calculus

Reading assignment: All students should read the Appendix about using oscilloscopes.

v w is orthogonal to both v and w. the three vectors v, w and v w form a right-handed set of vectors.

7 Gaussian Elimination and LU Factorization

Orthogonal Diagonalization of Symmetric Matrices

CS3220 Lecture Notes: QR factorization and orthogonal transformations

KINEMATICS OF PARTICLES RELATIVE MOTION WITH RESPECT TO TRANSLATING AXES

The purposes of this experiment are to test Faraday's Law qualitatively and to test Lenz's Law.

Elasticity Theory Basics

Multiple regression - Matrices

Notes on Determinant

Lecture 6. Weight. Tension. Normal Force. Static Friction. Cutnell+Johnson: , second half of section 4.7

Section 1.1. Introduction to R n

Review of Fundamental Mathematics

The Basics of FEA Procedure

Lecture Notes 2: Matrices as Systems of Linear Equations

1 of 79 Erik Eberhardt UBC Geological Engineering EOSC 433

Metrics on SO(3) and Inverse Kinematics

Mathematics Course 111: Algebra I Part IV: Vector Spaces

Rotation: Moment of Inertia and Torque

Linear Equations ! $ & " % & " 11,750 12,750 13,750% MATHEMATICS LEARNING SERVICE Centre for Learning and Professional Development

α = u v. In other words, Orthogonal Projection

ANALYTICAL METHODS FOR ENGINEERS

Gas Dynamics Prof. T. M. Muruganandam Department of Aerospace Engineering Indian Institute of Technology, Madras. Module No - 12 Lecture No - 25

Linear Algebra Review. Vectors

EDEXCEL NATIONAL CERTIFICATE/DIPLOMA MECHANICAL PRINCIPLES AND APPLICATIONS NQF LEVEL 3 OUTCOME 1 - LOADING SYSTEMS

Tennessee State University

Center of Gravity. We touched on this briefly in chapter 7! x 2

6. LECTURE 6. Objectives

Nonlinear Iterative Partial Least Squares Method

Simple Harmonic Motion

Transcription:

How to obtain angular velocity and angular acceleration values directly from 3D accelerometer array data using simple matrix operations in Propeller/SPIN...the merit of service is seldom attributed to the true and exact performer. William Shakespeare (1564-1616) All's Well That Ends Well, Act III, scene vi In the followings we shall reproduce the algorithm described in K. Parsa, J. Angeles and A. K. Misra Rigid-body pose and twist estimation using an accelerometer array In Applied Mechanics, 74 (2004) pp. 223-236. without the agonizing pain of abstract tensor and matrix algebra. The method will be demonstrated with many numeric examples. To calculate these examples I used only Propeller/SPIN and the FPU_Matrix_Driver.SPIN object from OBEX (http://obex.parallax.com/objects/317/). First the arrangement of four 3-axis acceleration sensors will be described, then the algorithm will be introduced and exercised via numeric examples. The arrangement of the sensors Let us put two H48C 3D accelerometers at the opposite corners of a square plate as shown in Fig. 1. z y x Plate A z y Figure 1. The z-axis of the H48C accelerometers are pointing towards the reader. x Let us make another square plate, equipped with two other sensors, like in Fig. 2.

z y x Plate B z y x Figure 2. The z-axis of the H48C accelerometers are pointing towards the reader. Now let us mount Plate A on top of Plate B to form a regular cube as shown in Fig. 3. 1 z Plate A 2 C 4 y x 3 Plate B Figure 3. The four H48Cs arranged at the vertices of a tetrahedron. The three corresponding axis of the sensors are parallel, and, by design, mutually orthogonal. The centroid of the pickup points is denoted by C and the sensors are numbered as shown.

Definition of matrices Let us define two [3 by 4] matrices. These are matrix R of the relative positions and matrix A of the relative accelerations. The position of the sensors is related to the centroid C. Let us take the length of the side of the cube as one, then the coordinates of the sensors are r 1 = [-0.5, -0.5, 0.5] r 2 = [ 0.5, 0.5, 0.5] r 3 = [ 0.5, -0.5, -0.5] r 4 = [-0.5, 0.5, -0.5] as you can verify this in Fig. 3. The R matrix contains the coordinates of the sensors in its columns r 1 r 2 r 3 r 4 [[ -0.5 0.5 0.5-0.5 ] R = [ -0.5 0.5-0.5 0.5 ] [3 by 4] matrix [ 0.5 0.5-0.5-0.5 ]] The A matrix is the matrix of the relative accelerations. The acceleration vectors measured by the sensors are a 1 = [ a 1x, a 1y, a 1z ] a 2 = [ a 2x, a 2y, a 2z ] a 3 = [ a 3x, a 3y, a 3z ] a 4 = [ a 4x, a 4y, a 4z ] How to make relative acceleration values from these? Let us first calculate the average acceleration vector a C a C = 0.25. [a 1x +a 2x +a 3x +a 4x, a 1y +a 2y +a 3y +a 4y, a 1z +a 2z +a 3z +a 4z ] Then subtract a C from the acceleration vectors to obtain relative accelerations a r1 = [ a 1x -a Cx, a 1y -a Cy, a 1z -a Cz ] a r2 = [ a 2x -a Cx, a 2y -a Cy, a 2z -a Cz ] a r3 = [ a 3x -a Cx, a 3y -a Cy, a 3z -a Cz ] a r4 = [ a 4x -a Cx, a 4y -a Cy, a 4z -a Cz ] And the A matrix is a r1 a r2 a r3 a r4 [[ a r1x a r2x a r3x a r4x ] A = [ a r1y a r2y a r3y a r4y ] [ a r1z a r2z a r3z a r4z ]] [3 by 4] matrix By the way, a C is the linear acceleration vector measured by the sensor array. So half of the 6DOF IMU job done. Now, we have to calculate the angular acceleration and the angular velocity values. In other words we will get 9DOF data, won't we? Up till now the operations were reading the sensors, adding, subtracting dividing values, some housekeeping to arrange values in arrays. So, we encountered not too many complications.

An offline task to be solved only once Before we proceed, we have to calculate the Moore-penrose inverse P of matrix R. This is easy and has to be done only once for a given sensor arrangement. You can do it with the FPU_Matrix_Driver object. Some of the comments of the Matrix_SVD (Singular Value Decomposition) procedure will guide you. Or, you can use some simple matrix algebra as follows P = R T. (R. R T ) -1 Again, every step can be done with the FPU_Matrix_Driver, like for example Matrix_Transpose(@RT,@R,3,4) 'This calculates R T Matrix_Multiply(@RRT,@R,@RT,3,4,4,3) 'This calculates R. R T Matrix_Inverse(@RRTI,@RRT,3) 'This calculates inverse of (R. R T ) Matrix_Multiply(@P,@RT,@RRTI,4,3,3,3) 'This calculates P = R T. (R. R T ) -1 For our sensor arrangement the result is [[-0.5-0.5 0.5 ] P = [ 0.5 0.5 0.5 ] [ 0.5-0.5-0.5 ] [-0.5 0.5-0.5 ]] [4 by 3] matrix Verify that the R. P matrix product gives a [3 by 3] identity matrix. O.K. We have P, we have to store it somewhere as we shall use it frequently. A little bit of physics shouldn't hurt From rigid body kinematics, a very compact formula can be derived for the a i accelerations. This formula contains the acceleration a C of the centroid C, the angular velocity of the body's rotation around an axis containing the centroid and the time derivative of the angular velocity, the so called angular acceleration. Note that these are just the IMU quantities we would like to measure. Before I write down the formula, I emphasize again, that our sensor array estimates directly all these three basic kinematic vectors. In other words, neither we have to derivate to obtain, or, nor we have to integrate to obtain. Beware of the following formula, because it is so simple that you can even remember it, if you are not careful enough. The formula is a i = a C + x r i + x ( x r i ) where x denotes the vector product. In SPIN using the FPU_Matrix_Driver, e.g. for a 1, it goes as Vector_CrossProduct(@wr1,@omega,@r1,3,1) 'This calculates xr 1 Vector_CrossProduct(@wwr1,@omega,@wr1,3,1) 'This calculates x( xr 1 ) Vector_CrossProduct(@alphar1,@alpha,@r1,3,1) 'This calculates xr 1 Matrix_Add(@alphar1wwr1,@alphar1,@wwr1,3,1) 'This calculates xr 1 + x( xr 1 ) Matrix_Add(@a1,@ac,@alphar1wwr1,3,1) 'This calculates a 1 Of course, here we use this formula only to calculate correct a i values for our sensor array for different types of motion of the body to numerically check the decoding algorithm. Now, we have prepared the tests, let's get back to the decoding algorithm.

How to decode the angular acceleration? Well, we have decoded the linear acceleration of the sensor array. That is simply a C. To get the angular acceleration, we have first to multiply the A matrix of the relative accelerations with P. The matrix A was calculated from the measured a i values before and P was stored somewhere. W = A. P W has a name, it is called the angular acceleration tensor. But it doesn't matter. We got it. W is a small [3 by 3] matrix, nine nicely arranged float values, nothing else from now on. The angular acceleration vector is simply = 0.5. [ W 32 -W 23, W 13 -W 31, W 21 -W 12 ] where the double subscript of W denotes the corresponding element of the W matrix. For example W 32 is the second element of the third row. Yes, yes, but what about the angular velocity? We'll get it quickly. Angular velocity components are calculated from the diagonal elements of the matrix W. In preparation of the final result we calculate the quantity and finally sp = 0.5. (W S11 + W S22 + W S33 ) = [SQR(W S11 -sp), SQR(W S22 -sp), SQR(W S33 -sp)] Where SQR denotes the square root operation. These were two additions, a multiplication, three subtractions and three square roots. The correct sign of the components can be obtained easily as described, for example, in the original paper. We shall discuss the sign determination later. We can see, that the nine numbers of the W matrix contain all information about angular acceleration and angular velocity. So it deserves its name. Now we continue with some practical considerations and than with the numerical tests. What to do if I arranged the sensors in a different way? You have to compute the R matrix, then the P matrix for your arrangement. That's all. R, of course, has not to be singular in order to obtain a Moore-penrose inverse. In a planar arrangement, which seems to be a practical idea to place the sensors, the third row of R contains only zeroes. And R is singular, then. In other words, all sensors should not line up, or should not lay in the same plane. O.K. But how long does this decoding take? Well, in PASM this decoding takes 4-5 msec. In the FPU it takes less than 2 msec. Whichever you choose, you can handle 100 Hz (10 msec period) acceleration data. In SPIN you can cope with 20 Hz data easily. First example: Sensor resting on a table Let us assume that the table is horizontal and is resting on the ground. We have gravity of course (9.81 m/sec 2 ), but we don't have angular rotation and angular acceleration of the sensor array. The and vectors are zero and the sensed a i vectors are as follows

a 1 = [ 0.0, 0.0, 9.81] a 2 = [ 0.0, 0.0, 9.81] a 3 = [ 0.0, 0.0, 9.81] a 4 = [ 0.0, 0.0, 9.81] First we calculate a C a C = [ 0.0, 0.0, 9.81] Then the A matrix is [[ 0.0 0.0 0.0 0.0 ] A = [ 0.0 0.0 0.0 0.0 ] [ 0.0 0.0 0.0 0.0 ]] The W matrix is [[ 0.0 0.0 0.0 ] W = A. P = [ 0.0 0.0 0.0 ] [ 0.0 0.0 0.0 ]] So, both the measured and are null vectors. Why do our sensors measure a positive (upwards) 9.81 when we all know that gravity points downwards? The proof-mass, or whatever, that measures the acceleration is pulled down by the gravity. The sensor feels that it is accelerating upwards, because the proof-mass is displaced downwards inside the sensor. Sensor array accelerating but not rotating Let us push the sensor array in the x direction with 1 m/sec 2 linear acceleration. The and vectors are zero again, but we have a linear a C acceleration of the whole sensor in the x direction. According to our formula a i = a C + x r i + x ( x r i ) we calculate a i values, taking into account the sensed g, of course a 1 = [ 1.0, 0.0, 9.81] a 2 = [ 1.0, 0.0, 9.81] a 3 = [ 1.0, 0.0, 9.81] a 4 = [ 1.0, 0.0, 9.81] The measured a C, the average of the four a i vectors, is Then the A matrix is The W matrix is a C = [ 1.0, 0.0, 9.81] [[ 0.0 0.0 0.0 0.0 ] A = [ 0.0 0.0 0.0 0.0 ] [ 0.0 0.0 0.0 0.0 ]]

[[ 0.0 0.0 0.0 ] W = A. P = [ 0.0 0.0 0.0 ] [ 0.0 0.0 0.0 ]] So, both the measured and are null vectors, again. Let us take some increasing spin Now, we accelerate the sensor array as in the previous example, but this time we start to rotate it with = [ 0.0, 0.0, 0.5] [rad/sec 2 ] angular acceleration around the z axis. According to our formula a i = a C + x r i + x ( x r i ) we calculate a i values again. First let us calculate the x r i vectors then the a i vectors x r 1 = [ 0.25, -0.25, 0.00 ] x r 2 = [ -0.25, 0.25, 0.00 ] x r 3 = [ 0.25, 0.25, 0.00 ] x r 4 = [ -0.25, -0.25, 0.00 ] a 1 = [ 1.25, -0.25, 9.81 ] a 2 = [ 0.75, 0.25, 9.81 ] a 3 = [ 1.25, 0.25, 9.81 ] a 4 = [ 0.75, -0.25, 9.81 ] The a C vector, the average of a i is the same as before a C = [ 1.0, 0.0, 9.81] But the A matrix of the relative accelerations is filled not only with zeroes now The W matrix is [[ 0.25-0.25 0.25-0.25 ] A = [ -0.25 0.25 0.25-0.25 ] [ 0.00 0.00 0.00 0.00 ]] [[ 0.0-0.5 0.0 ] W = A. P = [ 0.5 0.0 0.0 ] [ 0.0 0.0 0.0 ]] From this, using the formula for the decoded, measured = 0.5. [ W 32 -W 23, W 13 -W 31, W 21 -W 12 ] we obtain = [ 0.0, 0.0, 0.5 ]

and the decoded, measured angular velocity vector is Well, so far, so good. = [ 0.0, 0.0, 0.0 ] Accelerating and rotating sensor array Four seconds have passed and the sensor array is rotating now with = [ 0.0, 0.0, 2.0 ] [rad/sec] angular velocity, while accelerating linearly and angularly as before a C = [ 1.0, 0.0, 9.81 ] = [ 0.0, 0.0, 0.5 ] The constituents to the a i accelerations at the pickup points are a C = [ 1.0, 0.0, 9.81 ] x r 1 = [ 0.25, -0.25, 0.00 ] x r 2 = [ -0.25, 0.25, 0.00 ] x r 3 = [ 0.25, 0.25, 0.00 ] x r 4 = [ -0.25, -0.25, 0.00 ] x ( x r 1 ) = [ 2.00, 2.00, 0.00 ] x ( x r 2 ) = [ -2.00, -2.00, 0.00 ] x ( x r 3 ) = [ -2.00, 2.00, 0.00 ] x ( x r 4 ) = [ 2.00, -2.00, 0.00 ] These are sensed accelerations at the pickup points and according to our formula a i = a C + x r i + x ( x r i ) they are added (scrambled) in the sensors a 1 = [ 3.25, 1.75, 9.81 ] a 2 = [ -1.25, -1.75, 9.81 ] a 3 = [ -0.75, 2.25, 9.81 ] a 4 = [ 2.75, -2.25, 9.81 ] Now let us see, how the algorithm unscrambles the a C, and vectors. The a C is simply the average of the four a i vectors a C = [ 1.0, 0.0, 9.81 ] The A matrix of the relative accelerations is [[ 2.25-2.25-1.75 1.75 ] A = [ 1.75-1.75 2.25-2.25 ] [ 0.00 0.00 0.00 0.00 ]]

We obtain the [3 by 3] W matrix with a simple matrix multiplication [[ -4.0-0.5 0.0 ] W = A. P = [ 0.5-4.0 0.0 ] [ 0.0 0.0 0.0 ]] And we unscramble the angular acceleration vector immediately, using the formula resulting Then we calculate the quantity And finally, from the formula we get the unscrambled vector Right, again. = 0.5. [ W 32 -W 23, W 13 -W 31, W 21 -W 12 ] = [ 0.0, 0.0, 0.5 ] sp = 0.5. (W S11 + W S22 + W S33 ) = -4.0 = [SQR(W S11 -sp), SQR(W S22 -sp), SQR(W S33 -sp)] = [ 0.0, 0.0, 2.0 ] Summarizing the steps of the algorithm To check and to follow the steps of the numeric examples one can use the Propeller/SPIN language and the FPU_Matrix_Driver. Some practice will ensure the user how simple it is and how easy to program the algorithm in Propeller/SPIN. Now I summarize briefly the main steps of the process. The four sensor readings (a i vectors) are stored in a [3 by 4] matrix, column wise. The average of the acceleration vectors gives the linear acceleration a C of the sensor array. This average vector is subtracted from each column of the matrix, and the resulting matrix is multiplied with a precomputed one. The [3 by 3] product matrix is used to estimate the and the vectors. is obtained directly from this matrix with a simple formula. is obtained directly again with simple formulas. One can get the sign of the components of the vector, for example, for x easily as Sign_of_ x = SIGN[( x _Now - x _Previous). x _Now]

based upon the fact that the components of are measured with sign and they are directly related to the change of the consequtive components of. Another, and numerically more robust way to get the sign of the components of the vector is to store the sum of the components. The sign of the stored sums will yield the sign of the measured components at any moment. Yes, I know that this is something like an integration. But the difference between using the sign of a value, or using the value itself, is huge. Some words about calibration It is beyond the scope of this document to discuss the calibration of the sensor array in details. I will describe the calibration process and the involved simple math of that later. Now I just mention, that each of the H48C sensors should be calibrated statically. After that the whole sensor array can be calibrated kinematically as described in the original paper. This kinematic calibration will improve the precision of the sensor array with several orders of magnitude! The kinematic calibration can be done en-route during an arbitrary maneuver of the body that carries the sensor array. cessnapilot, 14.03.2009