25
Cassting Demonstrator Mads Kronborg Kim G. Larsen Marco Muniz Petur Olsen Thomas Pedersen Arne Skou Jiri Srba Center for Embedded Software Systems Aalborg University, Denmark [email protected] InfinIT, November 3, 2016

The Casting Demonstrator. Using the Raspberry Pi for graphics and simulated floor heating

Embed Size (px)

Citation preview

Page 1: The Casting Demonstrator. Using the Raspberry Pi for graphics and simulated floor heating

Cassting Demonstrator

Mads Kronborg Kim G. Larsen Marco MunizPetur Olsen Thomas Pedersen Arne Skou Jiri Srba

Center for Embedded Software SystemsAalborg University, Denmark

[email protected]

InfinIT, November 3, 2016

Page 2: The Casting Demonstrator. Using the Raspberry Pi for graphics and simulated floor heating

Introduction Demonstrator Raspberry Pi Conclusion

Introduction

Cassting demonstrator

Implementation on Raspberry Pi

2/21 [email protected] Cassting Demonstrator

Page 3: The Casting Demonstrator. Using the Raspberry Pi for graphics and simulated floor heating

Introduction Demonstrator Raspberry Pi Conclusion

Overview

European research project

System synthesis

Floor heating controller

Demonstrator

Real and simulated devices

3/21 [email protected] Cassting Demonstrator

Page 4: The Casting Demonstrator. Using the Raspberry Pi for graphics and simulated floor heating

Introduction Demonstrator Raspberry Pi Conclusion

4/21 [email protected] Cassting Demonstrator

Page 5: The Casting Demonstrator. Using the Raspberry Pi for graphics and simulated floor heating

Introduction Demonstrator Raspberry Pi Conclusion

5/21 [email protected] Cassting Demonstrator

Page 6: The Casting Demonstrator. Using the Raspberry Pi for graphics and simulated floor heating

Introduction Demonstrator Raspberry Pi Conclusion

Homeport

Middleware for heterogeneous home automation networks

Abstracts underlying physical devices

Adapters

RESTful interface

Real and simulated devices

6/21 [email protected] Cassting Demonstrator

Page 7: The Casting Demonstrator. Using the Raspberry Pi for graphics and simulated floor heating

Introduction Demonstrator Raspberry Pi Conclusion

Adapter1 Adapter2... Adaptern

HomePort API

DiscoveryService

EventHandler

RequestHandler

Data Model

Application1 Application2... Applicationm

LoggingService

DaemonService

Devices Devices Devices...

Clients Clients Clients...

7/21 [email protected] Cassting Demonstrator

Page 8: The Casting Demonstrator. Using the Raspberry Pi for graphics and simulated floor heating

Introduction Demonstrator Raspberry Pi Conclusion

Tool Chain Architecture

Uppaal-Stratego

HomePort GUI

Seluxit adapters

temperature readings valve control

data strategy

weatherforecast

current data

temperatureset-point

8/21 [email protected] Cassting Demonstrator

Page 9: The Casting Demonstrator. Using the Raspberry Pi for graphics and simulated floor heating

Introduction Demonstrator Raspberry Pi Conclusion

Tool Chain Architecture

Uppaal-Stratego

HomePort GUI

temperature readings valve control

ddtTi (t) =

∑nj=1 A

di ,j(Tj(t) − Ti (t)) + Bi (Tenv(t) − Ti (t)) + Hv

j ,i · vj

data strategy

weatherforecast

current data

temperatureset-point

8/21 [email protected] Cassting Demonstrator

Page 10: The Casting Demonstrator. Using the Raspberry Pi for graphics and simulated floor heating

Introduction Demonstrator Raspberry Pi Conclusion

Tool Chain Architecture

Uppaal-Stratego

HomePort GUI

temperature readings valve control

ddtTi (t) =

∑nj=1 A

di ,j(Tj(t) − Ti (t)) + Bi (Tenv(t) − Ti (t)) + Hv

j ,i · vj

data strategy

weatherforecast

current data

temperatureset-point

8/21 [email protected] Cassting Demonstrator

Page 11: The Casting Demonstrator. Using the Raspberry Pi for graphics and simulated floor heating

Introduction Demonstrator Raspberry Pi Conclusion

HomePort Library

RestWebservice

Simulinkto

Seluxit

SeluxitAdapter

HouseGFX

(SDL2)

SimulinkERT

Adapter

ForecastAdapter

Controller

SimulinkModel

LCD ScreenUPPAALSTRATEGO

SeluxitGateway

Setpoint Ctrl

Relay Box Valve1..n

9/21 [email protected] Cassting Demonstrator

Page 12: The Casting Demonstrator. Using the Raspberry Pi for graphics and simulated floor heating

Introduction Demonstrator Raspberry Pi Conclusion

HomePort Library

RestWebservice

Simulinkto

Seluxit

SeluxitAdapter

HouseGFX

(SDL2)

SimulinkERT

Adapter

ForecastAdapter

Controller

SimulinkModel

LCD ScreenUPPAALSTRATEGO

SeluxitGateway

Setpoint Ctrl

Relay Box Valve1..n

10/21 [email protected] Cassting Demonstrator

Page 13: The Casting Demonstrator. Using the Raspberry Pi for graphics and simulated floor heating

Introduction Demonstrator Raspberry Pi Conclusion

11/21 [email protected] Cassting Demonstrator

Page 14: The Casting Demonstrator. Using the Raspberry Pi for graphics and simulated floor heating

Introduction Demonstrator Raspberry Pi Conclusion

Implementation on Raspberry Pi

Not Uppaal

Homeport with adapters

Matlab/Simulink Code Generation

GUI - C++/SDL2

12/21 [email protected] Cassting Demonstrator

Page 15: The Casting Demonstrator. Using the Raspberry Pi for graphics and simulated floor heating

Introduction Demonstrator Raspberry Pi Conclusion

Matlab/Simulink

Thermodynamics simulation

Four times per second

Homeport adapter

Sends new values to Homeport

Received values from Homeport

Code generation out-of-the-box

13/21 [email protected] Cassting Demonstrator

Page 16: The Casting Demonstrator. Using the Raspberry Pi for graphics and simulated floor heating

Introduction Demonstrator Raspberry Pi Conclusion

Graphical User Interface

Simple DirectMedia Layer

C++

OpenGL

Game development

Simple game loop - event, update, render

Dynamic rendering

14/21 [email protected] Cassting Demonstrator

Page 17: The Casting Demonstrator. Using the Raspberry Pi for graphics and simulated floor heating

Introduction Demonstrator Raspberry Pi Conclusion

15/21 [email protected] Cassting Demonstrator

Page 18: The Casting Demonstrator. Using the Raspberry Pi for graphics and simulated floor heating

Introduction Demonstrator Raspberry Pi Conclusion

16/21 [email protected] Cassting Demonstrator

Page 19: The Casting Demonstrator. Using the Raspberry Pi for graphics and simulated floor heating

Introduction Demonstrator Raspberry Pi Conclusion

17/21 [email protected] Cassting Demonstrator

Page 20: The Casting Demonstrator. Using the Raspberry Pi for graphics and simulated floor heating

Introduction Demonstrator Raspberry Pi Conclusion

Performance issues

Runs at about 2-3 FPS

CPU utilization about 40%

Vast majority of CPU time spent waiting for drawing

Grid tiles 96x54 = 5184

18/21 [email protected] Cassting Demonstrator

Page 21: The Casting Demonstrator. Using the Raspberry Pi for graphics and simulated floor heating

Introduction Demonstrator Raspberry Pi Conclusion

Possible solution

Pre-render background

Bake rooms

Did not help

Full HD 1920x1080

Proves to much for the graphics chip

No graphics upgrade in new Raspberry Pi

19/21 [email protected] Cassting Demonstrator

Page 22: The Casting Demonstrator. Using the Raspberry Pi for graphics and simulated floor heating

Introduction Demonstrator Raspberry Pi Conclusion

Possible solution

Pre-render background

Bake rooms

Did not help

Full HD 1920x1080

Proves to much for the graphics chip

No graphics upgrade in new Raspberry Pi

19/21 [email protected] Cassting Demonstrator

Page 23: The Casting Demonstrator. Using the Raspberry Pi for graphics and simulated floor heating

Introduction Demonstrator Raspberry Pi Conclusion

Possible solution

Pre-render background

Bake rooms

Did not help

Full HD 1920x1080

Proves to much for the graphics chip

No graphics upgrade in new Raspberry Pi

19/21 [email protected] Cassting Demonstrator

Page 24: The Casting Demonstrator. Using the Raspberry Pi for graphics and simulated floor heating

Introduction Demonstrator Raspberry Pi Conclusion

Conclusion

Excellent platform for the demonstrator

(Mostly) Easy to develop on

Prototyping with Matlab/Simulink

Very good performance, except

Lacking graphics performance

20/21 [email protected] Cassting Demonstrator

Page 25: The Casting Demonstrator. Using the Raspberry Pi for graphics and simulated floor heating

Introduction Demonstrator Raspberry Pi Conclusion

Questions?

21/21 [email protected] Cassting Demonstrator