LG Electronics Develops Smart Headlamp with a Rapid Prototyping Workflow

“MATLAB and Simulink cut the time required in the development stage by half. The tools made it easy to respond to our OEM customer’s requirements by enabling the design of custom functions.”


Develop video processing and control algorithms for a next-generation smart headlamp


Use Model-Based Design with MATLAB, Simulink, and HDL Coder to establish a prototyping workflow for modeling, simulating, and implementing FPGA-based video processing designs


  • Requirements rapidly implemented on prototyping hardware
  • Coding and verification time reduced
  • Code consistency and reusability increased
A car using next-generation smart headlamps.

LG Electronics develops next-generation smart headlamps with MATLAB, Simulink, and HDL Coder.

Engineers at LG Electronics’ CTO Optics Lab are developing a next-generation smart headlamp for vehicles. The smart headlamp module dynamically controls the vehicle’s front lighting system in response to objects detected in the environment, such as road signs, oncoming vehicles, and pedestrians. To react effectively to on-road situations, the control algorithm needs to quickly recognize detected targets and then control hundreds of LED modules in the beam projector.

LG Electronics, in cooperation with their affiliate ZKW, used Model-Based Design with MATLAB®, Simulink®, and HDL Coder™ to build an FPGA-based prototyping platform that can produce the correct light patterns for the LED headlight to project.

“Model-Based Design with MATLAB and Simulink made it easy to design and integrate the parts each company was responsible for in a single project workflow,” says Jiyoung Jeong, hardware/software integration specialist at LG Electronics. “MATLAB and Simulink improved existing embedded hardware implementation workflows and easily integrated with existing simulations and systems.”


A key requirement for the smart headlamp was the ability to rapidly respond to changes detected in the environment. To meet this requirement, the team would need to implement the video processing system as an FPGA-based prototype. At the time, however, they lacked the tools needed to create the custom functions requested by the customer.

The smart headlamp is a new product for LG Electronics. Compounding the challenges common to such a project, the customer, an original equipment manufacturer, requested a prototype in just six months. In the past, the LG Electronics team wrote HDL code by hand to implement high-speed video processing algorithms on FPGAs. With this manual workflow, it took a long time to develop and verify complex algorithms, and coding errors introduced during hardware implementation required additional time to debug. Given the aggressive deadline for the prototype, the traditional approach would take too long.


LG Electronics engineers used Model-Based Design with MATLAB, Simulink, and HDL Coder to design and implement the FPGA-based prototyping platform. The team found that HDL Coder’s automation of fixed-point conversion, its support for development of custom functions, and its overall workflow integration better met their needs. ZKW performed the final tuning and testing for products based on this platform.

The LG Electronics team designed a frame-based video processing algorithm in Simulink with blocks and functions from Image Processing Toolbox™ and Computer Vision Toolbox™. To prepare for HDL implementation, they then created a pixel-streaming version of the algorithm using hardware-ready blocks from Vision HDL Toolbox™. The team ran frame-based and pixel-based simulations in Simulink to verify their algorithm design using video files and actual input from evaluation boards.

After validating the video processing algorithm via simulation, the engineers used HDL Coder with two hardware support packages: the HDL Coder Support Package for Xilinx® Zynq® Platform and the Vision HDL Toolbox Support Package for Xilinx Zynq-Based Hardware. They used HDL Coder to explore a variety of design options and find a solution that met their resource and speed requirements.

They also used Embedded Coder® to develop an application for the SoC’s Arm Cortex-A53 processor. The application enabled real-time tuning of the video processing algorithm during prototyping.

Having successfully deployed and tested their video processing system as an FPGA-based prototype by the deadline, LG Electronics engineers are now planning to implement an ECU-based prototype using the same workflow.


  • Requirements rapidly implemented on prototyping hardware. “We were able to implement our requirements directly in the model, check the validity of the results through simulation at the frame- and pixel-level in Simulink, and quickly prototype on the target FPGA using HDL Coder,” says Jeong.
  • Coding and verification time reduced. “Automatic HDL code generation with HDL Coder enabled us to reduce the time required for coding by 80% and for verification by 30%,” says Jeong. “We estimate that we reduced prototyping time by 50% by using features in the hardware support package.”
  • Code consistency and reusability increased. “When generating code with HDL Coder, we always apply the same code generation rules. This results in more consistent code, which is helpful when multiple people are working on the same project,” says Jeong. “We’ve also increased reusability by using Simulink Projects and creating a reusable Simulink model library, features that are not provided by general-purpose FPGA tools.”