Code covered by the BSD License  

Highlights from
SAE Paper Demo: Model-Based Design of Hybrid Electric Vehicles

image thumbnail

SAE Paper Demo: Model-Based Design of Hybrid Electric Vehicles

by

 

07 Nov 2010 (Updated )

Demo files to accompany the paper by the same name

HEV_script_links.m
model = 'HEV_Controller_PIL';

switch linkClicked,

    case('link1'),
        cleaner;
        hybridCarDemo;
        
    case('link2'),
        open_bd = find_system('type', 'block_diagram'); 
        if isempty(open_bd)||isequal(sum(ismember(open_bd,'system_design')),0)
            cleaner; 
        end; 
        open_system('system_design'); 
        clc;
     
    case('link3') 
        open_bd = find_system('type', 'block_diagram'); 
        if isempty(open_bd)||isequal(sum(ismember(open_bd,'system_design')),0)
            cleaner; 
        end; 
        open_system('system_design');
        open_system('system_design/Synchronous Generator and Drive/Generator and Drive', 'force');
        clc;     
    
    case('link4')
        open_bd = find_system('type', 'block_diagram'); 
        if isempty(open_bd)||isequal(sum(ismember(open_bd,'system_design')),0)
            cleaner; 
        end; 
        open_system('system_design'); 
        hybridCarDemo;
        open_system('system_design/System Power Management/Mode Logic');
        clc;        
            
    case('link5'),
        cleaner;
        open_system('generator_control_design');
        sim('generator_control_design', 0.01);
        open_system('generator_control_design/Inverter');
        open_system('generator_control_design/Synchronous Generator_SPS')
        clc;        

    case('link6'),
        open_system('generator_control_design');
        open_system('generator_control_design/Generator Controller_SPS/Speed Controller');
        open_system('generator_control_design/Generator Controller_Simscape')
 
    case('link7'),
        cleaner; 
        fxptdlg('hev_final_fixedpt');
        open_system('hev_final_fixedpt/Fixed Point Speed Controller','force');
        set_param('hev_final_fixedpt', 'SimulationCommand', 'update')
        clc;  
        
    case('link8'),
        bdclose all;
        clc;    
        a = open('fxpt_bad_results.fig');
        set(a,'windowstyle','normal');
        
    case('link9'),
        bdclose all;
        clc;    
        a = open('fxpt_good_results.fig');
        set(a,'windowstyle','normal');
   
    case('link10'),
        bdclose all;
        clc;      
        mode_comparison;
         
    case('link11'),
        bdclose all;
        clc;      
        open_system('hev_final');
         
    case('link12'),
        bdclose all;
        clc;     
        open speed_mpg_comparison.fig

    case('open_top_model'),
        open(model);
        open_system(model);
        set_param(model,'ZoomFactor','FitSystem')
        clear linkClicked;
        clc;

    case('change_ghsmulticonfig_sim850'),
        eval(get_param([model '/Configure ERT'],'openfcn'));
        helpdlg('Configured for V850 instruction set simulator');
        
    case('change_ghsmulticonfig_sim5554'),
        eval(get_param([model '/Configure ERT2'],'openfcn'))
        helpdlg('Configured for MPC5554 instruction set simulator');

    case('change_tasking_simC166'),
        eval(get_param([model '/Configure ERT7'],'openfcn'));
        helpdlg('Configured for C166 instruction set simulator');

    case('change_tasking_hwC166'),
        eval(get_param([model '/Configure ERT8'],'openfcn'));
        helpdlg('Configured for XC166CM USB stick hardware');

    case('change_tasking_simTriCore'),
        eval(get_param([model '/Configure ERT10'],'openfcn'));
        helpdlg('Configured for TriCore instruction set simulator');

    case('generate_PIL'),
        open(model);
        rtwbuild([model '/Fixed Point Speed Controller']);
        helpdlg('PIL block has been created successful');
        clear linkClicked

    case('copy_PIL'),
        delete_block([model '/Fixed Point Speed Controller']);
        add_block('untitled/Fixed Point Speed Controller', [model '/Fixed Point Speed Controller (PIL)'],'Position',[415    42   545   153]);

    case('run_PIL'),
        set_param(model, 'SimulationCommand', 'start')
        clear linkClicked
end

Contact us