developing measurement and analysis system measurement and analysis system using matlab ... data...

Download Developing Measurement and Analysis System Measurement and Analysis System using MATLAB ... Data Analysis Tasks ... Connect the sensor and acquire the data in the desired engineering

Post on 27-May-2018

213 views

Category:

Documents

1 download

Embed Size (px)

TRANSCRIPT

  • 1 2013 The MathWorks, Inc.

    Developing Measurement and Analysis System using MATLAB

    Senior Application Engineer MathWorks Korea

  • 2

    Agenda

    Great Demo : Battery test demo Overview of data acquisition capabilities from MATLAB Simple examples Acquiring data from stand alone application

    MATLAB Compiler

    Summary Q&A

  • 3 2013 The MathWorks, Inc.

    Realistic Example of T&M System.

    Battery Testing Demo

  • 4

    Control Algorithm Development

    What do I do first? Understand the plant behavior.

    How can I do that? Build a plant model Use the plant model to develop controller

    +u yController

    s1 s2

    s3

    Plant

    System

    Actuators

    Sensors

  • 5

    Battery Equivalent Circuit

    1

    [Main Branch]

    R2R1

    Em

    C1

    End of Discharge Resistance

    Rx = f(SOC, Current, Voltage, Temperature)Transient Dynamics

    End of Charge Resistance Terminal Resistance

    Open-Circuit Voltage

    2

    1VR0

  • 6

    Simulink Model

    What did I just modeled?

    OR OR

  • 7

    Model Correlation

    Every model needs to be correlated against real data.

    1

    [Main Branch]

    R2R1

    Em

    C1

    End of Discharge Resistance

    Rx = f(SOC, Current, Voltage, Temperature)

    Transient DynamicsEnd of Charge Resistance Terminal Resistance

    Open-Circuit Voltage

    2

    1VR0

  • 8

    What is Model Correlation?

    A form of Data Analysis Take raw data Transform it into applicable form Apply it to make engineering decision

  • 9

    Data Analysis Tasks

    Reporting and Documentation

    Outputs for Design

    Deployment

    ShareExplore & Discover

    Data Analysis & Modeling

    Algorithm Development

    Application Development

    Files

    Software

    Hardware

    Access

    Code & Applications

    Automate

  • 10

    Data Analysis Tasks

    Access

    Bring data into MATLAB Test and Measurement Toolbox Vehicle Network Toolbox

    Ensure data integrity during data collection Voltage threshold CAN dropout

    Files

    Software

    Hardware

    Access

    Code & Applications

  • 11

    Data Analysis Tasks

    Explore & Discover

    Data Analysis & Modeling

    Algorithm Development

    Application Development

    Files

    Software

    Hardware

    Access

    Code & Applications

  • 12

    Data Analysis Tasks

    Explore & Discover

    Data Analysis & Modeling

    Algorithm Development

    Application Development

    Files

    Software

    Hardware

    Access

    Code & Applications

    Explorer and Discover

    Data Managing heterogeneous data Visualizing

    Quality Combining different sampling rates Handling missing data Identifying bad data (outliers)

  • 13

    Demo: Pre-Processing of Test Data

    Goal: Prepare data for further analysis

    Approach: Load data from files Combine different sampling

    rates to unified time scale Handle missing data Identify outliers

  • 14

    Demo: Pre-Processing of Test Data

    Goal: Prepare data for further analysis

    Approach: Load data from files Combine different sampling

    rates to unified time scale Handle missing data Identify outliers

  • 15

    Joins for Datasets

    Merge datasets together

    Popular Joins: Inner Full Outer Left Outer Right Outer

    Inner Join

    Full Outer Join

    Left Outer Join

  • 16

    Full Outer Join

    X Y Z1 0.1 0.23 0.3 0.45 0.5 0.67 0.7 0.8

    Key B Y Z

    1

    3

    4

    5

    7

    9

    First Data Set

    A B1 1.14 1.47 1.79 1.9

    Second Data Set

    Key

    Key

    1.1

    1.4

    1.7

    1.9

    0.1

    0.3

    0.7

    0.5

    0.2

    0.4

    0.8

    0.6

    NaN

    NaN

    NaN

    NaN

    NaN

    NaN

    Joined Data Set

  • 17

    Inner Join

    X Y Z1 0.1 0.23 0.3 0.45 0.5 0.67 0.7 0.8

    Key B Y Z

    1

    3

    4

    5

    7

    9

    First Data Set

    A B1 1.14 1.47 1.79 1.9

    Second Data Set

    Key

    Key

    1.1

    1.4

    1.7

    1.9

    0.1

    0.3

    0.7

    0.5

    0.2

    0.4

    0.8

    0.6

    NaN

    NaN

    NaN

    NaN

    NaN

    NaN

    Joined Data Set

    Key B Y Z

    1 1.1 0.1 0.2

    7 1.7 0.7 0.8Joined Data Set

  • 18

    Left Outer Join

    X Y Z1 0.1 0.23 0.3 0.45 0.5 0.67 0.7 0.8

    Key B Y Z

    1

    3

    4

    5

    7

    9

    First Data Set

    A B1 1.14 1.47 1.79 1.9

    Second Data Set

    Key

    Key

    1.1

    1.4

    1.7

    1.9

    0.1

    0.3

    0.7

    0.5

    0.2

    0.4

    0.8

    0.6

    NaN

    NaN

    NaN

    NaN

    NaN

    NaN

    Joined Data Set

    Key B Y Z

    1 1.1 0.1 0.2

    4 1.4 NaN NaN

    7 1.7 0.7 0.8

    9 1.9 NaN NaN

    Joined Data Set

  • 19

    Demo: Pre-Processing of Test Data

    Goal: Prepare data for further analysis

    Approach: Load data from files Combine different sampling

    rates to unified time scale Handle missing data Identify outliers

  • 20

    Techniques to Handle Missing Data

    List-wise deletion Unbiased estimates

    (assuming that the data is MCAR)

    Reduces sample size Loss of power

    Implementation options Listwise deletion is

    built in to many MATLAB functions

    Manual filtering

  • 21

    Techniques to Handle Missing Data

    Substitution - Replace missing data points with a reasonable approximation

    Easy to model

    Too important to exclude

  • 22

    Techniques to handle missing data

    Substitution: Replace the missing data point with something reasonable

    Enables othertypes of analysis

    Error estimateswill be biased

    4 4.5 5 5.5 6

    3

    3.2

    3.4

    3.6

    3.8

    4

  • 23

    Techniques to handle missing data

    Substitution: Replace the missing data point with something reasonable

    4 4.5 5 5.5 6

    3

    3.2

    3.4

    3.6

    3.8

    4

    Missing Data Point

  • 24

    4 4.5 5 5.5 6

    3

    3.2

    3.4

    3.6

    3.8

    4

    Techniques to handle missing data

    Substitution: Replace the missing data point with something reasonable

    Mean Substitution

  • 25

    4 4.5 5 5.5 6

    3

    3.2

    3.4

    3.6

    3.8

    4

    Techniques to handle missing data

    Substitution: Replace the missing data point with something reasonable

    Median Substitution

  • 26

    4 4.5 5 5.5 6

    3

    3.2

    3.4

    3.6

    3.8

    4

    Techniques to handle missing data

    Substitution: Replace the missing data point with something reasonable

    Linear Interpolation

  • 27

    Techniques to handle missing data

    Substitution: Replace the missing data point with something reasonable

    Regression Substitution (Linear)

    4 4.5 5 5.5 6

    3

    3.2

    3.4

    3.6

    3.8

    4

  • 28

    4 4.5 5 5.5 6

    3

    3.2

    3.4

    3.6

    3.8

    4

    Techniques to handle missing data

    Substitution: Replace the missing data point with something reasonable

    More complicated model- Nonlinear regression- Smoothing spline- Localized regression-

  • 29

    4 4.5 5 5.5 6

    3

    3.2

    3.4

    3.6

    3.8

    4

    Techniques to handle missing data

    Substitution: Replace the missing data point with something reasonable

    Mean Substitution

    Regression Substitution (Linear)

    Linear Interpolation

    Median Substitution

    Regression Substitution (Nonlinear)

  • 30

    Demo: Pre-Processing of Test Data

    Goal: Prepare data for further analysis

    Approach: Load data from files Combine different sampling

    rates to unified time scale Handle missing data Identify outliers

  • 31

    Demo: Pre-Processing of Test DataSummary

    Managed data with dataset array

    Merged dataset arrays with join

    Resampled data with fit objects and filled in missing values

    Identified outliers using statistical analysis

  • 32

    Explore & Discover

    Automate

    Access

    Technical Computing Workflow

    Share

  • 33

    MATLAB Connects to Your Hardware

    Data Acquisition ToolboxPlug in data acquisition boards and modules

    Image Acquisition ToolboxImage capture devices

    Instrument Control ToolboxInstruments and RS-232 devices

    Vehicle Network ToolboxCAN bus interface devices

    MATLABInterfaces for communicating with everything

  • 34

    Data Acquisition Toolbox: Supported Hardware Agilent Technologies Keithley

    ISA, PCI, PCMCIA Measurement Computing Corporation

    USB, PC/104, ISA, PCMCIA, Parallel port National Instruments

    Hardware supported by NI-DAQ, NI-DAQmx drivers over AT, PCI, PCI Express, FireWire, PXI, SCXI, PCMCIA, parallel port, USB, CompactDAQ

    Any Windows compatible sound cards (AI, AO) IOtech

    DaqBoard, DaqBook, DaqLab, DaqScan, Personal Daq/3000, and WaveBook Series Data Translation

    All USB and PCI boards CONTEC

    Various boards through CONTEC ML-DAQ adaptor Advantech

    For a complete list, visit www.mathworks.com/products/daq/supportedio.html

  • 35

    Demo: Acquiring and analyzing data from sound cards

    Windows sound card Frequency Analysis Live Data Graphical User

    In

Recommended

View more >