1. Introduction
This document describes the contents of the 6ch_MPPT_Boost project, a software example running on the STM32H7P hardware. The low-cost and easy-to-use Hardware In Loop (HIL) kit is convenient for quick evaluation and application development with STM32H7P series microcontrollers, a family of devices designed for digital power conversion applications, combining high integration with performance.
The document illustrates how to drive the HIL power plant emulator, by describing the steps required to execute the code and to check output signals, using the IAR Embedded Workbench toolchain. The document describes the MPPT usage, alongside with STM32H7Pxx capabilities exploited by this application, and how they can be used in larger scale systems.
2. Application and hardware overview
The complete system includes 6 photovoltaic panels as power sources, each channel contributing to the DC Bus and the corresponding 800V rail. Each channel includes a synchronous 2L boost converter which extracts the most power of each PV Panel, using Maximum Power Point Tracking (MPPT) closed loop control (perturb and observe technique). MPPT principle is explained in the next chapter.
HIL platform emulates PV panels as well as synchronous boost converter HW components, electrical load and current sensors needed for MPPT control. H7P controller generates transistor gate signals and MMPT algorithm.
Image below shows an H7P controller board driving a first HIL containing the 6ch 2L Boost system detailed previously but also driving a second HIL emulating a 3L-TT inverter.
3. MPPT principle
MPPT charge controller techniques optimize the generation of solar power by ensuring that the operating voltages of solar panels are close to the maximum power point under changing environmental conditions. Solar panels have non-linear current-voltage characteristics that vary with environmental changes, making it challenging to maximize power generation.
MPPT techniques are needed in solar power systems to optimize power generation, adapt to environmental variations, and increase system efficiency. These techniques play a crucial role in ensuring the efficient operation of solar systems and maximizing the utilization of solar resources.
The figure below shows typical solar panel current-voltage characteristics and corresponding tracked maximum power point. (Courtesy of elecdan-converter.com)
The technique chosen in this application is Perturb and Observe (P&O – also known as the hill-climbing method). It involves perturbing the photovoltaic current by adjusting the pulse-width modulation duty cycle and observing the resulting changes in output power to determine the appropriate direction for further perturbation.
The figure below shows a typical P&O flowchart. (Courtesy of Asma Ul Husna, Madhumitha: Solar charge controller with Maximum Power Point Tracking)
4. Application contents
4.1. Synchronous boost converter operation
This application implements a synchronous boost converter stage (see the figure below).
By storing energy in an inductor during the switch-on phase and releasing it to the load during the switch-off phase, this voltage conversion is made possible. Power electronics applications requiring a greater output voltage than the input source depend on boost converters.
At the beginning of the switching period, the PWM of the low side switch is set high and the high side switch is set low. This turns MOSFET Q1 on, and MOSFET Q2 off.
The current through the inductor increases linearly. The output capacitor is already charged in steady-state and holds the output voltage on the load. At the end of the duty cycle, the switch Q1 is turned off.
A dead time is inserted between low side (Q1) and high side (Q2) switches to prevent shoot-through. When this dead time has elapsed, the high side (Q2) switch turns on.
The inductor current decreases linearly when it charges the output capacitor again (output voltage is higher than input), and current flows through switch Q2. This switching action is described in the figure below:
The output capacitor filters the AC component, while the DC component is the output load current. The output voltage is always greater than or equal to the input voltage.
The basic principle of operation for a boost converter can be understood through the following two stages:
Switch-on period (Q1 closed, Q2 open): During this stage, the input voltage (Vin) is applied across the inductor (L), causing the current through the inductor to increase linearly. The energy stored in the inductor builds up, and the switch Q2 is open, preventing current flowing to the load. The inductor current can be expressed as:
where is the change in inductor current, is the inductance, and is the duration of the Q1 switch-on period.
Switch-off period (Q1 open, Q2 closed): When the switch Q1 opens, and after a wanted deadtime, the switch Q2 is closed. Then, the inductor releases its stored energy to the load (R) and the output capacitor (C).
During this period, the voltage across the inductor (VL) is equal to the difference between the output voltage (Vout) and the input voltage (Vin). The inductor current decreases linearly as the energy is transferred to the load, and the equation for the inductor current becomes:
where is the duration of the Q1 switch-off period.
Through the inductor current equations for both stages and rearranging the terms, the voltage conversion relationship for the boost converter is derived as follows:
where is the duty cycle, defined as the ratio of the switch-on time () to the total switching period (). This equation shows that the output voltage can be controlled by adjusting the duty cycle of the switching waveform, allowing for a higher output voltage than the input voltage.
5. Program flow and IP dependencies
The ADC module sampling is triggered by the HRTIM Timer M CMP1. Once sampling and conversion are completed, the ADC activates DMA to copy the result directly from the ADC result log to the DMA buffer.
The end of ADC group transfer interrupt copies acquisitions from DMA buffer to global variables. TIM8 interrupt stores newly acquired ADC values for averaging purposes. Then, if the number of samples is sufficient to get a convenient average, TIM20 interrupts execute MPPT algorithm that computes adequate duty cycle correction from acquired values for each of the 6 channels.
This duty cycle correction is applied on each out of 6 HRTIM Timer to update the corresponding channel PWM signals. The figure below shows the corresponding block diagram for one channel, herein HRTIM Timer A.
6. HRTIM configuration
This section focuses on:
- Master timer sync slave timer
- ADC trigger by timer
- Output set/reset from timer itself or other timer event
- Dead time insertion
This example shows how to configure the HRTIM to drive a 2‑level synchronous boost converter that steps an input voltage up to a higher output voltage using two controlled switches (one main switch and one synchronous rectifier) and two voltage levels at the switching node (ground and input voltage).
The figure below recalls the synchronous boost power stage topology
The HRTIM is operating in continuous mode, and the Timers and PWMs signals are defined as follows:
- HRTIM_Master (TM): Continuous mode, counting up, update source is repetition event. This is the common clock of the HRTIMER slave channels (CHA to CHF). Every slave channel is independent but defined through Master Timer (TM) events.
- HRTIM_CHA (TA): update source is TM update event, reset is TM period.
- HRTIM_CHA1: set on TA CMP1, reset on TM period.
- HRTIM_CHA2: complementary of HRTIM_CHA1 with dead time generator (identical rising and falling edge dead times).
The figure below shows the boost control waveforms on the two outputs.
The ADC is configured to have conversions triggered at 60% of the converter ON time, with the help of the HRTIM Timer M compare unit 1. But virtual ADC sampling can be triggered at any interval as per user requirement, for example, where MOSFETs switching is not taking place.
2L-MPPT boost demonstration overview
The demonstration starts with a soft start on HRTIMER channels, the duty cycle is raised from a 10% value to a precomputed value which depends on the output voltage and solar panel voltage.
Then duty cycle is slowly adjusted in the ADC IRQ handlers (triggered by HRTIM Timer M compare unit 1) inside MPPT algorithm to reach the best power extraction from solar panels.
7. Evaluate 6ch_MPPT_Boost performances with HIL
7.1. HIL presentation
The HIL (Hardware In the Loop) board emulates the complete power conversion system, including AC and DC sources, converter power stages, and loads. Based on the Stellar E1 MCU, it is designed for safe, low-voltage emulation of digital power converters.
It enables verification of control algorithms by simulating a virtual power circuit where the real controller interacts under both normal and fault conditions, eliminating the risk to physical power hardware.
The control board implements control algorithms exploiting the capabilities of the STM32H7P MCU, ensuring seamless integration with the emulator for accurate real-time system validation. A dedicated software GUI offers intuitive real-time visualization and analysis of critical parameters and signals, enabling users to monitor system performance, detect anomalies, and fine-tune control algorithms efficiently.
Follow the guidelines described in UM3598 use manual for configuring and programming HIL Stellar MCU. The figure below shows the H7P controller board connected to x 1 HIL platform supporting the x6 channels MPPT-Boost topology.
7.2. 6ch_MPPT_Boost converter monitoring using DPower HIL Supervisor
Once HIL Stellar MCU is flashed with the proper 6ch MPPT model (HILV1_2L_ Boost_6ch_release_clean_v1.8.0_commits0.elf), and the STM32H7P MCU with the binary generated by the previously described application (MPPT_2L_Boost_A1.bin), the user can monitor various parameters with the help of the DPower HIL supervisor.
The GUI can show input variables as panels power maximum output and no-load panels output voltage. These parameters can be adjusted with the help of the HIL board rotary trimmers. Then, once the MPPT control is launched, the user can verify that each channel PWM is adjusted to get the maximum power extracted from each solar panel (visible in the last column of the DPower HIL supervisor snapshot below).
Under the Debug tab, the user can also get the PWM duty cycle value for each channel, which can be useful if the debugger is not attached to the HIL + H7P control board arrangement. The GUI is also widget configurable, so it is possible to get the desired gauges into a given screen to adapt to customer’s needs.
8. Conclusion
This page introduces a 6-channel photovoltaic energy harvesting method, featuring a MPPT algorithm on the STM32H7P platform. This multichannel application has been described through HRTIMER, ADC triggering and DMA dedicated configurations. Dynamic behavior characterization and performances have been performed by the Hardware In the Loop (HIL) emulation system.