data.txt中预设某个时间点下的摇炉角度和钢包车位置;假设摇炉角度的初始角度-86度,钢包车位置初始位置66米。在data.txt中设定你想要的轨迹曲线。
在第4秒想让摇炉摇到-86.3度,钢包车驶到65.46米
在第8秒想让摇炉摇到-87.3度,钢包车驶到65.03米
在第13秒想让摇炉摇到-88.2度,钢包车驶到65.01米
…
…
…
在第301秒想让摇炉摇到-102.7度,钢包车驶到63.59米
参考《基于出钢时间和模型计算的转炉自动出钢功能研究_褚光宇》
clear;close all;clc
sdata=importdata('data.txt');
data=sdata.data;
x=data(:,1);
y1=data(:,2);
y2=data(:,3);
xmax = max(x);
xcnt = length(x);
Y1 = zeros(xmax,1);
Y2 = zeros(xmax,1);
for j=1:xmax
for i=1:xcnt
if x(i)==j
Y1(j) = y1(i);
Y2(j) = y2(i);
end
end
end
Y1(xmax) = Y1(xmax);
for j=xmax-1:-1:1
if Y1(j)==0
Y1(j) = Y1(j+1);
else
Y1(j) = Y1(j);
end
end
Y2(xmax) = Y2(xmax);
for j=xmax-1:-1:1
if Y2(j)==0
Y2(j) = Y2(j+1);
else
Y2(j) = Y2(j);
end
end
figure(1)
subplot(221)
plot(Y1)
xlabel('连续时间')
ylabel('摇炉角度')
title('填补处理')
subplot(222)
plot(Y2)
xlabel('连续时间')
ylabel('钢包车位置')
title('填补处理')
subplot(223)
plot(y1)
xlabel('离散时间')
ylabel('摇炉角度')
title('原始数据')
subplot(224)
plot(y2)
xlabel('离散时间')
ylabel('钢包车位置')
title('原始数据')
z = 0;
ZZZ = [];
YY1 = [];
YY2 = [];
while 1
z=z+1;
if z > xmax
break;
end
formatSpec = '时间:%ds,摇炉角度:%.2f°,钢包车位置:%.2fm\n';
resutstr = sprintf(formatSpec,z,Y1(z),Y2(z))
ZZZ = [ZZZ,z];
YY1 = [YY1,Y1(z)];
YY2 = [YY2,Y2(z)];
hold on;
figure(2)
subplot(121)
plot(ZZZ,YY1)
xlabel('连续时间')
ylabel('摇炉角度')
title(sprintf('时间: %ds ,摇炉角度: %.2f° ', z,Y1(z)));
grid on;
subplot(122)
plot(ZZZ,YY2)
xlabel('连续时间')
ylabel('钢包车位置')
title(sprintf('时间: %ds ,钢包车位置: %.2fm ', z,Y2(z)));
grid on;
pause(1);
end
代码、使用说明、演示视频:
https://download.csdn.net/download/weixin_37928884/86724958
siemens中的WinCC和Step7仿真项目:
https://download.csdn.net/download/weixin_37928884/86724951