image thumbnail

Using Model-Based Design for Vehicle Electronics Applications

by

 

29 Aug 2006 (Updated )

This ZIP-file contains the presentation and power window model that was used in the MathWorks webina

PWin_SRO_Slide_Prep2.m
colordef black;

Start_Time = 0;
End_Time = 5;

%Speed_Kp = 0.5; Speed_Ki = 10;
%Speed_Kp = 1; Speed_Ki = 20;
%Speed_Kp = 2; Speed_Ki = 30;
Speed_Kp = 3; Speed_Ki = 62.79;

%sim('HEVElectricDrive75ControlV3_SM_SRO.mdl');

time = PWin_SCD_DATA.time;
Speed_Data = PWin_SCD_DATA.signals.values(:,1);

%Disp_Data = FEL_Actuator_DATA.signals(1).values(:,1);
%Voltage_Data = DashSimple.signals(3).values;

figure(1);
clf;

%new_sb211_h = 400;
set(gcf,'Position',[765   405   449   336]);

%%%if(1==2)
patch1_x = [0 0.5 0.5 0];
patch1_y = [0 0 2 2];
patch_color = [239/256 241/256 227/256]*.8;
patch1_h = patch(patch1_x, patch1_y, patch_color);
hold on;
set([patch1_h],'EdgeColor',patch_color);
patch2_x = [0.5 3 3 0.5];
patch2_y = [1.15 1.15 2 2];
patch2_h = patch(patch2_x, patch2_y, patch_color);
set([patch2_h],'EdgeColor',patch_color);
patch3_x = [3 5 5 3];
patch3_y = [1.4 1.4 1.6 1.6];
patch3_h = patch(patch3_x, patch3_y, patch_color);
set([patch3_h],'EdgeColor',patch_color);
%%%end
%set(gca,'Position',[0.15 0.63/522*new_sb211_h 0.775 0.341163*522/new_sb211_h])
%POSITION_211 = [0.15 0.583837 0.775 0.341163*522/new_sb211_h];
%subplot(211)
sc_h = plot(time,Speed_Data,'r');
%%%end

%hold on
%sv_h = plot(time,SpeedVeh_Data,'r-.');
title_h = title('Motor Speed');
xlabel_h = xlabel('Time (s)');
ylabel_h = ylabel('Speed (rpm)');
%set(rct_h,'color',[0 0.3 1]);
set(sc_h,'LineWidth',3);
%set(sv_h,'LineWidth',3);
set(title_h,'FontSize',14);
%set(xlabel_h,'FontSize',12);
set(ylabel_h,'FontSize',12);
grid on
set(gca,'Box','on');
%legend('No Friction','Friction','Location','Best');
%legend('Rod','Piston','Location',[0.2128    0.4421    0.2691    0.1622]);
axis([Start_Time End_Time 0 2.5]);






Contact us