presets for FT23 with timestamps works now, save and FT24+25 not
This commit is contained in:
		@ -1,4 +1,4 @@
 | 
			
		||||
function [outputArg] = plot_accumulator(panel, start, stop, pltData)
 | 
			
		||||
function [outputArg] = plot_accumulator(panel, pltData, tr)
 | 
			
		||||
    % create tiledlayout (R2023a and newer)
 | 
			
		||||
    tl = tiledlayout(panel,"vertical");
 | 
			
		||||
    
 | 
			
		||||
@ -7,27 +7,27 @@ function [outputArg] = plot_accumulator(panel, start, stop, pltData)
 | 
			
		||||
    hold(ax1, "on")
 | 
			
		||||
    grid(ax1, "on")
 | 
			
		||||
    title(ax1, "Speed [km/h]")
 | 
			
		||||
    plot(ax1,pltData.xAxis(start:stop),pltData.speed_kph(start:stop))
 | 
			
		||||
    plot(ax1,pltData.xAxis(tr,:),pltData.speed_kph(tr,:))
 | 
			
		||||
 | 
			
		||||
    % plot 2: power [kW]
 | 
			
		||||
    ax2 = nexttile(tl);
 | 
			
		||||
    hold(ax2, "on")
 | 
			
		||||
    grid(ax2, "on")
 | 
			
		||||
    title(ax2, "Power [kW]")
 | 
			
		||||
    plot(ax2,pltData.xAxis(start:stop),pltData.ams_ptot(start:stop))
 | 
			
		||||
    plot(ax2,pltData.xAxis(tr,:),pltData.ams_ptot(tr,:))
 | 
			
		||||
 | 
			
		||||
    % plot 3: Max Cell Temp [°C]
 | 
			
		||||
    ax3 = nexttile(tl);
 | 
			
		||||
    hold(ax3, "on")
 | 
			
		||||
    grid(ax3, "on")
 | 
			
		||||
    title(ax3, "Max Cell Temp [°C]")
 | 
			
		||||
    plot(ax3,pltData.xAxis(start:stop),pltData.ams_tmax(start:stop))
 | 
			
		||||
    plot(ax3,pltData.xAxis(tr,:),pltData.ams_tmax(tr,:))
 | 
			
		||||
    % plot 4: State of charge [%]
 | 
			
		||||
    ax4 = nexttile(tl);
 | 
			
		||||
    hold(ax4, "on")
 | 
			
		||||
    grid(ax4, "on")
 | 
			
		||||
    title(ax4, "SOC")
 | 
			
		||||
    plot(ax4,pltData.xAxis(start:stop),pltData.ams_soc(start:stop))
 | 
			
		||||
    plot(ax4,pltData.xAxis(tr,:),pltData.ams_soc(tr,:))
 | 
			
		||||
    % link all x axes
 | 
			
		||||
    linkaxes([ax1, ax2, ax3, ax4],"x")
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -1,4 +1,4 @@
 | 
			
		||||
function [outputArg] = plot_brakes(panel, start, stop, pltData)
 | 
			
		||||
function [outputArg] = plot_brakes(panel, pltData, tr)
 | 
			
		||||
    % create tiledlayout (R2023a and newer)
 | 
			
		||||
    tl = tiledlayout(panel,"vertical");
 | 
			
		||||
    
 | 
			
		||||
@ -7,15 +7,15 @@ function [outputArg] = plot_brakes(panel, start, stop, pltData)
 | 
			
		||||
    hold(ax1, "on")
 | 
			
		||||
    grid(ax1, "on")
 | 
			
		||||
    title(ax1, "Speed [km/h]")
 | 
			
		||||
    plot(ax1,pltData.xAxis(start:stop),pltData.speed_kph(start:stop))
 | 
			
		||||
    plot(ax1,pltData.xAxis(tr,:),pltData.speed_kph(tr,:))
 | 
			
		||||
 | 
			
		||||
    % plot 2: brake pressure front/rear [bar]
 | 
			
		||||
    ax2 = nexttile(tl);
 | 
			
		||||
    hold(ax2, "on")
 | 
			
		||||
    grid(ax2, "on")
 | 
			
		||||
    title(ax2, "Brake Pressure F/R [bar]")
 | 
			
		||||
    plot(ax2,pltData.xAxis(start:stop),pltData.brakePFront_bar(start:stop))
 | 
			
		||||
    plot(ax2,pltData.xAxis(start:stop),pltData.brakePRear_bar(start:stop))
 | 
			
		||||
    plot(ax2,pltData.xAxis(tr,:),pltData.brakePFront_bar(tr,:))
 | 
			
		||||
    plot(ax2,pltData.xAxis(tr,:),pltData.brakePRear_bar(tr,:))
 | 
			
		||||
    legend(ax2, "Front", "Rear")
 | 
			
		||||
 | 
			
		||||
    % plot 3: longitudinal acceleration [g]
 | 
			
		||||
@ -23,17 +23,17 @@ function [outputArg] = plot_brakes(panel, start, stop, pltData)
 | 
			
		||||
    hold(ax3, "on")
 | 
			
		||||
    grid(ax3, "on")
 | 
			
		||||
    title(ax3, "Long Acc [g]")
 | 
			
		||||
    plot(ax3,pltData.xAxis(start:stop),pltData.acc_long_g(start:stop))
 | 
			
		||||
    plot(ax3,pltData.xAxis(tr,:),pltData.acc_long_g(tr,:))
 | 
			
		||||
 | 
			
		||||
    % plot 4: Brake Temp [°C]
 | 
			
		||||
    ax4 = nexttile(tl);
 | 
			
		||||
    hold(ax4, "on")
 | 
			
		||||
    grid(ax4, "on")
 | 
			
		||||
    title(ax4, "Brake Temp [°C]")
 | 
			
		||||
    plot(ax4,pltData.xAxis(start:stop),pltData.brakeTFrontLeft_degC(start:stop))
 | 
			
		||||
    plot(ax4,pltData.xAxis(start:stop),pltData.brakeTFrontRight_degC(start:stop))
 | 
			
		||||
    plot(ax4,pltData.xAxis(start:stop),pltData.brakeTRearLeft_degC(start:stop))
 | 
			
		||||
    plot(ax4,pltData.xAxis(start:stop),pltData.brakeTRearRight_degC(start:stop))
 | 
			
		||||
    plot(ax4,pltData.xAxis(tr,:),pltData.brakeTFrontLeft_degC(tr,:))
 | 
			
		||||
    plot(ax4,pltData.xAxis(tr,:),pltData.brakeTFrontRight_degC(tr,:))
 | 
			
		||||
    plot(ax4,pltData.xAxis(tr,:),pltData.brakeTRearLeft_degC(tr,:))
 | 
			
		||||
    plot(ax4,pltData.xAxis(tr,:),pltData.brakeTRearRight_degC(tr,:))
 | 
			
		||||
    legend(ax4, "FL", "FR", "RL", "RR")
 | 
			
		||||
    
 | 
			
		||||
    % plot 5: brake bias [%]
 | 
			
		||||
@ -41,7 +41,7 @@ function [outputArg] = plot_brakes(panel, start, stop, pltData)
 | 
			
		||||
    hold(ax5, "on")
 | 
			
		||||
    grid(ax5, "on")
 | 
			
		||||
    title(ax5, "Brake Bias [%]")
 | 
			
		||||
    plot(ax5,pltData.xAxis(start:stop),pltData.brakeBias_perc(start:stop))
 | 
			
		||||
    plot(ax5,pltData.xAxis(tr,:),pltData.brakeBias_perc(tr,:))
 | 
			
		||||
 | 
			
		||||
    % link all x axes
 | 
			
		||||
    linkaxes([ax1, ax2, ax3, ax4, ax5],"x")
 | 
			
		||||
 | 
			
		||||
@ -1,4 +1,4 @@
 | 
			
		||||
function [outputArg] = plot_custom(panel, start, stop, pltData)
 | 
			
		||||
function [outputArg] = plot_custom(panel, pltData, tr)
 | 
			
		||||
    % create tiledlayout (R2023a and newer)
 | 
			
		||||
    
 | 
			
		||||
    tl = tiledlayout(panel,"flow");
 | 
			
		||||
@ -10,7 +10,7 @@ function [outputArg] = plot_custom(panel, start, stop, pltData)
 | 
			
		||||
    ylabel(ax1, "y-axis label")
 | 
			
		||||
    xlabel(ax1, "x-axis label")
 | 
			
		||||
    %"XXX = enter name of data you want to plot"
 | 
			
		||||
    plot(ax1,pltData.xAxis(start:stop),pltData.XXX(start:stop)) 
 | 
			
		||||
    plot(ax1,pltData.xAxis(tr,:),pltData.XXX(tr,:)) 
 | 
			
		||||
    
 | 
			
		||||
    % more plots for customizing
 | 
			
		||||
 | 
			
		||||
@ -19,21 +19,21 @@ function [outputArg] = plot_custom(panel, start, stop, pltData)
 | 
			
		||||
    % hold(ax2, "on")
 | 
			
		||||
    % grid(ax2, "on")
 | 
			
		||||
    % title(ax2, "Power [kW]")
 | 
			
		||||
    % plot(ax2,pltData.xAxis(start:stop),pltData. XXXX (start:stop))
 | 
			
		||||
    % plot(ax2,pltData.xAxis(tr,:),pltData. XXXX (tr,:))
 | 
			
		||||
 | 
			
		||||
    % plot 3:
 | 
			
		||||
    % ax3 = nexttile(tl);
 | 
			
		||||
    % hold(ax3, "on")
 | 
			
		||||
    % grid(ax3, "on")
 | 
			
		||||
    % title(ax3, "Max Cell Temp [°C]")
 | 
			
		||||
    % plot(ax3,pltData.xAxis(start:stop),pltData. XXXX (start:stop))
 | 
			
		||||
    % plot(ax3,pltData.xAxis(tr,:),pltData. XXXX (tr,:))
 | 
			
		||||
 | 
			
		||||
    % plot 4:
 | 
			
		||||
    % ax4 = nexttile(tl);
 | 
			
		||||
    % hold(ax4, "on")
 | 
			
		||||
    % grid(ax4, "on")
 | 
			
		||||
    % title(ax4, "SOC")
 | 
			
		||||
    % plot(ax4,pltData.xAxis(start:stop),pltData. XXXX (start:stop))
 | 
			
		||||
    % plot(ax4,pltData.xAxis(tr,:),pltData. XXXX (tr,:))
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    % link all x axes
 | 
			
		||||
 | 
			
		||||
@ -1,4 +1,4 @@
 | 
			
		||||
function [outputArg] = plot_driver_braking(panel, start, stop, pltData)
 | 
			
		||||
function [outputArg] = plot_driver_braking(panel, pltData, tr)
 | 
			
		||||
    % create tiledlayout (R2023a and newer)
 | 
			
		||||
    tl = tiledlayout(panel,"vertical");
 | 
			
		||||
    
 | 
			
		||||
@ -7,25 +7,25 @@ function [outputArg] = plot_driver_braking(panel, start, stop, pltData)
 | 
			
		||||
    hold(ax1, "on")
 | 
			
		||||
    grid(ax1, "on")
 | 
			
		||||
    title(ax1, "Speed [km/h]")
 | 
			
		||||
    plot(ax1,pltData.xAxis(start:stop),pltData.speed_kph(start:stop))
 | 
			
		||||
    plot(ax1,pltData.xAxis(tr,:),pltData.speed_kph(tr,:))
 | 
			
		||||
    % plot 2: accelerator pedal position [%]
 | 
			
		||||
    ax2 = nexttile(tl);
 | 
			
		||||
    hold(ax2, "on")
 | 
			
		||||
    grid(ax2, "on")
 | 
			
		||||
    title(ax2, "APP [%]")
 | 
			
		||||
    plot(ax2,pltData.xAxis(start:stop),pltData.app_percent(start:stop))
 | 
			
		||||
    plot(ax2,pltData.xAxis(tr,:),pltData.app_percent(tr,:))
 | 
			
		||||
    % plot 3: brake pressure front [bar]
 | 
			
		||||
    ax3 = nexttile(tl);
 | 
			
		||||
    hold(ax3, "on")
 | 
			
		||||
    grid(ax3, "on")
 | 
			
		||||
    title(ax3, "Brake Pressure Front [bar]")
 | 
			
		||||
    plot(ax3,pltData.xAxis(start:stop),pltData.brakePFront_bar(start:stop))
 | 
			
		||||
    plot(ax3,pltData.xAxis(tr,:),pltData.brakePFront_bar(tr,:))
 | 
			
		||||
    % plot 4: longitudinal acceleration [g]
 | 
			
		||||
    ax4 = nexttile(tl);
 | 
			
		||||
    hold(ax4, "on")
 | 
			
		||||
    grid(ax4, "on")
 | 
			
		||||
    title(ax4, "Long Acc [g]")
 | 
			
		||||
    plot(ax4,pltData.xAxis(start:stop),pltData.acc_long_g(start:stop))
 | 
			
		||||
    plot(ax4,pltData.xAxis(tr,:),pltData.acc_long_g(tr,:))
 | 
			
		||||
    % link all x axes
 | 
			
		||||
    linkaxes([ax1, ax2, ax3, ax4],"x")
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -1,4 +1,4 @@
 | 
			
		||||
function [outputArg] = plot_driver_general(panel, start, stop, pltData)
 | 
			
		||||
function [outputArg] = plot_driver_general(panel, pltData, tr)
 | 
			
		||||
    % create tiledlayout (R2023a and newer)
 | 
			
		||||
    tl = tiledlayout(panel,"vertical");
 | 
			
		||||
    
 | 
			
		||||
@ -7,25 +7,25 @@ function [outputArg] = plot_driver_general(panel, start, stop, pltData)
 | 
			
		||||
    hold(ax1, "on")
 | 
			
		||||
    grid(ax1, "on")
 | 
			
		||||
    title(ax1, "Speed [km/h]")
 | 
			
		||||
    plot(ax1,pltData.xAxis(start:stop),pltData.speed_kph(start:stop))
 | 
			
		||||
    plot(ax1,pltData.xAxis(tr,:),pltData.speed_kph(tr,:))
 | 
			
		||||
    % plot 2: accelerator pedal position [%]
 | 
			
		||||
    ax2 = nexttile(tl);
 | 
			
		||||
    hold(ax2, "on")
 | 
			
		||||
    grid(ax2, "on")
 | 
			
		||||
    title(ax2, "APP [%]")
 | 
			
		||||
    plot(ax2,pltData.xAxis(start:stop),pltData.app_percent(start:stop))
 | 
			
		||||
    plot(ax2,pltData.xAxis(tr,:),pltData.app_percent(tr,:))
 | 
			
		||||
    % plot 3: brake pressure front [bar]
 | 
			
		||||
    ax3 = nexttile(tl);
 | 
			
		||||
    hold(ax3, "on")
 | 
			
		||||
    grid(ax3, "on")
 | 
			
		||||
    title(ax3, "Brake Pressure Front [bar]")
 | 
			
		||||
    plot(ax3,pltData.xAxis(start:stop),pltData.brakePFront_bar(start:stop))
 | 
			
		||||
    plot(ax3,pltData.xAxis(tr,:),pltData.brakePFront_bar(tr,:))
 | 
			
		||||
    % plot 4: steering angle [°]
 | 
			
		||||
    ax4 = nexttile(tl);
 | 
			
		||||
    hold(ax4, "on")
 | 
			
		||||
    grid(ax4, "on")
 | 
			
		||||
    title(ax4, "Steering Angle [°]")
 | 
			
		||||
    plot(ax4,pltData.xAxis(start:stop),pltData.steering_deg(start:stop))
 | 
			
		||||
    plot(ax4,pltData.xAxis(tr,:),pltData.steering_deg(tr,:))
 | 
			
		||||
    % link all x axes
 | 
			
		||||
    linkaxes([ax1, ax2, ax3, ax4],"x")
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -1,4 +1,4 @@
 | 
			
		||||
function [outputArg] = plot_driver_statistics(panel, start, stop, pltData)
 | 
			
		||||
function [outputArg] = plot_driver_statistics(panel, pltData, tr)
 | 
			
		||||
    % create tiledlayout (R2023a and newer)
 | 
			
		||||
    tl = tiledlayout(panel,"vertical");
 | 
			
		||||
 | 
			
		||||
@ -7,13 +7,13 @@ function [outputArg] = plot_driver_statistics(panel, start, stop, pltData)
 | 
			
		||||
    hold(ax1, "on")
 | 
			
		||||
    grid(ax1, "on")
 | 
			
		||||
    title(ax1, "speed [km/h]")
 | 
			
		||||
    plot(ax1,pltData.xAxis(start:stop),pltData.speed_kph(start:stop))
 | 
			
		||||
    plot(ax1,pltData.xAxis(tr,:),pltData.speed_kph(tr,:))
 | 
			
		||||
    % plot 2: accelerator pedal position [%]
 | 
			
		||||
    ax2 = nexttile(tl);
 | 
			
		||||
    hold(ax2, "on")
 | 
			
		||||
    grid(ax2, "on")
 | 
			
		||||
    title(ax2, "APP [%]")
 | 
			
		||||
    plot(ax2,pltData.xAxis(start:stop),pltData.app_percent(start:stop))
 | 
			
		||||
    plot(ax2,pltData.xAxis(tr,:),pltData.app_percent(tr,:))
 | 
			
		||||
    linkaxes([ax1, ax2],"x")
 | 
			
		||||
    % plot 3: accelerator pedal position histogram
 | 
			
		||||
    ax3 = nexttile(tl);
 | 
			
		||||
@ -22,7 +22,7 @@ function [outputArg] = plot_driver_statistics(panel, start, stop, pltData)
 | 
			
		||||
    title(ax3, "APP distribution")
 | 
			
		||||
    ylabel(ax3, "\sigma [%]")
 | 
			
		||||
    xlabel(ax3, "APP [%]")
 | 
			
		||||
    histogram(ax3,pltData.app_percent(start:stop),"Normalization","percentage")
 | 
			
		||||
    histogram(ax3,pltData.app_percent(tr,:),"Normalization","percentage")
 | 
			
		||||
    % plot 4: brake pressure histogram
 | 
			
		||||
    ax4 = nexttile(tl);
 | 
			
		||||
    hold(ax4, "on")
 | 
			
		||||
@ -30,7 +30,7 @@ function [outputArg] = plot_driver_statistics(panel, start, stop, pltData)
 | 
			
		||||
    title(ax4, "BrakeP distribution")
 | 
			
		||||
    ylabel(ax4, "\sigma [%]")
 | 
			
		||||
    xlabel(ax4, "Brake Pressure Front [bar]")
 | 
			
		||||
    histogram(ax4,pltData.brakePFront_bar(start:stop),"Normalization","percentage")
 | 
			
		||||
    histogram(ax4,pltData.brakePFront_bar(tr,:),"Normalization","percentage")
 | 
			
		||||
 | 
			
		||||
    % return null (not relevant for plots!)
 | 
			
		||||
    outputArg = [];
 | 
			
		||||
 | 
			
		||||
@ -1,4 +1,4 @@
 | 
			
		||||
function [outputArg] = plot_driver_steering(panel, start, stop, pltData)
 | 
			
		||||
function [outputArg] = plot_driver_steering(panel, pltData, tr)
 | 
			
		||||
    % create tiledlayout (R2023a and newer)
 | 
			
		||||
    tl = tiledlayout(panel,"vertical");
 | 
			
		||||
    
 | 
			
		||||
@ -7,13 +7,13 @@ function [outputArg] = plot_driver_steering(panel, start, stop, pltData)
 | 
			
		||||
    hold(ax1, "on")
 | 
			
		||||
    grid(ax1, "on")
 | 
			
		||||
    title(ax1, "Speed [km/h]")
 | 
			
		||||
    plot(ax1,pltData.xAxis(start:stop),pltData.speed_kph(start:stop))
 | 
			
		||||
    plot(ax1,pltData.xAxis(tr,:),pltData.speed_kph(tr,:))
 | 
			
		||||
    % plot 2: steering angle [°]
 | 
			
		||||
    ax2 = nexttile(tl);
 | 
			
		||||
    hold(ax2, "on")
 | 
			
		||||
    grid(ax2, "on")
 | 
			
		||||
    title(ax2, "Steering Angle [°]")
 | 
			
		||||
    plot(ax2,pltData.xAxis(start:stop),pltData.steering_deg(start:stop))
 | 
			
		||||
    plot(ax2,pltData.xAxis(tr,:),pltData.steering_deg(tr,:))
 | 
			
		||||
    % plot 3: oversteer
 | 
			
		||||
    ax3 = nexttile(tl);
 | 
			
		||||
    hold(ax3, "on")
 | 
			
		||||
@ -26,9 +26,9 @@ function [outputArg] = plot_driver_steering(panel, start, stop, pltData)
 | 
			
		||||
    hold(ax4, "on")
 | 
			
		||||
    grid(ax4, "on")
 | 
			
		||||
    title(ax4, "Lateral Acc [g]")
 | 
			
		||||
    plot(ax4,pltData.xAxis(start:stop),pltData.acc_lat_g)(start:stop)
 | 
			
		||||
    plot(ax4,pltData.xAxis(tr,:),pltData.acc_lat_g(tr,:))
 | 
			
		||||
    % link all x axes
 | 
			
		||||
    linkaxes([ax1, ax2, ax3, ax4],"x")
 | 
			
		||||
    %linkaxes([ax1, ax2, ax3, ax4],"x")
 | 
			
		||||
 | 
			
		||||
    % return null (not relevant for plots!)
 | 
			
		||||
    outputArg = [];
 | 
			
		||||
 | 
			
		||||
@ -1,4 +1,4 @@
 | 
			
		||||
function [outputArg] = plot_inverter(panel, start, stop, pltData)
 | 
			
		||||
function [outputArg] = plot_inverter(panel, pltData, tr)
 | 
			
		||||
    % create tiledlayout (R2023a and newer)
 | 
			
		||||
    tl = tiledlayout(panel,"vertical");
 | 
			
		||||
    
 | 
			
		||||
@ -7,38 +7,38 @@ function [outputArg] = plot_inverter(panel, start, stop, pltData)
 | 
			
		||||
    hold(ax1, "on")
 | 
			
		||||
    grid(ax1, "on")
 | 
			
		||||
    title(ax1, "Speed [km/h]")
 | 
			
		||||
    plot(ax1,pltData.xAxis(start:stop),pltData.speed_kph(start:stop))
 | 
			
		||||
    plot(ax1,pltData.xAxis(tr,:),pltData.speed_kph(tr,:))
 | 
			
		||||
    % plot 2: Inverter Temps [°C]
 | 
			
		||||
    ax2 = nexttile(tl);
 | 
			
		||||
    hold(ax2, "on")
 | 
			
		||||
    grid(ax2, "on")
 | 
			
		||||
    title(ax2, "Inverter Temp [°C]")
 | 
			
		||||
    plot(ax2,pltData.xAxis(start:stop),pltData.invL_temp(start:stop))
 | 
			
		||||
    plot(ax2,pltData.xAxis(start:stop),pltData.invR_temp(start:stop))
 | 
			
		||||
    plot(ax2,pltData.xAxis(tr,:),pltData.invL_temp(tr,:))
 | 
			
		||||
    plot(ax2,pltData.xAxis(tr,:),pltData.invR_temp(tr,:))
 | 
			
		||||
    legend(ax2, "Left", "Right")
 | 
			
		||||
    % plot 3: Torque request / actual inverter left
 | 
			
		||||
    ax3 = nexttile(tl);
 | 
			
		||||
    hold(ax3, "on")
 | 
			
		||||
    grid(ax3, "on")
 | 
			
		||||
    title(ax3, "Left Torque")
 | 
			
		||||
    plot(ax3,pltData.xAxis(start:stop),pltData.invL_torqueDemand(start:stop))
 | 
			
		||||
    plot(ax3,pltData.xAxis(start:stop),pltData.invL_torqueActual(start:stop))
 | 
			
		||||
    plot(ax3,pltData.xAxis(tr,:),pltData.invL_torqueDemand(tr,:))
 | 
			
		||||
    plot(ax3,pltData.xAxis(tr,:),pltData.invL_torqueActual(tr,:))
 | 
			
		||||
    legend(ax3, "Demand", "Actual")
 | 
			
		||||
    % plot 4: Torque request / actual inverter right
 | 
			
		||||
    ax4 = nexttile(tl);
 | 
			
		||||
    hold(ax4, "on")
 | 
			
		||||
    grid(ax4, "on")
 | 
			
		||||
    title(ax4, "Right Torque")
 | 
			
		||||
    plot(ax4,pltData.xAxis(start:stop),pltData.invR_torqueDemand(start:stop))
 | 
			
		||||
    plot(ax4,pltData.xAxis(start:stop),pltData.invR_torqueActual(start:stop))
 | 
			
		||||
    plot(ax4,pltData.xAxis(tr,:),pltData.invR_torqueDemand(tr,:))
 | 
			
		||||
    plot(ax4,pltData.xAxis(tr,:),pltData.invR_torqueActual(tr,:))
 | 
			
		||||
    legend(ax4, "Demand", "Actual")
 | 
			
		||||
    % plot 5: Motor velocities
 | 
			
		||||
    ax5 = nexttile(tl);
 | 
			
		||||
    hold(ax5, "on")
 | 
			
		||||
    grid(ax5, "on")
 | 
			
		||||
    title(ax5, "Motor Velocities [1/min]")
 | 
			
		||||
    plot(ax5,pltData.xAxis(start:stop),pltData.motL_vel_rpm(start:stop))
 | 
			
		||||
    plot(ax5,pltData.xAxis(start:stop),pltData.motR_vel_rpm(start:stop))
 | 
			
		||||
    plot(ax5,pltData.xAxis(tr,:),pltData.motL_vel_rpm(tr,:))
 | 
			
		||||
    plot(ax5,pltData.xAxis(tr,:),pltData.motR_vel_rpm(tr,:))
 | 
			
		||||
    legend(ax5, "Left", "Right")
 | 
			
		||||
 | 
			
		||||
    % link all x axes
 | 
			
		||||
 | 
			
		||||
@ -1,4 +1,4 @@
 | 
			
		||||
function [outputArg] = plot_powertrain(panel, start, stop, pltData)
 | 
			
		||||
function [outputArg] = plot_powertrain(panel, pltData, tr)
 | 
			
		||||
    % create tiledlayout (R2023a and newer)
 | 
			
		||||
    tl = tiledlayout(panel,"vertical");
 | 
			
		||||
    
 | 
			
		||||
@ -7,36 +7,36 @@ function [outputArg] = plot_powertrain(panel, start, stop, pltData)
 | 
			
		||||
    hold(ax1, "on")
 | 
			
		||||
    grid(ax1, "on")
 | 
			
		||||
    title(ax1, "Speed [km/h]")
 | 
			
		||||
    plot(ax1,pltData.xAxis(start:stop),pltData.speed_kph(start:stop))
 | 
			
		||||
    plot(ax1,pltData.xAxis(tr,:),pltData.speed_kph(tr,:))
 | 
			
		||||
    % plot 2: power [kW]
 | 
			
		||||
    ax2 = nexttile(tl);
 | 
			
		||||
    hold(ax2, "on")
 | 
			
		||||
    grid(ax2, "on")
 | 
			
		||||
    title(ax2, "Power [kW]")
 | 
			
		||||
    plot(ax2,pltData.xAxis(start:stop),pltData.ams_ptot(start:stop))
 | 
			
		||||
    plot(ax2,pltData.xAxis(tr,:),pltData.ams_ptot(tr,:))
 | 
			
		||||
    % plot 3: Inverter Temps [°C]
 | 
			
		||||
    ax3 = nexttile(tl);
 | 
			
		||||
    hold(ax3, "on")
 | 
			
		||||
    grid(ax3, "on")
 | 
			
		||||
    title(ax3, "Inverter Temp [°C]")
 | 
			
		||||
    plot(ax3,pltData.xAxis(start:stop),pltData.invL_temp(start:stop))
 | 
			
		||||
    plot(ax3,pltData.xAxis(start:stop),pltData.invR_temp(start:stop))
 | 
			
		||||
    plot(ax3,pltData.xAxis(tr,:),pltData.invL_temp(tr,:))
 | 
			
		||||
    plot(ax3,pltData.xAxis(tr,:),pltData.invR_temp(tr,:))
 | 
			
		||||
    legend(ax3, "Left", "Right")
 | 
			
		||||
    % plot 4: Motor Temps
 | 
			
		||||
    ax4 = nexttile(tl);
 | 
			
		||||
    hold(ax4, "on")
 | 
			
		||||
    grid(ax4, "on")
 | 
			
		||||
    title(ax4, "Motor Temp [°C]")
 | 
			
		||||
    plot(ax4,pltData.xAxis(start:stop),pltData.motL_temp(start:stop))
 | 
			
		||||
    plot(ax4,pltData.xAxis(start:stop),pltData.motR_temp(start:stop))
 | 
			
		||||
    plot(ax4,pltData.xAxis(tr,:),pltData.motL_temp(tr,:))
 | 
			
		||||
    plot(ax4,pltData.xAxis(tr,:),pltData.motR_temp(tr,:))
 | 
			
		||||
    legend(ax4, "Left", "Right")
 | 
			
		||||
    % plot 5: Motor velocities
 | 
			
		||||
    ax5 = nexttile(tl);
 | 
			
		||||
    hold(ax5, "on")
 | 
			
		||||
    grid(ax5, "on")
 | 
			
		||||
    title(ax5, "Motor Velocities [1/min]")
 | 
			
		||||
    plot(ax5,pltData.xAxis(start:stop),pltData.motL_vel_rpm(start:stop))
 | 
			
		||||
    plot(ax5,pltData.xAxis(start:stop),pltData.motR_vel_rpm(start:stop))
 | 
			
		||||
    plot(ax5,pltData.xAxis(tr,:),pltData.motL_vel_rpm(tr,:))
 | 
			
		||||
    plot(ax5,pltData.xAxis(tr,:),pltData.motR_vel_rpm(tr,:))
 | 
			
		||||
    legend(ax5, "Left", "Right")
 | 
			
		||||
 | 
			
		||||
    % link all x axes
 | 
			
		||||
 | 
			
		||||
@ -1,4 +1,4 @@
 | 
			
		||||
function [outputArg] = plot_suspension_histogram(panel, start, stop, pltData)
 | 
			
		||||
function [outputArg] = plot_suspension_histogram(panel, pltData, tr)
 | 
			
		||||
    % create tiledlayout (R2023a and newer)
 | 
			
		||||
    tl = tiledlayout(panel,"vertical");
 | 
			
		||||
    % plot 1: position heave front [mm/s]
 | 
			
		||||
@ -6,25 +6,25 @@ function [outputArg] = plot_suspension_histogram(panel, start, stop, pltData)
 | 
			
		||||
    hold(ax1, "on")
 | 
			
		||||
    grid(ax1, "on")
 | 
			
		||||
    title(ax1, "Heave Front [mm/s]")
 | 
			
		||||
    histogram(ax1, pltData.velocityHeaveFront_mmps(start:stop),"Normalization","percentage")
 | 
			
		||||
    histogram(ax1, pltData.velocityHeaveFront_mmps(tr,:),"Normalization","percentage")
 | 
			
		||||
    % plot 2: position roll front [mm/s]
 | 
			
		||||
    ax2 = nexttile(tl);
 | 
			
		||||
    hold(ax2, "on")
 | 
			
		||||
    grid(ax2, "on")
 | 
			
		||||
    title(ax2, "Roll Front [mm/s]")
 | 
			
		||||
    histogram(ax2, pltData.velocityHeaveFront_mmps(start:stop),"Normalization","percentage")
 | 
			
		||||
    histogram(ax2, pltData.velocityHeaveFront_mmps(tr,:),"Normalization","percentage")
 | 
			
		||||
    % plot 3: position heave front [mm/s]
 | 
			
		||||
    ax3 = nexttile(tl);
 | 
			
		||||
    hold(ax3, "on")
 | 
			
		||||
    grid(ax3, "on")
 | 
			
		||||
    title(ax3, "Heave Rear [mm/s]")
 | 
			
		||||
    histogram(ax3, pltData.velocityHeaveFront_mmps(start:stop),"Normalization","percentage")
 | 
			
		||||
    histogram(ax3, pltData.velocityHeaveFront_mmps(tr,:),"Normalization","percentage")
 | 
			
		||||
    % plot 4: position roll front [mm/s]
 | 
			
		||||
    ax4 = nexttile(tl);
 | 
			
		||||
    hold(ax4, "on")
 | 
			
		||||
    grid(ax4, "on")
 | 
			
		||||
    title(ax4, "Roll Rear [mm/s]")
 | 
			
		||||
    histogram(ax4, pltData.velocityHeaveFront_mmps(start:stop),"Normalization","percentage")
 | 
			
		||||
    histogram(ax4, pltData.velocityHeaveFront_mmps(tr,:),"Normalization","percentage")
 | 
			
		||||
    linkaxes([ax1, ax2, ax3, ax4],"x")
 | 
			
		||||
 | 
			
		||||
    % return null (not relevant for plots!)
 | 
			
		||||
 | 
			
		||||
@ -1,4 +1,4 @@
 | 
			
		||||
function [outputArg] = plot_suspension_positions(panel, start, stop, pltData)
 | 
			
		||||
function [outputArg] = plot_suspension_positions(panel, pltData, tr)
 | 
			
		||||
    % create tiledlayout (R2023a and newer)
 | 
			
		||||
    tl = tiledlayout(panel,"vertical");
 | 
			
		||||
    % plot 1: position heave front [mm]
 | 
			
		||||
@ -6,25 +6,25 @@ function [outputArg] = plot_suspension_positions(panel, start, stop, pltData)
 | 
			
		||||
    hold(ax1, "on")
 | 
			
		||||
    grid(ax1, "on")
 | 
			
		||||
    title(ax1, "Heave Front [mm]")
 | 
			
		||||
    plot(ax1, pltData.xAxis(start:stop),pltData.damperHeaveFront_mm(start:stop))
 | 
			
		||||
    plot(ax1, pltData.xAxis(tr,:),pltData.damperHeaveFront_mm(tr,:))
 | 
			
		||||
    % plot 2: position roll front [mm]
 | 
			
		||||
    ax2 = nexttile(tl);
 | 
			
		||||
    hold(ax2, "on")
 | 
			
		||||
    grid(ax2, "on")
 | 
			
		||||
    title(ax2, "Roll Front [mm]")
 | 
			
		||||
    plot(ax2, pltData.xAxis(start:stop),pltData.damperRollFront_mm(start:stop))
 | 
			
		||||
    plot(ax2, pltData.xAxis(tr,:),pltData.damperRollFront_mm(tr,:))
 | 
			
		||||
    % plot 3: position heave front [mm]
 | 
			
		||||
    ax3 = nexttile(tl);
 | 
			
		||||
    hold(ax3, "on")
 | 
			
		||||
    grid(ax3, "on")
 | 
			
		||||
    title(ax3, "Heave Rear [mm]")
 | 
			
		||||
    plot(ax3, pltData.xAxis(start:stop),pltData.damperHeaveRear_mm(start:stop))
 | 
			
		||||
    plot(ax3, pltData.xAxis(tr,:),pltData.damperHeaveRear_mm(tr,:))
 | 
			
		||||
    % plot 4: position roll front [mm]
 | 
			
		||||
    ax4 = nexttile(tl);
 | 
			
		||||
    hold(ax4, "on")
 | 
			
		||||
    grid(ax4, "on")
 | 
			
		||||
    title(ax4, "Roll Rear [mm]")
 | 
			
		||||
    plot(ax4, pltData.xAxis(start:stop),pltData.damperRollRear_mm(start:stop))
 | 
			
		||||
    plot(ax4, pltData.xAxis(tr,:),pltData.damperRollRear_mm(tr,:))
 | 
			
		||||
    linkaxes([ax1, ax2, ax3, ax4],"x")
 | 
			
		||||
 | 
			
		||||
    % return null (not relevant for plots!)
 | 
			
		||||
 | 
			
		||||
@ -1,4 +1,4 @@
 | 
			
		||||
function [outputArg] = plot_suspension_velocities(panel, start, stop, pltData)
 | 
			
		||||
function [outputArg] = plot_suspension_velocities(panel, pltData, tr)
 | 
			
		||||
    % create tiledlayout (R2023a and newer)
 | 
			
		||||
    tl = tiledlayout(panel,"vertical");
 | 
			
		||||
    % plot 1: velocity heave front [mm/s]
 | 
			
		||||
@ -6,25 +6,25 @@ function [outputArg] = plot_suspension_velocities(panel, start, stop, pltData)
 | 
			
		||||
    hold(ax1, "on")
 | 
			
		||||
    grid(ax1, "on")
 | 
			
		||||
    title(ax1, "Heave Front [mm/s]")
 | 
			
		||||
    plot(ax1, pltData.xAxis(start:stop), pltData.velocityHeaveFront_mmps(start:stop))
 | 
			
		||||
    plot(ax1, pltData.xAxis(tr,:), pltData.velocityHeaveFront_mmps(tr,:))
 | 
			
		||||
    % plot 2: velocity roll front [mm/s]
 | 
			
		||||
    ax2 = nexttile(tl);
 | 
			
		||||
    hold(ax2, "on")
 | 
			
		||||
    grid(ax2, "on")
 | 
			
		||||
    title(ax2, "Roll Front [mm/s]")
 | 
			
		||||
    plot(ax2, pltData.xAxis(start:stop), pltData.velocityRollFront_mmps(start:stop))
 | 
			
		||||
    plot(ax2, pltData.xAxis(tr,:), pltData.velocityRollFront_mmps(tr,:))
 | 
			
		||||
    % plot 3: velocity heave front [mm/s]
 | 
			
		||||
    ax3 = nexttile(tl);
 | 
			
		||||
    hold(ax3, "on")
 | 
			
		||||
    grid(ax3, "on")
 | 
			
		||||
    title(ax3, "Heave Rear [mm/s]")
 | 
			
		||||
    plot(ax3, pltData.xAxis(start:stop), pltData.velocityHeaveRear_mmps(start:stop))
 | 
			
		||||
    plot(ax3, pltData.xAxis(tr,:), pltData.velocityHeaveRear_mmps(tr,:))
 | 
			
		||||
    % plot 4: velocity roll front [mm/s]
 | 
			
		||||
    ax4 = nexttile(tl);
 | 
			
		||||
    hold(ax4, "on")
 | 
			
		||||
    grid(ax4, "on")
 | 
			
		||||
    title(ax4, "Roll Rear [mm/s]")
 | 
			
		||||
    plot(ax4, pltData.xAxis(start:stop), pltData.velocityRollRear_mmps(start:stop))
 | 
			
		||||
    plot(ax4, pltData.xAxis(tr,:), pltData.velocityRollRear_mmps(tr,:))
 | 
			
		||||
    linkaxes([ax1, ax2, ax3, ax4],"x")
 | 
			
		||||
 | 
			
		||||
    % return null (not relevant for plots!)
 | 
			
		||||
 | 
			
		||||
@ -1,4 +1,4 @@
 | 
			
		||||
function [outputArg] = plot_tires_firctionCircle(panel, start, stop, pltData)
 | 
			
		||||
function [outputArg] = plot_tires_firctionCircle(panel, pltData, tr)
 | 
			
		||||
    % create tiledlayout (R2023a and newer)
 | 
			
		||||
    
 | 
			
		||||
    tl = tiledlayout(panel,"flow");
 | 
			
		||||
@ -10,10 +10,20 @@ function [outputArg] = plot_tires_firctionCircle(panel, start, stop, pltData)
 | 
			
		||||
    ylabel(ax1, "Longitudinal Acc [g]")
 | 
			
		||||
    xlabel(ax1, "Lateral Acc [g]")
 | 
			
		||||
    colors = colororder(ax1);
 | 
			
		||||
    plot(ax1,pltData.acc_lat_g(start:stop), pltData.acc_long_g(start:stop),"Color",colors(i,:))
 | 
			
		||||
    K = convhull(pltData.acc_lat_g(start:stop), pltData.acc_long_g(start:stop));
 | 
			
		||||
    plot(ax1,pltData.acc_lat_g(K), pltData.acc_long_g(K),"Color",colors(i,:),"LineStyle","--","LineWidth",2)
 | 
			
		||||
 | 
			
		||||
    % old code for reference
 | 
			
		||||
    % for i = 1:length(selected_laps)
 | 
			
		||||
    %     plot(ax1,pltData(selected_laps(i)).acc_lat_g, ...
 | 
			
		||||
    %         pltData(selected_laps(i)).acc_long_g,"Color",colors(i,:))
 | 
			
		||||
    %     K = convhull(pltData(selected_laps(i)).acc_lat_g, pltData(selected_laps(i)).acc_long_g);
 | 
			
		||||
    %     plot(ax1,pltData(selected_laps(i)).acc_lat_g(K), ...
 | 
			
		||||
    %         pltData(selected_laps(i)).acc_long_g(K),"Color",colors(i,:),"LineStyle","--","LineWidth",2)
 | 
			
		||||
    % end
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    plot(ax1,pltData.acc_lat_g(tr,:), pltData.acc_long_g(tr,:))
 | 
			
		||||
    K = convhull(pltData.acc_lat_g(tr,:), pltData.acc_long_g(tr,:));
 | 
			
		||||
    plot(ax1,pltData.acc_lat_g(K), pltData.acc_long_g(K))
 | 
			
		||||
    % return null (not relevant for plots!)
 | 
			
		||||
    outputArg = [];
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user