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.
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 |
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 |
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.
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.
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:
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. | |