Controlling Zinc-flow Batteries and Switch-Mode Power Regulation for Megawatt-scale Energy Storage

By François Normandin, Javier Ruiz, Tomi Maila, Jim Kring, and Ryan Talbot

primus power download

Creating a system to control the electrochemical process of an industrial zinc-flow battery and to regulate and synchronize the DC power of multiple zinc-flow batteries connected in series for delivery onto the AC power grid.


Using LabVIEW and multiple CompactRIO controllers to develop a real-time distributed system to control multiple zinc flow-batteries and LabVIEW FPGA for high-speed control and regulation of their DC power to and from the AC power grid.

  • NI CompactRIO LabVIEW
  • FPGA NI Linux Real-Time
  • LabVIEW LabVIEW Real-Time
  • LabVIEW FPGA Compile
  • Cloud Service

Grid-scale energy storage is becoming increasingly important for enabling renewable energy production, energy demand management, and microgrid applications. These large energy storage devices can be used across the power delivery system (shown in Figure 1) to provide backup power and act like shock absorbers for the grid. They are capable of handling large spikes in energy supply and demand, for example: renewable supply spikes when the sun is out or the wind is blowing, and consumer demand spikes from large loads like air conditioning or heaters.

EnergyPod™ Storage Devices

Figure 1: EnergyPod™ storage devices used across the delivery system.

Primus Power has developed an innovative large capacity zinc-flow battery and power regulation system that is cost effective and safe to operate. This system consists of multiple 30kW (72kWh) zinc-flow batteries called EnergyCells contained within a larger 420kW EnergyPod™. The EnergyPod™ provides centralized regulation of the batteries’ DC power, inversion of the DC power to and from the AC power grid, and thermal management. Multiple EnergyPods can be composed into an EnergyFarm system for nearly unlimited storage capacity.

The system had the following requirements:

  1. Real-time control and monitoring of the electrochemical processes of each zinc-flow battery
  2. Real-time control of battery power distribution and inversion to allow charging/discharging from/to the power grid
  3. Deterministic high-speed fault monitoring and protection to ensure system performance and reliability
  4. High-speed communication to support real-time control across multiple embedded controllers
  5. Flexible communication via multiple industrial protocols to support third-party energy management systems
  6. Modular and expandable system architecture to support multiple possible deployment scenarios
  7. Professional-grade human machine interfaces (HMI) to allow operator control and monitoring of the high-level system, low-level subsystems, and individual components

Primus Power had developed lab prototype systems using LabVIEW for test and validation. When it came time to develop commercial systems for shipment to customers, Primus Power partnered with JKI, a Silver NI Alliance Partner specializing in commercial-quality LabVIEW development and helping high-tech companies get their innovative products to market with speed and impact.

Solution Details

Initially, a traditional PLC control system was considered for the commercial systems. However, it quickly became clear that using NI CompactRIO, powered by NI Linux Real-Time and LabVIEW FPGA, would not only address the technical and performance requirements, but would also reduce development time; this would enable us to get the product to market much faster and generate considerable business value.

An Individual Energy Cell

Figure 2: An Individual EnergyCell

Each EnergyCell is controlled by an independent cRIO-9068 responsible for managing the zinc-flow battery’s electrochemical process, state of charge, and overall health by controlling and monitoring a variety of pumps, valves, and sensors using NI 9375 and NI 9265 modules. Two NI 9205 modules are used to acquire 39 RSE voltage measurements for performing real-time prediction of battery health and characterization of electrochemical behaviors.

The EnergyCells are connected in series inside the EnergyPod to form a high-power DC current loop called the “powertrain”. Each EnergyCell can charge or discharge its zinc-flow battery by accepting or providing power from or to the powertrain’s DC current loop. This is achieved with the cRIO-9068’s FPGA plus NI 9474, NI 9401, and NI 9423 modules by switching MOSFETs at high frequency to provide closed-loop current and voltage regulation.

The EnergyPod™ has a cRIO-9068 controller that it uses to manage the powertrain DC current loop in order to accept or provide power to or from the AC grid, as requested by the EnergyFarm. The EnergyPod™ cRIO-9068’s FPGA acts as a switch-mode power regulator that modulates IGBTs to achieve closed-loop current and voltage control for the overall powertrain, while individually modulating power and or bypassing EnergyCells. Using high-speed NI 9401, NI 9423, and NI 9474 C Series modules, the powertrain system synchronizes each EnergyCell to a common triggering signal and distributes ON and OFF times with microsecond accuracy. Additionally, the system is able to detect and react to potentially catastrophic faults within microseconds.

An Energy Pod Containing 14 Energy Cells

Figure 3: An EnergyPod containing 14 EnergyCells

The EnergyPod™ also uses its cRIO-9068 to run a complex thermal management system (controlling pumps and valves, and monitoring temperatures), to communicate with groundfault protection devices via Modbus, and to manage the fire suppression and ventilation systems.

The EnergyFarm has a cRIO-9068 that controls and monitors multiple EnergyPods, communicates with an external energy management system (EMS) via OPC or DNP3, and controls inverters and other devices via Modbus. When the EnergyFarm cRIO receives a request from the EMS to accept/provide power from/to the grid, it determines the necessary steps and commands all the EnergyPods to accept/provide the necessary power.

We have a lot of respect for the JKI team. We enjoy working with them and have built a great relationship. The JKI engineers integrate well with our team and have really become a part of it. I would absolutely recommend them to other companies who need custom product development. They are a top-notch team that you can trust to deliver high quality work on time.

The Control System For The Energy Farm

Figure 4: The control system consists of 15 cRIOs per EnergyPod™, plus 1 cRIO for the EnergyFarm.

JKI designed and developed a modular and distributed control software architecture that allows for networked communication and high scalability. Built upon the NI Actor Framework for LabVIEW, the architecture seamlessly runs on both embedded and PC targets and can accommodate various system configurations ranging from just a couple of cRIOs to more than a hundred. Switching between subsystem implementations allows for fast prototyping and rapid changes in requirements. Loosely coupled distributed system components make it possible to reuse elements in both the lab and manufacturing environments. JKI also developed commercial-grade human machine interfaces (HMI) using LabVIEW to provide intuitive operator control of the entire system and individual components.

Project Conclusions

As with most high-tech product development efforts, we had an aggressive project schedule and demanding requirements that continued to evolve over the course of the project. NI CompactRIO, powered by NI Linux Real-Time and LabVIEW FPGA, provided a fantastic platform for our system, because of its performance, affordability, and ruggedness in extreme environments where our EnergyFarm systems are deployed. We saved thousands of dollars in custom board design and validation. CompactRIOs were found to provide better performance and flexibility than traditional PLCs and allowed for the reuse of existing LabVIEW code originally written for testing and validation. Moreover, the NI Linux RealTime OS opens the door to augment the functionality of the system with the ecosystem that Linux provides.

Using LabVIEW at all stages of the development cycle (from research to proof-of-concept to product test and deployment) minimized the time to market and facilitated code reusability. Moreover, LabVIEW allowed for one programming language to be uniformly used all the way from low-level FPGA control to high-level business logic and user interfaces. Communication with external systems via OPC, Modbus, and DNP3 was easily accomplished thanks to the extensive library of drivers for LabVIEW.


Video 1. NIWeek Presentation  - Designing the Next Generation of Grid Energy Storage with LabVIEW

LabVIEW FPGA was used for running the complex high-speed control algorithms and fault handling logic required for Primus Power’s powertrain architecture. The LabVIEW FPGA-based solution allowed for extremely short development iteration cycles, making it possible to go from prototype to a shipping product in a fraction of the time compared to traditional FPGA development. This accelerated development enabled Primus Power to showcase its powertrain as part of an Advanced Microgrid Demonstration at the National Renewable Energy Laboratory (NREL) in Golden, Colorado in fall 2014, where the system was capable of islanded (off-grid) operation using stored and high-penetration renewable energy.


The first EnergyFarm was successfully delivered to the Marine Corps Air Station (MCAS) Miramar in San Diego, California in May 2015 as part of their advanced microgrid system, which ensures the continuous flow of electricity while managing renewable sources. The MCAS Miramar received the 2015 Environmental Protection Agency (EPA) Federal Green Challenge award for having the greatest percentage reduction in energy use of nearly 400 federal sites.


primus power MiramarFigure 5. The MCAS Miramar receiving the 2015 EPA Federal Green Challenge award.


By all measures, using NI CompactRIO, NI Linux Real-Time, and LabVIEW FPGA significantly reduced development time, enabling our team to get the product to market much faster than alternative approaches and make a significant impact in the energy storage market.

PDF Download
Primus Power

3967 Trust Way
Hayward, CA 94545

National Instruments

JKI is a National Instruments Certified Silver Alliance Partner.

Speak with us today and learn how we can help bring your ideas to life.

Contact Us