铰接式车辆的横向动力学仿真提供车辆模型研究(Matlab代码实现)

 欢迎来到本博客❤️❤️

博主优势:博客内容尽量做到思维缜密,逻辑清晰,为了方便读者。

⛳️座右铭:行百里者,半于九十。

本文目录如下:

目录

1 概述

2 运行结果

3 参考文献

4 Matlab代码实现


1 概述

铰接式车辆是一种具有铰接连接的多体系统,具有特殊的动力学行为。进行铰接式车辆的横向动力学仿真研究可以遵循以下步骤:

1. 定义车辆模型:首先建立铰接式车辆的几何模型,并定义车辆的基本参数,如质量、惯性特性、轮胎参数等。可以使用计算机辅助设计软件(如AutoCAD)或专业的车辆仿真软件(如CarSim、ADAMS等)创建车辆的3D几何模型。

2. 车辆动力学模型:根据车辆几何模型和运动学原理,建立车辆的动力学模型。通常使用多体动力学原理描述车辆的运动,包括刚体运动学和运动学方程。可以使用拉格朗日方程或牛顿-欧拉方程等动力学方法建立车辆的运动学和动力学方程。

3. 轮胎模型:根据车辆使用的轮胎类型,选择合适的轮胎力学模型。常见的轮胎模型包括线性模型、Magic Formula模型等。根据轮胎模型的参数,计算轮胎的侧向力和纵向力。

4. 驱动和操纵控制模型:定义车辆的驱动和操纵控制系统模型,包括驱动力和转向力的输入模型。根据驾驶策略和控制算法,生成对应的引擎扭矩和转向角信号,用于驱动和操纵车辆。

5. 数值求解:设定仿真的时间步长,并使用数值方法(如欧拉法、龙格-库塔法等)对车辆的动力学方程进行求解。在每个时间步长内,使用车辆的输入模型、轮胎模型和操纵控制模型,计算车辆的状态和响应。

6. 仿真结果评估:通过分析仿真结果,得到车辆的横向动力学响应,包括车辆的侧向运动、横向力、滑移角等。评估车辆的稳定性和控制性能,分析车辆参数和控制策略对横向动力学的影响。

7. 结果解释和报告:根据仿真结果,撰写研究报告或技术论文,包括车辆的模型建立、仿真方法、参数分析和结论等。

需要指出的是,进行铰接式车辆的横向动力学仿真需要熟悉车辆动力学原理和相关仿真工具。为了获得精确和可靠的仿真结果,建议使用专业的车辆仿真软件,并根据具体的研究目的和问题,选择合适的车辆模型和控制策略进行仿真研究。

2 运行结果

 

 

 

 

 

 

 

 

部分代码:

%% Maneuver
% The maneuver to be estimated by the Kalman Filter is defined here.
%
% Choosing simulation parameters:
%

T       = 6;                        % Total simulation time [s]
resol   = 50;                       % Resolution
TSPAN   = 0:T/resol:T;              % Time span             [s]
    
%%
% Running simulation.
%

simulatorPlant = Simulator(VehiclePlant, TSPAN);
simulatorPlant.dPSI0 = 0.35;
simulatorPlant.Simulate

%%
% Printing simulation parameters.
%

disp(simulatorPlant)

%%
% Retrieving states
%

XTPlant     = simulatorPlant.XT;
YTPlant     = simulatorPlant.YT;
PSIPlant    = simulatorPlant.PSI;
vTPlant     = simulatorPlant.VEL;
ALPHATPlant = simulatorPlant.ALPHAT;
dPSIPlant   = simulatorPlant.dPSI;

XOUTPlant   = [XTPlant YTPlant PSIPlant vTPlant ALPHATPlant dPSIPlant];

%%
% Generating graphics of the vehicle in the considered maneuver (plant)
%

gPlant = Graphics(simulatorPlant);
gPlant.TractorColor = 'r';
gPlant.Frame();

%%
%

close all                   % Closing figures

%% Modelo
% O modelo utilizado no algoritmo de estima玢o � baseado no mesmo modelo
% f韘ico considerado no modelo da planta. Al閙 disso, o modelo parte da
% premissa de que o projetista do estimador n鉶 tem conhecimento adequado
% da curva caracter韘tica do pneu. Logo, o modelo de ve韈ulo � igual ao
% utilizado na planta, por閙, o modelo de pneu � dado pelo modelo linear
% Tire linear, resultando num modelo do sistema de menor complexidade (em
% rela玢o � planta) e com mais hip髏eses simplificadoras.
%
% Inicializando o pneu
%

TireModel = TireLinear;
disp(TireModel)

%%
% Choosing model vehicle
%

VehicleModel        = VehicleSimpleNonlinear; % Same as plant
VehicleModel.tire   = TireModel;
disp(VehicleModel)

%%
% Simulador com o mesmo vetor TSPAN e simula玢o
%

simulatorModel = Simulator(VehicleModel, TSPAN);
simulatorModel.dPSI0 = 0.35;
simulatorModel.Simulate;

disp(simulatorModel)

%%
% Retrieving states
%

XTModel = simulatorModel.XT;
YTModel = simulatorModel.YT;
PSIModel = simulatorModel.PSI;
vTModel = simulatorModel.VEL;
ALPHATModel = simulatorModel.ALPHAT;
dPSIModel = simulatorModel.dPSI;

%%
% A manobra gerada pelo modelo escolhido pelo projetista a partir da mesma
% condi玢o inicial � ilustrada na figura a seguir
%

gModel = Graphics(simulatorModel);
gModel.TractorColor = 'g';
gModel.Frame();

%%
%

close all                   % Closing figures

%% Plant and model comparison
% Comparando o modelo de pneu
%

g       = 9.81;
FzF     = VehiclePlant.mF0*g;
FzR     = VehiclePlant.mR0*g;
muy     = VehiclePlant.muy;
nF      = VehiclePlant.nF;
nR      = VehiclePlant.nR;

alpha   = 0:0.5:15;
alpha   = alpha*pi/180;
FyLin   = - TireModel.Characteristic(alpha);
FyFPac  = - TirePlant.Characteristic(alpha, FzF, muy);
FyRPac  = - TirePlant.Characteristic(alpha, FzR, muy);

figure
ax = gca;
set(ax,'NextPlot','add','Box','on','XGrid','on','YGrid','on')
plot(alpha(1:floor(end/2))*180/pi,FyLin(1:floor(end/2)),'r')
plot(alpha*180/pi,FyFPac,'g')
plot(alpha*180/pi,FyRPac,'g--')
xlabel('alpha [deg]')
ylabel('Fy [N]')
l = legend('Linear','Pacejka F','Pacejka R');
set(l,'Location','SouthEast')

%%
% Comparando os estados

figure
ax = gca;
set(ax,'NextPlot','add','Box','on','XGrid','on','YGrid','on')
plot(TSPAN,XTPlant,'r')
plot(TSPAN,XTModel,'r--')
xlabel('Time [s]')
ylabel('Distance X [m]')

figure
ax = gca;
set(ax,'NextPlot','add','Box','on','XGrid','on','YGrid','on')
plot(TSPAN,YTPlant,'g')
plot(TSPAN,YTModel,'g--')
xlabel('Time [s]')
ylabel('Distance Y [m]')

figure
ax = gca;
set(ax,'NextPlot','add','Box','on','XGrid','on','YGrid','on')
plot(TSPAN,PSIPlant,'b')
plot(TSPAN,PSIModel,'b--')
xlabel('Time [s]')
ylabel('PSI [rad]')

figure
ax = gca;
set(ax,'NextPlot','add','Box','on','XGrid','on','YGrid','on')
plot(TSPAN,vTPlant,'c')
plot(TSPAN,vTModel,'c--')
xlabel('Time [s]')
ylabel('vT [m/s]')

figure
ax = gca;
set(ax,'NextPlot','add','Box','on','XGrid','on','YGrid','on')
plot(TSPAN,ALPHATPlant,'m'),
plot(TSPAN,ALPHATModel,'m--'),
xlabel('Time [s]')
ylabel('ALPHAT [rad/s]')

figure
ax = gca;
set(ax,'NextPlot','add','Box','on','XGrid','on','YGrid','on')
plot(TSPAN,dPSIPlant,'k')
plot(TSPAN,dPSIModel,'k--')
xlabel('Time [s]')
ylabel('dPSI [rad/s]')

%%
% Comparando a acelera玢o longitudinal e transversal

saidasPlant = [XTPlant YTPlant PSIPlant vTPlant ALPHATPlant dPSIPlant];
matDerivEstadosPlant = zeros(size(saidasPlant));
for i = 1:size(saidasPlant,1)
    auxil = simulatorPlant.Vehicle.Model(1,saidasPlant(i,:),TSPAN);
    matDerivEstadosPlant(i,:) = auxil';
end

dXTPlant = matDerivEstadosPlant(:,1);
dYTPlant = matDerivEstadosPlant(:,2);
dPSIPlant = matDerivEstadosPlant(:,3);
dvTPlant = matDerivEstadosPlant(:,4);
dALPHATPlant = matDerivEstadosPlant(:,5);
ddPSIPlant = matDerivEstadosPlant(:,6);

ddXPlant = dvTPlant.*cos(PSIPlant + ALPHATPlant) - vTPlant.*(dPSIPlant + dALPHATPlant).*sin(PSIPlant + ALPHATPlant);
ddYPlant = dvTPlant.*sin(PSIPlant + ALPHATPlant) + vTPlant.*(dPSIPlant + dALPHATPlant).*cos(PSIPlant + ALPHATPlant);

ACELNumPlant = [(ddXPlant.*cos(PSIPlant) - ddYPlant.*sin(PSIPlant))  (-ddXPlant.*sin(PSIPlant) + ddYPlant.*cos(PSIPlant))];

saidasModel = [XTModel YTModel PSIModel vTModel ALPHATModel dPSIModel];
matDerivEstadosModel = zeros(size(saidasModel));
for i = 1:size(saidasModel,1)
    auxil = simulatorModel.Vehicle.Model(1,saidasModel(i,:),TSPAN);
    matDerivEstadosModel(i,:) = auxil';
end

dXTModel = matDerivEstadosModel(:,1);
dYTModel = matDerivEstadosModel(:,2);
dPSIModel = matDerivEstadosModel(:,3);
dvTModel = matDerivEstadosModel(:,4);
dALPHATModel = matDerivEstadosModel(:,5);
ddPSIModel = matDerivEstadosModel(:,6);

ddXModel = dvTModel.*cos(PSIModel + ALPHATModel) - vTModel.*(dPSIModel + dALPHATModel).*sin(PSIModel + ALPHATModel);
ddYModel = dvTModel.*sin(PSIModel + ALPHATModel) + vTModel.*(dPSIModel + dALPHATModel).*cos(PSIModel + ALPHATModel);

ACELNumModel = [(ddXModel.*cos(PSIModel) - ddYModel.*sin(PSIModel))  (-ddXModel.*sin(PSIModel) + ddYModel.*cos(PSIModel))];

figure
ax = gca;
set(ax,'NextPlot','add','Box','on','XGrid','on','YGrid','on')
plot(TSPAN,ACELNumPlant(:,1),'r')
plot(TSPAN,ACELNumPlant(:,2),'g')
plot(TSPAN,ACELNumModel(:,1),'r--')
plot(TSPAN,ACELNumModel(:,2),'g--')
xlabel('time [s]')
ylabel('acc. [m/s]')
l = legend('AX Plant','AY Plant','AX Model','AY Model');
set(l,'Location','NorthEast')

%%

3 参考文献

部分理论来源于网络,如有侵权请联系删除。

[1]农思赢.铰接式车辆与俄军北极战役集群[J].坦克装甲车辆,2022(05):56-61.DOI:10.19486/j.cnki.11-1936/tj.2022.05.003.

[2]宋广昊. 铰接式车辆紧急变道避障控制策略研究[D].吉林大学,2021.DOI:10.27162/d.cnki.gjlin.2021.001808.

[3].采用DT-30PM铰接式车辆底盘的俄罗斯“雷神”M2DT防空导弹系统[J].坦克装甲车辆,2017(11):73.

4 Matlab代码实现

你可能感兴趣的:(matlab,机器学习,算法)