Simulink and OpenSees Real-time Applications White paper

Add to My manuals
9 Pages

advertisement

Real-time Applications Simulink and OpenSees white paper | Manualzz

Real-time Applications Using Simulink and

OpenSees

Introduction

Real-time computing and operating systems provide a computational environment that allows for a very high degree of determinism, significantly more then standard commercially available operating systems like Windows or UNIX. An application running under a real-time kernel has essentially full control of the microprocessor and its associated resources.

FHT applications have been developed and tested at CU using two different real- time comp uting kernels. The first, Simulink and xPC Target create a host-target computer pair that will run a real-time version of a Simulink model in the real-time kernel provided by xPC Target. A second and similar host-target pair is created using the Venturcom’s TNT

Real-time Embedded ToolSuite (ETS) and the Open System for Earthquake Engineering

Simulation (OpenSees). The object oriented finite element program OpenSees has been modified to operate under the real-time ETS kernel.

These two real-time application development environments, xPC and ETS, provide a broad and well tested basis for custom application development. The ETS-OpenSees package has the benefit of being an extensive and supported Finite Element Program complete with a large library of existing elements and computational capabilities. On the other hand, the Simulink- xPC package provides a much more user friendly environment and the ease of symbolic building blocks and programming tools.

Another useful aspect of the xPC real-time kernel is a fully integrated real- time simulation mode. This simulation mode makes it possible to run realistic test simulations using the actual MTS servo-control program. In this mode of operation the actuators and test specimen are simulated in real- time using xPC while the remaining elements of the controller are the actual components that will be used for testing.

The MTS servo-control system constitutes a third unique real-time host-target computing environment. The application and capabilities of this real-time pair are for all practical purposes fixed. The three real-time pair s share information and communicate through a high performance fiber optic network.

1

Real-Time Communication Network

Real-time applications like the FHT system at University of Colo rado require a distributed computational approach and present a significant performance challenge in the area of network communication. Connecting multiple computers such that time critical inter-process communication is reliably completed is a very important element of the FHT system. This is achieved by integrating real-time host-target computer pairs that are running three unique real- time operating systems with a high performance fiber-optic shared memory network. This Shared Common RAM Network (SCRAMNet) is the realtime communication backbone of the FHT system.

With the SCRAMNet any memory write command to the correctly designated memory sector of the respective application is essentially instantly replicated at identical memory sectors throughout the fiber-optic network ring. The fiber optic line transmission rate is

150 Mbits/sec. There are no bus contentions, time consuming communication protocols, or unpredictable system time outs. The architecture and communication protocol implemented in the SCRAMNet network has been optimized for very low latency and deterministic data transfer. Table 1 summarizes some of the performance specifications for the SCRAMNet SC150E PCI board that is integrated into the 3 real-time applications running concurrently in the FHT system.

Table 1 SCRAMNet Performance Specifications

Item

Network access time for memory write

Specification

100-800 nanoseconds

Per node latency for network message

Node Latency (4 bytes/packet)

Network Data Bandwidth (4 byte/packet)

Maximum Number of network Nodes

Network Line Transmission Rate

250-800 nanoseconds

250 to 800 nanoseconds

12 MB/second

256

150 Mbits/sec

xPC Target and Simulink

Of the two real-time programming environments, xPC/S imulink is probably the easiest to understand and use. Mathworks, Inc. has extended and enhanced the capabilities of

Matlab with a software package called Simulink. Simulink is then extended into the relm of real-time modeling with another Mathworks package called Real- Time Workshop.

Real-Time Workshop, in conjuction with Microsoft Visual C++, work together to

2

produce an application that will run in real-time. The final software link is provided by xPC, also produced by Mathworks, Inc. XPC is essentially the hardware and microprocessor specific real-time kernel that utilizes the Intel Pentium Processor.

Matlab

Matlab is a high-performance computing language for numerical problem solving or on a functional level it could be considered a matrix laboratory. It integrates computation, visualization, and programming in an easy-to-use environment where problems and solutions are expressed in familiar a mathematical notation. Matlab is an interactive system whose basic data element is an array that does not require dimensioning. This allows you to solve many technical computing problems, especially those with matrix and vector formulations, more efficient ly then noninteractive language s such as C or

Fortran. More detailed information about matlab is available that the Mathworks website, For more information about Matlab and other Mathworks products visit the

Mathworks website at http://www.mathworks.com/ . The Matlab computational engine utilize the LAPACK and BLAS libraries, embedding the state of the art in software for matrix computation

Simulink

Simulink is software packages that runs in conjunction with Matlab and makes it possible to model, simulate, and analyze linear and nonlinear dynamic systems. Simulink can be used to explore the behavior of a wide range of dynamic systems, including electrical, mechanical, and structural systems. Simulating a dynamic system is a two-step process with Simulink. First, you create a graphical model of the system to be simulated, using the Simulink model editor. The model depicts the time-dependent mathematical relationships among the system's inputs, states, and outputs. Essentially a dynamic system’s governing differential equations are translated into a graphical representation using the library of Simulink blocks and/or user defined blocks. Then, Simulink is used to simulate the behavior of the system over a specified time period. Through easy to use popup menus Simulink acquires information that you enter which specifies simulation and model parameters for your specific dynamic system.

Real-time Workshop

Real-Time Workshop extends the capabilities of Simulink and Matlab to enable prototyping of real-time software applications on a variety of systems. Real-Time

Workshop, uses other Mathworks tools and components to provide automatic code generation tailored for a specific target platform. The FHT system targets an Intel

3

Pentium PC as the ho me of the real-time application and kernel, the code generated is C.

So at the core of Real-time Workshop is the Target Language Compiler (TLC) which takes the Simulink model and creates the C source code for the real-time application.

The C code for the application is compiled and linked using Microsoft Visual C++.

xPC Target

As indicated above a FHT system has been developed using an Intel Pentium processor for the real-time target, thus the name xPC Target. XPC Target is another of Mathworks product that provides a solution for prototyping, testing, and deploying real- time systems using standard PC hardware. It is an environment that uses a target PC, separate from a host PC, for running real- time applications. xPC Host-Target Configuration

As is typical of most real-time prototyping systems xPC uses a computer host and target pair to generate and run real-time applications. The host-target communication may be configured for either a RS 232 serial or a standard Ethernet communication link. The

FHT system uses the Ethernet communication link as it has proven to be faster and more reliable then the RS 232 link.

The operating system running on the host computer is Microsoft Windows XP. The host computer is loaded with Matlab, Simulink, Real-time Workshop, xPC Target, and

Microsoft Visual C++. Prior to building the real-time application the target computer is booted to the xPC real-time kernel using a standard 3.5 inch floppy disk.

In a typical real-time xPC application the internal clock on the target computer is programmed and used to trigger the time increment or application clock cycle. FHT realtime applications are configured such that the time increment occurs each time an interrupt is received on the appropriately designated SCRAMNet memory location. This interrupt is generated each time the MTS servo-controller writes a data set to the

SCRAMNet. This takes place approximately every 976.6 microseconds (1/1024), or for practical purposes every millisecond. xPC and SCRAMNet

The real- time xPC application will typically need information from the test specimen, i.e. applied force and/or displacement at each of the hydraulic actuators. Information of this nature is passed to the real-time application through the shared memory of the

SCRAMNet. Mathworks includes the Simulink blocks needed to configure and carry out

4

this communication using SCRAMNet. It should also be mentioned that this is how the real-time application sends a discrete displacement command signal to the MTS controller and actuators. Although instead of reading from the SCRAMNet, in this case the real-time application is writing to the shared memory. In Figure 1 the 3 real-time host target computer pairs are represented graphically. All three pairs as well as the data acquisition (DAQ) computer are connected by the SCRAMNet ring. The programmer or program operator will sit at the host computer and develop and control the real-time application. The real-time kernel running on the target computer has only very basic IO capabilities.

Figure 1 – FHT System Real-time Components

5

TNT Embedded ToolSuite and OpenSees

A second real-time development and programming environment, Phar LAP ETS,

(produced by Venturcom, Inc. in Waltham, MA) compliments the Simulink/xPC system described above. Also referred to as TNT this real-time host-target pair extends the capabilities of Microsoft Visual C++ to include single process, multi-threaded real- time applications.

Embedded ToolSuite (ETS) is a complete embedded development environment for Intel's

32-bit x86 processors, featuring a Windows- friendly real-time operating system (RTOS) and the Real-time ETS Kernel. The Real-time ETS Kernel was built from the ground up to meet the requirements of industrial-strength embedded applications. Based on a subset of the Win32 API, the Real-time ETS Kernel provides hard real-time functionality in a

Windows- friendly package. ETS seamlessly integrates into Microsoft Visual C++ and the

Developer Studio Integrated Development Environment (IDE), providing a development environment that readily accommodates the source code for OpenSees.

OpenSees is a fully object oriented software framework for simulating the seismic response of structural and geotechnical systems. OpenSees is intended to serve as a computational platform for research in performance-based earthquake engineering. The source code for OpenSess is freely available to any one who wishes to use it and can be downloaded from the UC Berkeley OpenSees website at http://opensees.berkeley.edu

.

ETS can be divided into two major components: (1) The real-time kernel that runs on the target computer, and (2) the ETS monitor which connects the host and target computers together. The kernel memory requirements are summarized in Table 2.

Table 2 ETS Kernel Memory Requirements

6

Host-Target Communication

A serial communication link between the host and target is used to download the realtime application as well as start and stop it. A parrallel communication option is available but an Ehternet link is not available .

Protected Mode

The real- time ETS kernel always sets up a protected mode for the real-time application.

In protected mode, the segment registers contain an index into a table of segment descriptors. Each segment descriptor contains the start address of the segment, to which the offset is added to generate the address. In addition, the segment descriptor contains memory protection information. This includes an offset limit and bits for write and read permission. This allows the processor to prevent memory accesses to certain data. The operating system can use this to protect different processes' memory from each other, hence the name "protected mode".

Multiple Threads and Real -time

An important and distinguishing characteristic of the real- time capabilities of ETS is the deterministic execution of multiple or single threads within a single process. When multiple threads exist the highest priority thread will always run. Once the high priority thread ends or blocks the next highest priority thread runs. ETS does not support multiple processes; all ETS applications must be designed to operate as single process applications. This does not create any conflicts with the OpenSees but does require that the scripting interface, Tcl, be disabled.

The modified FHT version of OpenSees currently in use at CU is a single process, single thread application. The integration algorithm for the governing equations of motion is not readily broken into multiple threads. So during each integration time step a single thread is used to process feedback information from the test structure and compute the next set of displacement commands.

OpenSees and Test Structure Feedback and Control

The real- time FHT implementation of OpenSees requires test specimen or actuator feedback signals i.e. the measured reaction force(s) and actuator displacement(s). Much

7

like xPC applications this information is obtained by OpenSees using SCRAMNET. The displacement command calculated by the current integration time step is passed to the

MTS servo-controller through SCRAMNet. So during each time step OpenSees reads test structure feedback signals and writes actua tor displacement commands. The period of each time step is again dictated by the clock cycle of the MTS servo-controller which is set to 976.6 microseconds or 1024 Hz.

OpenSees and Real-time

The research team at CU-Boulder has developed a unique integration algorithm for the

FHT system. This algorithm has been encoded in C++, compiled and linked with

OpenSees.

The most demanding FHT test reproduces the base motion induced loading of a structure at the same loading rate as an earthquake, in other words there is a one to one correspondence of time in the experiment to time in the seismic event. In order to accurately preserve this relationship each integration step in the OpenSees application is triggered by the MTS servo-controller generated interrupt that is received through the

SCRAMNet. Figure 2 illustrates this timing. At the conclusion of the writing portion of the MTS control program’s SCRAMNet memory update a system interrupt is generated.

This interrupt is communicated to all computers on the SCRAMNet ring. This interrupt then initiates the processing cycle of the other real- time applications. This prevents any slippage in the phase relationship of the multiple process cycles, maintaining precise synchronized operation.

During a Fast Hybrid Test, aside from defining the conventional structural model, the user needs to define a special experimental element in OpenSees to represent the physical test specimen. This special element is responsible for data communications between

OpenSees and the controller/DAQ during the test. The user must provide information for defining this element. This includes a measured initial stiffness matrix of the specimen, a transformation matrix from global coordinate to actuator coordinates, and a second one in the reverse order.

The original OpenSees has a Tcl model builder as its user interface. Tcl needs to be installed on the computer as a separate program. The Tcl shell takes interactive OpenSees commands or a script file containing a series of OpenSees commands. It is, however, not possible for the ETS operating system to run two separate programs or processes at the same time. For this reason, the Tcl model builder was translated into and replaced by a new model builder written in C code. As a result, no separate program needs to be downloaded to the target PC, only the OpenSees executable. This new model builder will read and parse an input file containing OpenSees commands. These commands are in the

8

same format as the original OpenSees Tcl commands. The OpenSees Command

Language Manual is still applicable.

Figure 2 – Multiple Application Synchronization

9

advertisement

Key Features

  • Real-time computing
  • Simulink modeling
  • OpenSees finite element analysis
  • User-friendly interface
  • Object-oriented framework
  • Seismic response simulation
  • Structural and geotechnical systems
  • Real-time applications
  • Earthquake engineering

Related manuals

Frequently Answers and Questions

What are the key components of Simulink and OpenSees?
Simulink and OpenSees consists of two main components: Simulink, which is a graphical environment for modeling and simulating dynamic systems, and OpenSees, which is an object-oriented framework for finite element analysis of structural and geotechnical systems. These two components work together to provide a comprehensive platform for real-time application development in earthquake engineering.
What are some of the benefits of using Simulink and OpenSees?
Some of the key benefits of using Simulink and OpenSees include a user-friendly interface, object-oriented programming, a large library of existing elements and computational capabilities, and the ability to model and simulate a wide range of dynamic systems, including electrical, mechanical, and structural systems. The software also provides a robust environment for developing real-time applications for earthquake engineering.
What are some of the applications of Simulink and OpenSees?
Simulink and OpenSees are used in a variety of applications in earthquake engineering, including the development of real-time control systems for shaking tables, the simulation of seismic response of structures, and the evaluation of performance-based earthquake engineering designs.
Download PDF

advertisement