With LabVIEW it can be relatively straightforward to move from an entirely PC-based emulator to Hardware in the Loop (HIL) testing where the application software is running on the real-time target (e.g. CompactRIO). There are a few options for this.
Firstly, the system emulator can remain on the PC which interfaces to the real-time target using emulated IO (typically shared variables). This "Processor in the Loop" testing proves the real-time realisation, for example assessing CPU loading, specific FPGA features.
Full HIL testing is where the sensors and actuators are emulated electrically, which could simply use the software emulator running on a second real-time processor with interfacing using real IO modules. Clearly this is a more rigorous test of the application software, but the value of which depends on the criticality of determinism and dynamic performance in the final system.
As well as functional testing, HIL testing can be used to obtain initial tuning parameters for feedback controllers and test the controller tuning procedures to be used on the real system.
Early in the design process simulations can be used to evaluate different design options, assess likely performance and evaluate different features of the system. Typically this is confined to dynamic simulations where there may be fundamental uncertainties around performance and prove feasibility of designs. However, logic based functions can also be simulated at this stage should there be a need to de-risk some aspects of a design.
We use both MATLAB/Simulink and LabVIEW CD&SIM to build such simulations and we can also convert models between these development environments to enable model integration or reuse. Monte Carlo simulations can be useful to explore the performance over a random, wide range of operating scenarios.
During the development of the main control software application, a software emulation of the physical system can be built to replicate the operating modes and anything that requires testing (e.g. ability to inject faults as defined in the System Test Specification).
Typically this may be logic based to sufficiently replicate the full operation from start-up, operating modes and shutdown. Only simple dynamics may be needed here, unless the performance remains critical to assess at this stage.
In addition to testing the implemented software, such a software emulator can be used to review operational aspects with the end-users/customers, when linked to the user HMI screens and emulated button and lamps. This not only provides a valuable early review, but also helps build confidence with the final end-users.
With LabVIEW's ability to run the same code on a PC or a real-time target, there is minimal overhead when moving between an entirely PC-based emulator and the real-time target for HIL testing, though the early definition of the software architecture to facilitate switching between either emulated IO or the real IO helps.
The ability to extensively test software (either during development or for later revisions or bug fixes) without the need to have access to the physical system or the real-time target can be very helpful, as testing on the real system is often limited. This is more suited to logic-based systems and slower sample rate control systems as it is not fully deterministic.
Training on a simulator allows operators to learn the normal operations and how fault conditions are indicated and handled within a safe simulation environment. Developing such a training simulator may require nothing more than re-using the software-based emulator with some well defined instructions.
Dynamic simulations were used in the early stages of the Turbine Access System development process to assess the feasibility of achieving the required accuracy, by exploring different sensor types and combinations, and the most effective feedback control scheme. These simulations whilst kept simple as possible to evaluate dynamic performance, were well justified since the predicted accuracies matched what was observed on the final system.
Nonlinear dynamic simulations simulations were used on the hydraulic design to assess the operation of counterbalance valves under different load scenarios and review their potential interaction with the position control loops. In addition, a software based emulator was built to demonstrate operating sequences to customers, thoroughly test the software prior to actual commissioning on the boat and investigate and test revisions once the system was in-service. The emulator could run on either a PC or the real-time target for HIL testing. A feature that proved useful was that the emulator could be engaged in parts, in that each of the six large hydraulic cylinders could be either simulated or connected to a real cylinder.