Real-Time (RT) Testing
Physical testing and simulation join in real-time to evaluate hardware being driven by a software vehicle dynamics model.
For example, the system shown in the figure has an antilock brake system (ABS) electronic control unit (ECU) being tested on a bench, working in a virtual car provided by CarSim. The ECU "thinks" it is in a car and controls and communicates with the virtual brake system in the CarSim math model.
HIL and SIL
From the simulation point of view, the ECU is hardware-in-the-loop (HIL)—simulation results depend on both the math model and the physical hardware, which interact in real-time. From the hardware point of view, the CarSim model is software-in-the loop (SIL), contributing to the effectiveness of a hardware test procedure.
Video Presentation: HIL in CarSim and TruckSimMarch 2009. Dr. Jin Hu and Bob McGinnis discuss CarSim and TruckSim HIL applications running on different real-time systems. They explain how manufacturers use HIL systems to save time and reduce costs in their product design process. View here.
How It Works
Thanks to VehicleSim technology, CarSim, TruckSim, and BikeSim models run on most computers faster than real-time — a simulation of a 30-second test is completed in less than 30 seconds. The models support the MATLAB/Simulink block control interface, the LabView interface, and others. This not only gives compatibility with Simulink and LabView, but also provides a full support for any real-time testing software that uses the same interface. To run in HIL, the model receives measured variables from the hardware. The hardware in turn receives calculated variables from the math model.
To obtain real-time operation, the software obtains calculations from the model and then waits for the clock to catch up. (A 30-second simulated test must take exactly 30 seconds to run when there is HIL.) The precise timing needed to communicate with electronic controllers is provided by RT software running on a special RT operating system.
We provide the models ready to run on the major RT operating systems, including QNX, RT-Linux, dSPACE, and others. A host computer with Windows runs the graphical database, animator, plotter, and supporting software. A target computer with the RT OS runs the math models together with data acquisition/transfer software.
Live and Post-Processing Visualization
Any commercial RT system includes live plotting and analysis options, which can be applied to the CarSim/TruckSim/BikeSim models, along with any hardware in the loop. Further, all of the post-processing capabilities from our software still work, including the built-in plotter, the animator (with overlays, slow motion, etc.), and automatic export to Excel, MATLAB, and other external software. In addition, the RT versions of our simulations support live animation of the vehicle during testing with SurfAnim (our animator). During live animation mode, SurfAnim uses the same shape files, camera settings, etc. as it uses in the off-line mode, so no extra learning or setup is required.
Compatible with Many Systems
CarSim, TruckSim, and BikeSim RT packages are available in off-the-shelf CD's and downloads for six commercial RT families:
- AND Technology (Simulink and RT-Linux),
- dSPACE GmbH (Simulink w. dSPACE OS),
- ETAS LabCar (RTPC Linux and optionally Simulink),
- Fujitsu-TEN CRAMAS (Simulink and RT-Linux),
- National Instruments (LabVIEW RT on ETS), and
- Opal-RT RT-Lab (Simulink with QNX).
In all cases, the same models are used, with the same equations, solution methods, inputs, outputs, and post-processing tools. You can run datasets in real-time on different systems based on HIL needs, and exchange data sets with other users running on different systems, and users running off-line on ordinary Windows machines.
Historically, the architecture of our software has enabled the math model solver programs to work on almost any modern computer. (Our code is written in ANSI C, which is the most widely supported language for engineering applications, even on computers that don't have file systems.) This contrasts with many older RT vehicle models (commercial or in-house) that have been developed for a single system, and require significant development work to be ported to work with other systems. For example, CarSim RT was selected in 2003 by the Japanese MathWorks Automotive Advisory Board (J-MAAB) as the benchmark for RT vehicle dynamics because it was the ONLY commercial software that could be run with more than a single RT system!
RT versions of CarSim, Bikesim, and TruckSim can be added to existing HIL systems at a low cost similar to our off-line versions. If you are buying a new RT system, you can make the selection based on your HIL application (hardware testing? rapid prototyping? evaluating proprietery controllers?) with the confidence that all of the options listed above work well with BikeSim RT, CarSim RT, and TruckSim RT.