Test Your Control System with Simulation
Speed start-ups, avoid unplanned shut-downs, save money by modeling and pretesting a system to new or unforeseen situations with these strategies for computer-based software simulations.
Vance VanDoren -- Control Engineering, 9/1/2003
|
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 wayThat's much easier to do if the control code is first 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 the real controller 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 keyEither 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 trainingOnce 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
| For more information... | ||
| For more suppliers, go to www.controleng.com/ buyersguide; for more system integrators, visit www.controleng.com/integrators; for more information, enter the following numbers online at www.controleng.com/freeinfo | ||
| Revere Control Systems | Rockwell Automation | |
|



















View All Blogs



