Research on distributed MPC model predictive control of spacecraft rendezvous (Matlab code implementation)

Welcome to this blog

Advantages of bloggers:Blog content should be as thoughtful and logical as possible for the convenience of readers.

Motto:He who travels a hundred miles is half as good as ninety.

The directory of this article is as follows:

Table of Contents

1 Overview

2 Operation results

3 References

4 Matlab code and data


1 Overview

Distributed MPC (Model Predictive Control) is a method of collaborative control between multiple agents or subsystems. The spacecraft rendezvous problem refers to the situation where multiple spacecrafts approach and rendezvous with each other in space.

In the spacecraft rendezvous problem, the goal of distributed MPC is to achieve the coordinated movement of multiple spacecrafts by reasonably allocating control tasks and information exchange. Traditional centralized control methods encounter problems such as large computing load, high communication load, and poor scalability when dealing with large-scale systems. Distributed MPC can reduce the computing and communication load and improve the scalability of the system by decomposing the problem into multiple sub-problems and performing information exchange and collaborative optimization among various controllers.

In the research on distributed MPC model predictive control, researchers usually consider the following aspects:

1. Dynamic modeling: The motion dynamics of the spacecraft is the basis of research, and a mathematical model needs to be established to describe the motion laws of the spacecraft.

2. Optimization problem modeling: Transform the spacecraft rendezvous problem into an optimization problem, and determine the optimal control strategy by establishing objective functions and constraints.

3. Distributed algorithm design: Design algorithms suitable for distributed environments to solve optimization problems, and achieve information exchange and collaborative control between controllers while ensuring control performance.

4. Simulation and verification: Through numerical simulation and experimental verification, evaluate the performance and feasibility of the distributed MPC method on the spacecraft rendezvous problem.

In summary, the research on distributed MPC model predictive control of spacecraft rendezvous is a complex and challenging field, which requires involving dynamics modeling, optimization problem modeling, distributed algorithm design and simulation verification. research work. Researchers are committed to improving the control performance of spacecraft rendezvous and the scalability of the system to meet the needs of future space missions.

2 Running results

Visualization:

%% FUNCTION TO PLOT RESULTS

function plot_result(DMPC,DecMPC,pp,an_or_num,tmax)

    % initialize figure
    figure('Position',[540,100,700,800]);
    
    % semi-major axis [km]
    subplot(6,1,1);
    hold on;
    plot(DMPC.t,DMPC.a1,'LineWidth',1.5,'Color',pp.matlab_blue)
    plot(DecMPC.t,DecMPC.a1,'LineWidth',1.5,'Color',pp.matlab_light_blue);
    plot(DMPC.t,DMPC.a2,'LineWidth',1.5,'Color',pp.matlab_red)
    plot(DecMPC.t,DecMPC.a2,'LineWidth',1.5,'Color',pp.matlab_light_red);
    hold off;
    grid on;
    xlim([0,tmax]);
    ylabel('$a\;[\mathrm{km}]$','Interpreter','latex','FontSize',18);
    title({"\textbf{Orbital Element Trajectories (" + an_or_num + ...
        "Solution)}",''},'Interpreter','latex','FontSize',18);
    legend('spacecraft 1 (DMPC)','spacecraft 1 (DecMPC)',...
        'spacecraft 2 (DMPC)','spacecraft 2 (DecMPC)');

    % x-component of eccentricity vector [-]
    subplot(6,1,2);
    hold on;
    plot(DMPC.t,DMPC.ex1,'LineWidth',1.5,'Color',pp.matlab_blue)
    plot(DecMPC.t,DecMPC.ex1,'LineWidth',1.5,'Color',pp.matlab_light_blue);
    plot(DMPC.t,DMPC.ex2,'LineWidth',1.5,'Color',pp.matlab_red)
    plot(DecMPC.t,DecMPC.ex2,'LineWidth',1.5,'Color',pp.matlab_light_red);
    hold off;
    grid on;
    xlim([0,tmax]);
    ylabel('$e_{x}$','Interpreter','latex','FontSize',18);

    % y-component of eccentricity vector [-]
    subplot(6,1,3);
    hold on;
    plot(DMPC.t,DMPC.ey1,'LineWidth',1.5,'Color',pp.matlab_blue)
    plot(DecMPC.t,DecMPC.ey1,'LineWidth',1.5,'Color',pp.matlab_light_blue);
    plot(DMPC.t,DMPC.ey2,'LineWidth',1.5,'Color',pp.matlab_red)
    plot(DecMPC.t,DecMPC.ey2,'LineWidth',1.5,'Color',pp.matlab_light_red);
    hold off;
    grid on;
    xlim([0,tmax]);
    ylabel('$e_{y}$','Interpreter','latex','FontSize',18);
    
    % inclination [deg]
    subplot(6,1,4);
    hold on;
    plot(DMPC.t,DMPC.i1,'LineWidth',1.5,'Color',pp.matlab_blue);
    plot(DecMPC.t,DecMPC.i1,'LineWidth',1.5,'Color',pp.matlab_light_blue);
    plot(DMPC.t,DMPC.i2,'LineWidth',1.5,'Color',pp.matlab_red);
    plot(DecMPC.t,DecMPC.i2,'LineWidth',1.5,'Color',pp.matlab_light_red);
    hold off;
    grid on;
    xlim([0,tmax]);
    ylabel('$i\;[{}^{\circ}]$','Interpreter','latex','FontSize',18);
    
    % RAAN [deg]
    subplot(6,1,5);
    hold on;
    plot(DMPC.t,DMPC.Om1,'LineWidth',1.5,'Color',pp.matlab_blue);
    plot(DecMPC.t,DecMPC.Om1,'LineWidth',1.5,'Color',pp.matlab_light_blue);
    plot(DMPC.t,DMPC.Om2,'LineWidth',1.5,'Color',pp.matlab_red);
    plot(DecMPC.t,DecMPC.Om2,'LineWidth',1.5,'Color',pp.matlab_light_red);
    hold off;
    grid on;
    xlim([0,tmax]);
    ylabel('$\Omega\;[{}^{\circ}]$','Interpreter','latex','FontSize',18);

    % argument of latitude [deg]
    subplot(6,1,6);
    hold on;
    plot(DMPC.t,DMPC.u2-DMPC.u1,'LineWidth',1.5,'Color',pp.matlab_blue);
    plot(DecMPC.t,DecMPC.u2-DecMPC.u1,'LineWidth',1.5,'Color',...
        pp.matlab_light_blue);
    hold off;
    grid on;
    xlim([0,tmax]);
    xlabel('Time $[\mathrm{h}]$','Interpreter','latex','FontSize',18);
    ylabel('$u_{2}-u_{1}\;[{}^{\circ}]$','Interpreter','latex',...
        'FontSize',18);
    legend('DMPC','DecMPC');
    
    % ----------------------------------
    % Cumulative delta-V usage [m/s].
    % ----------------------------------
    
    figure('Position',[540,100,700,300]);
    hold on;
    plot(DMPC.t,DMPC.dV1,'LineWidth',1.5,'Color',pp.matlab_blue);
    plot(DecMPC.t,DecMPC.dV1,'LineWidth',1.5,'Color',pp.matlab_light_blue);
    plot(DMPC.t,DMPC.dV2,'LineWidth',1.5,'Color',pp.matlab_red);
    plot(DecMPC.t,DecMPC.dV2,'LineWidth',1.5,'Color',pp.matlab_light_red);
    hold off;
    grid on;
    xlim([0,tmax]);
    ylabel('$\Delta V$ (cumulative) $[\mathrm{m/s}]$','Interpreter',...
        'latex','FontSize',18);
    title("\textbf{Cumulative} \boldmath$\Delta V$ \textbf{Usage (" + ...
        an_or_num + " Solution)}",'Interpreter','latex','FontSize',18);
    legend('spacecraft 1 (DMPC)','spacecraft 1 (DecMPC)',...
        'spacecraft 2 (DMPC)','spacecraft 2 (DecMPC)');
    
    % RTN Position Plot
    figure;
    hold on;
    plot(DMPC.t,DMPC.RTN_2wrt1(1,:),'LineWidth',1.5,'Color',...
        pp.matlab_blue);
    plot(DecMPC.t,DecMPC.RTN_2wrt1(1,:),'LineWidth',1.5,'Color',...
        pp.matlab_light_blue);
    plot(DMPC.t,DMPC.RTN_2wrt1(2,:),'LineWidth',1.5,'Color',...
        pp.matlab_red);
    plot(DecMPC.t,DecMPC.RTN_2wrt1(2,:),'LineWidth',1.5,'Color',...
        pp.matlab_light_red);
    plot(DMPC.t,DMPC.RTN_2wrt1(3,:),'LineWidth',1.5,'Color',...
        pp.matlab_yellow);
    plot(DecMPC.t,DecMPC.RTN_2wrt1(3,:),'LineWidth',1.5,'Color',...
        pp.matlab_light_yellow);
    hold off;
    grid on;
    xlim([0,tmax]);
    xlabel('Time $[\mathrm{h}]$','Interpreter','latex','FontSize',18);
    ylabel('Relative Position $[\mathrm{km}]$','Interpreter','latex',...
        'FontSize',18);
    title("\textbf{Relative RTN Position of Spacecraft 2 w.r.t. Space" + ...
        "craft 1}",'Interpreter','latex','FontSize',18);
    legend('R (DMPC)','R(DecMPC)','T (DMPC)','T (DecMPC)',...
        'N(DMPC)','N (DecMPC)');

end

%% FUNCTION TO PLOT RESULTS

function plot_result(DMPC,DecMPC,pp,an_or_num,tmax)

% initialize figure
figure(‘Position’,[540,100,700,800]);

% semi-major axis [km]
subplot(6,1,1);
hold on;
plot(DMPC.t,DMPC.a1,’LineWidth’,1.5,’Color’,pp.matlab_blue)
plot(DecMPC.t,DecMPC.a1,’LineWidth’,1.5,’Color’,pp.matlab_light_blue);
plot(DMPC.t,DMPC.a2,’LineWidth’,1.5,’Color’,pp.matlab_red)
plot(DecMPC.t,DecMPC.a2,’LineWidth’,1.5,’Color’,pp.matlab_light_red);
hold off;
grid on;
xlim([0,tmax]);
ylabel(‘$a\;[\mathrm{km}]$’,’Interpreter’,’latex’,’FontSize’,18);
title({“\textbf{Orbital Element Trajectories (” + an_or_num + …
“Solution)}”,”},’Interpreter’,’latex’,’FontSize’,18);
legend(‘spacecraft 1 (DMPC)’,’spacecraft 1 (DecMPC)’,…
‘spacecraft 2 (DMPC)’,’spacecraft 2 (DecMPC)’);

% x-component of eccentricity vector [-]
subplot(6,1,2);
hold on;
plot(DMPC.t,DMPC.ex1,’LineWidth’,1.5,’Color’,pp.matlab_blue)
plot(DecMPC.t,DecMPC.ex1,’LineWidth’,1.5,’Color’,pp.matlab_light_blue);
plot(DMPC.t,DMPC.ex2,’LineWidth’,1.5,’Color’,pp.matlab_red)
plot(DecMPC.t,DecMPC.ex2,’LineWidth’,1.5,’Color’,pp.matlab_light_red);
hold off;
grid on;
xlim([0,tmax]);
ylabel(‘$e_{x}$’,’Interpreter’,’latex’,’FontSize’,18);

% y-component of eccentricity vector [-]
subplot(6,1,3);
hold on;
plot(DMPC.t,DMPC.ey1,’LineWidth’,1.5,’Color’,pp.matlab_blue)
plot(DecMPC.t,DecMPC.ey1,’LineWidth’,1.5,’Color’,pp.matlab_light_blue);
plot(DMPC.t,DMPC.ey2,’LineWidth’,1.5,’Color’,pp.matlab_red)
plot(DecMPC.t,DecMPC.ey2,’LineWidth’,1.5,’Color’,pp.matlab_light_red);
hold off;
grid on;
xlim([0,tmax]);
ylabel(‘$e_{y}$’,’Interpreter’,’latex’,’FontSize’,18);

% inclination [deg]
subplot(6,1,4);
hold on;
plot(DMPC.t,DMPC.i1,’LineWidth’,1.5,’Color’,pp.matlab_blue);
plot(DecMPC.t,DecMPC.i1,’LineWidth’,1.5,’Color’,pp.matlab_light_blue);
plot(DMPC.t,DMPC.i2,’LineWidth’,1.5,’Color’,pp.matlab_red);
plot(DecMPC.t,DecMPC.i2,’LineWidth’,1.5,’Color’,pp.matlab_light_red);
hold off;
grid on;
xlim([0,tmax]);
ylabel(‘$i\;[{}^{\circ}]$’,’Interpreter’,’latex’,’FontSize’,18);

% RAAN [deg]
subplot(6,1,5);
hold on;
plot(DMPC.t,DMPC.Om1,’LineWidth’,1.5,’Color’,pp.matlab_blue);
plot(DecMPC.t,DecMPC.Om1,’LineWidth’,1.5,’Color’,pp.matlab_light_blue);
plot(DMPC.t,DMPC.Om2,’LineWidth’,1.5,’Color’,pp.matlab_red);
plot(DecMPC.t,DecMPC.Om2,’LineWidth’,1.5,’Color’,pp.matlab_light_red);
hold off;
grid on;
xlim([0,tmax]);
ylabel(‘$\Omega\;[{}^{\circ}]$’,’Interpreter’,’latex’,’FontSize’,18);

% argument of latitude [deg]
subplot(6,1,6);
hold on;
plot(DMPC.t,DMPC.u2-DMPC.u1,’LineWidth’,1.5,’Color’,pp.matlab_blue);
plot(DecMPC.t,DecMPC.u2-DecMPC.u1,’LineWidth’,1.5,’Color’,…
pp.matlab_light_blue);
hold off;
grid on;
xlim([0,tmax]);
xlabel(‘Time $[\mathrm{h}]$’,’Interpreter’,’latex’,’FontSize’,18);
ylabel(‘$u_{2}-u_{1}\;[{}^{\circ}]$’,’Interpreter’,’latex’,…
‘FontSize’,18);
legend(‘DMPC’,’DecMPC’);

% ———————————-
% Cumulative delta-V usage [m/s].
% ———————————-

figure(‘Position’,[540,100,700,300]);
hold on;
plot(DMPC.t,DMPC.dV1,’LineWidth’,1.5,’Color’,pp.matlab_blue);
plot(DecMPC.t,DecMPC.dV1,’LineWidth’,1.5,’Color’,pp.matlab_light_blue);
plot(DMPC.t,DMPC.dV2,’LineWidth’,1.5,’Color’,pp.matlab_red);
plot(DecMPC.t,DecMPC.dV2,’LineWidth’,1.5,’Color’,pp.matlab_light_red);
hold off;
grid on;
xlim([0,tmax]);
ylabel(‘$\Delta V$ (cumulative) $[\mathrm{m/s}]$’,’Interpreter’,…
‘latex’,’FontSize’,18);
title(“\textbf{Cumulative} \boldmath$\Delta V$ \textbf{Usage (” + …
an_or_num + ” Solution)}”,’Interpreter’,’latex’,’FontSize’,18);
legend(‘spacecraft 1 (DMPC)’,’spacecraft 1 (DecMPC)’,…
‘spacecraft 2 (DMPC)’,’spacecraft 2 (DecMPC)’);

% RTN Position Plot
figure;
hold on;
plot(DMPC.t,DMPC.RTN_2wrt1(1,:),’LineWidth’,1.5,’Color’,…
pp.matlab_blue);
plot(DecMPC.t,DecMPC.RTN_2wrt1(1,:),’LineWidth’,1.5,’Color’,…
pp.matlab_light_blue);
plot(DMPC.t,DMPC.RTN_2wrt1(2,:),’LineWidth’,1.5,’Color’,…
pp.matlab_red);
plot(DecMPC.t,DecMPC.RTN_2wrt1(2,:),’LineWidth’,1.5,’Color’,…
pp.matlab_light_red);
plot(DMPC.t,DMPC.RTN_2wrt1(3,:),’LineWidth’,1.5,’Color’,…
pp.matlab_yellow);
plot(DecMPC.t,DecMPC.RTN_2wrt1(3,:),’LineWidth’,1.5,’Color’,…
pp.matlab_light_yellow);
hold off;
grid on;
xlim([0,tmax]);
xlabel(‘Time $[\mathrm{h}]$’,’Interpreter’,’latex’,’FontSize’,18);
ylabel(‘Relative Position $[\mathrm{km}]$’,’Interpreter’,’latex’,…
‘FontSize’,18);
title(“\textbf{Relative RTN Position of Spacecraft 2 w.r.t. Space” + …
“craft 1}”,’Interpreter’,’latex’,’FontSize’,18);
legend(‘R (DMPC)’,’R(DecMPC)’,’T (DMPC)’,’T (DecMPC)’,…
‘N(DMPC)’,’N (DecMPC)’);

end

3 References

Some of the content in the article is quoted from the Internet. The source will be indicated or cited as a reference. It is inevitable that there will be some unfinished information. If there is anything inappropriate, please feel free to contact us to delete it.

[1]Tan Tianle. Model prediction and inversion guidance control of spacecraft rendezvous and docking[J]. Control and Decision-making, 2019(4):6.DOI:10.13195/j.kzyjc.2017.1319.

[2] Dang Qingqing. Research on precise landing guidance and control of spacecraft based on model predictive control [D]. Sun Yat-sen University [2023-10-25].

4 Matlab code and data