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_SPE_Slide_Prep.m
colordef black;

Start_Time = 0;
End_Time = 3;

%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('Power_Window_DCMotor_SPE.mdl');

time = PWin_SPE_DCMotorVel.time;
Vel_Data = PWin_SPE_DCMotorVel.signals.values(:,1);
time_meas = PWin_SPE_DCMotorVel_time;
Vel_Meas = PWin_SPE_DCMotorVel_Signal;
%SpeedVeh_Data = DashSimple.signals.values(:,2);
%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]);

%hold on;
%set([patch1_h],'EdgeColor',patch_color);

%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_meas,Vel_Meas,'g');
%%%hold on
%%%sv_h = plot(time,Vel_Data,'r-.');
title_h = title('Motor Speed');
xlabel_h = xlabel('Time (s)');
ylabel_h = ylabel('Motor Speed');
%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 -3 3]);






Contact us