ModusToolbox Power Control Middleware Library
MPPT (Maximum Power Point Tracking)

General Description

Overview


This block implements Maximum Power Point Tracking (MPPT) algorithms for photovoltaic systems and other variable power sources. The MPPT controller continuously adjusts the operating voltage to extract maximum power from the source under varying environmental conditions.

The MPPT block provides robust tracking performance for solar power applications, wind energy systems, and other renewable energy sources where maximum power extraction is critical for system efficiency.

Configurable features


The MPPT block provides the following configurable features:

Configuration Parameter Name Description
Perturbation step size step_size Voltage step size for perturbation in Volts
Minimum voltage limit v_min Lower operating voltage limit in Volts
Maximum voltage limit v_max Upper operating voltage limit in Volts
Minimum power threshold p_min_threshold Minimum power for MPPT operation in Watts
Sampling time dt Algorithm execution period in seconds
Settling time settle_time Time delay after perturbation in seconds

Variants and configuration options

This section describes the available variants and configuration options. All variants share the same API so that changing the block interface does not require further changes to the application code when switching between the variants.

Macro name Macro purpose
MPPT_USE_VARIANT_PNO Use Perturb and Observe variant of MPPT (default)
MPPT_USE_INLINE Use function inlining for MPPT

Perturb and Observe variant


This is the default variant that implements the classic Perturb and Observe algorithm. The algorithm works by periodically perturbing the operating voltage and observing the resulting power change. If power increases, the perturbation continues in the same direction; if power decreases, the perturbation direction is reversed. The design of this variant is shown in the flowchart below.

The Perturb and Observe variant is selected by defining MPPT_USE_VARIANT_PNO in the user config file. This is the default variant.

#define MPPT_USE_VARIANT_PNO

Performance optimization:
To allow for the optimization of execution time, the API functions can be inlined by defining MPPT_USE_INLINE in the user config file. The default is no function inlining.

#define MPPT_USE_VARIANT_PNO
#define MPPT_USE_INLINE

Using the API
The application must allocate the context structure (mppt_context_t) in a memory section of choice. It must set the values of the configuration sub-structure (mppt_context_t::config). The static sub-structure (mppt_context_t::vars) contains the static memory the block needs to operate. It must not be initialized by the application. The application has to call the block reset function (MpptReset()) to clear the static sub-structure and the block init function (MpptInit()) to initialize the internal configuration.

Example usage of the Perturb and Observe variant:

// instantiate an instance of the MPPT context
mppt_context_t mppt_context;
{
// configure MPPT parameters
mppt_context.config.d_ref_init = 0.5f; // initial duty cycle (50%)
mppt_context.config.d_step = 0.01f; // perturbation step size
mppt_context.config.d_max = 0.9f; // maximum duty cycle limit
mppt_context.config.d_min = 0.1f; // minimum duty cycle limit
// reset and init MPPT context instance
MpptReset(&mppt_context);
MpptInit(&mppt_context);
// get some input values from PV panel
float32_t v_pv = 30.5f; // panel voltage
float32_t i_pv = 8.2f; // panel current
float32_t d_ref;
// execute MPPT algorithm
Mppt(&mppt_context, v_pv, i_pv, &d_ref);
// d_ref now contains the updated duty cycle reference
}

API Reference

 Macros and enumerated types
 Configuration macros for MPPT block.
 
 Typedefs and structures
 Context structure and sub-structures for the MPPT block.
 
 Functions
 API functions for MPPT block.