Model-based design of control systems: simulate and test before committing to hardware

MathWorks Australia
By Doug Jones and Brian McKay, Product Marketing at MathWorks
Monday, 25 February, 2013


Builders of complex equipment are driven to provide better performance, while meeting tight deadlines and keeping costs down. One way to improve performance and lower costs is by improving motors and motor control systems. However, the demand for better performance and accuracy of motor control systems is growing rapidly and reaching the point where traditional design and verification methodologies are falling short.

In a traditional workflow, engineers frequently could not test and validate their control system designs until late in the development cycle, when motors, sensors, actuators and other system hardware finally become available. This approach was sufficient when expected system behaviour was predictable. Problems that arose could often be resolved by augmenting and tuning the control system during final system integration.

For today’s complex machine systems, however, a tradition workflow has drawbacks. When late design problems surface, they generally require difficult and time-consuming changes that result in costly system hardware modification. Additionally, the growing requirements and complexity of control system designs make it difficult to test all possible operating conditions. Therefore, new verification methods are needed.

Leading system designers recognise these challenges and are adopting model-based design. This approach enables engineers to simulate the physical plant and test control system logic and algorithms at the early stages of the development process, where errors that are found are easier and less expensive to fix.

Model-based design allows designers to:

  • quickly evaluate a variety of control strategies and optimise system behaviour;
  • catch errors early, before motors and other machine hardware are available;
  • use simulation to test the full operating envelope;
  • re-use models for real-time testing.

Comparing traditional design workflows with model-based design

In the traditional workflow, specifications and requirements are provided in print or document form. Subsystems, including mechanical, electronic, controls and software, are independently designed, usually with several or many design tools, directly from the documentation. For this process, system verification comes late in the design cycle, usually during final integration and build-up. Only at this point can engineers fully observe the interaction between a system’s physical components and the control system design.

This approach may be acceptable for simple machines, where expected component or subsystem behaviour is easily predicted. However, as system designers add features and push for optimal performance, subsystem interaction becomes more complex. This increases the challenges of motor control system design and therefore increases the likelihood of error. Risk is further compounded because performance requirements, implementation details and test conditions for each component - mechanical, hydraulic, controls and software - are established independently. These differences make it easy to introduce conflicting requirements, misinterpret requirements during design, or perform incomplete or extraneous testing.

If an error is not discovered early in the design process, the complex interaction between subsystems can make it difficult to trace the problem back to its root cause - and fixing this problem can be just as tricky. Errors related to incomplete, incorrect or conflicting requirements may even necessitate a fundamental design change.

Model-based design

Model-based design mitigates these challenges by enabling simulation and up-front verification. In this case, verification is no longer treated as a final step. Instead, verification becomes a continuous process that begins with design simulation followed by real-time testing.

Model-based design enables systems engineers to create a mathematical model of both the control system and the physical plant or machine, including mechanical, electrical, hydraulic and other physical components. When the model is linked to the design requirements, the model becomes an executable specification reducing requirements ambiguity and minimising the risk of design errors.

Model-based design also provides a unified design and verification platform. Engineers have an intuitive, graphical view of the system, serving as a common environment for designers from different disciplines. Tools for model-based design also facilitate the re-use of existing designs and engineering data by providing hooks into CAE tools, such as CAD, FEA and circuit emulation tools (including SPICE).

The availability of an executable specification helps control engineers to better understand the interactions among the controllers, motors and machine, which leads to insight for improvements in the control system strategy. Instead of designing against an inherently vague paper specification, designers can experiment with the model, run behavioural simulations and quickly implement design changes, all helpful for understanding the achieved accuracy and performance of the system. This facilitates early identification of the control design that yields improved performance while meeting motor limitations and machine constraints.

Simulation and early verification

Control system designers using a traditional workflow are unable to verify their designs until motors and machine hardware are available, usually late in the design process. In contrast, model-based design enables designers to start verification and testing with models of these components, saving design time, reducing costs and improving overall system quality, accuracy and performance.

Simulation and early verification allow designers to catch errors early in the development process, where they are easier and cheaper to fix. Simulation helps designers spot problems that would require hardware changes - a particularly valuable capability because hardware changes are much more expensive than software fixes. Also, errors are much easier to troubleshoot in simulation than in the field. When a simulation error arises, an algorithm designer can inspect each component’s state and history, with the ability to drop in a scope and visualise the data at any point, run the simulation repeatedly under identical operating conditions to replicate the problem and then implement  changes to the model that resolve the problem. In the field, design change flexibility is far reduced.

Testing against a model also enables more thorough verification. Complex machine systems (which may feature multiple motors and motor control systems) often have large operating envelopes with numerous control modes and logic states. Testing the full operating envelope with real motors and system hardware can even be impractical or dangerous. It is much more effective to achieve full test coverage in simulation where there are no concerns about equipment damage or safety hazards.

Real-time testing

With model-based design, the same models used in simulation can be used to take verification a step further by performing real-time testing. Real-time testing is the process of running, proving and testing integrated hardware-software system designs under normal modes of operation. Two of the most common real-time testing strategies are rapid control prototyping and hardware-in-the-loop simulation.

In rapid control prototyping, an executable application is generated from the control system model and tested on a real-time computational platform while connecting to the physical motors and machine hardware. Because there is a direct connection between the design (model) and implementation (executable application), it is easy to improve control design deficiencies identified during real-time testing. Engineers can even run through the same tests that were conducted in desktop simulation. Rapid control prototyping can also help highlight approximation errors or inaccuracies of the plant (motor and machine) models used during simulation - thus allowing for improvements in system simulation. Once the control design has been verified through real-time testing, engineers can re-use the model through code generation to implement the design in embedded or production control hardware.

In hardware-in-the-loop simulation, a production controller is tested against a real-time simulation of the plant (motors and machine). This capability is useful in cases where access to the actual system is limited or unavailable - for example, motors attached to large industrial machines such as printing presses or packaging equipment. Hardware-in-the-loop simulation is also invaluable when it is dangerous to test the plant’s full operational envelope. Consider the risks of trying out a complex motor control algorithm in an industrial environment. If something goes wrong, a system failure can damage equipment and endanger people nearby. Testing the production controller against a real-time simulation of the motors and machine is far better. Just as important, hardware-in-the-loop simulation can be used to fully exercise system diagnostics (for example, emergency condition detection and shutdown procedures), which might be difficult or impossible to test on the motor and machine itself.

Benefits of model-based design

Model-based design, including simulation, early verification and real-time testing, has become an important workflow for a broad range of motor control applications, including industrial automation and machinery, office equipment, consumer goods, instruments, medical devices and process industries.

For motor control applications, model-based design, from simulation and early verification to real-time testing, results in shorter, less costly design cycles and also helps designers create more robust, higher-performing control systems. As control systems become increasingly complex, verifying designs before committing to hardware will not only be a best practice, it will be imperative.

Resources

Learn more about Model-Based Design at www.mathworks.com/model-based-design/.

Related Articles

The cyber-physical manufacturing journey

It is time for manufacturers to start their own digitalisation journey and ride the wave of the...

Securing the smart factory: cybersecurity for advanced manufacturing

Threats to industrial operations have outpaced the capabilities of most OT cybersecurity...

AI in engineering: no immediate solutions for specific projects

Will AI ever replace the imaginative and creative engineering professional? Maybe, but not yet.


  • All content Copyright © 2024 Westwick-Farrow Pty Ltd