introduction - meptecmeptec.org/resources/3 - stanley.pdfembedded data loggers ultimately, bring...

31
TM External Use 1 Employed at Motorola / Freescale Semiconductor from June 1980 to the present, where I’ve had multiple careers. Most recently: SoC Integration / MCU Architecture Sensors & Algorithms - basically, solving systems level problems I blog on sensor related topics at http://blogs.freescale.com/category/sensors/ [email protected] Download the Freescale Sensor Fusion Library for Kinetis MCUs from http://www.freescale.com/sensorfusion Introduction

Upload: others

Post on 10-Jun-2020

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Introduction - MEPTECmeptec.org/Resources/3 - Stanley.pdfembedded data loggers Ultimately, bring your generated model back to run on the very hardware you used to collect data Here

TM

External Use 1

•  Employed at Motorola / Freescale Semiconductor from June 1980 to the present, where I’ve had multiple careers. Most recently: − SoC Integration / MCU Architecture − Sensors & Algorithms - basically, solving

systems level problems •  I blog on sensor related topics at

http://blogs.freescale.com/category/sensors/ •  [email protected]

•  Download the Freescale Sensor Fusion Library for Kinetis MCUs from http://www.freescale.com/sensorfusion

Introduction

Page 2: Introduction - MEPTECmeptec.org/Resources/3 - Stanley.pdfembedded data loggers Ultimately, bring your generated model back to run on the very hardware you used to collect data Here

TM

External Use 2

Sensor Data Analytics

•  Unleash the information contained in sensors data beyond tracking motion

− Analyzing sensors data to guide informed decision

•  Create new user experiences and benefits

•  Monetize the information contained in the data

Page 3: Introduction - MEPTECmeptec.org/Resources/3 - Stanley.pdfembedded data loggers Ultimately, bring your generated model back to run on the very hardware you used to collect data Here

TM

External Use 3

Creating Values from Sensor Derived Information

KegData Measures the amount of beer

in a keg and provides beer consumption analytics data to

beverage distributors

Adidas miCoach Smart Run Watch

The next aid for sports drafting

Page 4: Introduction - MEPTECmeptec.org/Resources/3 - Stanley.pdfembedded data loggers Ultimately, bring your generated model back to run on the very hardware you used to collect data Here

TM

External Use 4

Using Sensor Data to Guide Informed Decisions

No longer just motion tracking •  New approach adding

revolutionary value to older applications

•  Brand new economy with getting data sets

•  Numerous sensor IoT applications that are unrealized today

•  Data transmission must be secure

Page 5: Introduction - MEPTECmeptec.org/Resources/3 - Stanley.pdfembedded data loggers Ultimately, bring your generated model back to run on the very hardware you used to collect data Here

TM

External Use 5

.csv

.xml

Git repository

Create Run

database

table.mat

Extract Features

misc.mat

Visualization

Physics-based model

extraction

Unsupervised Machine Learning

Supervised Machine Learning

Model of your system In

tera

ctiv

e D

ata

Logg

er

ISF-based embedded data loggers

Ultimately, bring your generated model back to run on the very hardware you used to collect data

Here is one possible workflow for Sensor Data Analytics

Page 6: Introduction - MEPTECmeptec.org/Resources/3 - Stanley.pdfembedded data loggers Ultimately, bring your generated model back to run on the very hardware you used to collect data Here

TM

External Use 6

You might broadly separate Sensor Data Analytics into two classes of sensor data:

1.  That based on well known physical phenomena (machine condition monitoring is an example)

2.  Data mining, in which we look for patterns in data without advance knowledge of what those patterns might be. We consider two types: !  Unsupervised Learning !  Supervised Learning

The techniques are applicable to a wide variety of applications – probably MUCH wider than is current practice!

Courtesy of Volvo Construction Equipment (mages.volvoce.com)

Sensor Data Analytics

Page 7: Introduction - MEPTECmeptec.org/Resources/3 - Stanley.pdfembedded data loggers Ultimately, bring your generated model back to run on the very hardware you used to collect data Here

TM

External Use 7

figure source; http://en.wikipedia.org/wiki/File:Centrifugal_Pump-mod.jpg

This machine includes: •  rotating motor •  centrifugal pump •  linkage between the two

Each is subject to its own array of problems. These might include: •  Bearing failures •  load imbalance •  shaft misalignment •  looseness •  gearbox faults •  drive belts •  resonance

Let’s look at machine condition monitoring first

Page 8: Introduction - MEPTECmeptec.org/Resources/3 - Stanley.pdfembedded data loggers Ultimately, bring your generated model back to run on the very hardware you used to collect data Here

TM

External Use 8

Gear Mesh Frequencies

A B

Machine “M”

•  Gear A has 10 teeth •  Gear B has 15 teeth •  If gear A is driven at fA=10

revolution/second, then the gear teeth mesh at a 100Hz rate and gear B turns at (fA X 10/15 = 6.67 Hz

•  We would expect peaks in the vibration FFT of machine “M” at 10, 100 and 6.67 Hz.

Suppose one of the teeth on gear B develops a defect. We would expect that to create sidebands about the gear meshing frequency.

Page 9: Introduction - MEPTECmeptec.org/Resources/3 - Stanley.pdfembedded data loggers Ultimately, bring your generated model back to run on the very hardware you used to collect data Here

TM

External Use 9

.csv

.xml

Git repository

Step 2: Create

Run database

table.mat

Step 3: Extract

Features

misc.mat

Step 5: Physics-

based model extraction

Step 6: Unsupervised

Machine Learning

Step 7: Supervised

Machine Learning

Model of your system In

tera

ctiv

e D

ata

Logg

er

ISF-based embedded data loggers

Step 8: Ultimately, bring your generated model back to run on the very hardware you used to collect data

Step 1: Log Data

Step 4: Visualization

Page 10: Introduction - MEPTECmeptec.org/Resources/3 - Stanley.pdfembedded data loggers Ultimately, bring your generated model back to run on the very hardware you used to collect data Here

TM

External Use 10

Rapid Prototype Your Firmware Using ISF R2.1 on FRDM Platforms™

PC with IDE and

customizable GUIs

Freescale Freedom Board

Serial Comms via USB/

OpenSDA

Embedded middleware (ISF) and application target the Kinetis™

processor family

Advantage: ⇒  Get something to evaluate fast ⇒  Identify and eliminate as many risk areas as possible

Arduino Expansion connectors

1.5”

Coming soon: Size Reduced OpenSDA board

Page 11: Introduction - MEPTECmeptec.org/Resources/3 - Stanley.pdfembedded data loggers Ultimately, bring your generated model back to run on the very hardware you used to collect data Here

TM

External Use 11

Example Data Logger

Use this section to specify your test environment (i.e. your stove)

What are the things I am measuring?

What hardware am I using to measure which “things”

Record data

Page 12: Introduction - MEPTECmeptec.org/Resources/3 - Stanley.pdfembedded data loggers Ultimately, bring your generated model back to run on the very hardware you used to collect data Here

TM

External Use 12

.csv

.xml

Git repository

Step 2: Create

Run database

table.mat

Step 3: Extract

Features

misc.mat

Step 5: Physics-

based model extraction

Step 6: Unsupervised

Machine Learning

Step 7: Supervised

Machine Learning

Model of your system In

tera

ctiv

e D

ata

Logg

er

ISF-based embedded data loggers

Step 8: Ultimately, bring your generated model back to run on the very hardware you used to collect data

Step 4: Visualization

Extract features from raw data

Page 13: Introduction - MEPTECmeptec.org/Resources/3 - Stanley.pdfembedded data loggers Ultimately, bring your generated model back to run on the very hardware you used to collect data Here

TM

External Use 13

Extracted Features

•  Statistical moments 1.  standard deviation 2.  variance 3.  skew factor (lopsidedness) 4.  Kurtosis (short and fat or tall and skinny)

•  FFT coefficients •  range (max - min values) •  crossing rate (the percentage at which the signal crosses

the mean value during a given period) •  cross-correlation between horizontal and vertical

components of acceleration •  entropy of raw values •  entropy of some of the statistical measures above

Page 14: Introduction - MEPTECmeptec.org/Resources/3 - Stanley.pdfembedded data loggers Ultimately, bring your generated model back to run on the very hardware you used to collect data Here

TM

External Use 14

.csv

.xml

Git repository

Step 2: Create

Run database

table.mat

Step 3: Extract

Features

misc.mat

Step 4: Visualization

Step 5: Physics-

based model extraction

Step 6: Unsupervised

Machine Learning

Step 7: Supervised

Machine Learning

Model of your system In

tera

ctiv

e D

ata

Logg

er

ISF-based embedded data loggers

Step 8: Ultimately, bring your generated model back to run on the very hardware you used to collect data

Visualize the data

Page 15: Introduction - MEPTECmeptec.org/Resources/3 - Stanley.pdfembedded data loggers Ultimately, bring your generated model back to run on the very hardware you used to collect data Here

TM

External Use 15

There is no pot on burner A. What you see here is a result of activity on burner B.

Sensor on stove top adjacent to the burner. 9” diameter stock pot with 2” of water.

3rd sensor is attached to one of the pot handles

Visualization: 3 Predictors X 3 Sensor Locations

Script = sda_step4b_plot3x3_predictors.m

Page 16: Introduction - MEPTECmeptec.org/Resources/3 - Stanley.pdfembedded data loggers Ultimately, bring your generated model back to run on the very hardware you used to collect data Here

TM

External Use 16

Visualization: Features vs Time

Helpful when you have a long run traversing across multiple system states.

Page 17: Introduction - MEPTECmeptec.org/Resources/3 - Stanley.pdfembedded data loggers Ultimately, bring your generated model back to run on the very hardware you used to collect data Here

TM

External Use 17

.csv

.xml

Git repository

Step 2: Create

Run database

table.mat

Step 3: Extract

Features

misc.mat

Visualization

Step 5: Physics-

based model extraction

Step 6: Unsupervised

Machine Learning

Step 7: Supervised

Machine Learning

Model of your system In

tera

ctiv

e D

ata

Logg

er

ISF-based embedded data loggers

Step 8: Ultimately, bring your generated model back to run on the very hardware you used to collect data

Consider physics-based models

Page 18: Introduction - MEPTECmeptec.org/Resources/3 - Stanley.pdfembedded data loggers Ultimately, bring your generated model back to run on the very hardware you used to collect data Here

TM

External Use 18

A physical model is better if you can Accelerometer Vector Magnitude vs Time

Cavitation starts

We start to get film boiling

Film boiling dominates (rolling boil)

Page 19: Introduction - MEPTECmeptec.org/Resources/3 - Stanley.pdfembedded data loggers Ultimately, bring your generated model back to run on the very hardware you used to collect data Here

TM

External Use 19

When we looked at the standard deviation of the data, we discovered the stove’s heating cycle

Page 20: Introduction - MEPTECmeptec.org/Resources/3 - Stanley.pdfembedded data loggers Ultimately, bring your generated model back to run on the very hardware you used to collect data Here

TM

External Use 20

.csv

.xml

Git repository

Step 2: Create

Run database

table.mat

Step 3: Extract

Features

misc.mat

Visualization

Step 5: Physics-

based model extraction

Step 6: Unsupervised

Machine Learning

Step 7: Supervised

Machine Learning

Model of your system In

tera

ctiv

e D

ata

Logg

er

ISF-based embedded data loggers

Step 8: Ultimately, bring your generated model back to run on the very hardware you used to collect data

Unsupervised machine learning

Page 21: Introduction - MEPTECmeptec.org/Resources/3 - Stanley.pdfembedded data loggers Ultimately, bring your generated model back to run on the very hardware you used to collect data Here

TM

External Use 21

Unsupervised learning can identify clusters

But cannot identify what the clusters represent

Page 22: Introduction - MEPTECmeptec.org/Resources/3 - Stanley.pdfembedded data loggers Ultimately, bring your generated model back to run on the very hardware you used to collect data Here

TM

External Use 22

.csv

.xml

Git repository

Step 2: Create

Run database

table.mat

Step 3: Extract

Features

misc.mat

Visualization

Step 5: Physics-

based model extraction

Step 6: Unsupervised

Machine Learning

Step 7: Supervised

Machine Learning

Model of your system In

tera

ctiv

e D

ata

Logg

er

ISF-based embedded data loggers

Step 8: Ultimately, bring your generated model back to run on the very hardware you used to collect data

Supervised machine learning

Page 23: Introduction - MEPTECmeptec.org/Resources/3 - Stanley.pdfembedded data loggers Ultimately, bring your generated model back to run on the very hardware you used to collect data Here

TM

External Use 23

Supervised Learning starts with data corresponding to known states

Page 24: Introduction - MEPTECmeptec.org/Resources/3 - Stanley.pdfembedded data loggers Ultimately, bring your generated model back to run on the very hardware you used to collect data Here

TM

External Use 24

Here we have used Support Vector Machines (SVM) to find hyper-planes to divide the clusters.

Page 25: Introduction - MEPTECmeptec.org/Resources/3 - Stanley.pdfembedded data loggers Ultimately, bring your generated model back to run on the very hardware you used to collect data Here

TM

External Use 25

Here we have used Logistic Regression on the same data set

Page 26: Introduction - MEPTECmeptec.org/Resources/3 - Stanley.pdfembedded data loggers Ultimately, bring your generated model back to run on the very hardware you used to collect data Here

TM

External Use 26

A classic error is not taking enough data

Page 27: Introduction - MEPTECmeptec.org/Resources/3 - Stanley.pdfembedded data loggers Ultimately, bring your generated model back to run on the very hardware you used to collect data Here

TM

External Use 27

Compare the two side by side

Page 28: Introduction - MEPTECmeptec.org/Resources/3 - Stanley.pdfembedded data loggers Ultimately, bring your generated model back to run on the very hardware you used to collect data Here

TM

External Use 28

.csv

.xml

Git repository

Step 2: Create

Run database

table.mat

Step 3: Extract

Features

misc.mat

Visualization

Step 5: Physics-

based model extraction

Step 6: Unsupervised

Machine Learning

Step 7: Supervised

Machine Learning

Model of your system In

tera

ctiv

e D

ata

Logg

er

ISF-based embedded data loggers

Step 8: Ultimately, bring your generated model back to run on the very hardware you used to collect data

Doing something useful with the result

Page 29: Introduction - MEPTECmeptec.org/Resources/3 - Stanley.pdfembedded data loggers Ultimately, bring your generated model back to run on the very hardware you used to collect data Here

TM

External Use 29

function [class, score1, score2] = score_svm(dataIn)

scale1=1.000000;

Beta1=[-1.797829; 2.370778; 0.614247];

bias1=4.575018;

scale2=1.000000;

Beta2=[-0.334549; 1.026571; 0.663425];

bias2=-0.748881;

mean_data=[4.046597e-01, 1.241677e-02, 1.997011e-02];

stddev_data=[5.116909e-02, 8.566602e-03, 2.431111e-02];

X = dataIn-mean_data;

X = X ./ stddev_data;

score1 = (X/scale1)*Beta1 + bias1;

score2 = (X/scale2)*Beta2 + bias2;

if ((score1<0)&&(score2<0))

class=1;

elseif ((score1>=0)&&(score2<0))

class=2;

elseif ((score1>=0)&&(score2>=0))

class=3;

else

class=4;

end

end

Model generated via support vector machines

Results are identical to those reported when the model was generated.

Page 30: Introduction - MEPTECmeptec.org/Resources/3 - Stanley.pdfembedded data loggers Ultimately, bring your generated model back to run on the very hardware you used to collect data Here

TM

External Use 30

Summary “Sensor Data Analytics” is not a tool you simply run; it is a set of techniques you apply, coupled with a workflow to guide your efforts. Sensor data analytics allow engineers to rethink conventional devices and make them simpler and safer to use and/or offer greater benefits to the quality of life of consumers. Sensor data analytics can make new information available in real time to improve operational efficiency Machine learning techniques are now in the mainstream. Tools are good, and improving. http://blogs.freescale.com/tag/sensor-data-analytics/

Page 31: Introduction - MEPTECmeptec.org/Resources/3 - Stanley.pdfembedded data loggers Ultimately, bring your generated model back to run on the very hardware you used to collect data Here

TM

External Use 31

Secure Embedded Processing Solutions for the Internet of Tomorrow.

TM