Implementing Hardware-in-the-Loop (HIL) Test Systems Christian Hahn National Instruments Closed-Loop Control Disturbance Desired Speed Motor Controller Motor Command Measured Speed DC Motor 2 Closed-Loop Control Engine Control Navigation Control Flight Control Steam Turbine Control Dryer Cycle Control Print Head Control Medical Device Control 3 Example…the automobile 3 ECUs 15 to 70 ECUs in 10 years 4 Embedded Control System Challenges • Increasing application complexity Test Challenges • Increasing reliability requirements • Decreasing time-to-market Test Resources • Reduce development cost Are these mutually exclusive? 5 Testing Embedded Control Systems System Level Testing Test System Test Profile Logging/ Analysis UUT Disturbance Desired Speed Motor Controller Measured Speed Motor Command DC Motor 6 Testing Embedded Control Systems System Level Testing • What if the “DC Motor” is not available yet? • What if test failures could damage the ”DC Motor”? • What if the ”DC Motor” is very expensive (capital, maintenance, operation, facilities)? • What if ”DC Motor” conditions are not repeatable? • What if there are numerous variations of the ”DC Motor”? Disturbance Measured Speed Motor Command DC Motor 7 Testing Embedded Control Systems Component Level Testing Test System Test Profile Logging/ Analysis UUT Disturbance Desired Speed Motor Motor Command Controller Measured Speed 8 What is HIL Simulation? • Types of Test • Test Methods Functional Parametric Validation (V&V) Durability (HALT/HAST) End-of-line … Temperature/power variation Salt/sand spray EM radiation Mechanical loading/resistance HIL Simulation … 9 Virtual Reality for your UUT What does your UUT know about the world around it? UUT Voltage Desired Speed TCP Motor Controller ENCODER Motor Command Current PWM Impedance Measured Speed Timing 10 Testing Embedded Control Systems Virtual System Level Testing Test System Test Profile Logging/ Analysis MODEL UUT Desired Speed Motor Motor Command Controller Measured Speed Stimulus = MODEL(test profile, UUT response) 11 Testing Embedded Control Systems Virtual System Level Testing Test System Test Profile Logging/ Analysis MODEL UUT Desired Speed Motor Motor Command Controller Measured Speed Stimulus = MODEL(test profile, UUT response) 12 What is a Model? m k c 13 Dynamic System Models NI LabVIEW MapleSoft MapleSim The MathWorks, Inc. Simulink® Software Esterel SCADE Simulink® is a registered trademark of The MathWorks, Inc. All other trademarks are the property of their respective owners. 14 ANSI C NI MATRIXx SystemBuild You Need a Model… Test System Test Profile Logging/ Analysis MODEL UUT Desired Speed Motor Motor Command Controller Measured Speed Stimulus = MODEL(test profile, UUT response) 15 Control Design Process Modeling and Design System Testing Rapid Prototyping Hardwarein-the-Loop Testing Targeting 16 Modeling and Design Setpoint Error Kc Controller Control Output Kp Feedback Plant Modeling and Design Produce Controller and Plant Models 17 Modeling and Design Software Tools • NI LabVIEW Simulation Module • NI MATRIXx • The MathWorks Inc., Simulink® Application Software • MSC CarSim • Hand-coded models (C, Fortran, etc.) Simulink® is a registered trademark of The MathWorks, Inc. 18 Rapid Control Prototyping Setpoint Error Kc Controller Control Output Kp Feedback Plant Creating a Functional Prototype of the Controller 19 Hardware-in-the-Loop Simulation Setpoint Error Kc Controller Control Output Kp Feedback Plant Testing Production Controller with Simulated Plant 20 HIL System Architecture Host PC Loads / Power Real-Time Fault Insertion Simulator Unit (FIU) 21 ECU Loads, Power, and Faults Simulated & Real Loads Physical loads that would be seen by the ECU Break-out Panel Simulated and Real Loads Power Supplies Break-out & Power Supplies Panel for manual fault insertion and custom loads Fault Insertion Unit Programmatic fault insertion of open, short to Vbatt, short to GND, ch-to-ch Fault Insertion Unit (FIU) 22 HIL Functional Architecture Host User Interface Model Manager Data Manager Test Sequence Analysis & Reporting IO RT Simulator Simulator Interface Datalogging IO Interfaces Sequencer/Profiler Plant Model Simulated Fault Insertion RT IO Interfaces Bus DMM/ FPGA IO AIO/DIO RF / Cal / Diag IO Scope Vision SigCon GPIB Interfaces Fault Insertion Unit (Switching) Power Supply Break-out ECU Loads 23 Manufacturing test of hydraulic actuators Customer: Parker Hannifin • Application Integrate measurements with control Control actuator movement deterministically Easily change motion profile for each unit • Solution LabVIEW Real-Time Modular PXI hardware platform NI DAQ I/O modules • Saved 44 weeks of development time and reduced cost by 6x 24 Lockheed Martin Simulator (PXI, LabVIEW Real-Time, SIT, VISA) • Application Prototype integrated avionics unit in XSS-11 Create hardware-in-the-loop/HIL simulator to test LIDAR (light detection and ranging system) controller • Key points LabVIEW and NI hardware provide future flexibility NI helped create an interface to a third-party synchronous serial interface using NI-VISA 25