I am trying to control a DC to DC boost converter using FSC MPC to generate a 20 kW PV power but the MPC controller is very poorly than PI controller.
Afficher commentaires plus anciens
I am trying to control a DC to DC boost converter using FSC MPC to generate a 20 kW PV power but the MPC controller generated a maximum of 1135 W PV power and a maximum of 7184 W DC load power instead of 20 kW power. The PV voltage has a maximum of 59 V against 847 V boosted voltage with 21 A maximum PV current against a maximum of 27 A inductor current. Below is the MPC script used in the Matlab function block:
function S = MPC_Boost(iL, V_PV, Vout, iL_ref, wf_min, wf_max, Dref)
% MPC controller for boost converter with iL_ref from MPPT logic
%% System Parameters
Ts = 10e-6;
RL = 0.02;
L = 0.0199;
C = 3.1222e-04;
R_load = 18;
%% Limits
iL_max = 20;
iL_min = 0.2;
Vout_max = 420;
Vout_min = 360;
P_PV_max = 20000;
Vout_ref = 400;
%% Persistent memory
persistent S_old wf;
if isempty(S_old)
S_old = Dref;
wf = wf_min;
end
%% Sanitize Inputs
iL = abs(iL);
Vout = abs(Vout);
V_PV = max(V_PV, 50);
%% Duty Cycle Candidates
states = [Dref - 0.05; Dref; Dref + 0.05];
states = min(max(states, 0.3), 0.9); % Clamp
%% Cost Evaluation
g = zeros(length(states),1);
g_min = inf;
n_best = 1;
X_k = [iL; Vout];
for n = 1:length(states)
D = states(n);
% Discrete model
A_d = [1 - (RL * Ts / L), -(1 - D) * (Ts / L);
(1 - D) * (Ts / C), 1 - (Ts / (R_load * C))];
B_d = [Ts / L; 0];
% Predict state
X_k1 = A_d * X_k + B_d * V_PV;
iboost_k1 = X_k1(1);
Vout_k1 = X_k1(2);
P_PV_pred = V_PV * iboost_k1;
% Constraint check
if iboost_k1 < iL_min || iboost_k1 > iL_max || ...
Vout_k1 < Vout_min || Vout_k1 > Vout_max || ...
P_PV_pred <= 0 || P_PV_pred > P_PV_max || ...
isnan(iboost_k1) || isnan(Vout_k1)
g(n) = inf;
continue;
end
% Cost terms
g_iboost = (iL_ref - iboost_k1)^2;
g_vout = (Vout_ref - Vout_k1)^2;
g_sw = (D ~= S_old) * wf;
g_dref = (D - Dref)^2;
g_pv = (P_PV_pred < 100) * 1000;
% Total cost
g(n) = g_iboost + 0.1 * g_vout + g_sw + g_dref + g_pv;
if g(n) < g_min
g_min = g(n);
n_best = n;
end
end
%% Apply Selected Duty Cycle
S = states(n_best);
S = min(max(S, 0.3), 0.9); % Clamp again
% Adaptive penalty update
if S ~= S_old
wf = min(wf * 1.10, wf_max);
else
wf = max(wf * 0.90, wf_min);
end
S_old = S;
end
1 commentaire
Gloria Sitsofe
le 7 Mai 2025
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Controller Creation dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!