7B99659
7B99659
Overview
Hardware-in-the-Loop (HIL) applications are used by design and test engineers to evaluate and validate vehicle components during development of new systems, assemblies and vehicles. Rather than testing these components in complete system setups, HIL allows the testing of new components and prototypes while communicating with software models that simulate the rest of the vehicle and system. Replacing the rest of the vehicle with computers running software simulations greatly reduces the size and complexity of applications and increases the flexibility and rate of running many different tests and test scenarios. The physical components being tested respond to the simulated signals as though they were operating in a real vehicle as they cannot distinguish between the signals sent by other physical components and signals provided by software models running on a computer. In many cases new components that are being developed are modeled in software first. The designer will run simulations of the new component in conjunction with models of the rest of the vehicle to study the behavior of the overall system and to optimize the algorithms and routines used in a new component before building any prototypes. This type of application is commonly referred to as a co-simulation, as all parts of the system are being simulated in software. The resulting prototypes are then validated in a HIL application that includes the effects of the hardware-vehicle interaction (sampling, time lags, etc.). Additionally, HIL systems are commonly used for fault tolerant studies (shorted or open signals, etc.) and reliability (endurance) tests of new components. For the application described in this article we are using National Instruments LabVIEW and Mechanical Simulation Corporation CarSim to develop a HIL application to evaluate the performance of an ABS electronic control unit (ECU). This application is typical of systems to test a wide range of ECUs used through out cars, airplanes, trains and other forms of transportation. CarSim is used in the application to run the vehicle dynamics models to provide the vehicle response to the ABS control unit.
Table of Contents
1. Application Architecture 2. CarSim and TruckSim 3. CarSim Math Model 4. LabVIEW Real-Time 5. Integrating the CarSim Engine with LabVIEW Real-Time 6. Application Results
1. Application Architecture
This application evaluates the performance of the ABS ECU by interfacing the ECU to software models of the vehicle and brake actuator and running the system through a variety of brake scenarios. The performance of the ABS controller, as well as the software model, is monitored by logging and plotting the system variables passed between the different components. The system parameters include the solenoid outputs of the ABS controller, the force and torques from the brake actuator, the vehicle motions, and dynamics of the vehicle model.
Figure 1: Application architecture showing the logical flow between the system components
The brake actuator model and vehicle dynamics are running in software on a PXI controller. The application framework of the software running on the PXI system is developed using LabVIEW and the LabVIEW Real-Time module. The brake actuator model is also implemented in LabVIEW code, while the vehicle dynamics are modeled and running in the CarSim software, which is integrated into the LabVIEW application. The communication and signal interface between the PXI system and the physical ECU controller is implemented using National Instruments measurement hardware, specifically the PXI-7831R reconfigurable I/O (RIO) card. The RIO hardware with its onboard FPGA can be configured to use a wide range of signal and communication interfaces such as PCM, PWM, and frequency signals commonly used with ECUs. The RIO card is configured using LabVIEW and the LabVIEW FPGA module. Based on the vehicle dynamics information from CarSim, the ECU generates the brake solenoid signals (rise, hold, or fall) which are passed back to the brake actuator model. The actuator model calculates the brake pressure and brake torques to feed to the CarSim vehicle dynamics to close the loop. These processes are performed in real-time in the LabVIEW application framework, which controls the sequence and synchronization of the individual components. The arrangement of the software and hardware components is shown in the following diagram.
1/4
www.ni.com
Figure 2: Signal routing between ABS ECU and software models on the computer
Figure 3: Body and force diagram of the mathematical model used in CarSim for vehicle dynamics simulation
CarSim includes models of all vehicle component forces (ABS, suspension, steering, driveline, and aerodynamics) and all of them can easily be modified or replaced by the user. For the ABS brake application, the software ABS model in CarSim is replaced with the external ABS ECU and a separate model of the brake actuator implemented in LabVIEW.
4. LabVIEW Real-Time
2/4
www.ni.com
LabVIEW and the LabVIEW Real-Time module provide an ideal platform for HIL test and evaluation applications with its deterministic run-time environment and graphical application development tools. The LabVIEW graphical programming environment is used to build highly customized and flexible applications or application frameworks for a wide range of prototyping, validation, and test applications, and the Real-Time module enables these applications to run deterministically in a real-time environment on high performance PXI controllers. Integration on the PXI platform with a wide range of I/O options including data acquisition and CAN provide all the necessary communication and data interfaces required by a variety of applications. Additional communication and data acquisition interfaces can be developed using the National Instruments reconfigurable I/O (RIO) hardware and the LabVIEW FPGA module. This tool enables you to configure your own hardware for your application, implementing custom timing and triggering routines, communication protocols, and closed-loop control routines. For the ABS brake application we developed the application framework in LabVIEW and integrated the CarSim modeling engine to provide the vehicle dynamics to the application. The figure below shows the top-level application diagram. The main portion of the application consists of a loop that runs through the three components of our HIL application; the interface to the external ABS controller, the brake actuator implemented in LabVIEW, and the vehicle dynamics in CarSim (CS Step.vi). Each of these components is called by one the three VIs (functions blocks) in the main loop of the diagram. Dynamic parameters are returned from each of these components and passed to the next component. Before the main application loop is started, the CarSim modeling engine is initialized and the static properties of the simulated vehicle are loaded (CS Init.vi).
6. Application Results
The purpose of this application is to simulate a wide variety of braking maneuvers of a vehicle using the ABS ECU being evaluated to activate the brakes. By running through these different scenarios, varying such parameters as the starting velocity, amount of pressure applied to the brake pedal, and road surface coefficient of friction, the behavior of the ABS system can be characterized. This will verify both the theoretical model used to build the ABS ECU and the implementation of the model in the ECU. The results of the application are time plots of the vehicle kinematics, wheel velocities, and brake pressures. With the graphical user interface it is easy to run, visualize and quickly evaluate different braking maneuvers. This data is also logged and can be stored for more detailed evaluation and documentation. The following graph from the application shows a typical plot of the vehicle and wheel speeds during a straight-line braking maneuver in a split-mu scenario (variable coefficients of road friction between the left and right side). The second graph shows the corresponding brake pressures applied to each of the wheels by the ABS/brake actuator. Notice the typical spikes in the brake pressure as the ABS engages and releases the brakes to allow steering of the vehicle.
Figure 6: Plots of the vehicle velocities and brake pressures as simulated in the ABS ECU test application Related Links: Shorten Product Development Time by Integrating LabVIEW with your Design Software
3/4
www.ni.com
4/4
www.ni.com