The document describes a demonstrator project implementing a floor heating controller on a Raspberry Pi. It uses the Homeport middleware to connect simulated and real devices. A graphical user interface displays temperature readings in real-time from a Simulink simulation running on the Raspberry Pi, but graphics performance is limited due to the Raspberry Pi's hardware.
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
The Casting Demonstrator. Using the Raspberry Pi for graphics and simulated floor heating
1. 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
petur@cs.aau.dk
InfinIT, November 3, 2016
2. Introduction Demonstrator Raspberry Pi Conclusion
Introduction
Cassting demonstrator
Implementation on Raspberry Pi
2/21 petur@cs.aau.dk Cassting Demonstrator
3. Introduction Demonstrator Raspberry Pi Conclusion
Overview
European research project
System synthesis
Floor heating controller
Demonstrator
Real and simulated devices
3/21 petur@cs.aau.dk Cassting Demonstrator
6. 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 petur@cs.aau.dk Cassting Demonstrator
7. Introduction Demonstrator Raspberry Pi Conclusion
Adapter1 Adapter2
... Adaptern
HomePort API
Discovery
Service
Event
Handler
Request
Handler
Data Model
Application1 Application2
... Applicationm
Logging
Service
Daemon
Service
Devices Devices Devices...
Clients Clients Clients...
7/21 petur@cs.aau.dk Cassting Demonstrator
8. Introduction Demonstrator Raspberry Pi Conclusion
Tool Chain Architecture
Uppaal-
Stratego
HomePort GUI
Seluxit adapters
temperature readings valve control
data strategy
weather
forecast
current data
temperature
set-point
8/21 petur@cs.aau.dk Cassting Demonstrator
9. Introduction Demonstrator Raspberry Pi Conclusion
Tool Chain Architecture
Uppaal-
Stratego
HomePort GUI
temperature readings valve control
d
dt Ti (t) = n
j=1 Ad
i,j (Tj (t) − Ti (t)) + Bi (Tenv(t) − Ti (t)) + Hv
j,i · vj
data strategy
weather
forecast
current data
temperature
set-point
8/21 petur@cs.aau.dk Cassting Demonstrator
10. Introduction Demonstrator Raspberry Pi Conclusion
Tool Chain Architecture
Uppaal-
Stratego
HomePort GUI
temperature readings valve control
d
dt Ti (t) = n
j=1 Ad
i,j (Tj (t) − Ti (t)) + Bi (Tenv(t) − Ti (t)) + Hv
j,i · vj
data strategy
weather
forecast
current data
temperature
set-point
8/21 petur@cs.aau.dk Cassting Demonstrator
11. Introduction Demonstrator Raspberry Pi Conclusion
HomePort Library
Rest
Webservice
Simulink
to
Seluxit
Seluxit
Adapter
House
GFX
(SDL2)
Simulink
ERT
Adapter
Forecast
Adapter
Controller
Simulink
Model
LCD ScreenUPPAAL
STRATEGO
Seluxit
Gateway
Setpoint Ctrl
Relay Box Valve1..n
9/21 petur@cs.aau.dk Cassting Demonstrator
12. Introduction Demonstrator Raspberry Pi Conclusion
HomePort Library
Rest
Webservice
Simulink
to
Seluxit
Seluxit
Adapter
House
GFX
(SDL2)
Simulink
ERT
Adapter
Forecast
Adapter
Controller
Simulink
Model
LCD ScreenUPPAAL
STRATEGO
Seluxit
Gateway
Setpoint Ctrl
Relay Box Valve1..n
10/21 petur@cs.aau.dk Cassting Demonstrator
14. Introduction Demonstrator Raspberry Pi Conclusion
Implementation on Raspberry Pi
Not Uppaal
Homeport with adapters
Matlab/Simulink Code Generation
GUI - C++/SDL2
12/21 petur@cs.aau.dk Cassting Demonstrator
15. 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 petur@cs.aau.dk Cassting Demonstrator
16. 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 petur@cs.aau.dk Cassting Demonstrator
20. 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 petur@cs.aau.dk Cassting Demonstrator
21. Introduction Demonstrator Raspberry Pi Conclusion
Possible solution
Pre-render background
Bake rooms
Did not help
19/21 petur@cs.aau.dk Cassting Demonstrator
22. 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
19/21 petur@cs.aau.dk Cassting Demonstrator
23. 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 petur@cs.aau.dk Cassting Demonstrator
24. 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 petur@cs.aau.dk Cassting Demonstrator