User Stories

Murata Manufacturing Reduces Development Time for Energy Management System Control Software by More Than 50% with Model-Based Design

Challenge

Reduce time-to-market for the company’s first energy management system product trial

Solution

Use Model-Based Design with Simulink to model the controller and power electronics, run simulations, and generate production code

Results

  • Control software development time reduced by more than 50%
  • Defect-free code generated
  • Project ramp-up time shortened

“We check every requirement needed for certification via simulation in Simulink before verifying it on the real circuit—and because we used Embedded Coder to generate code directly from our model, there’s no gap between our simulations and the real embedded software.”

Dr. Yue Ma, Murata Manufacturing Co., Ltd.

Murata flexible three-phase energy management system with lithium-ion battery.


As part of its smart home/office/factory initiative, Murata Manufacturing is developing an energy management system (EMS) that combines a solar panel, a battery controller, a grid-tied inverter, and an intelligent control system to optimize energy usage. When the solar panel produces more power than the user needs, the control system either uses the excess energy to charge the battery or feeds it back into the grid. Conversely, when the user needs more power than is being produced by the solar panel, the control system either discharges the battery or accesses power from the grid.

Murata engineers used Model-Based Design with Simulink® to speed the development of embedded control software for the new EMS product line.

“EMS was a new market for us, and we needed to minimize risk,” says Dr. Yue Ma, energy technology development department manager at Murata. “Model-Based Design with Simulink enabled us to reduce time-to-market, which was a significant advantage for us. Because we were not expert programmers, modeling and simulating our control design and then generating quality C code from our models was essential to produce a working system as quickly as possible.” 

Challenge

Because Murata had not previously developed an EMS product, the engineering team had to start from scratch. They needed a way to simulate the inverters, converters, and other power electronics hardware in the EMS in order to evaluate various hardware topologies. Since it would be difficult and costly to test the system with real hardware, they needed to model the control system and run simulations using a system model with a power grid model to verify the design under normal operating conditions as well as under abnormal and hard-to-test conditions such as grid power outages and surges.

Because competitors had already introduced EMS products, Murata wanted to get to market quickly with its own offering. To shorten development time for the control system, the engineering team wanted to generate control code directly from their models. With no more than three engineers on the team, and with little previous programming experience, they felt that writing and debugging the control code by hand would take too long and result in poor quality. 

Solution

Murata engineers used Model-Based Design to design and implement the EMS embedded control software.

Before starting the project, Dr. Ma attended a three-day MathWorks training course on the fundamentals of Model-Based Design and code generation.

Dr. Ma and his team created some plant models of the major system components, including the solar converter, battery DC-DC converter, and three-phase grid-tied inverter using Simscape Electrical™. The model was adjustable so that they could test different hardware topologies.

After adding measurement blocks to compute the total harmonic distortion (THD) and root-mean-square (RMS) of key signals, the team ran simulations to check that these metrics were within acceptable ranges and to compare the performance of different control strategies and hardware topologies.

Working in Simulink, the team modeled the system’s PI controller and then ran closed-loop simulations with the controller and the transfer function counterpart of the plant, using Simulink Control Design™ to tune control parameters.

Additional closed-loop simulations were performed to assess the design’s response to abnormal situations, including blackouts and phase unbalance of the grid, as well as some grid-tied requirements, including fault ride through (FRT) and maximum power point tracking (MPPT) for solar.

Using Stateflow®, they created state transition diagrams to model EMS startup, shutdown, and abnormal sequences as well as state transitions for the system’s various operating modes.

To implement the control logic on the micro-controller, they converted the floating-point design to fixed point using auto-scaling and other time-saving tools in Fixed-Point Designer.

Next, they generated C code and Code Composer Studio™ projects from the controller model with Embedded Coder®. Finally, they deployed it to Piccolo™ and Delfino™ 32-bit microcontrollers made by TI.

The team tested the microcontroller and EMS circuitry together to verify the code with the production hardware, by running open-loop tests to perform basic checks and by verifying system closed-loop controller and state transitions.

Murata has completed both the EMS project and a photovoltaic inverter project using Model-Based Design. The company is applying for JET certification for the grid connectivity, and the engineering team is preparing for long-term reliability testing. 

Results

  • Control software development time reduced by more than 50%. “We completed the control software in about six months with just three engineers,” says Dr. Ma. “Without Model-Based Design it would have taken two or three times longer or we would have needed to hire additional software engineers.”
  • Defect-free code generated. “Because our programming experience was limited, I expect there would have been many more bugs if we had hand-coded our controller,” says Dr. Ma. “Generating 100% of our code guaranteed reliability. We read the output and found zero bugs in the code we generated with Embedded Coder.”
  • Project ramp-up time shortened. “During the MathWorks training class, I learned a lot of practical skills and techniques that I then shared with the rest of my team,” says Dr. Ma. “That, combined with the strong support we received from MathWorks whenever we had an issue, helped us get our whole project done.”