自适应巡航控制系统研究(Matlab代码实现)

     目录

💥1 概述

📚2 运行结果

🎉3 参考文献

👨‍💻4 Matlab代码

💥1 概述

据统计, 我国交通事故造成的伤亡人数每年超过10万人, 其中驾驶员人为原因 (疲劳、酒驾、误操作等) 所致事故逐渐升高.汽车交通事故引起的人员伤亡、经济损失、道路拥堵等已演变成重大社会问题.

为解决上述问题, 交通法规、安全技术等各种交通安全措施随之诞生并不断发展, 其中汽车安全技术是保障道路交通安全的关键.汽车安全技术分为被动安全技术和主动安全技术.从20世纪80年代开始的安全气囊、安全带等被动安全技术, 再到90年代逐渐出现且成为标配的制动防抱死系统 (antilock braking system, ABS) 、电子稳定控制(electronic stability control, ESC) 系统等主动安全技术, 都在一定程度上起到了保证人们财产安全的作用.进入21世纪, 汽车主动安全技术愈发被重视, 从预警系统、独立控制、集成控制、智能驾驶到无人驾驶等主动安全技术方面都获得了飞速发展, 其中自适应巡航控制(adaptive cruise control, ACC) 、车道偏离预警 (lane departure warning, LDW) 、前方碰撞预警 (front collision warning, FCW) 等汽车先进驾驶辅助系统 (advanced driver assistance systems, ADAS) 成为防止交通事故的新一代前沿技术.

📚2 运行结果

主函数部分代码:

clear
clc
close all
%addpath(fullfile(matlabroot,'examples','mpc','main'));
global mdl Ts T G_ego t_gap D_default v_set amin_ego amax_ego
global x0_lead v0_lead x0_ego v0_ego seed
mdl = 'mpcACCsystem';
open_system(mdl)
​
% Generate training data
[inputs_cell, output_cell] = generateOnetrace();
inputs_test = inputs_cell;
output_test = output_cell;
for i = 1:20
    [input1, output1] = generateOnetrace();
    inputs_cell = catsamples(inputs_cell, input1, 'pad');
    output_cell = catsamples(output_cell, output1, 'pad');
end
​
​
%% Construct NN controller
​
S = [10,10,10];
mrac_net = feedforwardnet(S);
for i = 1:length(S)
    mrac_net.layers{i}.transferFcn = 'poslin';
end
​
mrac_net.layers{length(S)+1}.transferFcn = 'purelin';
mrac_net.inputs{1}.processFcns = {};
mrac_net.outputs{length(S)+1}.processFcns = {};
​
% mrac_net.layerConnect = [0 0 0 1;1 0 0 0;0 1 0 0;0 0 1 0];
%  mrac_net.layerWeights{1,4}.delays = 1:2;
 
mrac_net = configure(mrac_net,inputs_cell,output_cell);
mrac_net.plotFcns = {'plotperform','plottrainstate',...
    'ploterrhist','plotregression','plotresponse'};
mrac_net.trainFcn = 'trainlm';
​
[x_tot,xi_tot,ai_tot,t_tot] = ...
            preparets(mrac_net,inputs_cell,output_cell);
mrac_net.trainParam.epochs = 500;
mrac_net.trainParam.min_grad = 1e-10;
[mrac_net,tr] = train(mrac_net,x_tot,t_tot,xi_tot,ai_tot);
​
testoutseq = mrac_net(inputs_test);
testout = cell2mat(testoutseq);
figure
plot(testout,'r');
hold on 
plot(cell2mat(output_test),'b')
hold off
​
%generate simlink nn
%gensim(mrac_net)
​
% store weights to network
% weights(1) = mrac_net.IW(1,1);
% for i = 1:length(S)
%     weights(i+1) = mrac_net.LW(i+1,i);
% end
% bias = mrac_net.b;
% 
% network.weights = weights;
% network.bias = bias;
% save network
​
%% Remove example file folder from MATLAB path, and close Simulink model.
rmpath(fullfile(matlabroot,'examples','mpc','main'));

🎉3 参考文献

[1]吴光强,张亮修,刘兆勇等.汽车自适应巡航控制系统研究现状与发展趋势[J].同济大学学报(自然科学版),2017,45(04):544-553.

部分理论引用网络文献,若有侵权联系博主删除。

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

荔枝科研社

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值