Test Your Control System with Simulation

Computer-based simulations abound in the 21st century. The most familiar examples are just for fun—video games, animated toys, amusement park rides, and the like. But simulations can serve a serious purpose in the manufacturing world as well. The functions of a proposed control system can be tested with a simulated plant, allowing mistakes to be identified in a cost-free virtual world.

By Vance VanDoren September 1, 2003
AT A GLANCE
  • Simulation explained

  • Benefits of simulation testing

  • Process and discrete case studies

一边bars:
Ford simulates production lines Simulation simplifies start-ups for Revere Control Systems

Computer-based simulations abound in the 21st century. The most familiar examples are just for fun—video games, animated toys, amusement park rides, and the like. But simulations can serve a serious purpose in the manufacturing world as well. The functions of a proposed control system can be tested with a simulated plant, allowing mistakes to be identified in a cost-free virtual world.

Simulation tests are generally designed to answer what-if questions about the control system and the plant. What would happen if the setpoint were doubled? What would the control system do if the power failed? Can the assembly line be sped up safely? These can literally be million-dollar questions since a control system can either run the plant more profitably or make matters worse when unexpected situations occur.

Unfortunately, it is not always obvious from the design of a control system whether it will be able to do its job under all conceivable conditions. A continuous process controller may be able to handle disturbance rejections smoothly, yet fluctuate wildly when the setpoint is changed abruptly. Adjacent robot arms may successfully pick and place electronic components for years, yet collide catastrophically when the path of one is changed even slightly to accommodate a new product design.

The only certain way to test how a control system will handle every possible situation is to design the code, install it in the controller, and try it out on the plant. However, this can be a very costly means of uncovering design flaws. A control system failure can shut down the plant and require expensive modifications. In the worst case, the entire control system may have to be scrapped, redesigned, and rebuilt.

A better way

这是更容易如果fi的控制代码rst designed and tested in a computer-based virtual world. A simulated control system can be connected to a simulated plant without the expense of real equipment or risk of disrupting the real plant’s production. In such a virtual world, both the plant and control system exist only as customized code in a simulation computer.

A simulation test can also be conducted with therealcontroller connected to a simulated plant through the controller’s I/O ports. The simulated plant can be as simple as a bank of knobs and switches manipulated by a test engineer or as complex as a separate computer programmed to act like the plant. (See sidebars for examples).

Using the actual controller for testing the control code as well as running the plant allows the tested code to remain installed in just one controller. Using a separate simulation computer as the test bed for the control code risks the introduction of translation errors when the tested code is ported from the simulator to the actual controller.

On the other hand, using the actual controller as the test bed for the control code can be a much slower operation since the controller would have to be run in real time. Simulating the controller and the plant in a single simulation computer can be accomplished at computer speeds.

Modeling is key

Either way, the success of the simulation tests will depend in large part on how realistically the simulated plant behaves. That’s a fairly straightforward matter when the plant can be adequately represented with a few discrete or analog I/O points manipulated by a test engineer. But if the simulator is intended to mimic the behavior of a more complex plant, a model of the plant is required.

A typical plant model includes a set of mathematical equations and logical relationships that represent how the plant’s outputs react to its inputs. Anything that the control system does to influence the activities of the plant is an input. The results of those control efforts are the outputs.

The simulator uses its model to compute the outputs that would have resulted had the controller manipulated the real plant’s inputs. Conversely, the control system computes the inputs that it needs to apply to the simulated plant according to recent output measurements and the logic of the control program.

Just how the equations for a particular model should be structured is an issue worthy of graduate study. Modeling can be a relatively simple matter if the behavior of the plant is obviously governed by natural laws such as physics, chemistry, or geometry. For more complex plants, however, empirical relationships based on statistical observations of the plant’s previous behavior may be required to produce a realistic model. (For related links, see this article online.)

Testing and training

Once the plant model has been developed, verified, and programmed into the simulator, test engineers can create entire scenarios in the simulated plant and observe how the controller handles them. Likewise, proposed modifications to the control program can be tested to determine which would prove most beneficial.

A simulator can also help test and train plant operators. As experienced operators run the real plant, new operators can be trained to do the same using a simulated control system and plant. Simulation training is often conducted in a mock-up of the control room equipped with all the operator displays used in the real thing. If the simulation is realistic, the trainees don’t know the difference. They graduate ready to run the real plant.

This training regimen can be particularly effective in large, highly automated facilities where simulated “learning experiences” are much less risky than making real mistakes with the real plant. The cost of developing such elaborate simulations for training as well as for control system testing can be more than offset by the costs of disasters averted.

For more on software for embedded control applications, see “Simulate Your Embedded System” in this issue

Ford simulates production lines

Ford Motor Co. (

Control Planner/Simulator is a general-purpose modeling, visualization, and testing tool for both process and discrete industries. Originally developed with automotive applications in mind, it allows control designers and engineers to apply preconfigured model elements to functions such as robots, welding systems, and conveyors and integrate them into a three-dimensional virtual test environment.

The object of the VPLC initiative is “continuous improvement of delivery time and cost reductions for the design, build, and launch of new tooling and automation,” says Ford’s Al Ver, vice president of Advanced and Manufacturing Engineering. VPLC reduces floor debug time by allowing suppliers to model, visualize, and test manufacturing control logic in a virtual world prior to tool build.

KUKA Flexible Production Systems (

Simulation simplifies start-ups for Revere Control Systems

System integrator Revere Control Systems performs simulation testing on every control system it builds, even single panel systems. Simulation testing reduces the time the project engineer is in the field performing startup and generally leads to faster, smoother startups and better adherence to the project schedule.

In a typical application, all system panels and equipment racks are set up in Revere’s test department with power and interconnections just as they would be in the field. A panel of switches and potentiometers is used to simulate field device pressure measurements and other I/O signals. If more I/O points are needed than the switch panel can provide, a panel of PLCs is connected to generate additional signals according to program instructions entered from a laptop PC.

里维尔应用ed these simulation test procedures to a reverse osmosis water treatment plant for Palm Beach County, Florida. Project engineer Eddy Robinson says it would have been impossible to test the pump sequence logic without simulations. “To fully test such complex logic requires running the sequences hundreds of times. To do this in the field, where real devices and pumps are turning on and off and pumping real water, would mean extreme slowness in the testing process, plus unnecessary wear on the equipment,” Robinson explains.

Simulation testing avoided those problems and eliminated the software and manufactured hardware as a possible error source. That, in turn, allowed project engineers to focus on cabling and field devices, contributing to the faster startup.