Working Principle Analysis and Control Algorithm for Analog Microgrid Control Sys- tem Based on Cortex-M4 Controller

Baoying Li, Qu Chao, Li Chen, Mingli Song, Yang WanbingJournal of Engineering Science and Technology Review 2019 · DOI

Abstract

Modern power systems are transitioning from centralized single-power supplies to distributed generation models based on renewable energy. However, integrating these distributed sources requires high reliability, security, and precise control. This paper proposes an analog microgrid control system based on the Cortex-M4 controller, featuring real-time measurement and tracking capabilities. By utilizing three-phase grid-connected inverters and advanced control loops—including Proportional-Integral (PI) tracking, phase-locked loops (PLL), and digital feedback (2P2Z) compensation—the system achieves stable operation with a total harmonic distortion (THD) of just 0.03%. Experimental results verify the accuracy of the control algorithms, providing a robust reference for system modeling and power grid integration.

Introduction

Traditional centralized power grids often struggle to provide reliable electricity to remote or underserved areas. Distributed "new energy" sources, such as solar and wind, offer a flexible alternative but introduce technical challenges related to stability and synchronization. Interfacing these DC sources with an AC grid requires sophisticated inverters that can handle intermittent supply and sudden load changes without compromising system integrity. This study addresses these challenges by developing a high-performance control architecture centered on the Cortex-M4 microcontroller to manage a three-phase analog microgrid.

System Architecture and Methods

The proposed system is built upon a hardware-software co-design optimized for real-time responsiveness.

Hardware Design

The core of the system is the Cortex-M4 (M451 series) microcontroller, chosen for its high-frequency ADC sampling (10kHz) and dedicated math processing capabilities. The power stage consists of three-phase bridge inverters utilizing IRF540 MOSFETs and IR2110 drivers. To ensure clean power delivery, an LC filter stage smooths the high-frequency Sinusoidal Pulse Width Modulation (SPWM) signals into pure sine waves. Real-time feedback is provided by voltage and current transformers connected to the MCU's ADC channels.

System structure showing the integration of a photovoltaic array with an inverter and AC circuit.

Control Methodology

Stability is maintained through several key algorithms:

  • Incremental Digital PID: This algorithm calculates the change in the control signal rather than the absolute position, significantly improving system stability and adjustment performance during transient events.
  • Phase-Locked Loop (PLL): A software-implemented PLL ensures the inverter's output frequency and phase are perfectly synchronized with the grid.
  • 2P2Z Compensation: Digital feedback compensation is employed to stabilize the grid-connected current loop.
  • Safety Protections: The system integrates hardware-level overcurrent and overvoltage protection with software-based islanding and circulation detection to prevent hazardous operating conditions.

Experimental Results

The prototype was tested under various load conditions with a 41V DC input and a target 24V (line voltage) 50Hz output. Key performance metrics include:

  • Harmonic Purity: The system achieved a remarkably low THD of ≤0.03%, indicating highly optimized SPWM and filtering.
  • Voltage and Frequency Stability: The output line voltage was maintained at approximately 24.02V ± 0.2V at a steady 50Hz.
  • Efficiency: The system demonstrated a peak efficiency of 92%, maintaining over 87% across standard operating ranges.
  • Load Regulation: The load adjustment rate was exceptionally low (0.25% to 0.3%), ensuring voltage stability despite significant changes in current demand (up to 3A RMS).
  • Parallel Operation: In multi-inverter tests, the current difference between units was kept below 0.05A, demonstrating precise load sharing and synchronization.

Conclusion

The Cortex-M4-based control system successfully addresses the complexities of microgrid management. By combining high-speed digital control with robust safety features, the system provides a stable, high-quality power supply suitable for distributed generation. While currently demonstrated at an analog low-voltage scale, the underlying control logic offers a scalable foundation for future high-voltage microgrid applications and virtual synchronous generator research.

Summary updated

Abstract

The modern power system is a centralized single-power supply system based on large power grids. However, with the popularity of new energy generation technologies, a distributed power generation technology based on new energy has the characteristics of high maintainability and flexible power generation mode. Thus, the mechanism of an analog microgrid control system based on Cortex-M4 controller with real-time measurement and tracking control function was proposed to solve the problems of unsatisfactory load in remote areas and the difficulty of power supply to satisfy the reliability, security, and diversity of power supply. The analog microgrid utilized the principle of three-phase analog microgrid interconnection composed of several grid-connected inverters. The three-phase analog micro-grid generated Alternating Current (AC) signal and other inverters worked in the grid-connected mode and adopted many loop control technologies, such as Proportional-Integral (PI) voltage tracking, PI current tracking, phase-locked loop, and digital feedback (2P2Z) compensation, to operate the grid-connected system in a stable condition. The accuracy of selecting a control algorithm was verified using experimental data. Results demonstrate that the three-phase symmetrical AC generated by an inverter can output 50 Hz sinusoidal current, 240.2 V line voltage in load, and 0.03% total harmonic distortion. The adjustment rate when changing the current root mean square of the load is small. The analog microgrid improves the system's instability caused by the complex operation of the microgrid system. The analog microgrid control system also enhances the requirements of hardware protection, such as overcurrent and overvoltage, and designs a software protection for islanding and circulation detections. This study provides references in the fields of system modeling, data processing, and control strategy, which can solve the contradiction between microgrid and power grid and satisfy the requirements of users for power supply.
BibTeX
@article{li2019working,
  author = {Baoying Li and Qu Chao and Li Chen and Mingli Song and Yang Wanbing},
  title = {{Working Principle Analysis and Control Algorithm for Analog Microgrid Control Sys- tem Based on Cortex-M4 Controller}},
  journal = {Journal of Engineering Science and Technology Review},
  year = {2019},
  doi = {10.25103/jestr.121.08},
}
Figure