Visible to the public File preview

CPS Design Group
cps.ics.uci.edu

A Ball Goes to School –
Our Experiences from a CPS Design Experiment
Steffen Peter, Frank Vahid, Daniel Gajski, Tony Givargis

supported by 8 April 2013 – CPS Ed 2013, Philadelphia A Ball Goes To School – the National Science Foundation

1

Outline

• Motivation • The Falling Ball Example • Execution • Results

A Ball Goes To School – 8 April 2013 – CPS Ed 2013, Philadelphia

2

Motivation
• Program to teach CPS design to graduate students • Typical design flows for CPS design • Importance of models and their limitations • Introduction to state-of-the art simulation and modeling

tools
• Apply small examples that are: • Easy to understand • Possible to design and evaluate using a variety of tools

and methodologies • are implementable in the lab
A Ball Goes To School – 8 April 2013 – CPS Ed 2013, Philadelphia 3

The Falling Ball Example

-

-

Easily understood Need for precise timing Physical process needing mathematical modeling No perfect precision in cyber part Can be build in the lab

A Ball Goes To School – 8 April 2013 – CPS Ed 2013, Philadelphia

4

Execution
• Students modeled or implemented the system applying a

range of tools (one per student) • Progress, advantages and problems of the selected tools are discussed in the group
• Real Implementation • Raspberry Pie Board, gcc environment • Model based • Modelica • Simulink • Ptolemy • SystemC
A Ball Goes To School – 8 April 2013 – CPS Ed 2013, Philadelphia 5

Simulink / Matlab

A Ball Goes To School – 8 April 2013 – CPS Ed 2013, Philadelphia

6

SystemC
//====================================================== // Name : ball.cpp //====================================================== #include <iostream> #include "ball.h"
cyber_clk @ 1KHz

position = 0 sensor_1 physical_clk @1MHz sensor_2 gripper position = 0.5 x a x t2

Ball::Ball(sc_module_name name): sc_module(name) { time_us = 0; g_force = 0.0000000098; Controller Module SC_METHOD(position_update); dont_initialize(); sensitive << clk.pos(); }

position

Ball Module

void Ball::position_update() { position = 0.5 * g_force * time_us * time_us; //cout << "position:" << position << endl; //cout << "time: " << sc_time_stamp() << endl; time_us++; }

A Ball Goes To School – 8 April 2013 – CPS Ed 2013, Philadelphia

7

Modelica

Height [m]

Time [s] A Ball Goes To School – 8 April 2013 – CPS Ed 2013, Philadelphia 8

Discovered and discussed challenges:
• Math and modeling the physical system • Separation of physical and cyber part • Design methodologies of graphical design tools • Selection of an appropriate Model of Computation • Zeno behavior and simulation time resolution issues

A Ball Goes To School – 8 April 2013 – CPS Ed 2013, Philadelphia

9

Conclusions
• The Falling Ball example is a suitable use case to

teach CPS design
• Simplicity of the example allows students to focus on

the actual CPS design challenges
• In four weeks (10h/week) students learned • how to use CPS design tools, • model a CPS system, • run simulations, • test the system and evaluate the results • Discovered design challenges are good support for

lecture
A Ball Goes To School – 8 April 2013 – CPS Ed 2013, Philadelphia 10

Thank you

A Ball Goes To School – 8 April 2013 – CPS Ed 2013, Philadelphia

11