WCPS: Wireless Cyber-Physical Simulator
Wireless Cyber-Physical Simulator (WCPS) is an open-source simulation environment for wireless control systems. By integrating Simulink and the TOSSIM wireless sensor simulator in a holistic simulation environment, WCPS accurately captures the dynamics of both the physical systems and the wireless sensor-actuator networks used for control. WCPS has been used for realistic case studies of wireless structural control systems for civil infrastructure, studying routing and control of cyber physical system, and incorporating emergency alarms in reliable wireless process control. The broad application of WCPS is to support cyber-physical systems research on large-scale wireless control systems through high-fidelity joint cyber and physical simulations. This site includes the code release, tutorial, and simulation examples for wireless structural control systems.
- [Software Release] Dockerized WCPS v3.0 for industrial process control is released. here.
- [Software Release] Benchmark Problem in Active Structural Control with Wireless Sensor Network.
- [Software Release] WCPS v2.0 is released.
- [Software Update] Benchmark Wireless Structural Control Problem, July 29, 2014.
- [News] Smart Bridges - Interview and Podcast on Cyber-Physical Systems for Resilient Bridges, August 07, 2013.
- [News] Washington Bridge Collapse Could Be a Wake-up Call, May 30, 2013.
- [News] Matthew Roblez: Structural Engineering Saves Lives, May 22, 2013.
- [News Release] Engineering Professor Working to Help Bridges Survive Natural Disaster, April 26, 2013.
- [Paper] Realistic Case Studies of Wireless Structural Control, ACM/IEEE International Conference on Cyber-Physical Systems (ICCPS'13), April 2013.
- [Software Update] A complete package of Cygwin with TinyOS 2.1.1, MLA, TOSSIM pre-installed was released here, April 01, 2013.
- [Software Update] WCPS v0.1.1 and the four cases studies for the ICCPS'13 paper was released here, March 10, 2013.
- [Tutorial] Wireless structural control examples from a structural perspective, March 09, 2013.
In the Fig.1, WCPS simulates the feedback control loop of the control system as follows. Sensor data is generated from plant models such as structures and water tanks. Through a cross-platform function call from Simulink, sensor data is injected to the corresponding wireless sensors in TOSSIM. Following the routes and transmission schedule calculated by the network manager module, TOSSIM simulates the end-to-end wireless communication of the sensor data packets from the sensors to the base station, and then return the packet delay and loss to the Interfacing Block in Simulink through the Python interface. The Packet Collector module extracts packet delivery information(the delay and loss)from the message pool. Sensor data and their loss and delay are provided to the Data Block, which can feed the sensor data to the controller at the right time based on the packet delay (if the packet is not lost). WCPS utilizes basic API (e.g., the dos, UNIX command) of MATLAB to do cross-platform function calls. In TOSSIM, we re-implement a printf method in TinyOS to send simulation results to the Interfacing Block.
User inputs to WCPS includes reference signals of the plants and wireless traces used as input to TOSSIM. The scheduler module calculates transmission schedules. Networking schedule is then deployed into the MAC layer code of wireless nodes and becomes effective after a TinyOS compilation. The TDMA MAC layer in WCPS is developed based on the MAC Layer Architecture (MLA) library and further adapted for TOSSIM under TinyOS 2.1.1. Received Signal Strength Indication( RSSI) and wireless noises traces are collected from real-world environments and provided to the wireless model used by TOSSIM for realistic wireless network simulations. The interfaces between the Simulink model and TOSSIM are encapsulated as two MATLAB embedded functions in Simulink: the Interfacing Block and the Data Block, as is shown in Fig.2. The Interfacing Block extracts delay and loss information from TOSSIM messages, and the Data Block decides what data will be used for discrete control during each sampling period. The federated architecture of WCPS provides great flexibilities to incorporate different structural models and implement alternative scheduling-control approaches.
- Install TinyOS
WCPS is implemented and tested on MacOS X (snowleopard), Windows XP, and Windows 7. Current release of WCPS is under TinyOS 2.1.1, which can be installed following the two methods.
- Follow the TinyOS official tutorial on installation of TinyOS for your specific platform: Link
- Directly download the pre-tested TinyOS 2.1.1 image from here: TinyOS2.1.1 for SnowLeopard(and possibly later versions) [Cygwin package coming soon.]
- Install Mac Layer Architecture(MLA)
The MAC Layer Architecture (MLA) provides a component-based architecture for MAC protocols in wireless sensor networks. MLA extends the Unified Power Management Architecture to provide the hardware-independent interfaces required by timing sensitive MAC protocols, and defines platform-independent reusable components that implement MAC layer logic on top of them. The MLA architecture can be used to develop a large number of platform-independent MAC implementations, with little or no further effort required to adapt these implementations to new hardware platforms. Our current implementation of MLA is built on top of TinyOS 2.1.1. It currently supports platforms which use the CC2420 radio stack and has been tested on TelosB motes. In addition to providing interfaces and components for building new MAC layer implementations, MLA includes implementations of five representative MAC layers. Specifically for WCPS, we adopt and further change the pure-TDMA MAC protocol for centralized data communication.
- Follow the instructions here: Install MLA.
- Install MATLAB and Simulink
- If you already have MATLAB MATLAB 18.104.22.1684 (2010b) or later version, skip this step. Otherwise, follow the tutorial here: install MATLAB
- Install Python
If you already have Python 2.7.2 or later version installed, skip this step. Otherwise, follow the manual here: install Python
Below is the installation guide of WCPS v3.0. For Mac OSX Users who would like to run WCPS on their own computer, please follow first instruction link below for a detailed installation and test procedures. For OSX/Linux/UNIX/Windows users, please follow the second instruction link below for ruining Dockerized WCPS in a Docker container.
- Install WCPS v3.0 on Mac. Run_WCPS_On_Mac_Guide
- Run WCPS v3.0 using Docker Container. Run_WCPS_In_Docker_Container_Guide
- Dockerized WCPSv3: Docker image, local Matlab folder.
- Local WCPSv3 installation folder.
- A complete package of Cygwin with TinyOS 2.1.1, MLA, TOSSIM pre-installed with a WCPS Cygwin Installation & Usage Tutorial
- WCPS v0.1.1 and four extensive case studies for ICCPS'13 paper
Wireless network plays a critical role in close-loop wireless control system. Sitting on top of WCPS, simulating a wireless TDMA network is as easy as collecting these NesC files below:
- "Makefile" takes advantage of the fact that it's not necessary to recompile all the files not changed while specifying all necessary libraries.
- "TestNetwork.h" defines necessary message structures for the wireless communication.
- "TestNetworkAppC.nc" connects claimed application interfaces to interfaces that are defined in the hardware library.
- "TestNetworkC.nc" implements send/receive functionality of a wireless node.
- "tossim-call.py" configures TOSSIM network and does packet injection into the Tossim network.All above necessary files..
- Re-implemented TOSSIM libraries for TDMA simulation.TDMA components for TOSSIM..
- Wireless traces: Traces for 5-sensor wireless network in a building.
Put all the above files into the same folder, prompt a terminal (or a Cygwin window), and in the terminal run
Make micaz sim
If TinyOS and python is configured correctly, go ahead and run in the terminal:
Having collected aforementioned TinyOS files, a simplified example that uses key networking Interfacing Block and Data Block of WCPS is shown in Fig. 3.
This examples shows:
- How input data in Simulink is injected to TOSSIM network;
- How TOSSIM Interfacing Block runs as a Matlab Embedded function;
- What type of data is output from the Interfacing Block;
- How data usage strategies are applied to the data in the Data Block.
- What type of data is eventually output from the Data Block and provided for future control use.
Source code for the example can be found here. To run this integrated example, simply download, unzip the source code, and run Run_delay_data_func.m in Matlab.
- Chenyang Lu, Wireless Routing and Control: a Cyber-Physical Case Study , ACM/IEEE International Conference on Cyber-Physical Systems (ICCPS'16), Vienna, April 11, 2016.
- Chenyang Lu, Smart Bridges - Interview and Podcast on Cyber-Physical Systems for Resilient Bridges, IEEE Spectrum, August 07, 2013.
- Chenyang Lu, Real-Time Wireless Control Networks for Cyber-Physical Systems, Computer Science Colloquium, Temple University, April 12, 2013.
- Bo Li, Realistic Case Studies of Wireless Structural Control, ACM/IEEE International Conference on Cyber-Physical Systems (ICCPS'13), Philadelphia, PA, April 11, 2013.
- B. Li, Y. Ma, T. Westenbroek, C. Wu, H. Gonzalez, C. Lu. (2016, April). Wireless Routing and Control: a Cyber-Physical Case Study. ACM/IEEE 7th International Conference on Cyber-Physical Systems (ICCPS'16), April 2016.
- B. Li, L. Nie, C. Wu, H. Gonzalez, C. Lu.Incorporating Emergency Alarms in Reliable Wireless Process Control. ACM/IEEE 6th International Conference on Cyber-Physical Systems (ICCPS'15), April 2015.
- B. Li, Z. Sun, K. Mechitov, G. Hackmann, C. Lu, S. Dyke, G. Agha and B. Spencer, "Realistic Case Studies of Wireless Structural Control," ACM/IEEE International Conference on Cyber-Physical Systems (ICCPS'13), April 2013.
- WCPS v3.0: Yehan Ma: email@example.com
- TinyOS and TOSSIM: Bo Li: firstname.lastname@example.org
- Simulink Models: Zhuoxiong Sun: SUN152@purdue.edu