This realization is driving the need to simulate the entire system in an integrated environment such as MathWorks’ MATLAB and Simulink environment which can cover multiple domains such as electronics, controls, mechanical, etc. Prior to such an integrated environment, the tools used to be domain-specific which made it difficult to assess the interactions between the various systems, significantly limiting the system performance verification that can be achieved without hardware.
Because, engineers create and use models in the early design stages instead of relying on paper specifications the models serve as executable specifications of the system that enable engineers to validate and verify specifications against the system requirements early in the process. Engineers also use the models to communicate specifications in an unambiguous manner with their colleagues who may be working just down the hall or at another company across the globe. Further, these multi-domain models allow the designer to evaluate the complex interactions between controls, electronics, mechanics, and other physical phenomena.
Designers can perform rapid design iterations to make system level tradeoffs between various design parameters and optimize overall system performance. This enables engineers to try innovative ideas and concepts for improving system performance without the significant investment in time and resources that hardware-focused development processes require.
Further, because the MATLAB and Simulink environment allows linking product requirements to the model, test cases can be defined corresponding to the requirements and the simulation results can be used to determine if the system meets requirements or not. When the models are instrumented and linked to requirements, simulation results can be used to formally verify system behavior against documented requirements.
Once the engineers have verified and validated the model specification, they can implement the design by automatically generating code in a range of languages including C, C++, HDL, or Structured Text for PLC implementation.
The use of models makes it easy to separate the data and implementation attributes from the core algorithms, e.g., when switching from an embedded processor to a PLC, the software code can be quickly regenerated from the same model using the appropriate data and implementation attributes for the PLC.
Thus, the model serves as the golden reference for the software and can be reused across product lines and development programs, which further improves the efficiency of the development process. Once the production software is automatically generated, the test cases and system models can also be reused for testing the generated code via software-in-the-loop, processor-in-the-loop, and hardware-in-the-loop simulations.
By enabling rapid evaluation of innovative concepts and designs, MATLAB and Simulink help teams find and fix errors early in the process, when the cost and effort needed to fix them is lowest. Re-using the models throughout the development cycle through capabilities such as automatic code generation reduces errors introduced during hand coding, shortens product delivery times, and improves the efficiency of the development process.
How can one design, tune, and analyse a closed-loop control system for a real-world applications?
Real-world applications involve a significant amount of complexity, which makes developing and implementing control systems for these applications a difficult task since multiple interacting loops and dynamics need to be accounted for. Further, as we discussed earlier, before designing and tuning systems for the first time on actual hardware makes it expensive both in terms of the time required and also in terms of the cost of rework as errors are found later in the design process.
In order to address these issues, developing a model of the system being controlled, referred to as a plant model, is a key first step.
The plant model allows the entire system, plant plus controller, to be simulated to evaluate the performance of the system and verify that it meets system requirements before the hardware is built. MathWorks’ products provide the capability to both automatically tune the controller to meet performance criteria specified across time, frequency, and cost criteria. If test data from the real system is available, the plant models themselves can be validated to ensure the accuracy of the plant models.
This further increases the confidence that the control system will work as designed when we move to hardware implementation.
After, the entire system has been simulated, software code can be automatically generated in a range of languages including C, C++, HDL, or Structured Text for PLC implementation. As the controller implementation hardware changes, the software code can be quickly regenerated from the same model using the appropriate data and implementation attributes for the appropriate controller hardware.
The test cases and plant models can be reused for testing the software code running on the controller hardware, via software-in-the-loop, processor-in-the-loop, and hardware-in-the-loop simulations. This ensures that the final controller implementation meets system performance requirements and minimizes the amount of rework involved in developing control systems for real world applications.