INDUSTRIAL CONTROL SYSTEM SIMULATION ROUTINES:SOFTWARE AND SIMULATOR

SOFTWARE AND SIMULATOR

The simulation of both industrial process and system models including controllers must be experimented with by either simulation software or simulators. Simulation software consists of computer programs that can imitate real events and phenomena as realistically as possible based on a group of mathematical equations and formulas, or a set of logical relations and state transfers. Hundreds of such packages have been developed, nevertheless, which can be suitable for such classes as discrete events, continuous processes, single nodes and network systems, and electronic circuits.

An industrial simulator is a special system which integrates computation, visualization, and programming into an easy-to-use environment which provides tools and facilities for simulation hardware and software as well as mechanical instruments. There are a considerable number of industrial simulation tools for various applications, which are therefore impossible to cover in this section. Four of them are briefly introduced in subsection 19.3.2.

Industrial simulation software

In general, industrial simulation software is developed for discrete-event simulation, continuous process or system simulation, network simulation, or electronic circuit simulation. Many industrial simulators, such as CNC and PID controller simulators, are actually effective combinations of different types.

(1) Discrete-event simulation software

A discrete-event simulation is one in which the state of a model changes at only a discrete, but possibly random, set of time points. This often leads to logical complexity because it raises questions about the order in which two or more units are to be manipulated at one time point. For example, two or more traffic units often have to be manipulated at the same time. Such a “simultaneous” movement is achieved by manipulating units of traffic serially at that time point. The challenges faced by a software designer must take the logical requirements of discrete-event simulation into account in a generalized way. Choices and trade-offs exist. As a result, although the software packages are similar in broad terms, they can and typically do differ in subtle but important particulars.

In addition to the representation of state variables and the logical relations of what happens when events occur, discrete-event simulations include the following elements:

(1) Events

An event is a happening that changes the state of a process or a system model. In a model of an order- filling system, for example, the arrival of an order, which is an event, might be simulated by bringing an entity into the model.

(2) Entities

The term entity is used here to designate a unit of transaction. Entities instigate and respond to events. There are two possible types, here referred to as external entities and internal entities. External entities are those whose creation and movement is explicitly arranged for by the modeler. Entities migrate from state to state while they work their way through a model. Correspondingly, simulation software uses the following lists to organize and track entities in the five entity states. (i) The active entity forms an unnamed “list” consisting only of the active entity. (ii) Entities in the ready state are kept in a single list called the current events list. (iii) Entities in the time-delayed state belong to a single list called the future events list. (iv) Delay lists keep tentities in the condition-delayed state. (vi) User-managed lists are lists of entities in the dormant state.

(3) Simulation clock

The simulation must keep track of the current simulation time, in whatever measurement units are suitable for the system being modeled. In discrete-event simulations, as opposed to real-time, time “hops” because events are instantaneous: the clock skips to the next event start time as the simulation proceeds.

(4) Control components

Control components include: (i) an initialization routine, which initializes the model at time 0; (ii) a timing routine, which determines the next event time, type; advance clock; (iii) event routines, which carry out logic for each event type; (iv) library routines, which are utility routines to generate random variants, etc.; (vi) a report generator to summarize and report results at the end; (vii) the main program, which ties routines together and executes them in right order.

(5) Random-number generators

The simulation needs to generate random variables of various kinds, depending on the system model. This is accomplished by one or more pseudorandom-number generators. The use of pseudorandom numbers as opposed to true random numbers is a benefit should a simulation need a rerun with exactly the same behavior.

A simulation project is composed of experiments, each consisting of one or more replications (trials). A replication is a simulation that uses the experiment’s model logic and data but a different set of random numbers, and so produces different statistical results which can then be analyzed across a set of replications. A simulation project thus involves initializing the experimental model, running it until a run-ending condition is met, and reporting results. Figure 19.11 describes such a project.

(2) Continuous simulation software

Continuous simulation classifies simulations either for a continuous process or for a continuous system, which are usually described by sets of ordinary or partial differential equations, possibly coupled with algebraic ones. Continuous simulation introduces partly symbolical and partly numerical algorithms based on the mechanisms that dynamically govern the process or system.

Modern environments relieve the occasional user from having to understand how the simulation actually works. Once the mathematics has been formulated, the modeling and simulation environment compiles and simulates it, and curves of result trajectories appear magically on the user’s screen. Yet, magic has a tendency to fail, and it is then that the user must understand what went wrong, and why the model could not be simulated as expected.

Continuous simulation is a highly software-oriented task, mostly based on MATLAB, a process or system simulator. Advanced Continuous Simulation Language (ACSL) is another language designed for modeling and evaluating performance by time-dependent, nonlinear differential equations. It is a dialect of the Continuous System Simulation Language (CSSL), originally designed by the Simulations Council Inc. (SCI) in 1967 in an attempt to unify continuous simulation subjects.

Continuous simulation is often combined with discrete simulation as discrete-continuous simulation. In this approach, continuous variables are described by differential equations; and discrete events can occur that affect the continuously changing variables. Some discrete-event simulation software will also do combined discrete-continuous simulation.

(3) Network simulation software

Network simulation software is designed to model the potential behaviors of computer networks. These applications allow network engineers to simulate scenarios without a testbed of networked computers, network routers, and other, potentially expensive, hardware devices. Most products allow designers to experiment with nodes such as bridges, hubs, optical cross-connections and media access units (MAUs).

Such software is also used to model scenarios such as a sudden increase in network traffic or the effects of a denial-of-service attack. Some enable experimentation with various data layers, network layers, and routing and transportation protocols in networks consisting of point-to-point, Ethernet, and other standard-segment types.

(a) Network simulation principles

Simulation of networks can be a difficult task. For example, if congestion is high, then estimation of the average occupancy is challenging because of high variance. To estimate the likelihood of a buffer overflow in a network, the time required for an accurate answer can be fantastically large.

Most network simulations use discrete-event simulation, in which a list of pending events is stored, and those events are processed in order, with some events triggering future ones, such as the arrival of a packet at one node triggering its arrival at a downstream node.

Specialized techniques such as control variates and importance sampling have been developed to speed up simulation of data transmission in networks. Some problems, notably those relying on queuing theory, are well suited to Markov chain simulations, in which no list of future events is maintained and the simulation consists of transiting between different system states in a memory-less fashion. Markov chain simulation is typically faster, but less accurate and flexible, than detailed discrete-event simulation. Some simulations are cyclic-based, which are faster than event-based simulations.

(b) Network simulators

Often, network simulators are used to test new or changed protocols in a controlled environment. A network simulator is a program that imitates the working of a computer network, where the network is typically modeled with devices, traffic, etc., so its performance can be analysed. Typically, users can then customize the simulator to fulfill their specific analysis needs.

Most commercial simulators are GUI-driven, while some require input scripts or commands (network parameters). These parameters describe the state of the network (node placement, existing links) and the events (data transmissions, link failures, etc.). An important output of simulations is the

Industrial control system simulation routines-0207

trace files, which document every event that occurred in the simulation and are used for analysis. Certain simulators have the added functionality of capturing this type of data directly from a func- tioning production environment, at various times of the day, week, or month, in order to reflect average, worst-case, and best-case conditions. Network simulators can also provide other tools to facilitate visual analysis of trends and potential troublespots.

(c) Network protocol simulation software

Network simulation software supports protocols such as ATM, Ethernet, IPv4, IPv6, token bus, and token ring. Asynchronous transfer mode (ATM) is a high-speed technology that uses fiber-optic or CAT-5 copper cables. Ethernet is a local-area network (LAN) protocol that serves as the basis for the IEEE 802.3 standard, and which specifies the physical and lower software layers. IPv4 and IPv6 are the fourth and sixth versions, respectively, of Internet Protocol (IP), a technology for transmitting data across a packet-switched network. Token bus features a bus topology and uses a virtual token-passing mechanism for regulating network traffic. With token ring networks, all devices are connected in a ring or star. Network simulation software for other network protocols is also available.

(4) Electronic circuit simulation softwares

Software for electronic circuit simulation is used for designing circuits, schematics, wiring diagrams, and embedded systems (including firmware). Specialized software applications are used to draw schematics for printed circuit boards (PCBs), electronic or mechanical components, the design of microcontrollers and microprocessors, and systems for computer-aided manufacturing (CAM).

Electronic design services perform several steps to design a circuit. First, they review the customer’s requirements and produce a technical report. Next, they draft a schematic or circuit diagram to meet the project’s specifications. After calculating the component values, they perform simulations to verify the correctness and accuracy of the circuit design. Unless changes are required, a breadboard or other prototype version is then built. Electronic design services also select parts and materials, recommend a production method, and present their work to the customer. A number of prototypes are tested or type-tested to ensure compliance with the project’s requirements.

Electronic design services differ in terms of capabilities. Some companies specialize in the design of digital electronics and embedded systems, others in PCB layouts for analog electronics.

(a) Computer-based circuit simulators

Computer-based circuit simulation is a two-step process. The first step must construct the actual circuit diagram using wires and electronics components (i.e. resistor, capacitors, inductor, diodes, integrated circuits, etc.). The second step varies the inputs to the circuit and to see how it affects operation and outputs by calculating ideal theoretical behavior from Kirchhoff’s laws (see Wikipedia).

The industry standard analog circuit simulator is SPICE (Simulation Program with Integrated Circuit Emphasis), which was originally developed at the University of Berkeley during the 1970s. SPICE (v2G.6) is the basis for many commercial computer software programs, which provide the GUI (graphical user interface), but use the SPICE (or WinSPICE) simulation engine to perform all the circuit calculations. Figure 19.12(B) is an illustration of SPICE’s GUI window.

SPICE does not simulate the electromagnetic fields in a circuit, since these depend explicitly on its layout. Results are trust worthy to the low MHz range, but should be treated with suspicion for higher frequencies.

(b) Computer-based circuit layout editor

In a professional setting, the layout of an electronic circuit determines its compactness, ease of use (and debugging), cost, longevity, and performance (especially at high frequencies). A number of programs exist to help to design them. In fact, most electronics engineers will design an abstract circuit with a circuit simulator and then use a software package to lay out the actual circuit on a PCB. This design is then turned into an industry standard Gerber file, which is then sent to a PCB production company which will assemble a prototype and test it. Once it is tested, the entire production is usually contracted out to a third company. The use of professionally made PCBs is relatively common, since it generally results in a reproducible circuit, which is likely to work better at high frequencies than one assembled from wires or prototyping boards.

Industrial simulation tools

There are numerous industrial simulation tools for various applications, of which four are briefly introduced in this section: MATLAB, LabVIEW, SIMULINK and ModelSim.

(1) MATLAB

MATLAB is an integrated and technical computing environment that combines numeric computation, advanced graphics and visualization, and a high-level programming language. It gives an interactive system whose basic data element is an array that does not require dimensioning, which allows it to solve technical computing problems, especially those with matrix and vector formulations very quickly.

MATLAB has evolved over a period of years with contributions from many users. In university environments, it is the standard instructional tool for mathematics, engineering, and science. In industry, it is the tool of choice for high-productivity research, development, and analysis, used in a variety of application areas including signal and image processing, control system design, financial engineering, and medical research. Typical facilities provided by MATLAB include mathematical operations; numerical computation; algorithm development; data acquisition; modeling, simulation, and prototyping; data analysis, exploration, and visualization; scientific and engineering graphics; and application development including graphical user interface (GUI) building.

Several software toolkits for developing specialized applications are available from technical vendors. All the toolkits integrate MATLAB seamlessly. Refer to related websites for more information.

(2) LabVIEW

LabVIEW (Laboratory Virtual Instrument Engineering Workbench) is a graphical programming language that uses icons instead of lines of text to create applications. In contrast to text-based programming languages, where instructions determine the order of program execution, LabVIEW uses dataflow programming, where the flow of data through the nodes on the block diagram determines the execution order of the virtual instruments and functions. Virtual instruments are LabVIEW programs that imitate physical instruments.

In LabVIEW, a user interface can be built by using a set of tools and objects. The user interface is known as the front panel. Once an interface has been built successfully, code can be added by using graphical representations of functions to control the front panel objects. This graphical source code is known as G code or block diagram code. The block diagram contains this code. In some ways, the block diagram resembles a flowchart.

Several add-on software toolkits for developing specialized applications can be purchased; all integrating LabVIEW seamlessly. Refer to the National Instruments website at www.ni.com\toolkits for more information about these tools.

(3) SIMULINK

SIMULINK is an interactive tool for modeling, simulating, and analyzing dynamic systems. It inte- grates seamlessly with MATLAB, providing immediate access to an extensive range of analysis and design tools. It supports linear and nonlinear systems, continuous-time and sampled-time systems, and hybrid systems. With SIMULINK, simulations are interactive, so that parameters can be changed and the effect observed immediately. It moves beyond idealized linear models to explore more realistic nonlinear models, and has instant access to all of the analysis tools in MATLAB to take the results, analyze and visualize them.

For modeling, SIMULINK provides a graphical user interface for building models in block diagrams, using click-and-drag mouse operations. With this interface, models can be drawn as they would be with pencil and paper (or as most textbooks depict them). This is much better than packages that require you to formulate differential and difference equations in a language or program.

The model can then be simulated, choosing integration methods, either from the SIMULINK menus or by entering commands in the MATLAB window. The menus are particularly convenient for interactive work, while the command-line approach is very useful for batch simulations (e.g., if you want to sweep a parameter across a range of values). Using scopes and other display blocks, results can be watched while the simulation is running. In addition, parameters can be changed and the effect

Industrial control system simulation routines-0208

observed, for what-if exploration. The simulation results can be put in the MATLAB workspace for post-processing and visualization.

(4) ModelSim

ModelSim is the industry-leading, Windows-based simulator for very high-speed integrated circuits (VHDL), Verilog, or mixed-language simulation environments. ModelSim offers VHDL, Verilog, or mixed-language simulation. Coupled with the most popular HDL debugging capabilities in the industry, ModelSim is known for delivering high performance, ease-of-use, and outstanding product support.

It delivers a unique combination of native compiled code architecture and outstanding simulation performance. An easy-to-use graphical user interface enables the user to identify and debug problems quickly, aided by dynamically updated windows. For example, selecting a design region in the structured window automatically updates the Source, Signals, Process, and Variables windows. Once a problem is found, you can edit, recompile, and resimulate without leaving the simulator. ModelSim fully supports the VHDL and Verilog language standards. You can simulate behavioral and gate-level code separately or simultaneously. ModelSim also supports all application-specific integrated circuit (ASIC) and field-programmable gate array (FPGA) libraries, ensuring accurate timing simulations.

Incoming search terms:

Leave a comment

Your email address will not be published. Required fields are marked *