FPGAs for HIL and Engine Simulation ni.com Field-Programmable Gate Array (FPGA) Memory Blocks Store data sets or values in user defined RAM Configurable Logic Blocks (CLBs) Implement logic using flip-flops and LUTs Multipliers and DSPs Implement signal processing using multiplier and multiplier-accumulate circuitry Programmable Interconnects Route signals through the FPGA matrix I/O Blocks Directly access digital and analog I/O ni.com 2 FPGAs - Why Are They Useful? • Hard determinism – Realistic simulation timing, local intelligence • Off-load processing – Achieve real-time performance with more complex simulations • Custom Hardware – Create custom H/W instruments • Reconfigurable hardware personalities – Adapt to multiple UUT types and changing UUT interfaces • Industry standard technology – Off the shelf chips used for specific applications get COTS benefits like Moore’s Law ni.com 3 FPGAs in HIL Test Systems IO µP Test Application ni.com Signal Conditioning 4 UUT FPGAs in HIL Test Systems µP Test Application ni.com FPGA IO FPGA Personality Signal Conditioning 5 UUT FPGAs in HIL Test Systems NI Reconfigurable I/O (RIO) Platform µP Test Application FPGA IO FPGA Personality Signal Conditioning Test Application Interfaces ni.com Hardware I/O Interfaces 6 UUT Mechanical Systems – Engine Sensor Simulation RPMs µP ni.com FPGA I/O (Engine Simulation) 7 Crank UUT Free Engine Simulation Toolkit • Fully featured for Engine Control Unit (ECU) testing FPGA-based sensor simulation and measurement for ultra-fast pin-to-pin response time & lifetime upgradability Seamless integration with NI FPGA hardware and NI VeriStand Scalable design for simple to complex ECU testing Suitable for open loop or closed loop Open source architecture customizable with LabVIEW FPGA • Supports any NI FPGA device • Deploy with NI VeriStand 2013 or later Design with LabVIEW 2013 or later • • • • • • ni.com 8 Engine Simulation Toolkit Building Blocks CPU FPGA ECU Event ECU ECUEvent Event Waveform Waveform Waveform Capture Capture Capture Angle Processing Unit (APU) Digital Pattern Digital Pattern Digital Pattern Generation Generation Generation (i.e. Hall) Directional Directional Directional Sensor Sensor Sensor Simulation Simulation Simulation Analog Replay Analog AnalogData Data (i.e. VR) Replay Replay Knock Sensor Knock KnockSensor Sensor Simulation Simulation Simulation ECU Event ECU Event ECU Event Timing Timing Timing Capture Capture Capture (Inject & Ignite) Speed, Crank Angle, Cycle Angle Engine Simulation Toolkit Roadmap Item Angle Processing Unit (APU) Old AES Library 2 and 4 stroke engines Digital Pattern Generation N-M Teeth Generation Custom Edges Generation Analog Replay Play back any file by angle ECU Event Measurement Digital input timing capture of single event per cycle Knock Sensor N/A Directional Speed Sensor N/A FPGA space utilization ni.com Baseline 10 Engine Simulation Toolkit Roadmap Item Old AES Library Engine Simulation Toolkit 2 and 4 stroke engines Improved usability Digital Pattern Generation N-M Teeth Generation Custom Edges Generation Improved usability Analog Replay Play back any file by angle Improved usability ECU Event Measurement Digital input timing capture of single event per cycle Windowing, multi-event per cycle, error detection, & improved usability N/A Pseudorandom, amplitude & probability per cylinder. N/A Different forward/reverse digital pulse width triggered at tooth centers Baseline 3x Reduction Angle Processing Unit (APU) Knock Sensor Directional Speed Sensor FPGA space utilization ni.com 11 Engine Simulation Toolkit Roadmap Item Old AES Library Engine Simulation Toolkit 2 and 4 stroke engines Improved usability Digital Pattern Generation N-M Teeth Generation Custom Edges Generation Improved usability Analog Replay Play back any file by angle Improved usability ECU Event Measurement Digital input timing capture of single event per cycle Windowing, multi-event per cycle, error detection, & improved usability N/A Pseudorandom, amplitude & probability per cylinder. N/A Different forward/reverse digital pulse width triggered at tooth centers Baseline 3x Reduction Angle Processing Unit (APU) Knock Sensor Directional Speed Sensor FPGA space utilization ni.com 12 Q4 2014 Analog input thresholding and waveform capture Space and performance comparison ni.com 7854R PXIe 8130 PXIe 1082 AES Library 1 APU 1 N-M generation 4 Fully Custom generation 1 Analog Replay 12 Event Capture Engine Simulation Toolkit 1 APU 5 Digital Pattern Generation 1 Analog Replay 12 Event Capture Slices 6,703 of 17,280 (38.8%) 3,159 of 17,280 (18.3%) Registers 14,882 of 69,120 (21.5%) 5,912 of 69,120 (8.6%) LUTs 19,702 of 69,120 (28.5%) 8,239 of 69,120 (11.9%) DSP 24 of 64 (37.5%) 2 of 64 (3.1%) BRAM 21 of 128 (37.5%) 13 of 128 (10.2%) 40 Mhz Max 42.69 65.35 Compile time 37 minutes 21.7 minutes RT Loop Duration 305 to 335 uS 138 to 186 uS w/ RIO 13.1 132 to 165 uS w/ RIO 15.0 13 Reconfigurable I/O Interfaces V6 ECU µP FPGA I/O Multiple UUT types Evolution of UUT interface ni.com 14 V8 ECU NI VeriStand System Explorer ni.com 15 Analog Replay ni.com Analog Replay Configuration ni.com 17 Analog Replay: Voltage Scaling Configuration ni.com 18 Example FPGA: APU + 1 Analog Replay APU Load Look Up Table Play Look Up Table ni.com 19 Example FPGA : APU + 2 Analog Replay ni.com 20 Digital Pattern Generation ni.com Digital Pattern Generation of Two Cams and a Crank ni.com 22 Digital Pattern Generation Design ni.com 23 Digital Pattern Generation supports complex patterns easily ni.com 24 Example FPGA: 2 Digital Pattern Generations ni.com 25 Knock Sensor Simulation ni.com Knock Sensor Simulation Configuration ni.com 27 Example FPGA: Knock Sensor Simulation Loop ni.com 28 Knock Sensor with 4 Cylinders (Probably had been set to 100% with 4 different amplitudes) ni.com 29 Directional Speed Sensor Simulation ni.com Directional Speed Sensor • • Generates pulses of different widths, depending on forward (Tf) or reverse (Tr) rotation, when passing tooth centers Pulse slightly delayed from center by variable microseconds (Td) Directional sensor: forward Directional sensor: reverse Crank ni.com 31 Directional Speed Sensor ni.com 32 Example FPGA: 1 Directional Speed Sensor Load Tooth Centers Look Up Table ni.com From APU 33 ECU Event Capture ni.com Example FPGA : Typical MPI Injection Measurement (1 x Cylinder) Event measurement block outputs: Digital Input • • • • Event measurement block settings: • Angle Max (degrees) • Angle Min (degrees) • Active High (Boolean) • Time based ‘stuck active’ timeout ni.com (milliseconds) Stuck active (Boolean) Window all active (Boolean) Window orphan start edge (Boolean) Window orphan end edge (Boolean) Event capture block outputs: • Event Present (Boolean) • Start Angle (degrees) • End Angle (degrees) • Duration (milliseconds) 35 Example FPGA : Typical GDI or Diesel Injection Measurement (1 x Cylinder) ni.com 36 Example FPGA : Typical GDI or Diesel Injection Measurement (2 x Cylinder) ni.com 37 Example FPGA : Customize Windowing Per Event ni.com 38 ECU Event Capture Configuration ni.com 39 ECU Event Capture Configuration ni.com 40 Generation and measurement of two events neither wrapping 0 and window does not wrap 0 ni.com 41 Generation of one event wrapping zero and one not wrapping zero; window wraps zero and measures both ni.com 42 Start of a full cycle event within window, causing an orphan start edge and a stuck active flag ni.com 43 End of full cycle event within next window, causing an orphan end edge ni.com 44 Future* FPGA : Typical GDI or Diesel Injection Timing & Waveform Measurement Analog Input Timing Measurement and Capture Thresholding Waveform capture *Q4 2014 ni.com 45 Case Study Application Creating a flexible HIL test system with I/O interfaces that require custom timing and synchronization schemes not easily implementable with traditional hardware. NI Products LabVIEW FPGA Module, PXI, and Reconfigurable I/O (RIO) hardware "With LabVIEW FPGA and RIO hardware we were able to quickly and efficiently design custom analog and digital interfaces for our HIL test system.” Key Benefit Gaining the ability to efficiently create custom hardware interfaces that can be reconfigured after deployment to adapt to different ECU types and changes to ECU interfaces. ni.com – Roy Kranz, Wineman Technology Inc. 46 Summary • FPGA-based I/O interfaces are used to expand the capabilities and performance of HIL test systems. ni.com • Hard determinism – Realistic simulation timing and local intelligence with 25 ns resolution • Off-load processing – Achieve real-time performance with more complex simulations • Custom Hardware – Create custom H/W instruments • Industry standard technology – Off the shelf chips used for specific applications get COTS benefits • Reconfigurable hardware personalities – Test multiple UUT types and adapt to changes in UUT interfaces without changing hardware 47