Update: added plot_settings, integrated loadvector, added folders/files for future season preset selection
This commit is contained in:
parent
1e9dcbe19d
commit
7cdc35c90c
@ -5,6 +5,7 @@ function [pltData] = sortdata(data,start,stop)
|
|||||||
time_s = time_s - time_s(1); % set beginning of session to 0
|
time_s = time_s - time_s(1); % set beginning of session to 0
|
||||||
|
|
||||||
% x-Axis:
|
% x-Axis:
|
||||||
|
pltData.Time = data.Time(start:stop);
|
||||||
pltData.time_s = time_s(start:stop)-time_s(start);
|
pltData.time_s = time_s(start:stop)-time_s(start);
|
||||||
pltData.time_hms = time_hms(start:stop);
|
pltData.time_hms = time_hms(start:stop);
|
||||||
|
|
||||||
|
BIN
data/VL_2024_09_04_cleaned (1).mat
Normal file
BIN
data/VL_2024_09_04_cleaned (1).mat
Normal file
Binary file not shown.
@ -1,4 +1,4 @@
|
|||||||
function [outputArg] = plot_accumulator(panel, selected_laps, pltData)
|
function [outputArg] = plot_accumulator(panel, start, stop, pltData)
|
||||||
% create tiledlayout (R2023a and newer)
|
% create tiledlayout (R2023a and newer)
|
||||||
tl = tiledlayout(panel,"vertical");
|
tl = tiledlayout(panel,"vertical");
|
||||||
|
|
||||||
@ -7,33 +7,27 @@ function [outputArg] = plot_accumulator(panel, selected_laps, pltData)
|
|||||||
hold(ax1, "on")
|
hold(ax1, "on")
|
||||||
grid(ax1, "on")
|
grid(ax1, "on")
|
||||||
title(ax1, "Speed [km/h]")
|
title(ax1, "Speed [km/h]")
|
||||||
for i = 1:length(selected_laps)
|
plot(ax1,pltData.xAxis(start:stop),pltData.speed_kph(start:stop))
|
||||||
plot(ax1,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).speed_kph)
|
|
||||||
end
|
|
||||||
% plot 2: power [kW]
|
% plot 2: power [kW]
|
||||||
ax2 = nexttile(tl);
|
ax2 = nexttile(tl);
|
||||||
hold(ax2, "on")
|
hold(ax2, "on")
|
||||||
grid(ax2, "on")
|
grid(ax2, "on")
|
||||||
title(ax2, "Power [kW]")
|
title(ax2, "Power [kW]")
|
||||||
for i = 1:length(selected_laps)
|
plot(ax2,pltData.xAxis(start:stop),pltData.ams_ptot(start:stop))
|
||||||
plot(ax2,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).ams_ptot)
|
|
||||||
end
|
|
||||||
% plot 3: Max Cell Temp [°C]
|
% plot 3: Max Cell Temp [°C]
|
||||||
ax3 = nexttile(tl);
|
ax3 = nexttile(tl);
|
||||||
hold(ax3, "on")
|
hold(ax3, "on")
|
||||||
grid(ax3, "on")
|
grid(ax3, "on")
|
||||||
title(ax3, "Max Cell Temp [°C]")
|
title(ax3, "Max Cell Temp [°C]")
|
||||||
for i = 1:length(selected_laps)
|
plot(ax3,pltData.xAxis(start:stop),pltData.ams_tmax(start:stop))
|
||||||
plot(ax3,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).ams_tmax)
|
|
||||||
end
|
|
||||||
% plot 4: State of charge [%]
|
% plot 4: State of charge [%]
|
||||||
ax4 = nexttile(tl);
|
ax4 = nexttile(tl);
|
||||||
hold(ax4, "on")
|
hold(ax4, "on")
|
||||||
grid(ax4, "on")
|
grid(ax4, "on")
|
||||||
title(ax4, "SOC")
|
title(ax4, "SOC")
|
||||||
for i = 1:length(selected_laps)
|
plot(ax4,pltData.xAxis(start:stop),pltData.ams_soc(start:stop))
|
||||||
plot(ax4,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).ams_soc)
|
|
||||||
end
|
|
||||||
% link all x axes
|
% link all x axes
|
||||||
linkaxes([ax1, ax2, ax3, ax4],"x")
|
linkaxes([ax1, ax2, ax3, ax4],"x")
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
function [outputArg] = plot_brakes(panel, selected_laps, pltData)
|
function [outputArg] = plot_brakes(panel, start, stop, pltData)
|
||||||
% create tiledlayout (R2023a and newer)
|
% create tiledlayout (R2023a and newer)
|
||||||
tl = tiledlayout(panel,"vertical");
|
tl = tiledlayout(panel,"vertical");
|
||||||
|
|
||||||
@ -7,47 +7,41 @@ function [outputArg] = plot_brakes(panel, selected_laps, pltData)
|
|||||||
hold(ax1, "on")
|
hold(ax1, "on")
|
||||||
grid(ax1, "on")
|
grid(ax1, "on")
|
||||||
title(ax1, "Speed [km/h]")
|
title(ax1, "Speed [km/h]")
|
||||||
for i = 1:length(selected_laps)
|
plot(ax1,pltData.xAxis(start:stop),pltData.speed_kph(start:stop))
|
||||||
plot(ax1,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).speed_kph)
|
|
||||||
end
|
|
||||||
% plot 2: brake pressure front/rear [bar]
|
% plot 2: brake pressure front/rear [bar]
|
||||||
ax2 = nexttile(tl);
|
ax2 = nexttile(tl);
|
||||||
hold(ax2, "on")
|
hold(ax2, "on")
|
||||||
grid(ax2, "on")
|
grid(ax2, "on")
|
||||||
title(ax2, "Brake Pressure F/R [bar]")
|
title(ax2, "Brake Pressure F/R [bar]")
|
||||||
for i = 1:length(selected_laps)
|
plot(ax2,pltData.xAxis(start:stop),pltData.brakePFront_bar(start:stop))
|
||||||
plot(ax2,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).brakePFront_bar)
|
plot(ax2,pltData.xAxis(start:stop),pltData.brakePRear_bar(start:stop))
|
||||||
plot(ax2,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).brakePRear_bar)
|
|
||||||
end
|
|
||||||
legend(ax2, "Front", "Rear")
|
legend(ax2, "Front", "Rear")
|
||||||
|
|
||||||
% plot 3: longitudinal acceleration [g]
|
% plot 3: longitudinal acceleration [g]
|
||||||
ax3 = nexttile(tl);
|
ax3 = nexttile(tl);
|
||||||
hold(ax3, "on")
|
hold(ax3, "on")
|
||||||
grid(ax3, "on")
|
grid(ax3, "on")
|
||||||
title(ax3, "Long Acc [g]")
|
title(ax3, "Long Acc [g]")
|
||||||
for i = 1:length(selected_laps)
|
plot(ax3,pltData.xAxis(start:stop),pltData.acc_long_g(start:stop))
|
||||||
plot(ax3,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).acc_long_g)
|
|
||||||
end
|
|
||||||
% plot 4: Brake Temp [°C]
|
% plot 4: Brake Temp [°C]
|
||||||
ax4 = nexttile(tl);
|
ax4 = nexttile(tl);
|
||||||
hold(ax4, "on")
|
hold(ax4, "on")
|
||||||
grid(ax4, "on")
|
grid(ax4, "on")
|
||||||
title(ax4, "Brake Temp [°C]")
|
title(ax4, "Brake Temp [°C]")
|
||||||
for i = 1:length(selected_laps)
|
plot(ax4,pltData.xAxis(start:stop),pltData.brakeTFrontLeft_degC(start:stop))
|
||||||
plot(ax4,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).brakeTFrontLeft_degC)
|
plot(ax4,pltData.xAxis(start:stop),pltData.brakeTFrontRight_degC(start:stop))
|
||||||
plot(ax4,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).brakeTFrontRight_degC)
|
plot(ax4,pltData.xAxis(start:stop),pltData.brakeTRearLeft_degC(start:stop))
|
||||||
plot(ax4,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).brakeTRearLeft_degC)
|
plot(ax4,pltData.xAxis(start:stop),pltData.brakeTRearRight_degC(start:stop))
|
||||||
plot(ax4,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).brakeTRearRight_degC)
|
|
||||||
end
|
|
||||||
legend(ax4, "FL", "FR", "RL", "RR")
|
legend(ax4, "FL", "FR", "RL", "RR")
|
||||||
|
|
||||||
% plot 5: brake bias [%]
|
% plot 5: brake bias [%]
|
||||||
ax5 = nexttile(tl);
|
ax5 = nexttile(tl);
|
||||||
hold(ax5, "on")
|
hold(ax5, "on")
|
||||||
grid(ax5, "on")
|
grid(ax5, "on")
|
||||||
title(ax5, "Brake Bias [%]")
|
title(ax5, "Brake Bias [%]")
|
||||||
for i = 1:length(selected_laps)
|
plot(ax5,pltData.xAxis(start:stop),pltData.brakeBias_perc(start:stop))
|
||||||
plot(ax5,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).brakeBias_perc)
|
|
||||||
end
|
|
||||||
|
|
||||||
% link all x axes
|
% link all x axes
|
||||||
linkaxes([ax1, ax2, ax3, ax4, ax5],"x")
|
linkaxes([ax1, ax2, ax3, ax4, ax5],"x")
|
||||||
|
44
plot_settings/plot_custom.m
Normal file
44
plot_settings/plot_custom.m
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
function [outputArg] = plot_custom(panel, start, stop, pltData)
|
||||||
|
% create tiledlayout (R2023a and newer)
|
||||||
|
|
||||||
|
tl = tiledlayout(panel,"flow");
|
||||||
|
|
||||||
|
ax1 = nexttile(tl);
|
||||||
|
hold(ax1, "on")
|
||||||
|
grid(ax1, "on")
|
||||||
|
title(ax1, "Title")
|
||||||
|
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))
|
||||||
|
|
||||||
|
% more plots for customizing
|
||||||
|
|
||||||
|
% plot 2:
|
||||||
|
% ax2 = nexttile(tl);
|
||||||
|
% hold(ax2, "on")
|
||||||
|
% grid(ax2, "on")
|
||||||
|
% title(ax2, "Power [kW]")
|
||||||
|
% plot(ax2,pltData.xAxis(start:stop),pltData. XXXX (start:stop))
|
||||||
|
|
||||||
|
% 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 4:
|
||||||
|
% ax4 = nexttile(tl);
|
||||||
|
% hold(ax4, "on")
|
||||||
|
% grid(ax4, "on")
|
||||||
|
% title(ax4, "SOC")
|
||||||
|
% plot(ax4,pltData.xAxis(start:stop),pltData. XXXX (start:stop))
|
||||||
|
|
||||||
|
|
||||||
|
% link all x axes
|
||||||
|
linkaxes([ax1, ax2, ax3, ax4],"x")
|
||||||
|
% return null (not relevant for plots!)
|
||||||
|
outputArg = [];
|
||||||
|
end
|
||||||
|
|
@ -1,4 +1,4 @@
|
|||||||
function [outputArg] = plot_driver_braking(panel, selected_laps, pltData)
|
function [outputArg] = plot_driver_braking(panel, start, stop, pltData)
|
||||||
% create tiledlayout (R2023a and newer)
|
% create tiledlayout (R2023a and newer)
|
||||||
tl = tiledlayout(panel,"vertical");
|
tl = tiledlayout(panel,"vertical");
|
||||||
|
|
||||||
@ -7,33 +7,25 @@ function [outputArg] = plot_driver_braking(panel, selected_laps, pltData)
|
|||||||
hold(ax1, "on")
|
hold(ax1, "on")
|
||||||
grid(ax1, "on")
|
grid(ax1, "on")
|
||||||
title(ax1, "Speed [km/h]")
|
title(ax1, "Speed [km/h]")
|
||||||
for i = 1:length(selected_laps)
|
plot(ax1,pltData.xAxis(start:stop),pltData.speed_kph(start:stop))
|
||||||
plot(ax1,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).speed_kph)
|
|
||||||
end
|
|
||||||
% plot 2: accelerator pedal position [%]
|
% plot 2: accelerator pedal position [%]
|
||||||
ax2 = nexttile(tl);
|
ax2 = nexttile(tl);
|
||||||
hold(ax2, "on")
|
hold(ax2, "on")
|
||||||
grid(ax2, "on")
|
grid(ax2, "on")
|
||||||
title(ax2, "APP [%]")
|
title(ax2, "APP [%]")
|
||||||
for i = 1:length(selected_laps)
|
plot(ax2,pltData.xAxis(start:stop),pltData.app_percent(start:stop))
|
||||||
plot(ax2,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).app_percent)
|
|
||||||
end
|
|
||||||
% plot 3: brake pressure front [bar]
|
% plot 3: brake pressure front [bar]
|
||||||
ax3 = nexttile(tl);
|
ax3 = nexttile(tl);
|
||||||
hold(ax3, "on")
|
hold(ax3, "on")
|
||||||
grid(ax3, "on")
|
grid(ax3, "on")
|
||||||
title(ax3, "Brake Pressure Front [bar]")
|
title(ax3, "Brake Pressure Front [bar]")
|
||||||
for i = 1:length(selected_laps)
|
plot(ax3,pltData.xAxis(start:stop),pltData.brakePFront_bar(start:stop))
|
||||||
plot(ax3,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).brakePFront_bar)
|
|
||||||
end
|
|
||||||
% plot 4: longitudinal acceleration [g]
|
% plot 4: longitudinal acceleration [g]
|
||||||
ax4 = nexttile(tl);
|
ax4 = nexttile(tl);
|
||||||
hold(ax4, "on")
|
hold(ax4, "on")
|
||||||
grid(ax4, "on")
|
grid(ax4, "on")
|
||||||
title(ax4, "Long Acc [g]")
|
title(ax4, "Long Acc [g]")
|
||||||
for i = 1:length(selected_laps)
|
plot(ax4,pltData.xAxis(start:stop),pltData.acc_long_g(start:stop))
|
||||||
plot(ax4,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).acc_long_g)
|
|
||||||
end
|
|
||||||
% link all x axes
|
% link all x axes
|
||||||
linkaxes([ax1, ax2, ax3, ax4],"x")
|
linkaxes([ax1, ax2, ax3, ax4],"x")
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
function [outputArg] = plot_driver_general(panel, selected_laps, pltData)
|
function [outputArg] = plot_driver_general(panel, start, stop, pltData)
|
||||||
% create tiledlayout (R2023a and newer)
|
% create tiledlayout (R2023a and newer)
|
||||||
tl = tiledlayout(panel,"vertical");
|
tl = tiledlayout(panel,"vertical");
|
||||||
|
|
||||||
@ -7,33 +7,25 @@ function [outputArg] = plot_driver_general(panel, selected_laps, pltData)
|
|||||||
hold(ax1, "on")
|
hold(ax1, "on")
|
||||||
grid(ax1, "on")
|
grid(ax1, "on")
|
||||||
title(ax1, "Speed [km/h]")
|
title(ax1, "Speed [km/h]")
|
||||||
for i = 1:length(selected_laps)
|
plot(ax1,pltData.xAxis(start:stop),pltData.speed_kph(start:stop))
|
||||||
plot(ax1,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).speed_kph)
|
|
||||||
end
|
|
||||||
% plot 2: accelerator pedal position [%]
|
% plot 2: accelerator pedal position [%]
|
||||||
ax2 = nexttile(tl);
|
ax2 = nexttile(tl);
|
||||||
hold(ax2, "on")
|
hold(ax2, "on")
|
||||||
grid(ax2, "on")
|
grid(ax2, "on")
|
||||||
title(ax2, "APP [%]")
|
title(ax2, "APP [%]")
|
||||||
for i = 1:length(selected_laps)
|
plot(ax2,pltData.xAxis(start:stop),pltData.app_percent(start:stop))
|
||||||
plot(ax2,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).app_percent)
|
|
||||||
end
|
|
||||||
% plot 3: brake pressure front [bar]
|
% plot 3: brake pressure front [bar]
|
||||||
ax3 = nexttile(tl);
|
ax3 = nexttile(tl);
|
||||||
hold(ax3, "on")
|
hold(ax3, "on")
|
||||||
grid(ax3, "on")
|
grid(ax3, "on")
|
||||||
title(ax3, "Brake Pressure Front [bar]")
|
title(ax3, "Brake Pressure Front [bar]")
|
||||||
for i = 1:length(selected_laps)
|
plot(ax3,pltData.xAxis(start:stop),pltData.brakePFront_bar(start:stop))
|
||||||
plot(ax3,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).brakePFront_bar)
|
|
||||||
end
|
|
||||||
% plot 4: steering angle [°]
|
% plot 4: steering angle [°]
|
||||||
ax4 = nexttile(tl);
|
ax4 = nexttile(tl);
|
||||||
hold(ax4, "on")
|
hold(ax4, "on")
|
||||||
grid(ax4, "on")
|
grid(ax4, "on")
|
||||||
title(ax4, "Steering Angle [°]")
|
title(ax4, "Steering Angle [°]")
|
||||||
for i = 1:length(selected_laps)
|
plot(ax4,pltData.xAxis(start:stop),pltData.steering_deg(start:stop))
|
||||||
plot(ax4,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).steering_deg)
|
|
||||||
end
|
|
||||||
% link all x axes
|
% link all x axes
|
||||||
linkaxes([ax1, ax2, ax3, ax4],"x")
|
linkaxes([ax1, ax2, ax3, ax4],"x")
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
function [outputArg] = plot_driver_statistics(panel, selected_laps, pltData)
|
function [outputArg] = plot_driver_statistics(panel, start, stop, pltData)
|
||||||
% create tiledlayout (R2023a and newer)
|
% create tiledlayout (R2023a and newer)
|
||||||
tl = tiledlayout(panel,"vertical");
|
tl = tiledlayout(panel,"vertical");
|
||||||
|
|
||||||
@ -7,17 +7,13 @@ function [outputArg] = plot_driver_statistics(panel, selected_laps, pltData)
|
|||||||
hold(ax1, "on")
|
hold(ax1, "on")
|
||||||
grid(ax1, "on")
|
grid(ax1, "on")
|
||||||
title(ax1, "speed [km/h]")
|
title(ax1, "speed [km/h]")
|
||||||
for i = 1:length(selected_laps)
|
plot(ax1,pltData.xAxis(start:stop),pltData.speed_kph(start:stop))
|
||||||
plot(ax1,pltData(selected_laps(i)).xAxis,pltData(selected_laps(i)).speed_kph)
|
|
||||||
end
|
|
||||||
% plot 2: accelerator pedal position [%]
|
% plot 2: accelerator pedal position [%]
|
||||||
ax2 = nexttile(tl);
|
ax2 = nexttile(tl);
|
||||||
hold(ax2, "on")
|
hold(ax2, "on")
|
||||||
grid(ax2, "on")
|
grid(ax2, "on")
|
||||||
title(ax2, "APP [%]")
|
title(ax2, "APP [%]")
|
||||||
for i = 1:length(selected_laps)
|
plot(ax2,pltData.xAxis(start:stop),pltData.app_percent(start:stop))
|
||||||
plot(ax2,pltData(selected_laps(i)).xAxis,pltData(selected_laps(i)).app_percent)
|
|
||||||
end
|
|
||||||
linkaxes([ax1, ax2],"x")
|
linkaxes([ax1, ax2],"x")
|
||||||
% plot 3: accelerator pedal position histogram
|
% plot 3: accelerator pedal position histogram
|
||||||
ax3 = nexttile(tl);
|
ax3 = nexttile(tl);
|
||||||
@ -26,9 +22,7 @@ function [outputArg] = plot_driver_statistics(panel, selected_laps, pltData)
|
|||||||
title(ax3, "APP distribution")
|
title(ax3, "APP distribution")
|
||||||
ylabel(ax3, "\sigma [%]")
|
ylabel(ax3, "\sigma [%]")
|
||||||
xlabel(ax3, "APP [%]")
|
xlabel(ax3, "APP [%]")
|
||||||
for i = 1:length(selected_laps)
|
histogram(ax3,pltData.app_percent(start:stop),"Normalization","percentage")
|
||||||
histogram(ax3,pltData(selected_laps(i)).app_percent,"Normalization","percentage")
|
|
||||||
end
|
|
||||||
% plot 4: brake pressure histogram
|
% plot 4: brake pressure histogram
|
||||||
ax4 = nexttile(tl);
|
ax4 = nexttile(tl);
|
||||||
hold(ax4, "on")
|
hold(ax4, "on")
|
||||||
@ -36,9 +30,7 @@ function [outputArg] = plot_driver_statistics(panel, selected_laps, pltData)
|
|||||||
title(ax4, "BrakeP distribution")
|
title(ax4, "BrakeP distribution")
|
||||||
ylabel(ax4, "\sigma [%]")
|
ylabel(ax4, "\sigma [%]")
|
||||||
xlabel(ax4, "Brake Pressure Front [bar]")
|
xlabel(ax4, "Brake Pressure Front [bar]")
|
||||||
for i = 1:length(selected_laps)
|
histogram(ax4,pltData.brakePFront_bar(start:stop),"Normalization","percentage")
|
||||||
histogram(ax4,pltData(selected_laps(i)).brakePFront_bar,"Normalization","percentage")
|
|
||||||
end
|
|
||||||
|
|
||||||
% return null (not relevant for plots!)
|
% return null (not relevant for plots!)
|
||||||
outputArg = [];
|
outputArg = [];
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
function [outputArg] = plot_driver_steering(panel, selected_laps, pltData)
|
function [outputArg] = plot_driver_steering(panel, start, stop, pltData)
|
||||||
% create tiledlayout (R2023a and newer)
|
% create tiledlayout (R2023a and newer)
|
||||||
tl = tiledlayout(panel,"vertical");
|
tl = tiledlayout(panel,"vertical");
|
||||||
|
|
||||||
@ -7,17 +7,13 @@ function [outputArg] = plot_driver_steering(panel, selected_laps, pltData)
|
|||||||
hold(ax1, "on")
|
hold(ax1, "on")
|
||||||
grid(ax1, "on")
|
grid(ax1, "on")
|
||||||
title(ax1, "Speed [km/h]")
|
title(ax1, "Speed [km/h]")
|
||||||
for i = 1:length(selected_laps)
|
plot(ax1,pltData.xAxis(start:stop),pltData.speed_kph(start:stop))
|
||||||
plot(ax1,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).speed_kph)
|
|
||||||
end
|
|
||||||
% plot 2: steering angle [°]
|
% plot 2: steering angle [°]
|
||||||
ax2 = nexttile(tl);
|
ax2 = nexttile(tl);
|
||||||
hold(ax2, "on")
|
hold(ax2, "on")
|
||||||
grid(ax2, "on")
|
grid(ax2, "on")
|
||||||
title(ax2, "Steering Angle [°]")
|
title(ax2, "Steering Angle [°]")
|
||||||
for i = 1:length(selected_laps)
|
plot(ax2,pltData.xAxis(start:stop),pltData.steering_deg(start:stop))
|
||||||
plot(ax2,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).steering_deg)
|
|
||||||
end
|
|
||||||
% plot 3: oversteer
|
% plot 3: oversteer
|
||||||
ax3 = nexttile(tl);
|
ax3 = nexttile(tl);
|
||||||
hold(ax3, "on")
|
hold(ax3, "on")
|
||||||
@ -30,9 +26,7 @@ function [outputArg] = plot_driver_steering(panel, selected_laps, pltData)
|
|||||||
hold(ax4, "on")
|
hold(ax4, "on")
|
||||||
grid(ax4, "on")
|
grid(ax4, "on")
|
||||||
title(ax4, "Lateral Acc [g]")
|
title(ax4, "Lateral Acc [g]")
|
||||||
for i = 1:length(selected_laps)
|
plot(ax4,pltData.xAxis(start:stop),pltData.acc_lat_g)(start:stop)
|
||||||
plot(ax4,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).acc_lat_g)
|
|
||||||
end
|
|
||||||
% link all x axes
|
% link all x axes
|
||||||
linkaxes([ax1, ax2, ax3, ax4],"x")
|
linkaxes([ax1, ax2, ax3, ax4],"x")
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
function [outputArg] = plot_inverter(panel, selected_laps, pltData)
|
function [outputArg] = plot_inverter(panel, start, stop, pltData)
|
||||||
% create tiledlayout (R2023a and newer)
|
% create tiledlayout (R2023a and newer)
|
||||||
tl = tiledlayout(panel,"vertical");
|
tl = tiledlayout(panel,"vertical");
|
||||||
|
|
||||||
@ -7,48 +7,38 @@ function [outputArg] = plot_inverter(panel, selected_laps, pltData)
|
|||||||
hold(ax1, "on")
|
hold(ax1, "on")
|
||||||
grid(ax1, "on")
|
grid(ax1, "on")
|
||||||
title(ax1, "Speed [km/h]")
|
title(ax1, "Speed [km/h]")
|
||||||
for i = 1:length(selected_laps)
|
plot(ax1,pltData.xAxis(start:stop),pltData.speed_kph(start:stop))
|
||||||
plot(ax1,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).speed_kph)
|
|
||||||
end
|
|
||||||
% plot 2: Inverter Temps [°C]
|
% plot 2: Inverter Temps [°C]
|
||||||
ax2 = nexttile(tl);
|
ax2 = nexttile(tl);
|
||||||
hold(ax2, "on")
|
hold(ax2, "on")
|
||||||
grid(ax2, "on")
|
grid(ax2, "on")
|
||||||
title(ax2, "Inverter Temp [°C]")
|
title(ax2, "Inverter Temp [°C]")
|
||||||
for i = 1:length(selected_laps)
|
plot(ax2,pltData.xAxis(start:stop),pltData.invL_temp(start:stop))
|
||||||
plot(ax2,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).invL_temp)
|
plot(ax2,pltData.xAxis(start:stop),pltData.invR_temp(start:stop))
|
||||||
plot(ax2,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).invR_temp)
|
|
||||||
end
|
|
||||||
legend(ax2, "Left", "Right")
|
legend(ax2, "Left", "Right")
|
||||||
% plot 3: Torque request / actual inverter left
|
% plot 3: Torque request / actual inverter left
|
||||||
ax3 = nexttile(tl);
|
ax3 = nexttile(tl);
|
||||||
hold(ax3, "on")
|
hold(ax3, "on")
|
||||||
grid(ax3, "on")
|
grid(ax3, "on")
|
||||||
title(ax3, "Left Torque")
|
title(ax3, "Left Torque")
|
||||||
for i = 1:length(selected_laps)
|
plot(ax3,pltData.xAxis(start:stop),pltData.invL_torqueDemand(start:stop))
|
||||||
plot(ax3,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).invL_torqueDemand)
|
plot(ax3,pltData.xAxis(start:stop),pltData.invL_torqueActual(start:stop))
|
||||||
plot(ax3,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).invL_torqueActual)
|
|
||||||
end
|
|
||||||
legend(ax3, "Demand", "Actual")
|
legend(ax3, "Demand", "Actual")
|
||||||
% plot 4: Torque request / actual inverter right
|
% plot 4: Torque request / actual inverter right
|
||||||
ax4 = nexttile(tl);
|
ax4 = nexttile(tl);
|
||||||
hold(ax4, "on")
|
hold(ax4, "on")
|
||||||
grid(ax4, "on")
|
grid(ax4, "on")
|
||||||
title(ax4, "Right Torque")
|
title(ax4, "Right Torque")
|
||||||
for i = 1:length(selected_laps)
|
plot(ax4,pltData.xAxis(start:stop),pltData.invR_torqueDemand(start:stop))
|
||||||
plot(ax4,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).invR_torqueDemand)
|
plot(ax4,pltData.xAxis(start:stop),pltData.invR_torqueActual(start:stop))
|
||||||
plot(ax4,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).invR_torqueActual)
|
|
||||||
end
|
|
||||||
legend(ax4, "Demand", "Actual")
|
legend(ax4, "Demand", "Actual")
|
||||||
% plot 5: Motor velocities
|
% plot 5: Motor velocities
|
||||||
ax5 = nexttile(tl);
|
ax5 = nexttile(tl);
|
||||||
hold(ax5, "on")
|
hold(ax5, "on")
|
||||||
grid(ax5, "on")
|
grid(ax5, "on")
|
||||||
title(ax5, "Motor Velocities [1/min]")
|
title(ax5, "Motor Velocities [1/min]")
|
||||||
for i = 1:length(selected_laps)
|
plot(ax5,pltData.xAxis(start:stop),pltData.motL_vel_rpm(start:stop))
|
||||||
plot(ax5,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).motL_vel_rpm)
|
plot(ax5,pltData.xAxis(start:stop),pltData.motR_vel_rpm(start:stop))
|
||||||
plot(ax5,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).motR_vel_rpm)
|
|
||||||
end
|
|
||||||
legend(ax5, "Left", "Right")
|
legend(ax5, "Left", "Right")
|
||||||
|
|
||||||
% link all x axes
|
% link all x axes
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
function [outputArg] = plot_powertrain(panel, selected_laps, pltData)
|
function [outputArg] = plot_powertrain(panel, start, stop, pltData)
|
||||||
% create tiledlayout (R2023a and newer)
|
% create tiledlayout (R2023a and newer)
|
||||||
tl = tiledlayout(panel,"vertical");
|
tl = tiledlayout(panel,"vertical");
|
||||||
|
|
||||||
@ -7,46 +7,36 @@ function [outputArg] = plot_powertrain(panel, selected_laps, pltData)
|
|||||||
hold(ax1, "on")
|
hold(ax1, "on")
|
||||||
grid(ax1, "on")
|
grid(ax1, "on")
|
||||||
title(ax1, "Speed [km/h]")
|
title(ax1, "Speed [km/h]")
|
||||||
for i = 1:length(selected_laps)
|
plot(ax1,pltData.xAxis(start:stop),pltData.speed_kph(start:stop))
|
||||||
plot(ax1,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).speed_kph)
|
|
||||||
end
|
|
||||||
% plot 2: power [kW]
|
% plot 2: power [kW]
|
||||||
ax2 = nexttile(tl);
|
ax2 = nexttile(tl);
|
||||||
hold(ax2, "on")
|
hold(ax2, "on")
|
||||||
grid(ax2, "on")
|
grid(ax2, "on")
|
||||||
title(ax2, "Power [kW]")
|
title(ax2, "Power [kW]")
|
||||||
for i = 1:length(selected_laps)
|
plot(ax2,pltData.xAxis(start:stop),pltData.ams_ptot(start:stop))
|
||||||
plot(ax2,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).ams_ptot)
|
|
||||||
end
|
|
||||||
% plot 3: Inverter Temps [°C]
|
% plot 3: Inverter Temps [°C]
|
||||||
ax3 = nexttile(tl);
|
ax3 = nexttile(tl);
|
||||||
hold(ax3, "on")
|
hold(ax3, "on")
|
||||||
grid(ax3, "on")
|
grid(ax3, "on")
|
||||||
title(ax3, "Inverter Temp [°C]")
|
title(ax3, "Inverter Temp [°C]")
|
||||||
for i = 1:length(selected_laps)
|
plot(ax3,pltData.xAxis(start:stop),pltData.invL_temp(start:stop))
|
||||||
plot(ax3,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).invL_temp)
|
plot(ax3,pltData.xAxis(start:stop),pltData.invR_temp(start:stop))
|
||||||
plot(ax3,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).invR_temp)
|
|
||||||
end
|
|
||||||
legend(ax3, "Left", "Right")
|
legend(ax3, "Left", "Right")
|
||||||
% plot 4: Motor Temps
|
% plot 4: Motor Temps
|
||||||
ax4 = nexttile(tl);
|
ax4 = nexttile(tl);
|
||||||
hold(ax4, "on")
|
hold(ax4, "on")
|
||||||
grid(ax4, "on")
|
grid(ax4, "on")
|
||||||
title(ax4, "Motor Temp [°C]")
|
title(ax4, "Motor Temp [°C]")
|
||||||
for i = 1:length(selected_laps)
|
plot(ax4,pltData.xAxis(start:stop),pltData.motL_temp(start:stop))
|
||||||
plot(ax4,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).motL_temp)
|
plot(ax4,pltData.xAxis(start:stop),pltData.motR_temp(start:stop))
|
||||||
plot(ax4,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).motR_temp)
|
|
||||||
end
|
|
||||||
legend(ax4, "Left", "Right")
|
legend(ax4, "Left", "Right")
|
||||||
% plot 5: Motor velocities
|
% plot 5: Motor velocities
|
||||||
ax5 = nexttile(tl);
|
ax5 = nexttile(tl);
|
||||||
hold(ax5, "on")
|
hold(ax5, "on")
|
||||||
grid(ax5, "on")
|
grid(ax5, "on")
|
||||||
title(ax5, "Motor Velocities [1/min]")
|
title(ax5, "Motor Velocities [1/min]")
|
||||||
for i = 1:length(selected_laps)
|
plot(ax5,pltData.xAxis(start:stop),pltData.motL_vel_rpm(start:stop))
|
||||||
plot(ax5,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).motL_vel_rpm)
|
plot(ax5,pltData.xAxis(start:stop),pltData.motR_vel_rpm(start:stop))
|
||||||
plot(ax5,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).motR_vel_rpm)
|
|
||||||
end
|
|
||||||
legend(ax5, "Left", "Right")
|
legend(ax5, "Left", "Right")
|
||||||
|
|
||||||
% link all x axes
|
% link all x axes
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
function [outputArg] = plot_suspension_histogram(panel, selected_laps, pltData)
|
function [outputArg] = plot_suspension_histogram(panel, start, stop, pltData)
|
||||||
% create tiledlayout (R2023a and newer)
|
% create tiledlayout (R2023a and newer)
|
||||||
tl = tiledlayout(panel,"vertical");
|
tl = tiledlayout(panel,"vertical");
|
||||||
% plot 1: position heave front [mm/s]
|
% plot 1: position heave front [mm/s]
|
||||||
@ -6,33 +6,25 @@ function [outputArg] = plot_suspension_histogram(panel, selected_laps, pltData)
|
|||||||
hold(ax1, "on")
|
hold(ax1, "on")
|
||||||
grid(ax1, "on")
|
grid(ax1, "on")
|
||||||
title(ax1, "Heave Front [mm/s]")
|
title(ax1, "Heave Front [mm/s]")
|
||||||
for i = 1:length(selected_laps)
|
histogram(ax1, pltData.velocityHeaveFront_mmps(start:stop),"Normalization","percentage")
|
||||||
histogram(ax1, pltData(selected_laps(i)).velocityHeaveFront_mmps,"Normalization","percentage")
|
|
||||||
end
|
|
||||||
% plot 2: position roll front [mm/s]
|
% plot 2: position roll front [mm/s]
|
||||||
ax2 = nexttile(tl);
|
ax2 = nexttile(tl);
|
||||||
hold(ax2, "on")
|
hold(ax2, "on")
|
||||||
grid(ax2, "on")
|
grid(ax2, "on")
|
||||||
title(ax2, "Roll Front [mm/s]")
|
title(ax2, "Roll Front [mm/s]")
|
||||||
for i = 1:length(selected_laps)
|
histogram(ax2, pltData.velocityHeaveFront_mmps(start:stop),"Normalization","percentage")
|
||||||
histogram(ax2, pltData(selected_laps(i)).velocityHeaveFront_mmps,"Normalization","percentage")
|
|
||||||
end
|
|
||||||
% plot 3: position heave front [mm/s]
|
% plot 3: position heave front [mm/s]
|
||||||
ax3 = nexttile(tl);
|
ax3 = nexttile(tl);
|
||||||
hold(ax3, "on")
|
hold(ax3, "on")
|
||||||
grid(ax3, "on")
|
grid(ax3, "on")
|
||||||
title(ax3, "Heave Rear [mm/s]")
|
title(ax3, "Heave Rear [mm/s]")
|
||||||
for i = 1:length(selected_laps)
|
histogram(ax3, pltData.velocityHeaveFront_mmps(start:stop),"Normalization","percentage")
|
||||||
histogram(ax3, pltData(selected_laps(i)).velocityHeaveFront_mmps,"Normalization","percentage")
|
|
||||||
end
|
|
||||||
% plot 4: position roll front [mm/s]
|
% plot 4: position roll front [mm/s]
|
||||||
ax4 = nexttile(tl);
|
ax4 = nexttile(tl);
|
||||||
hold(ax4, "on")
|
hold(ax4, "on")
|
||||||
grid(ax4, "on")
|
grid(ax4, "on")
|
||||||
title(ax4, "Roll Rear [mm/s]")
|
title(ax4, "Roll Rear [mm/s]")
|
||||||
for i = 1:length(selected_laps)
|
histogram(ax4, pltData.velocityHeaveFront_mmps(start:stop),"Normalization","percentage")
|
||||||
histogram(ax4, pltData(selected_laps(i)).velocityHeaveFront_mmps,"Normalization","percentage")
|
|
||||||
end
|
|
||||||
linkaxes([ax1, ax2, ax3, ax4],"x")
|
linkaxes([ax1, ax2, ax3, ax4],"x")
|
||||||
|
|
||||||
% return null (not relevant for plots!)
|
% return null (not relevant for plots!)
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
function [outputArg] = plot_suspension_positions(panel, selected_laps, pltData)
|
function [outputArg] = plot_suspension_positions(panel, start, stop, pltData)
|
||||||
% create tiledlayout (R2023a and newer)
|
% create tiledlayout (R2023a and newer)
|
||||||
tl = tiledlayout(panel,"vertical");
|
tl = tiledlayout(panel,"vertical");
|
||||||
% plot 1: position heave front [mm]
|
% plot 1: position heave front [mm]
|
||||||
@ -6,33 +6,25 @@ function [outputArg] = plot_suspension_positions(panel, selected_laps, pltData)
|
|||||||
hold(ax1, "on")
|
hold(ax1, "on")
|
||||||
grid(ax1, "on")
|
grid(ax1, "on")
|
||||||
title(ax1, "Heave Front [mm]")
|
title(ax1, "Heave Front [mm]")
|
||||||
for i = 1:length(selected_laps)
|
plot(ax1, pltData.xAxis(start:stop),pltData.damperHeaveFront_mm(start:stop))
|
||||||
plot(ax1, pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).damperHeaveFront_mm)
|
|
||||||
end
|
|
||||||
% plot 2: position roll front [mm]
|
% plot 2: position roll front [mm]
|
||||||
ax2 = nexttile(tl);
|
ax2 = nexttile(tl);
|
||||||
hold(ax2, "on")
|
hold(ax2, "on")
|
||||||
grid(ax2, "on")
|
grid(ax2, "on")
|
||||||
title(ax2, "Roll Front [mm]")
|
title(ax2, "Roll Front [mm]")
|
||||||
for i = 1:length(selected_laps)
|
plot(ax2, pltData.xAxis(start:stop),pltData.damperRollFront_mm(start:stop))
|
||||||
plot(ax2, pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).damperRollFront_mm)
|
|
||||||
end
|
|
||||||
% plot 3: position heave front [mm]
|
% plot 3: position heave front [mm]
|
||||||
ax3 = nexttile(tl);
|
ax3 = nexttile(tl);
|
||||||
hold(ax3, "on")
|
hold(ax3, "on")
|
||||||
grid(ax3, "on")
|
grid(ax3, "on")
|
||||||
title(ax3, "Heave Rear [mm]")
|
title(ax3, "Heave Rear [mm]")
|
||||||
for i = 1:length(selected_laps)
|
plot(ax3, pltData.xAxis(start:stop),pltData.damperHeaveRear_mm(start:stop))
|
||||||
plot(ax3, pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).damperHeaveRear_mm)
|
|
||||||
end
|
|
||||||
% plot 4: position roll front [mm]
|
% plot 4: position roll front [mm]
|
||||||
ax4 = nexttile(tl);
|
ax4 = nexttile(tl);
|
||||||
hold(ax4, "on")
|
hold(ax4, "on")
|
||||||
grid(ax4, "on")
|
grid(ax4, "on")
|
||||||
title(ax4, "Roll Rear [mm]")
|
title(ax4, "Roll Rear [mm]")
|
||||||
for i = 1:length(selected_laps)
|
plot(ax4, pltData.xAxis(start:stop),pltData.damperRollRear_mm(start:stop))
|
||||||
plot(ax4, pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).damperRollRear_mm)
|
|
||||||
end
|
|
||||||
linkaxes([ax1, ax2, ax3, ax4],"x")
|
linkaxes([ax1, ax2, ax3, ax4],"x")
|
||||||
|
|
||||||
% return null (not relevant for plots!)
|
% return null (not relevant for plots!)
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
function [outputArg] = plot_suspension_velocities(panel, selected_laps, pltData)
|
function [outputArg] = plot_suspension_velocities(panel, start, stop, pltData)
|
||||||
% create tiledlayout (R2023a and newer)
|
% create tiledlayout (R2023a and newer)
|
||||||
tl = tiledlayout(panel,"vertical");
|
tl = tiledlayout(panel,"vertical");
|
||||||
% plot 1: velocity heave front [mm/s]
|
% plot 1: velocity heave front [mm/s]
|
||||||
@ -6,33 +6,25 @@ function [outputArg] = plot_suspension_velocities(panel, selected_laps, pltData)
|
|||||||
hold(ax1, "on")
|
hold(ax1, "on")
|
||||||
grid(ax1, "on")
|
grid(ax1, "on")
|
||||||
title(ax1, "Heave Front [mm/s]")
|
title(ax1, "Heave Front [mm/s]")
|
||||||
for i = 1:length(selected_laps)
|
plot(ax1, pltData.xAxis(start:stop), pltData.velocityHeaveFront_mmps(start:stop))
|
||||||
plot(ax1, pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).velocityHeaveFront_mmps)
|
|
||||||
end
|
|
||||||
% plot 2: velocity roll front [mm/s]
|
% plot 2: velocity roll front [mm/s]
|
||||||
ax2 = nexttile(tl);
|
ax2 = nexttile(tl);
|
||||||
hold(ax2, "on")
|
hold(ax2, "on")
|
||||||
grid(ax2, "on")
|
grid(ax2, "on")
|
||||||
title(ax2, "Roll Front [mm/s]")
|
title(ax2, "Roll Front [mm/s]")
|
||||||
for i = 1:length(selected_laps)
|
plot(ax2, pltData.xAxis(start:stop), pltData.velocityRollFront_mmps(start:stop))
|
||||||
plot(ax2, pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).velocityRollFront_mmps)
|
|
||||||
end
|
|
||||||
% plot 3: velocity heave front [mm/s]
|
% plot 3: velocity heave front [mm/s]
|
||||||
ax3 = nexttile(tl);
|
ax3 = nexttile(tl);
|
||||||
hold(ax3, "on")
|
hold(ax3, "on")
|
||||||
grid(ax3, "on")
|
grid(ax3, "on")
|
||||||
title(ax3, "Heave Rear [mm/s]")
|
title(ax3, "Heave Rear [mm/s]")
|
||||||
for i = 1:length(selected_laps)
|
plot(ax3, pltData.xAxis(start:stop), pltData.velocityHeaveRear_mmps(start:stop))
|
||||||
plot(ax3, pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).velocityHeaveRear_mmps)
|
|
||||||
end
|
|
||||||
% plot 4: velocity roll front [mm/s]
|
% plot 4: velocity roll front [mm/s]
|
||||||
ax4 = nexttile(tl);
|
ax4 = nexttile(tl);
|
||||||
hold(ax4, "on")
|
hold(ax4, "on")
|
||||||
grid(ax4, "on")
|
grid(ax4, "on")
|
||||||
title(ax4, "Roll Rear [mm/s]")
|
title(ax4, "Roll Rear [mm/s]")
|
||||||
for i = 1:length(selected_laps)
|
plot(ax4, pltData.xAxis(start:stop), pltData.velocityRollRear_mmps(start:stop))
|
||||||
plot(ax4, pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).velocityRollRear_mmps)
|
|
||||||
end
|
|
||||||
linkaxes([ax1, ax2, ax3, ax4],"x")
|
linkaxes([ax1, ax2, ax3, ax4],"x")
|
||||||
|
|
||||||
% return null (not relevant for plots!)
|
% return null (not relevant for plots!)
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
function [outputArg] = plot_tires_firctionCircle(panel, selected_laps, pltData)
|
function [outputArg] = plot_tires_firctionCircle(panel, start, stop, pltData)
|
||||||
% create tiledlayout (R2023a and newer)
|
% create tiledlayout (R2023a and newer)
|
||||||
|
|
||||||
tl = tiledlayout(panel,"flow");
|
tl = tiledlayout(panel,"flow");
|
||||||
@ -10,13 +10,9 @@ function [outputArg] = plot_tires_firctionCircle(panel, selected_laps, pltData)
|
|||||||
ylabel(ax1, "Longitudinal Acc [g]")
|
ylabel(ax1, "Longitudinal Acc [g]")
|
||||||
xlabel(ax1, "Lateral Acc [g]")
|
xlabel(ax1, "Lateral Acc [g]")
|
||||||
colors = colororder(ax1);
|
colors = colororder(ax1);
|
||||||
for i = 1:length(selected_laps)
|
plot(ax1,pltData.acc_lat_g(start:stop), pltData.acc_long_g(start:stop),"Color",colors(i,:))
|
||||||
plot(ax1,pltData(selected_laps(i)).acc_lat_g, ...
|
K = convhull(pltData.acc_lat_g(start:stop), pltData.acc_long_g(start:stop));
|
||||||
pltData(selected_laps(i)).acc_long_g,"Color",colors(i,:))
|
plot(ax1,pltData.acc_lat_g(K), pltData.acc_long_g(K),"Color",colors(i,:),"LineStyle","--","LineWidth",2)
|
||||||
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
|
|
||||||
|
|
||||||
% return null (not relevant for plots!)
|
% return null (not relevant for plots!)
|
||||||
outputArg = [];
|
outputArg = [];
|
||||||
|
43
season/FT23/plot_settings/plot_accumulator.m
Normal file
43
season/FT23/plot_settings/plot_accumulator.m
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
function [outputArg] = plot_accumulator(panel, selected_laps, pltData)
|
||||||
|
% create tiledlayout (R2023a and newer)
|
||||||
|
tl = tiledlayout(panel,"vertical");
|
||||||
|
|
||||||
|
% plot 1: speed [km/h]
|
||||||
|
ax1 = nexttile(tl);
|
||||||
|
hold(ax1, "on")
|
||||||
|
grid(ax1, "on")
|
||||||
|
title(ax1, "Speed [km/h]")
|
||||||
|
for i = 1:length(selected_laps)
|
||||||
|
plot(ax1,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).speed_kph)
|
||||||
|
end
|
||||||
|
% plot 2: power [kW]
|
||||||
|
ax2 = nexttile(tl);
|
||||||
|
hold(ax2, "on")
|
||||||
|
grid(ax2, "on")
|
||||||
|
title(ax2, "Power [kW]")
|
||||||
|
for i = 1:length(selected_laps)
|
||||||
|
plot(ax2,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).ams_ptot)
|
||||||
|
end
|
||||||
|
% plot 3: Max Cell Temp [°C]
|
||||||
|
ax3 = nexttile(tl);
|
||||||
|
hold(ax3, "on")
|
||||||
|
grid(ax3, "on")
|
||||||
|
title(ax3, "Max Cell Temp [°C]")
|
||||||
|
for i = 1:length(selected_laps)
|
||||||
|
plot(ax3,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).ams_tmax)
|
||||||
|
end
|
||||||
|
% plot 4: State of charge [%]
|
||||||
|
ax4 = nexttile(tl);
|
||||||
|
hold(ax4, "on")
|
||||||
|
grid(ax4, "on")
|
||||||
|
title(ax4, "SOC")
|
||||||
|
for i = 1:length(selected_laps)
|
||||||
|
plot(ax4,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).ams_soc)
|
||||||
|
end
|
||||||
|
% link all x axes
|
||||||
|
linkaxes([ax1, ax2, ax3, ax4],"x")
|
||||||
|
|
||||||
|
% return null (not relevant for plots!)
|
||||||
|
outputArg = [];
|
||||||
|
end
|
||||||
|
|
59
season/FT23/plot_settings/plot_brakes.m
Normal file
59
season/FT23/plot_settings/plot_brakes.m
Normal file
@ -0,0 +1,59 @@
|
|||||||
|
function [outputArg] = plot_brakes(panel, selected_laps, pltData)
|
||||||
|
% create tiledlayout (R2023a and newer)
|
||||||
|
tl = tiledlayout(panel,"vertical");
|
||||||
|
|
||||||
|
% plot 1: speed
|
||||||
|
ax1 = nexttile(tl);
|
||||||
|
hold(ax1, "on")
|
||||||
|
grid(ax1, "on")
|
||||||
|
title(ax1, "Speed [km/h]")
|
||||||
|
for i = 1:length(selected_laps)
|
||||||
|
plot(ax1,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).speed_kph)
|
||||||
|
end
|
||||||
|
% plot 2: brake pressure front/rear [bar]
|
||||||
|
ax2 = nexttile(tl);
|
||||||
|
hold(ax2, "on")
|
||||||
|
grid(ax2, "on")
|
||||||
|
title(ax2, "Brake Pressure F/R [bar]")
|
||||||
|
for i = 1:length(selected_laps)
|
||||||
|
plot(ax2,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).brakePFront_bar)
|
||||||
|
plot(ax2,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).brakePRear_bar)
|
||||||
|
end
|
||||||
|
legend(ax2, "Front", "Rear")
|
||||||
|
% plot 3: longitudinal acceleration [g]
|
||||||
|
ax3 = nexttile(tl);
|
||||||
|
hold(ax3, "on")
|
||||||
|
grid(ax3, "on")
|
||||||
|
title(ax3, "Long Acc [g]")
|
||||||
|
for i = 1:length(selected_laps)
|
||||||
|
plot(ax3,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).acc_long_g)
|
||||||
|
end
|
||||||
|
% plot 4: Brake Temp [°C]
|
||||||
|
ax4 = nexttile(tl);
|
||||||
|
hold(ax4, "on")
|
||||||
|
grid(ax4, "on")
|
||||||
|
title(ax4, "Brake Temp [°C]")
|
||||||
|
for i = 1:length(selected_laps)
|
||||||
|
plot(ax4,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).brakeTFrontLeft_degC)
|
||||||
|
plot(ax4,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).brakeTFrontRight_degC)
|
||||||
|
plot(ax4,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).brakeTRearLeft_degC)
|
||||||
|
plot(ax4,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).brakeTRearRight_degC)
|
||||||
|
end
|
||||||
|
legend(ax4, "FL", "FR", "RL", "RR")
|
||||||
|
% plot 5: brake bias [%]
|
||||||
|
ax5 = nexttile(tl);
|
||||||
|
hold(ax5, "on")
|
||||||
|
grid(ax5, "on")
|
||||||
|
title(ax5, "Brake Bias [%]")
|
||||||
|
for i = 1:length(selected_laps)
|
||||||
|
plot(ax5,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).brakeBias_perc)
|
||||||
|
end
|
||||||
|
|
||||||
|
% link all x axes
|
||||||
|
linkaxes([ax1, ax2, ax3, ax4, ax5],"x")
|
||||||
|
|
||||||
|
|
||||||
|
% return null (not relevant for plots!)
|
||||||
|
outputArg = [];
|
||||||
|
end
|
||||||
|
|
43
season/FT23/plot_settings/plot_driver_braking.m
Normal file
43
season/FT23/plot_settings/plot_driver_braking.m
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
function [outputArg] = plot_driver_braking(panel, selected_laps, pltData)
|
||||||
|
% create tiledlayout (R2023a and newer)
|
||||||
|
tl = tiledlayout(panel,"vertical");
|
||||||
|
|
||||||
|
% plot 1: speed
|
||||||
|
ax1 = nexttile(tl);
|
||||||
|
hold(ax1, "on")
|
||||||
|
grid(ax1, "on")
|
||||||
|
title(ax1, "Speed [km/h]")
|
||||||
|
for i = 1:length(selected_laps)
|
||||||
|
plot(ax1,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).speed_kph)
|
||||||
|
end
|
||||||
|
% plot 2: accelerator pedal position [%]
|
||||||
|
ax2 = nexttile(tl);
|
||||||
|
hold(ax2, "on")
|
||||||
|
grid(ax2, "on")
|
||||||
|
title(ax2, "APP [%]")
|
||||||
|
for i = 1:length(selected_laps)
|
||||||
|
plot(ax2,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).app_percent)
|
||||||
|
end
|
||||||
|
% plot 3: brake pressure front [bar]
|
||||||
|
ax3 = nexttile(tl);
|
||||||
|
hold(ax3, "on")
|
||||||
|
grid(ax3, "on")
|
||||||
|
title(ax3, "Brake Pressure Front [bar]")
|
||||||
|
for i = 1:length(selected_laps)
|
||||||
|
plot(ax3,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).brakePFront_bar)
|
||||||
|
end
|
||||||
|
% plot 4: longitudinal acceleration [g]
|
||||||
|
ax4 = nexttile(tl);
|
||||||
|
hold(ax4, "on")
|
||||||
|
grid(ax4, "on")
|
||||||
|
title(ax4, "Long Acc [g]")
|
||||||
|
for i = 1:length(selected_laps)
|
||||||
|
plot(ax4,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).acc_long_g)
|
||||||
|
end
|
||||||
|
% link all x axes
|
||||||
|
linkaxes([ax1, ax2, ax3, ax4],"x")
|
||||||
|
|
||||||
|
% return null (not relevant for plots!)
|
||||||
|
outputArg = [];
|
||||||
|
end
|
||||||
|
|
43
season/FT23/plot_settings/plot_driver_general.m
Normal file
43
season/FT23/plot_settings/plot_driver_general.m
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
function [outputArg] = plot_driver_general(panel, selected_laps, pltData)
|
||||||
|
% create tiledlayout (R2023a and newer)
|
||||||
|
tl = tiledlayout(panel,"vertical");
|
||||||
|
|
||||||
|
% plot 1: speed
|
||||||
|
ax1 = nexttile(tl);
|
||||||
|
hold(ax1, "on")
|
||||||
|
grid(ax1, "on")
|
||||||
|
title(ax1, "Speed [km/h]")
|
||||||
|
for i = 1:length(selected_laps)
|
||||||
|
plot(ax1,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).speed_kph)
|
||||||
|
end
|
||||||
|
% plot 2: accelerator pedal position [%]
|
||||||
|
ax2 = nexttile(tl);
|
||||||
|
hold(ax2, "on")
|
||||||
|
grid(ax2, "on")
|
||||||
|
title(ax2, "APP [%]")
|
||||||
|
for i = 1:length(selected_laps)
|
||||||
|
plot(ax2,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).app_percent)
|
||||||
|
end
|
||||||
|
% plot 3: brake pressure front [bar]
|
||||||
|
ax3 = nexttile(tl);
|
||||||
|
hold(ax3, "on")
|
||||||
|
grid(ax3, "on")
|
||||||
|
title(ax3, "Brake Pressure Front [bar]")
|
||||||
|
for i = 1:length(selected_laps)
|
||||||
|
plot(ax3,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).brakePFront_bar)
|
||||||
|
end
|
||||||
|
% plot 4: steering angle [°]
|
||||||
|
ax4 = nexttile(tl);
|
||||||
|
hold(ax4, "on")
|
||||||
|
grid(ax4, "on")
|
||||||
|
title(ax4, "Steering Angle [°]")
|
||||||
|
for i = 1:length(selected_laps)
|
||||||
|
plot(ax4,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).steering_deg)
|
||||||
|
end
|
||||||
|
% link all x axes
|
||||||
|
linkaxes([ax1, ax2, ax3, ax4],"x")
|
||||||
|
|
||||||
|
% return null (not relevant for plots!)
|
||||||
|
outputArg = [];
|
||||||
|
end
|
||||||
|
|
46
season/FT23/plot_settings/plot_driver_statistics.m
Normal file
46
season/FT23/plot_settings/plot_driver_statistics.m
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
function [outputArg] = plot_driver_statistics(panel, selected_laps, pltData)
|
||||||
|
% create tiledlayout (R2023a and newer)
|
||||||
|
tl = tiledlayout(panel,"vertical");
|
||||||
|
|
||||||
|
% plot 1: speed
|
||||||
|
ax1 = nexttile(tl);
|
||||||
|
hold(ax1, "on")
|
||||||
|
grid(ax1, "on")
|
||||||
|
title(ax1, "speed [km/h]")
|
||||||
|
for i = 1:length(selected_laps)
|
||||||
|
plot(ax1,pltData(selected_laps(i)).xAxis,pltData(selected_laps(i)).speed_kph)
|
||||||
|
end
|
||||||
|
% plot 2: accelerator pedal position [%]
|
||||||
|
ax2 = nexttile(tl);
|
||||||
|
hold(ax2, "on")
|
||||||
|
grid(ax2, "on")
|
||||||
|
title(ax2, "APP [%]")
|
||||||
|
for i = 1:length(selected_laps)
|
||||||
|
plot(ax2,pltData(selected_laps(i)).xAxis,pltData(selected_laps(i)).app_percent)
|
||||||
|
end
|
||||||
|
linkaxes([ax1, ax2],"x")
|
||||||
|
% plot 3: accelerator pedal position histogram
|
||||||
|
ax3 = nexttile(tl);
|
||||||
|
hold(ax3, "on")
|
||||||
|
grid(ax3, "on")
|
||||||
|
title(ax3, "APP distribution")
|
||||||
|
ylabel(ax3, "\sigma [%]")
|
||||||
|
xlabel(ax3, "APP [%]")
|
||||||
|
for i = 1:length(selected_laps)
|
||||||
|
histogram(ax3,pltData(selected_laps(i)).app_percent,"Normalization","percentage")
|
||||||
|
end
|
||||||
|
% plot 4: brake pressure histogram
|
||||||
|
ax4 = nexttile(tl);
|
||||||
|
hold(ax4, "on")
|
||||||
|
grid(ax4, "on")
|
||||||
|
title(ax4, "BrakeP distribution")
|
||||||
|
ylabel(ax4, "\sigma [%]")
|
||||||
|
xlabel(ax4, "Brake Pressure Front [bar]")
|
||||||
|
for i = 1:length(selected_laps)
|
||||||
|
histogram(ax4,pltData(selected_laps(i)).brakePFront_bar,"Normalization","percentage")
|
||||||
|
end
|
||||||
|
|
||||||
|
% return null (not relevant for plots!)
|
||||||
|
outputArg = [];
|
||||||
|
end
|
||||||
|
|
42
season/FT23/plot_settings/plot_driver_steering.m
Normal file
42
season/FT23/plot_settings/plot_driver_steering.m
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
function [outputArg] = plot_driver_steering(panel, selected_laps, pltData)
|
||||||
|
% create tiledlayout (R2023a and newer)
|
||||||
|
tl = tiledlayout(panel,"vertical");
|
||||||
|
|
||||||
|
% plot 1: speed
|
||||||
|
ax1 = nexttile(tl);
|
||||||
|
hold(ax1, "on")
|
||||||
|
grid(ax1, "on")
|
||||||
|
title(ax1, "Speed [km/h]")
|
||||||
|
for i = 1:length(selected_laps)
|
||||||
|
plot(ax1,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).speed_kph)
|
||||||
|
end
|
||||||
|
% plot 2: steering angle [°]
|
||||||
|
ax2 = nexttile(tl);
|
||||||
|
hold(ax2, "on")
|
||||||
|
grid(ax2, "on")
|
||||||
|
title(ax2, "Steering Angle [°]")
|
||||||
|
for i = 1:length(selected_laps)
|
||||||
|
plot(ax2,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).steering_deg)
|
||||||
|
end
|
||||||
|
% plot 3: oversteer
|
||||||
|
ax3 = nexttile(tl);
|
||||||
|
hold(ax3, "on")
|
||||||
|
grid(ax3, "on")
|
||||||
|
title(ax3, "Oversteer")
|
||||||
|
% TODO!!
|
||||||
|
|
||||||
|
% plot 4: lateral acceleration [g]
|
||||||
|
ax4 = nexttile(tl);
|
||||||
|
hold(ax4, "on")
|
||||||
|
grid(ax4, "on")
|
||||||
|
title(ax4, "Lateral Acc [g]")
|
||||||
|
for i = 1:length(selected_laps)
|
||||||
|
plot(ax4,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).acc_lat_g)
|
||||||
|
end
|
||||||
|
% link all x axes
|
||||||
|
linkaxes([ax1, ax2, ax3, ax4],"x")
|
||||||
|
|
||||||
|
% return null (not relevant for plots!)
|
||||||
|
outputArg = [];
|
||||||
|
end
|
||||||
|
|
60
season/FT23/plot_settings/plot_inverter.m
Normal file
60
season/FT23/plot_settings/plot_inverter.m
Normal file
@ -0,0 +1,60 @@
|
|||||||
|
function [outputArg] = plot_inverter(panel, selected_laps, pltData)
|
||||||
|
% create tiledlayout (R2023a and newer)
|
||||||
|
tl = tiledlayout(panel,"vertical");
|
||||||
|
|
||||||
|
% plot 1: speed [km/h]
|
||||||
|
ax1 = nexttile(tl);
|
||||||
|
hold(ax1, "on")
|
||||||
|
grid(ax1, "on")
|
||||||
|
title(ax1, "Speed [km/h]")
|
||||||
|
for i = 1:length(selected_laps)
|
||||||
|
plot(ax1,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).speed_kph)
|
||||||
|
end
|
||||||
|
% plot 2: Inverter Temps [°C]
|
||||||
|
ax2 = nexttile(tl);
|
||||||
|
hold(ax2, "on")
|
||||||
|
grid(ax2, "on")
|
||||||
|
title(ax2, "Inverter Temp [°C]")
|
||||||
|
for i = 1:length(selected_laps)
|
||||||
|
plot(ax2,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).invL_temp)
|
||||||
|
plot(ax2,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).invR_temp)
|
||||||
|
end
|
||||||
|
legend(ax2, "Left", "Right")
|
||||||
|
% plot 3: Torque request / actual inverter left
|
||||||
|
ax3 = nexttile(tl);
|
||||||
|
hold(ax3, "on")
|
||||||
|
grid(ax3, "on")
|
||||||
|
title(ax3, "Left Torque")
|
||||||
|
for i = 1:length(selected_laps)
|
||||||
|
plot(ax3,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).invL_torqueDemand)
|
||||||
|
plot(ax3,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).invL_torqueActual)
|
||||||
|
end
|
||||||
|
legend(ax3, "Demand", "Actual")
|
||||||
|
% plot 4: Torque request / actual inverter right
|
||||||
|
ax4 = nexttile(tl);
|
||||||
|
hold(ax4, "on")
|
||||||
|
grid(ax4, "on")
|
||||||
|
title(ax4, "Right Torque")
|
||||||
|
for i = 1:length(selected_laps)
|
||||||
|
plot(ax4,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).invR_torqueDemand)
|
||||||
|
plot(ax4,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).invR_torqueActual)
|
||||||
|
end
|
||||||
|
legend(ax4, "Demand", "Actual")
|
||||||
|
% plot 5: Motor velocities
|
||||||
|
ax5 = nexttile(tl);
|
||||||
|
hold(ax5, "on")
|
||||||
|
grid(ax5, "on")
|
||||||
|
title(ax5, "Motor Velocities [1/min]")
|
||||||
|
for i = 1:length(selected_laps)
|
||||||
|
plot(ax5,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).motL_vel_rpm)
|
||||||
|
plot(ax5,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).motR_vel_rpm)
|
||||||
|
end
|
||||||
|
legend(ax5, "Left", "Right")
|
||||||
|
|
||||||
|
% link all x axes
|
||||||
|
linkaxes([ax1, ax2, ax3, ax4, ax5],"x")
|
||||||
|
|
||||||
|
% return null (not relevant for plots!)
|
||||||
|
outputArg = [];
|
||||||
|
end
|
||||||
|
|
58
season/FT23/plot_settings/plot_powertrain.m
Normal file
58
season/FT23/plot_settings/plot_powertrain.m
Normal file
@ -0,0 +1,58 @@
|
|||||||
|
function [outputArg] = plot_powertrain(panel, selected_laps, pltData)
|
||||||
|
% create tiledlayout (R2023a and newer)
|
||||||
|
tl = tiledlayout(panel,"vertical");
|
||||||
|
|
||||||
|
% plot 1: speed [km/h]
|
||||||
|
ax1 = nexttile(tl);
|
||||||
|
hold(ax1, "on")
|
||||||
|
grid(ax1, "on")
|
||||||
|
title(ax1, "Speed [km/h]")
|
||||||
|
for i = 1:length(selected_laps)
|
||||||
|
plot(ax1,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).speed_kph)
|
||||||
|
end
|
||||||
|
% plot 2: power [kW]
|
||||||
|
ax2 = nexttile(tl);
|
||||||
|
hold(ax2, "on")
|
||||||
|
grid(ax2, "on")
|
||||||
|
title(ax2, "Power [kW]")
|
||||||
|
for i = 1:length(selected_laps)
|
||||||
|
plot(ax2,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).ams_ptot)
|
||||||
|
end
|
||||||
|
% plot 3: Inverter Temps [°C]
|
||||||
|
ax3 = nexttile(tl);
|
||||||
|
hold(ax3, "on")
|
||||||
|
grid(ax3, "on")
|
||||||
|
title(ax3, "Inverter Temp [°C]")
|
||||||
|
for i = 1:length(selected_laps)
|
||||||
|
plot(ax3,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).invL_temp)
|
||||||
|
plot(ax3,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).invR_temp)
|
||||||
|
end
|
||||||
|
legend(ax3, "Left", "Right")
|
||||||
|
% plot 4: Motor Temps
|
||||||
|
ax4 = nexttile(tl);
|
||||||
|
hold(ax4, "on")
|
||||||
|
grid(ax4, "on")
|
||||||
|
title(ax4, "Motor Temp [°C]")
|
||||||
|
for i = 1:length(selected_laps)
|
||||||
|
plot(ax4,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).motL_temp)
|
||||||
|
plot(ax4,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).motR_temp)
|
||||||
|
end
|
||||||
|
legend(ax4, "Left", "Right")
|
||||||
|
% plot 5: Motor velocities
|
||||||
|
ax5 = nexttile(tl);
|
||||||
|
hold(ax5, "on")
|
||||||
|
grid(ax5, "on")
|
||||||
|
title(ax5, "Motor Velocities [1/min]")
|
||||||
|
for i = 1:length(selected_laps)
|
||||||
|
plot(ax5,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).motL_vel_rpm)
|
||||||
|
plot(ax5,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).motR_vel_rpm)
|
||||||
|
end
|
||||||
|
legend(ax5, "Left", "Right")
|
||||||
|
|
||||||
|
% link all x axes
|
||||||
|
linkaxes([ax1, ax2, ax3, ax4, ax5],"x")
|
||||||
|
|
||||||
|
% return null (not relevant for plots!)
|
||||||
|
outputArg = [];
|
||||||
|
end
|
||||||
|
|
41
season/FT23/plot_settings/plot_suspension_histogram.m
Normal file
41
season/FT23/plot_settings/plot_suspension_histogram.m
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
function [outputArg] = plot_suspension_histogram(panel, selected_laps, pltData)
|
||||||
|
% create tiledlayout (R2023a and newer)
|
||||||
|
tl = tiledlayout(panel,"vertical");
|
||||||
|
% plot 1: position heave front [mm/s]
|
||||||
|
ax1 = nexttile(tl);
|
||||||
|
hold(ax1, "on")
|
||||||
|
grid(ax1, "on")
|
||||||
|
title(ax1, "Heave Front [mm/s]")
|
||||||
|
for i = 1:length(selected_laps)
|
||||||
|
histogram(ax1, pltData(selected_laps(i)).velocityHeaveFront_mmps,"Normalization","percentage")
|
||||||
|
end
|
||||||
|
% plot 2: position roll front [mm/s]
|
||||||
|
ax2 = nexttile(tl);
|
||||||
|
hold(ax2, "on")
|
||||||
|
grid(ax2, "on")
|
||||||
|
title(ax2, "Roll Front [mm/s]")
|
||||||
|
for i = 1:length(selected_laps)
|
||||||
|
histogram(ax2, pltData(selected_laps(i)).velocityHeaveFront_mmps,"Normalization","percentage")
|
||||||
|
end
|
||||||
|
% plot 3: position heave front [mm/s]
|
||||||
|
ax3 = nexttile(tl);
|
||||||
|
hold(ax3, "on")
|
||||||
|
grid(ax3, "on")
|
||||||
|
title(ax3, "Heave Rear [mm/s]")
|
||||||
|
for i = 1:length(selected_laps)
|
||||||
|
histogram(ax3, pltData(selected_laps(i)).velocityHeaveFront_mmps,"Normalization","percentage")
|
||||||
|
end
|
||||||
|
% plot 4: position roll front [mm/s]
|
||||||
|
ax4 = nexttile(tl);
|
||||||
|
hold(ax4, "on")
|
||||||
|
grid(ax4, "on")
|
||||||
|
title(ax4, "Roll Rear [mm/s]")
|
||||||
|
for i = 1:length(selected_laps)
|
||||||
|
histogram(ax4, pltData(selected_laps(i)).velocityHeaveFront_mmps,"Normalization","percentage")
|
||||||
|
end
|
||||||
|
linkaxes([ax1, ax2, ax3, ax4],"x")
|
||||||
|
|
||||||
|
% return null (not relevant for plots!)
|
||||||
|
outputArg = [];
|
||||||
|
end
|
||||||
|
|
41
season/FT23/plot_settings/plot_suspension_positions.m
Normal file
41
season/FT23/plot_settings/plot_suspension_positions.m
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
function [outputArg] = plot_suspension_positions(panel, selected_laps, pltData)
|
||||||
|
% create tiledlayout (R2023a and newer)
|
||||||
|
tl = tiledlayout(panel,"vertical");
|
||||||
|
% plot 1: position heave front [mm]
|
||||||
|
ax1 = nexttile(tl);
|
||||||
|
hold(ax1, "on")
|
||||||
|
grid(ax1, "on")
|
||||||
|
title(ax1, "Heave Front [mm]")
|
||||||
|
for i = 1:length(selected_laps)
|
||||||
|
plot(ax1, pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).damperHeaveFront_mm)
|
||||||
|
end
|
||||||
|
% plot 2: position roll front [mm]
|
||||||
|
ax2 = nexttile(tl);
|
||||||
|
hold(ax2, "on")
|
||||||
|
grid(ax2, "on")
|
||||||
|
title(ax2, "Roll Front [mm]")
|
||||||
|
for i = 1:length(selected_laps)
|
||||||
|
plot(ax2, pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).damperRollFront_mm)
|
||||||
|
end
|
||||||
|
% plot 3: position heave front [mm]
|
||||||
|
ax3 = nexttile(tl);
|
||||||
|
hold(ax3, "on")
|
||||||
|
grid(ax3, "on")
|
||||||
|
title(ax3, "Heave Rear [mm]")
|
||||||
|
for i = 1:length(selected_laps)
|
||||||
|
plot(ax3, pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).damperHeaveRear_mm)
|
||||||
|
end
|
||||||
|
% plot 4: position roll front [mm]
|
||||||
|
ax4 = nexttile(tl);
|
||||||
|
hold(ax4, "on")
|
||||||
|
grid(ax4, "on")
|
||||||
|
title(ax4, "Roll Rear [mm]")
|
||||||
|
for i = 1:length(selected_laps)
|
||||||
|
plot(ax4, pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).damperRollRear_mm)
|
||||||
|
end
|
||||||
|
linkaxes([ax1, ax2, ax3, ax4],"x")
|
||||||
|
|
||||||
|
% return null (not relevant for plots!)
|
||||||
|
outputArg = [];
|
||||||
|
end
|
||||||
|
|
41
season/FT23/plot_settings/plot_suspension_velocities.m
Normal file
41
season/FT23/plot_settings/plot_suspension_velocities.m
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
function [outputArg] = plot_suspension_velocities(panel, selected_laps, pltData)
|
||||||
|
% create tiledlayout (R2023a and newer)
|
||||||
|
tl = tiledlayout(panel,"vertical");
|
||||||
|
% plot 1: velocity heave front [mm/s]
|
||||||
|
ax1 = nexttile(tl);
|
||||||
|
hold(ax1, "on")
|
||||||
|
grid(ax1, "on")
|
||||||
|
title(ax1, "Heave Front [mm/s]")
|
||||||
|
for i = 1:length(selected_laps)
|
||||||
|
plot(ax1, pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).velocityHeaveFront_mmps)
|
||||||
|
end
|
||||||
|
% plot 2: velocity roll front [mm/s]
|
||||||
|
ax2 = nexttile(tl);
|
||||||
|
hold(ax2, "on")
|
||||||
|
grid(ax2, "on")
|
||||||
|
title(ax2, "Roll Front [mm/s]")
|
||||||
|
for i = 1:length(selected_laps)
|
||||||
|
plot(ax2, pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).velocityRollFront_mmps)
|
||||||
|
end
|
||||||
|
% plot 3: velocity heave front [mm/s]
|
||||||
|
ax3 = nexttile(tl);
|
||||||
|
hold(ax3, "on")
|
||||||
|
grid(ax3, "on")
|
||||||
|
title(ax3, "Heave Rear [mm/s]")
|
||||||
|
for i = 1:length(selected_laps)
|
||||||
|
plot(ax3, pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).velocityHeaveRear_mmps)
|
||||||
|
end
|
||||||
|
% plot 4: velocity roll front [mm/s]
|
||||||
|
ax4 = nexttile(tl);
|
||||||
|
hold(ax4, "on")
|
||||||
|
grid(ax4, "on")
|
||||||
|
title(ax4, "Roll Rear [mm/s]")
|
||||||
|
for i = 1:length(selected_laps)
|
||||||
|
plot(ax4, pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).velocityRollRear_mmps)
|
||||||
|
end
|
||||||
|
linkaxes([ax1, ax2, ax3, ax4],"x")
|
||||||
|
|
||||||
|
% return null (not relevant for plots!)
|
||||||
|
outputArg = [];
|
||||||
|
end
|
||||||
|
|
24
season/FT23/plot_settings/plot_tires_firctionCircle.m
Normal file
24
season/FT23/plot_settings/plot_tires_firctionCircle.m
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
function [outputArg] = plot_tires_firctionCircle(panel, selected_laps, pltData)
|
||||||
|
% create tiledlayout (R2023a and newer)
|
||||||
|
|
||||||
|
tl = tiledlayout(panel,"flow");
|
||||||
|
|
||||||
|
ax1 = nexttile(tl);
|
||||||
|
hold(ax1, "on")
|
||||||
|
grid(ax1, "on")
|
||||||
|
title(ax1, "Friction Circle")
|
||||||
|
ylabel(ax1, "Longitudinal Acc [g]")
|
||||||
|
xlabel(ax1, "Lateral Acc [g]")
|
||||||
|
colors = colororder(ax1);
|
||||||
|
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
|
||||||
|
|
||||||
|
% return null (not relevant for plots!)
|
||||||
|
outputArg = [];
|
||||||
|
end
|
||||||
|
|
21
season/FT23/plot_settings/sidebar_stats.m
Normal file
21
season/FT23/plot_settings/sidebar_stats.m
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
function [sidebarLabel] = sidebar_stats(pltData)
|
||||||
|
%SIDEBAR_STATS Summary of this function goes here
|
||||||
|
% Detailed explanation goes here
|
||||||
|
sidebarLabel = sprintf(...
|
||||||
|
"Statistics:\nEnergy\n Used: %.2f kWh\n" + ...
|
||||||
|
" Regen: %.2f kWh\n" + ...
|
||||||
|
" Total: %.2f kWh\n" + ...
|
||||||
|
"\nPower\n Peak: %.1f kW\n" + ...
|
||||||
|
" Peak (mean): %1.f kW\n" + ...
|
||||||
|
"\nDistance: %.2f km\n" + ...
|
||||||
|
"\nTopspeed: %.1f km/h\n", ...
|
||||||
|
pltData.energy_used_kwh, ...
|
||||||
|
pltData.energy_regen_kwh, ...
|
||||||
|
pltData.energy_kwh, ...
|
||||||
|
pltData.peakPower_kw, ...
|
||||||
|
pltData.peakPowerMean_kw, ...
|
||||||
|
pltData.distanceTotal_km, ...
|
||||||
|
pltData.maxSpeed_kph ...
|
||||||
|
);
|
||||||
|
end
|
||||||
|
|
122
season/FT23/sortdata.m
Normal file
122
season/FT23/sortdata.m
Normal file
@ -0,0 +1,122 @@
|
|||||||
|
function [pltData] = sortdata(data,start,stop)
|
||||||
|
date = dateshift(data.Time(1),'start','day');
|
||||||
|
time_hms = data.Time-date;
|
||||||
|
time_s = seconds(time_hms);
|
||||||
|
time_s = time_s - time_s(1); % set beginning of session to 0
|
||||||
|
|
||||||
|
% x-Axis:
|
||||||
|
pltData.time_s = time_s(start:stop)-time_s(start);
|
||||||
|
pltData.time_hms = time_hms(start:stop);
|
||||||
|
|
||||||
|
% distance calculation
|
||||||
|
speed_mps = movmean(data.ABX_Driver_ABX_Speed(start:stop),50); % TODO: test different speed filters for distance calculation
|
||||||
|
pltData.distance(1) = 0;
|
||||||
|
for i = 2:length(speed_mps)
|
||||||
|
pltData.distance(i) = speed_mps(i)*(pltData.time_s(i)-pltData.time_s(i-1)) + pltData.distance(i-1);
|
||||||
|
end
|
||||||
|
pltData.xAxis = pltData.time_s; % set time as default x-Axis for plotting
|
||||||
|
|
||||||
|
%% Misc
|
||||||
|
pltData.app_percent = data.ABX_Driver_ABX_APPS_percent(start:stop);
|
||||||
|
pltData.speed_kph = 3.6*movmean(data.ABX_Driver_ABX_Speed(start:stop),50); % same filter as for distance calculation ???
|
||||||
|
pltData.steering_deg = data.ABX_Driver_ABX_Steering_Angle(start:stop);
|
||||||
|
|
||||||
|
%% AMS:
|
||||||
|
pltData.ams_soc = data.AMS_Status_SOC(start:stop);
|
||||||
|
pltData.ams_tmax = data.AMS_Status_Max_cell_temp(start:stop);
|
||||||
|
pltData.ams_utot = data.Shunt_Voltage1_Shunt_Voltage1(start:stop);
|
||||||
|
pltData.ams_itot = data.Shunt_Current_Shunt_Current(start:stop);
|
||||||
|
% calculations:
|
||||||
|
pltData.ams_ptot = pltData.ams_utot.*pltData.ams_itot/1000;
|
||||||
|
|
||||||
|
%% Brakes
|
||||||
|
% brake pressure
|
||||||
|
pltData.brakePFront_bar = data.ABX_Driver_ABX_BrakeP_F(start:stop);
|
||||||
|
pltData.brakePRear_bar = data.ABX_Driver_ABX_BrakeP_R(start:stop);
|
||||||
|
% brake disc temperatures
|
||||||
|
pltData.brakeTFrontLeft_degC = data.ABX_BrakeT_ABX_BrakeT_FL(start:stop);
|
||||||
|
pltData.brakeTFrontRight_degC = data.ABX_BrakeT_ABX_BrakeT_FR(start:stop);
|
||||||
|
pltData.brakeTRearLeft_degC = data.ABX_BrakeT_ABX_BrakeT_RL(start:stop);
|
||||||
|
pltData.brakeTRearRight_degC = data.ABX_BrakeT_ABX_BrakeT_RR(start:stop);
|
||||||
|
% calculate brake bias [%]
|
||||||
|
minBrakeP = 5; % minimum brake pressure to avoid artifacts due to sensor noise near 0 bar
|
||||||
|
brakePFront = pltData.brakePFront_bar;
|
||||||
|
brakePFront(brakePFront < minBrakeP) = minBrakeP;
|
||||||
|
brakePRear = pltData.brakePRear_bar;
|
||||||
|
brakePRear(brakePRear < minBrakeP) = minBrakeP;
|
||||||
|
pltData.brakeBias_perc = 100*brakePFront./brakePRear; % check calculation!
|
||||||
|
|
||||||
|
%% Cooling system
|
||||||
|
|
||||||
|
%% Dampers
|
||||||
|
% damper positions
|
||||||
|
pltData.damper_FL_mm = data.ABX_Dampers_ABX_Damper_FL(start:stop); %Heave_F
|
||||||
|
pltData.damper_FR_mm = data.ABX_Dampers_ABX_Damper_FR(start:stop); %Roll_F
|
||||||
|
pltData.damper_RL_mm = data.ABX_Dampers_ABX_Damper_RL(start:stop); %Heave_R
|
||||||
|
pltData.damper_RR_mm = data.ABX_Dampers_ABX_Damper_RR(start:stop); %Roll_R
|
||||||
|
% calculate damper velocities
|
||||||
|
pltData.velocity_FL_mmps(1) = 0;
|
||||||
|
pltData.velocity_FR_mmps(1) = 0;
|
||||||
|
pltData.velocity_RL_mmps(1) = 0;
|
||||||
|
pltData.velocity_RR_mmps(1) = 0;
|
||||||
|
for i = 2:length(pltData.time_s)
|
||||||
|
timestep = pltData.time_s(i)-pltData.time_s(i-1);
|
||||||
|
pltData.velocity_FL_mmps(i) = pltData.damper_FL_mm(i)-pltData.damper_FL_mm(i-1)/timestep;
|
||||||
|
pltData.velocity_FR_mmps(i) = pltData.damper_FR_mm(i)-pltData.damper_FR_mm(i-1)/timestep;
|
||||||
|
pltData.velocity_RL_mmps(i) = pltData.damper_RL_mm(i)-pltData.damper_RL_mm(i-1)/timestep;
|
||||||
|
pltData.velocity_RR_mmps(i) = pltData.damper_RR_mm(i)-pltData.damper_RR_mm(i-1)/timestep;
|
||||||
|
end
|
||||||
|
% filter damper velocities ??? bessere Berechnung über mittelwert aus mehreren werten? Vorfilterung?
|
||||||
|
pltData.velocity_FL_mmps = movmean(pltData.velocity_FL_mmps,100);
|
||||||
|
pltData.velocity_FR_mmps = movmean(pltData.velocity_FR_mmps,100);
|
||||||
|
pltData.velocity_RL_mmps = movmean(pltData.velocity_RL_mmps,100);
|
||||||
|
pltData.velocity_RR_mmps = movmean(pltData.velocity_RR_mmps,100);
|
||||||
|
|
||||||
|
%% IMU
|
||||||
|
% Acceleration
|
||||||
|
% pltData.acc_long_g = movmean(data.XSens_Acceleration_XSens_accX(start:stop),100)/9.81;
|
||||||
|
% pltData.acc_lat_g = movmean(data.XSens_Acceleration_XSens_accY(start:stop),100)/9.81;
|
||||||
|
% Rate of turn
|
||||||
|
% pltData.rot_roll_degps = movmean(data.XSens_RateOfTurn_XSens_gyrX(start:stop),100);
|
||||||
|
% pltData.rot_pitch_degps = movmean(data.XSens_RateOfTurn_XSens_gyrY(start:stop),100);
|
||||||
|
% pltData.rot_yaw_degps = movmean(data.XSens_RateOfTurn_XSens_gyrZ(start:stop),100);
|
||||||
|
|
||||||
|
%% Inverters
|
||||||
|
% inverter temperatures
|
||||||
|
pltData.invL_temp = data.INV_L_TxPDO_1_T_Inv_L(start:stop);
|
||||||
|
pltData.invR_temp = data.INV_R_TxPDO_1_T_Inv_R(start:stop);
|
||||||
|
% motor temperatures
|
||||||
|
pltData.motL_temp = data.INV_L_TxPDO_1_T_Mot_L(start:stop);
|
||||||
|
pltData.motR_temp = data.INV_R_TxPDO_1_T_Mot_R(start:stop);
|
||||||
|
% motor velocities
|
||||||
|
pltData.motL_vel_rpm = 60*data.INV_L_TxPDO_4_Velocity_L(start:stop);
|
||||||
|
pltData.motR_vel_rpm = 60*data.INV_R_TxPDO_4_Velocity_R(start:stop);
|
||||||
|
% inverter torque demand
|
||||||
|
pltData.invL_torqueDemand = data.INV_L_TxPDO_3_DemandedTorque_L(start:stop)/10; % /10 to match autobox torque
|
||||||
|
pltData.invR_torqueDemand = data.INV_R_TxPDO_3_DemandedTorque_R(start:stop)/10;
|
||||||
|
% inverter actual torque
|
||||||
|
pltData.invL_torqueActual = data.INV_L_TxPDO_3_ActualTorque_L(start:stop)/10;
|
||||||
|
pltData.invR_torqueActual = data.INV_R_TxPDO_3_ActualTorque_R(start:stop)/10;
|
||||||
|
|
||||||
|
%% Wheelspeed
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
%% Statistics:
|
||||||
|
power_regen_kw = pltData.ams_ptot;
|
||||||
|
power_regen_kw(power_regen_kw > 0) = 0;
|
||||||
|
power_used_kw = pltData.ams_ptot;
|
||||||
|
power_used_kw(power_used_kw < 0) = 0;
|
||||||
|
pltData.energy_kwh = trapz(pltData.time_s, pltData.ams_ptot)/3600;
|
||||||
|
pltData.energy_regen_kwh = trapz(pltData.time_s, power_regen_kw)/3600;
|
||||||
|
pltData.energy_used_kwh = trapz(pltData.time_s, power_used_kw)/3600;
|
||||||
|
pltData.distanceTotal_km = trapz(pltData.time_s, pltData.speed_kph./3.6)/1000; % 1/3.6 for km/h to m/s and /1000 for km output
|
||||||
|
pltData.peakPower_kw = max(pltData.ams_ptot);
|
||||||
|
pltData.peakPowerMean_kw = max(movmean(pltData.ams_ptot,500));
|
||||||
|
|
||||||
|
pltData.maxSpeed_kph = max(pltData.speed_kph);
|
||||||
|
pltData.startTime = time_hms(start);
|
||||||
|
pltData.stopTime = time_hms(stop);
|
||||||
|
end
|
||||||
|
|
43
season/FT24/plot_settings/plot_accumulator.m
Normal file
43
season/FT24/plot_settings/plot_accumulator.m
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
function [outputArg] = plot_accumulator(panel, selected_laps, pltData)
|
||||||
|
% create tiledlayout (R2023a and newer)
|
||||||
|
tl = tiledlayout(panel,"vertical");
|
||||||
|
|
||||||
|
% plot 1: speed [km/h]
|
||||||
|
ax1 = nexttile(tl);
|
||||||
|
hold(ax1, "on")
|
||||||
|
grid(ax1, "on")
|
||||||
|
title(ax1, "Speed [km/h]")
|
||||||
|
for i = 1:length(selected_laps)
|
||||||
|
plot(ax1,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).speed_kph)
|
||||||
|
end
|
||||||
|
% plot 2: power [kW]
|
||||||
|
ax2 = nexttile(tl);
|
||||||
|
hold(ax2, "on")
|
||||||
|
grid(ax2, "on")
|
||||||
|
title(ax2, "Power [kW]")
|
||||||
|
for i = 1:length(selected_laps)
|
||||||
|
plot(ax2,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).ams_ptot)
|
||||||
|
end
|
||||||
|
% plot 3: Max Cell Temp [°C]
|
||||||
|
ax3 = nexttile(tl);
|
||||||
|
hold(ax3, "on")
|
||||||
|
grid(ax3, "on")
|
||||||
|
title(ax3, "Max Cell Temp [°C]")
|
||||||
|
for i = 1:length(selected_laps)
|
||||||
|
plot(ax3,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).ams_tmax)
|
||||||
|
end
|
||||||
|
% plot 4: State of charge [%]
|
||||||
|
ax4 = nexttile(tl);
|
||||||
|
hold(ax4, "on")
|
||||||
|
grid(ax4, "on")
|
||||||
|
title(ax4, "SOC")
|
||||||
|
for i = 1:length(selected_laps)
|
||||||
|
plot(ax4,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).ams_soc)
|
||||||
|
end
|
||||||
|
% link all x axes
|
||||||
|
linkaxes([ax1, ax2, ax3, ax4],"x")
|
||||||
|
|
||||||
|
% return null (not relevant for plots!)
|
||||||
|
outputArg = [];
|
||||||
|
end
|
||||||
|
|
59
season/FT24/plot_settings/plot_brakes.m
Normal file
59
season/FT24/plot_settings/plot_brakes.m
Normal file
@ -0,0 +1,59 @@
|
|||||||
|
function [outputArg] = plot_brakes(panel, selected_laps, pltData)
|
||||||
|
% create tiledlayout (R2023a and newer)
|
||||||
|
tl = tiledlayout(panel,"vertical");
|
||||||
|
|
||||||
|
% plot 1: speed
|
||||||
|
ax1 = nexttile(tl);
|
||||||
|
hold(ax1, "on")
|
||||||
|
grid(ax1, "on")
|
||||||
|
title(ax1, "Speed [km/h]")
|
||||||
|
for i = 1:length(selected_laps)
|
||||||
|
plot(ax1,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).speed_kph)
|
||||||
|
end
|
||||||
|
% plot 2: brake pressure front/rear [bar]
|
||||||
|
ax2 = nexttile(tl);
|
||||||
|
hold(ax2, "on")
|
||||||
|
grid(ax2, "on")
|
||||||
|
title(ax2, "Brake Pressure F/R [bar]")
|
||||||
|
for i = 1:length(selected_laps)
|
||||||
|
plot(ax2,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).brakePFront_bar)
|
||||||
|
plot(ax2,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).brakePRear_bar)
|
||||||
|
end
|
||||||
|
legend(ax2, "Front", "Rear")
|
||||||
|
% plot 3: longitudinal acceleration [g]
|
||||||
|
ax3 = nexttile(tl);
|
||||||
|
hold(ax3, "on")
|
||||||
|
grid(ax3, "on")
|
||||||
|
title(ax3, "Long Acc [g]")
|
||||||
|
for i = 1:length(selected_laps)
|
||||||
|
plot(ax3,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).acc_long_g)
|
||||||
|
end
|
||||||
|
% plot 4: Brake Temp [°C]
|
||||||
|
ax4 = nexttile(tl);
|
||||||
|
hold(ax4, "on")
|
||||||
|
grid(ax4, "on")
|
||||||
|
title(ax4, "Brake Temp [°C]")
|
||||||
|
for i = 1:length(selected_laps)
|
||||||
|
plot(ax4,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).brakeTFrontLeft_degC)
|
||||||
|
plot(ax4,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).brakeTFrontRight_degC)
|
||||||
|
plot(ax4,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).brakeTRearLeft_degC)
|
||||||
|
plot(ax4,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).brakeTRearRight_degC)
|
||||||
|
end
|
||||||
|
legend(ax4, "FL", "FR", "RL", "RR")
|
||||||
|
% plot 5: brake bias [%]
|
||||||
|
ax5 = nexttile(tl);
|
||||||
|
hold(ax5, "on")
|
||||||
|
grid(ax5, "on")
|
||||||
|
title(ax5, "Brake Bias [%]")
|
||||||
|
for i = 1:length(selected_laps)
|
||||||
|
plot(ax5,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).brakeBias_perc)
|
||||||
|
end
|
||||||
|
|
||||||
|
% link all x axes
|
||||||
|
linkaxes([ax1, ax2, ax3, ax4, ax5],"x")
|
||||||
|
|
||||||
|
|
||||||
|
% return null (not relevant for plots!)
|
||||||
|
outputArg = [];
|
||||||
|
end
|
||||||
|
|
43
season/FT24/plot_settings/plot_driver_braking.m
Normal file
43
season/FT24/plot_settings/plot_driver_braking.m
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
function [outputArg] = plot_driver_braking(panel, selected_laps, pltData)
|
||||||
|
% create tiledlayout (R2023a and newer)
|
||||||
|
tl = tiledlayout(panel,"vertical");
|
||||||
|
|
||||||
|
% plot 1: speed
|
||||||
|
ax1 = nexttile(tl);
|
||||||
|
hold(ax1, "on")
|
||||||
|
grid(ax1, "on")
|
||||||
|
title(ax1, "Speed [km/h]")
|
||||||
|
for i = 1:length(selected_laps)
|
||||||
|
plot(ax1,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).speed_kph)
|
||||||
|
end
|
||||||
|
% plot 2: accelerator pedal position [%]
|
||||||
|
ax2 = nexttile(tl);
|
||||||
|
hold(ax2, "on")
|
||||||
|
grid(ax2, "on")
|
||||||
|
title(ax2, "APP [%]")
|
||||||
|
for i = 1:length(selected_laps)
|
||||||
|
plot(ax2,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).app_percent)
|
||||||
|
end
|
||||||
|
% plot 3: brake pressure front [bar]
|
||||||
|
ax3 = nexttile(tl);
|
||||||
|
hold(ax3, "on")
|
||||||
|
grid(ax3, "on")
|
||||||
|
title(ax3, "Brake Pressure Front [bar]")
|
||||||
|
for i = 1:length(selected_laps)
|
||||||
|
plot(ax3,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).brakePFront_bar)
|
||||||
|
end
|
||||||
|
% plot 4: longitudinal acceleration [g]
|
||||||
|
ax4 = nexttile(tl);
|
||||||
|
hold(ax4, "on")
|
||||||
|
grid(ax4, "on")
|
||||||
|
title(ax4, "Long Acc [g]")
|
||||||
|
for i = 1:length(selected_laps)
|
||||||
|
plot(ax4,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).acc_long_g)
|
||||||
|
end
|
||||||
|
% link all x axes
|
||||||
|
linkaxes([ax1, ax2, ax3, ax4],"x")
|
||||||
|
|
||||||
|
% return null (not relevant for plots!)
|
||||||
|
outputArg = [];
|
||||||
|
end
|
||||||
|
|
43
season/FT24/plot_settings/plot_driver_general.m
Normal file
43
season/FT24/plot_settings/plot_driver_general.m
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
function [outputArg] = plot_driver_general(panel, selected_laps, pltData)
|
||||||
|
% create tiledlayout (R2023a and newer)
|
||||||
|
tl = tiledlayout(panel,"vertical");
|
||||||
|
|
||||||
|
% plot 1: speed
|
||||||
|
ax1 = nexttile(tl);
|
||||||
|
hold(ax1, "on")
|
||||||
|
grid(ax1, "on")
|
||||||
|
title(ax1, "Speed [km/h]")
|
||||||
|
for i = 1:length(selected_laps)
|
||||||
|
plot(ax1,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).speed_kph)
|
||||||
|
end
|
||||||
|
% plot 2: accelerator pedal position [%]
|
||||||
|
ax2 = nexttile(tl);
|
||||||
|
hold(ax2, "on")
|
||||||
|
grid(ax2, "on")
|
||||||
|
title(ax2, "APP [%]")
|
||||||
|
for i = 1:length(selected_laps)
|
||||||
|
plot(ax2,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).app_percent)
|
||||||
|
end
|
||||||
|
% plot 3: brake pressure front [bar]
|
||||||
|
ax3 = nexttile(tl);
|
||||||
|
hold(ax3, "on")
|
||||||
|
grid(ax3, "on")
|
||||||
|
title(ax3, "Brake Pressure Front [bar]")
|
||||||
|
for i = 1:length(selected_laps)
|
||||||
|
plot(ax3,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).brakePFront_bar)
|
||||||
|
end
|
||||||
|
% plot 4: steering angle [°]
|
||||||
|
ax4 = nexttile(tl);
|
||||||
|
hold(ax4, "on")
|
||||||
|
grid(ax4, "on")
|
||||||
|
title(ax4, "Steering Angle [°]")
|
||||||
|
for i = 1:length(selected_laps)
|
||||||
|
plot(ax4,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).steering_deg)
|
||||||
|
end
|
||||||
|
% link all x axes
|
||||||
|
linkaxes([ax1, ax2, ax3, ax4],"x")
|
||||||
|
|
||||||
|
% return null (not relevant for plots!)
|
||||||
|
outputArg = [];
|
||||||
|
end
|
||||||
|
|
46
season/FT24/plot_settings/plot_driver_statistics.m
Normal file
46
season/FT24/plot_settings/plot_driver_statistics.m
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
function [outputArg] = plot_driver_statistics(panel, selected_laps, pltData)
|
||||||
|
% create tiledlayout (R2023a and newer)
|
||||||
|
tl = tiledlayout(panel,"vertical");
|
||||||
|
|
||||||
|
% plot 1: speed
|
||||||
|
ax1 = nexttile(tl);
|
||||||
|
hold(ax1, "on")
|
||||||
|
grid(ax1, "on")
|
||||||
|
title(ax1, "speed [km/h]")
|
||||||
|
for i = 1:length(selected_laps)
|
||||||
|
plot(ax1,pltData(selected_laps(i)).xAxis,pltData(selected_laps(i)).speed_kph)
|
||||||
|
end
|
||||||
|
% plot 2: accelerator pedal position [%]
|
||||||
|
ax2 = nexttile(tl);
|
||||||
|
hold(ax2, "on")
|
||||||
|
grid(ax2, "on")
|
||||||
|
title(ax2, "APP [%]")
|
||||||
|
for i = 1:length(selected_laps)
|
||||||
|
plot(ax2,pltData(selected_laps(i)).xAxis,pltData(selected_laps(i)).app_percent)
|
||||||
|
end
|
||||||
|
linkaxes([ax1, ax2],"x")
|
||||||
|
% plot 3: accelerator pedal position histogram
|
||||||
|
ax3 = nexttile(tl);
|
||||||
|
hold(ax3, "on")
|
||||||
|
grid(ax3, "on")
|
||||||
|
title(ax3, "APP distribution")
|
||||||
|
ylabel(ax3, "\sigma [%]")
|
||||||
|
xlabel(ax3, "APP [%]")
|
||||||
|
for i = 1:length(selected_laps)
|
||||||
|
histogram(ax3,pltData(selected_laps(i)).app_percent,"Normalization","percentage")
|
||||||
|
end
|
||||||
|
% plot 4: brake pressure histogram
|
||||||
|
ax4 = nexttile(tl);
|
||||||
|
hold(ax4, "on")
|
||||||
|
grid(ax4, "on")
|
||||||
|
title(ax4, "BrakeP distribution")
|
||||||
|
ylabel(ax4, "\sigma [%]")
|
||||||
|
xlabel(ax4, "Brake Pressure Front [bar]")
|
||||||
|
for i = 1:length(selected_laps)
|
||||||
|
histogram(ax4,pltData(selected_laps(i)).brakePFront_bar,"Normalization","percentage")
|
||||||
|
end
|
||||||
|
|
||||||
|
% return null (not relevant for plots!)
|
||||||
|
outputArg = [];
|
||||||
|
end
|
||||||
|
|
42
season/FT24/plot_settings/plot_driver_steering.m
Normal file
42
season/FT24/plot_settings/plot_driver_steering.m
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
function [outputArg] = plot_driver_steering(panel, selected_laps, pltData)
|
||||||
|
% create tiledlayout (R2023a and newer)
|
||||||
|
tl = tiledlayout(panel,"vertical");
|
||||||
|
|
||||||
|
% plot 1: speed
|
||||||
|
ax1 = nexttile(tl);
|
||||||
|
hold(ax1, "on")
|
||||||
|
grid(ax1, "on")
|
||||||
|
title(ax1, "Speed [km/h]")
|
||||||
|
for i = 1:length(selected_laps)
|
||||||
|
plot(ax1,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).speed_kph)
|
||||||
|
end
|
||||||
|
% plot 2: steering angle [°]
|
||||||
|
ax2 = nexttile(tl);
|
||||||
|
hold(ax2, "on")
|
||||||
|
grid(ax2, "on")
|
||||||
|
title(ax2, "Steering Angle [°]")
|
||||||
|
for i = 1:length(selected_laps)
|
||||||
|
plot(ax2,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).steering_deg)
|
||||||
|
end
|
||||||
|
% plot 3: oversteer
|
||||||
|
ax3 = nexttile(tl);
|
||||||
|
hold(ax3, "on")
|
||||||
|
grid(ax3, "on")
|
||||||
|
title(ax3, "Oversteer")
|
||||||
|
% TODO!!
|
||||||
|
|
||||||
|
% plot 4: lateral acceleration [g]
|
||||||
|
ax4 = nexttile(tl);
|
||||||
|
hold(ax4, "on")
|
||||||
|
grid(ax4, "on")
|
||||||
|
title(ax4, "Lateral Acc [g]")
|
||||||
|
for i = 1:length(selected_laps)
|
||||||
|
plot(ax4,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).acc_lat_g)
|
||||||
|
end
|
||||||
|
% link all x axes
|
||||||
|
linkaxes([ax1, ax2, ax3, ax4],"x")
|
||||||
|
|
||||||
|
% return null (not relevant for plots!)
|
||||||
|
outputArg = [];
|
||||||
|
end
|
||||||
|
|
60
season/FT24/plot_settings/plot_inverter.m
Normal file
60
season/FT24/plot_settings/plot_inverter.m
Normal file
@ -0,0 +1,60 @@
|
|||||||
|
function [outputArg] = plot_inverter(panel, selected_laps, pltData)
|
||||||
|
% create tiledlayout (R2023a and newer)
|
||||||
|
tl = tiledlayout(panel,"vertical");
|
||||||
|
|
||||||
|
% plot 1: speed [km/h]
|
||||||
|
ax1 = nexttile(tl);
|
||||||
|
hold(ax1, "on")
|
||||||
|
grid(ax1, "on")
|
||||||
|
title(ax1, "Speed [km/h]")
|
||||||
|
for i = 1:length(selected_laps)
|
||||||
|
plot(ax1,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).speed_kph)
|
||||||
|
end
|
||||||
|
% plot 2: Inverter Temps [°C]
|
||||||
|
ax2 = nexttile(tl);
|
||||||
|
hold(ax2, "on")
|
||||||
|
grid(ax2, "on")
|
||||||
|
title(ax2, "Inverter Temp [°C]")
|
||||||
|
for i = 1:length(selected_laps)
|
||||||
|
plot(ax2,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).invL_temp)
|
||||||
|
plot(ax2,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).invR_temp)
|
||||||
|
end
|
||||||
|
legend(ax2, "Left", "Right")
|
||||||
|
% plot 3: Torque request / actual inverter left
|
||||||
|
ax3 = nexttile(tl);
|
||||||
|
hold(ax3, "on")
|
||||||
|
grid(ax3, "on")
|
||||||
|
title(ax3, "Left Torque")
|
||||||
|
for i = 1:length(selected_laps)
|
||||||
|
plot(ax3,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).invL_torqueDemand)
|
||||||
|
plot(ax3,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).invL_torqueActual)
|
||||||
|
end
|
||||||
|
legend(ax3, "Demand", "Actual")
|
||||||
|
% plot 4: Torque request / actual inverter right
|
||||||
|
ax4 = nexttile(tl);
|
||||||
|
hold(ax4, "on")
|
||||||
|
grid(ax4, "on")
|
||||||
|
title(ax4, "Right Torque")
|
||||||
|
for i = 1:length(selected_laps)
|
||||||
|
plot(ax4,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).invR_torqueDemand)
|
||||||
|
plot(ax4,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).invR_torqueActual)
|
||||||
|
end
|
||||||
|
legend(ax4, "Demand", "Actual")
|
||||||
|
% plot 5: Motor velocities
|
||||||
|
ax5 = nexttile(tl);
|
||||||
|
hold(ax5, "on")
|
||||||
|
grid(ax5, "on")
|
||||||
|
title(ax5, "Motor Velocities [1/min]")
|
||||||
|
for i = 1:length(selected_laps)
|
||||||
|
plot(ax5,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).motL_vel_rpm)
|
||||||
|
plot(ax5,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).motR_vel_rpm)
|
||||||
|
end
|
||||||
|
legend(ax5, "Left", "Right")
|
||||||
|
|
||||||
|
% link all x axes
|
||||||
|
linkaxes([ax1, ax2, ax3, ax4, ax5],"x")
|
||||||
|
|
||||||
|
% return null (not relevant for plots!)
|
||||||
|
outputArg = [];
|
||||||
|
end
|
||||||
|
|
58
season/FT24/plot_settings/plot_powertrain.m
Normal file
58
season/FT24/plot_settings/plot_powertrain.m
Normal file
@ -0,0 +1,58 @@
|
|||||||
|
function [outputArg] = plot_powertrain(panel, selected_laps, pltData)
|
||||||
|
% create tiledlayout (R2023a and newer)
|
||||||
|
tl = tiledlayout(panel,"vertical");
|
||||||
|
|
||||||
|
% plot 1: speed [km/h]
|
||||||
|
ax1 = nexttile(tl);
|
||||||
|
hold(ax1, "on")
|
||||||
|
grid(ax1, "on")
|
||||||
|
title(ax1, "Speed [km/h]")
|
||||||
|
for i = 1:length(selected_laps)
|
||||||
|
plot(ax1,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).speed_kph)
|
||||||
|
end
|
||||||
|
% plot 2: power [kW]
|
||||||
|
ax2 = nexttile(tl);
|
||||||
|
hold(ax2, "on")
|
||||||
|
grid(ax2, "on")
|
||||||
|
title(ax2, "Power [kW]")
|
||||||
|
for i = 1:length(selected_laps)
|
||||||
|
plot(ax2,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).ams_ptot)
|
||||||
|
end
|
||||||
|
% plot 3: Inverter Temps [°C]
|
||||||
|
ax3 = nexttile(tl);
|
||||||
|
hold(ax3, "on")
|
||||||
|
grid(ax3, "on")
|
||||||
|
title(ax3, "Inverter Temp [°C]")
|
||||||
|
for i = 1:length(selected_laps)
|
||||||
|
plot(ax3,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).invL_temp)
|
||||||
|
plot(ax3,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).invR_temp)
|
||||||
|
end
|
||||||
|
legend(ax3, "Left", "Right")
|
||||||
|
% plot 4: Motor Temps
|
||||||
|
ax4 = nexttile(tl);
|
||||||
|
hold(ax4, "on")
|
||||||
|
grid(ax4, "on")
|
||||||
|
title(ax4, "Motor Temp [°C]")
|
||||||
|
for i = 1:length(selected_laps)
|
||||||
|
plot(ax4,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).motL_temp)
|
||||||
|
plot(ax4,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).motR_temp)
|
||||||
|
end
|
||||||
|
legend(ax4, "Left", "Right")
|
||||||
|
% plot 5: Motor velocities
|
||||||
|
ax5 = nexttile(tl);
|
||||||
|
hold(ax5, "on")
|
||||||
|
grid(ax5, "on")
|
||||||
|
title(ax5, "Motor Velocities [1/min]")
|
||||||
|
for i = 1:length(selected_laps)
|
||||||
|
plot(ax5,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).motL_vel_rpm)
|
||||||
|
plot(ax5,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).motR_vel_rpm)
|
||||||
|
end
|
||||||
|
legend(ax5, "Left", "Right")
|
||||||
|
|
||||||
|
% link all x axes
|
||||||
|
linkaxes([ax1, ax2, ax3, ax4, ax5],"x")
|
||||||
|
|
||||||
|
% return null (not relevant for plots!)
|
||||||
|
outputArg = [];
|
||||||
|
end
|
||||||
|
|
41
season/FT24/plot_settings/plot_suspension_histogram.m
Normal file
41
season/FT24/plot_settings/plot_suspension_histogram.m
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
function [outputArg] = plot_suspension_histogram(panel, selected_laps, pltData)
|
||||||
|
% create tiledlayout (R2023a and newer)
|
||||||
|
tl = tiledlayout(panel,"vertical");
|
||||||
|
% plot 1: position heave front [mm/s]
|
||||||
|
ax1 = nexttile(tl);
|
||||||
|
hold(ax1, "on")
|
||||||
|
grid(ax1, "on")
|
||||||
|
title(ax1, "Heave Front [mm/s]")
|
||||||
|
for i = 1:length(selected_laps)
|
||||||
|
histogram(ax1, pltData(selected_laps(i)).velocityHeaveFront_mmps,"Normalization","percentage")
|
||||||
|
end
|
||||||
|
% plot 2: position roll front [mm/s]
|
||||||
|
ax2 = nexttile(tl);
|
||||||
|
hold(ax2, "on")
|
||||||
|
grid(ax2, "on")
|
||||||
|
title(ax2, "Roll Front [mm/s]")
|
||||||
|
for i = 1:length(selected_laps)
|
||||||
|
histogram(ax2, pltData(selected_laps(i)).velocityHeaveFront_mmps,"Normalization","percentage")
|
||||||
|
end
|
||||||
|
% plot 3: position heave front [mm/s]
|
||||||
|
ax3 = nexttile(tl);
|
||||||
|
hold(ax3, "on")
|
||||||
|
grid(ax3, "on")
|
||||||
|
title(ax3, "Heave Rear [mm/s]")
|
||||||
|
for i = 1:length(selected_laps)
|
||||||
|
histogram(ax3, pltData(selected_laps(i)).velocityHeaveFront_mmps,"Normalization","percentage")
|
||||||
|
end
|
||||||
|
% plot 4: position roll front [mm/s]
|
||||||
|
ax4 = nexttile(tl);
|
||||||
|
hold(ax4, "on")
|
||||||
|
grid(ax4, "on")
|
||||||
|
title(ax4, "Roll Rear [mm/s]")
|
||||||
|
for i = 1:length(selected_laps)
|
||||||
|
histogram(ax4, pltData(selected_laps(i)).velocityHeaveFront_mmps,"Normalization","percentage")
|
||||||
|
end
|
||||||
|
linkaxes([ax1, ax2, ax3, ax4],"x")
|
||||||
|
|
||||||
|
% return null (not relevant for plots!)
|
||||||
|
outputArg = [];
|
||||||
|
end
|
||||||
|
|
41
season/FT24/plot_settings/plot_suspension_positions.m
Normal file
41
season/FT24/plot_settings/plot_suspension_positions.m
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
function [outputArg] = plot_suspension_positions(panel, selected_laps, pltData)
|
||||||
|
% create tiledlayout (R2023a and newer)
|
||||||
|
tl = tiledlayout(panel,"vertical");
|
||||||
|
% plot 1: position heave front [mm]
|
||||||
|
ax1 = nexttile(tl);
|
||||||
|
hold(ax1, "on")
|
||||||
|
grid(ax1, "on")
|
||||||
|
title(ax1, "Heave Front [mm]")
|
||||||
|
for i = 1:length(selected_laps)
|
||||||
|
plot(ax1, pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).damperHeaveFront_mm)
|
||||||
|
end
|
||||||
|
% plot 2: position roll front [mm]
|
||||||
|
ax2 = nexttile(tl);
|
||||||
|
hold(ax2, "on")
|
||||||
|
grid(ax2, "on")
|
||||||
|
title(ax2, "Roll Front [mm]")
|
||||||
|
for i = 1:length(selected_laps)
|
||||||
|
plot(ax2, pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).damperRollFront_mm)
|
||||||
|
end
|
||||||
|
% plot 3: position heave front [mm]
|
||||||
|
ax3 = nexttile(tl);
|
||||||
|
hold(ax3, "on")
|
||||||
|
grid(ax3, "on")
|
||||||
|
title(ax3, "Heave Rear [mm]")
|
||||||
|
for i = 1:length(selected_laps)
|
||||||
|
plot(ax3, pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).damperHeaveRear_mm)
|
||||||
|
end
|
||||||
|
% plot 4: position roll front [mm]
|
||||||
|
ax4 = nexttile(tl);
|
||||||
|
hold(ax4, "on")
|
||||||
|
grid(ax4, "on")
|
||||||
|
title(ax4, "Roll Rear [mm]")
|
||||||
|
for i = 1:length(selected_laps)
|
||||||
|
plot(ax4, pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).damperRollRear_mm)
|
||||||
|
end
|
||||||
|
linkaxes([ax1, ax2, ax3, ax4],"x")
|
||||||
|
|
||||||
|
% return null (not relevant for plots!)
|
||||||
|
outputArg = [];
|
||||||
|
end
|
||||||
|
|
41
season/FT24/plot_settings/plot_suspension_velocities.m
Normal file
41
season/FT24/plot_settings/plot_suspension_velocities.m
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
function [outputArg] = plot_suspension_velocities(panel, selected_laps, pltData)
|
||||||
|
% create tiledlayout (R2023a and newer)
|
||||||
|
tl = tiledlayout(panel,"vertical");
|
||||||
|
% plot 1: velocity heave front [mm/s]
|
||||||
|
ax1 = nexttile(tl);
|
||||||
|
hold(ax1, "on")
|
||||||
|
grid(ax1, "on")
|
||||||
|
title(ax1, "Heave Front [mm/s]")
|
||||||
|
for i = 1:length(selected_laps)
|
||||||
|
plot(ax1, pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).velocityHeaveFront_mmps)
|
||||||
|
end
|
||||||
|
% plot 2: velocity roll front [mm/s]
|
||||||
|
ax2 = nexttile(tl);
|
||||||
|
hold(ax2, "on")
|
||||||
|
grid(ax2, "on")
|
||||||
|
title(ax2, "Roll Front [mm/s]")
|
||||||
|
for i = 1:length(selected_laps)
|
||||||
|
plot(ax2, pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).velocityRollFront_mmps)
|
||||||
|
end
|
||||||
|
% plot 3: velocity heave front [mm/s]
|
||||||
|
ax3 = nexttile(tl);
|
||||||
|
hold(ax3, "on")
|
||||||
|
grid(ax3, "on")
|
||||||
|
title(ax3, "Heave Rear [mm/s]")
|
||||||
|
for i = 1:length(selected_laps)
|
||||||
|
plot(ax3, pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).velocityHeaveRear_mmps)
|
||||||
|
end
|
||||||
|
% plot 4: velocity roll front [mm/s]
|
||||||
|
ax4 = nexttile(tl);
|
||||||
|
hold(ax4, "on")
|
||||||
|
grid(ax4, "on")
|
||||||
|
title(ax4, "Roll Rear [mm/s]")
|
||||||
|
for i = 1:length(selected_laps)
|
||||||
|
plot(ax4, pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).velocityRollRear_mmps)
|
||||||
|
end
|
||||||
|
linkaxes([ax1, ax2, ax3, ax4],"x")
|
||||||
|
|
||||||
|
% return null (not relevant for plots!)
|
||||||
|
outputArg = [];
|
||||||
|
end
|
||||||
|
|
24
season/FT24/plot_settings/plot_tires_firctionCircle.m
Normal file
24
season/FT24/plot_settings/plot_tires_firctionCircle.m
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
function [outputArg] = plot_tires_firctionCircle(panel, selected_laps, pltData)
|
||||||
|
% create tiledlayout (R2023a and newer)
|
||||||
|
|
||||||
|
tl = tiledlayout(panel,"flow");
|
||||||
|
|
||||||
|
ax1 = nexttile(tl);
|
||||||
|
hold(ax1, "on")
|
||||||
|
grid(ax1, "on")
|
||||||
|
title(ax1, "Friction Circle")
|
||||||
|
ylabel(ax1, "Longitudinal Acc [g]")
|
||||||
|
xlabel(ax1, "Lateral Acc [g]")
|
||||||
|
colors = colororder(ax1);
|
||||||
|
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
|
||||||
|
|
||||||
|
% return null (not relevant for plots!)
|
||||||
|
outputArg = [];
|
||||||
|
end
|
||||||
|
|
21
season/FT24/plot_settings/sidebar_stats.m
Normal file
21
season/FT24/plot_settings/sidebar_stats.m
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
function [sidebarLabel] = sidebar_stats(pltData)
|
||||||
|
%SIDEBAR_STATS Summary of this function goes here
|
||||||
|
% Detailed explanation goes here
|
||||||
|
sidebarLabel = sprintf(...
|
||||||
|
"Statistics:\nEnergy\n Used: %.2f kWh\n" + ...
|
||||||
|
" Regen: %.2f kWh\n" + ...
|
||||||
|
" Total: %.2f kWh\n" + ...
|
||||||
|
"\nPower\n Peak: %.1f kW\n" + ...
|
||||||
|
" Peak (mean): %1.f kW\n" + ...
|
||||||
|
"\nDistance: %.2f km\n" + ...
|
||||||
|
"\nTopspeed: %.1f km/h\n", ...
|
||||||
|
pltData.energy_used_kwh, ...
|
||||||
|
pltData.energy_regen_kwh, ...
|
||||||
|
pltData.energy_kwh, ...
|
||||||
|
pltData.peakPower_kw, ...
|
||||||
|
pltData.peakPowerMean_kw, ...
|
||||||
|
pltData.distanceTotal_km, ...
|
||||||
|
pltData.maxSpeed_kph ...
|
||||||
|
);
|
||||||
|
end
|
||||||
|
|
122
season/FT24/sortdata.m
Normal file
122
season/FT24/sortdata.m
Normal file
@ -0,0 +1,122 @@
|
|||||||
|
function [pltData] = sortdata(data,start,stop)
|
||||||
|
date = dateshift(data.Time(1),'start','day');
|
||||||
|
time_hms = data.Time-date;
|
||||||
|
time_s = seconds(time_hms);
|
||||||
|
time_s = time_s - time_s(1); % set beginning of session to 0
|
||||||
|
|
||||||
|
% x-Axis:
|
||||||
|
pltData.time_s = time_s(start:stop)-time_s(start);
|
||||||
|
pltData.time_hms = time_hms(start:stop);
|
||||||
|
|
||||||
|
% distance calculation
|
||||||
|
speed_mps = movmean(data.ABX_Driver_ABX_Speed(start:stop),50); % TODO: test different speed filters for distance calculation
|
||||||
|
pltData.distance(1) = 0;
|
||||||
|
for i = 2:length(speed_mps)
|
||||||
|
pltData.distance(i) = speed_mps(i)*(pltData.time_s(i)-pltData.time_s(i-1)) + pltData.distance(i-1);
|
||||||
|
end
|
||||||
|
pltData.xAxis = pltData.time_s; % set time as default x-Axis for plotting
|
||||||
|
|
||||||
|
%% Misc
|
||||||
|
pltData.app_percent = data.ABX_Driver_ABX_APPS_percent(start:stop);
|
||||||
|
pltData.speed_kph = 3.6*movmean(data.ABX_Driver_ABX_Speed(start:stop),50); % same filter as for distance calculation ???
|
||||||
|
pltData.steering_deg = data.ABX_Driver_ABX_Steering_Angle(start:stop);
|
||||||
|
|
||||||
|
%% AMS:
|
||||||
|
pltData.ams_soc = data.AMS_Status_SOC(start:stop);
|
||||||
|
pltData.ams_tmax = data.AMS_Status_Max_cell_temp(start:stop);
|
||||||
|
pltData.ams_utot = data.Shunt_Voltage1_Shunt_Voltage1(start:stop);
|
||||||
|
pltData.ams_itot = data.Shunt_Current_Shunt_Current(start:stop);
|
||||||
|
% calculations:
|
||||||
|
pltData.ams_ptot = pltData.ams_utot.*pltData.ams_itot/1000;
|
||||||
|
|
||||||
|
%% Brakes
|
||||||
|
% brake pressure
|
||||||
|
pltData.brakePFront_bar = data.ABX_Driver_ABX_BrakeP_F(start:stop);
|
||||||
|
pltData.brakePRear_bar = data.ABX_Driver_ABX_BrakeP_R(start:stop);
|
||||||
|
% brake disc temperatures
|
||||||
|
pltData.brakeTFrontLeft_degC = data.ABX_BrakeT_ABX_BrakeT_FL(start:stop);
|
||||||
|
pltData.brakeTFrontRight_degC = data.ABX_BrakeT_ABX_BrakeT_FR(start:stop);
|
||||||
|
pltData.brakeTRearLeft_degC = data.ABX_BrakeT_ABX_BrakeT_RL(start:stop);
|
||||||
|
pltData.brakeTRearRight_degC = data.ABX_BrakeT_ABX_BrakeT_RR(start:stop);
|
||||||
|
% calculate brake bias [%]
|
||||||
|
minBrakeP = 5; % minimum brake pressure to avoid artifacts due to sensor noise near 0 bar
|
||||||
|
brakePFront = pltData.brakePFront_bar;
|
||||||
|
brakePFront(brakePFront < minBrakeP) = minBrakeP;
|
||||||
|
brakePRear = pltData.brakePRear_bar;
|
||||||
|
brakePRear(brakePRear < minBrakeP) = minBrakeP;
|
||||||
|
pltData.brakeBias_perc = 100*brakePFront./brakePRear; % check calculation!
|
||||||
|
|
||||||
|
%% Cooling system
|
||||||
|
|
||||||
|
%% Dampers
|
||||||
|
% damper positions
|
||||||
|
pltData.damper_FL_mm = data.ABX_Dampers_ABX_Damper_FL(start:stop); %Heave_F
|
||||||
|
pltData.damper_FR_mm = data.ABX_Dampers_ABX_Damper_FR(start:stop); %Roll_F
|
||||||
|
pltData.damper_RL_mm = data.ABX_Dampers_ABX_Damper_RL(start:stop); %Heave_R
|
||||||
|
pltData.damper_RR_mm = data.ABX_Dampers_ABX_Damper_RR(start:stop); %Roll_R
|
||||||
|
% calculate damper velocities
|
||||||
|
pltData.velocity_FL_mmps(1) = 0;
|
||||||
|
pltData.velocity_FR_mmps(1) = 0;
|
||||||
|
pltData.velocity_RL_mmps(1) = 0;
|
||||||
|
pltData.velocity_RR_mmps(1) = 0;
|
||||||
|
for i = 2:length(pltData.time_s)
|
||||||
|
timestep = pltData.time_s(i)-pltData.time_s(i-1);
|
||||||
|
pltData.velocity_FL_mmps(i) = pltData.damper_FL_mm(i)-pltData.damper_FL_mm(i-1)/timestep;
|
||||||
|
pltData.velocity_FR_mmps(i) = pltData.damper_FR_mm(i)-pltData.damper_FR_mm(i-1)/timestep;
|
||||||
|
pltData.velocity_RL_mmps(i) = pltData.damper_RL_mm(i)-pltData.damper_RL_mm(i-1)/timestep;
|
||||||
|
pltData.velocity_RR_mmps(i) = pltData.damper_RR_mm(i)-pltData.damper_RR_mm(i-1)/timestep;
|
||||||
|
end
|
||||||
|
% filter damper velocities ??? bessere Berechnung über mittelwert aus mehreren werten? Vorfilterung?
|
||||||
|
pltData.velocity_FL_mmps = movmean(pltData.velocity_FL_mmps,100);
|
||||||
|
pltData.velocity_FR_mmps = movmean(pltData.velocity_FR_mmps,100);
|
||||||
|
pltData.velocity_RL_mmps = movmean(pltData.velocity_RL_mmps,100);
|
||||||
|
pltData.velocity_RR_mmps = movmean(pltData.velocity_RR_mmps,100);
|
||||||
|
|
||||||
|
%% IMU
|
||||||
|
% Acceleration
|
||||||
|
% pltData.acc_long_g = movmean(data.XSens_Acceleration_XSens_accX(start:stop),100)/9.81;
|
||||||
|
% pltData.acc_lat_g = movmean(data.XSens_Acceleration_XSens_accY(start:stop),100)/9.81;
|
||||||
|
% Rate of turn
|
||||||
|
% pltData.rot_roll_degps = movmean(data.XSens_RateOfTurn_XSens_gyrX(start:stop),100);
|
||||||
|
% pltData.rot_pitch_degps = movmean(data.XSens_RateOfTurn_XSens_gyrY(start:stop),100);
|
||||||
|
% pltData.rot_yaw_degps = movmean(data.XSens_RateOfTurn_XSens_gyrZ(start:stop),100);
|
||||||
|
|
||||||
|
%% Inverters
|
||||||
|
% inverter temperatures
|
||||||
|
pltData.invL_temp = data.INV_L_TxPDO_1_T_Inv_L(start:stop);
|
||||||
|
pltData.invR_temp = data.INV_R_TxPDO_1_T_Inv_R(start:stop);
|
||||||
|
% motor temperatures
|
||||||
|
pltData.motL_temp = data.INV_L_TxPDO_1_T_Mot_L(start:stop);
|
||||||
|
pltData.motR_temp = data.INV_R_TxPDO_1_T_Mot_R(start:stop);
|
||||||
|
% motor velocities
|
||||||
|
pltData.motL_vel_rpm = 60*data.INV_L_TxPDO_4_Velocity_L(start:stop);
|
||||||
|
pltData.motR_vel_rpm = 60*data.INV_R_TxPDO_4_Velocity_R(start:stop);
|
||||||
|
% inverter torque demand
|
||||||
|
pltData.invL_torqueDemand = data.INV_L_TxPDO_3_DemandedTorque_L(start:stop)/10; % /10 to match autobox torque
|
||||||
|
pltData.invR_torqueDemand = data.INV_R_TxPDO_3_DemandedTorque_R(start:stop)/10;
|
||||||
|
% inverter actual torque
|
||||||
|
pltData.invL_torqueActual = data.INV_L_TxPDO_3_ActualTorque_L(start:stop)/10;
|
||||||
|
pltData.invR_torqueActual = data.INV_R_TxPDO_3_ActualTorque_R(start:stop)/10;
|
||||||
|
|
||||||
|
%% Wheelspeed
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
%% Statistics:
|
||||||
|
power_regen_kw = pltData.ams_ptot;
|
||||||
|
power_regen_kw(power_regen_kw > 0) = 0;
|
||||||
|
power_used_kw = pltData.ams_ptot;
|
||||||
|
power_used_kw(power_used_kw < 0) = 0;
|
||||||
|
pltData.energy_kwh = trapz(pltData.time_s, pltData.ams_ptot)/3600;
|
||||||
|
pltData.energy_regen_kwh = trapz(pltData.time_s, power_regen_kw)/3600;
|
||||||
|
pltData.energy_used_kwh = trapz(pltData.time_s, power_used_kw)/3600;
|
||||||
|
pltData.distanceTotal_km = trapz(pltData.time_s, pltData.speed_kph./3.6)/1000; % 1/3.6 for km/h to m/s and /1000 for km output
|
||||||
|
pltData.peakPower_kw = max(pltData.ams_ptot);
|
||||||
|
pltData.peakPowerMean_kw = max(movmean(pltData.ams_ptot,500));
|
||||||
|
|
||||||
|
pltData.maxSpeed_kph = max(pltData.speed_kph);
|
||||||
|
pltData.startTime = time_hms(start);
|
||||||
|
pltData.stopTime = time_hms(stop);
|
||||||
|
end
|
||||||
|
|
43
season/FT25/plot_settings/plot_accumulator.m
Normal file
43
season/FT25/plot_settings/plot_accumulator.m
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
function [outputArg] = plot_accumulator(panel, selected_laps, pltData)
|
||||||
|
% create tiledlayout (R2023a and newer)
|
||||||
|
tl = tiledlayout(panel,"vertical");
|
||||||
|
|
||||||
|
% plot 1: speed [km/h]
|
||||||
|
ax1 = nexttile(tl);
|
||||||
|
hold(ax1, "on")
|
||||||
|
grid(ax1, "on")
|
||||||
|
title(ax1, "Speed [km/h]")
|
||||||
|
for i = 1:length(selected_laps)
|
||||||
|
plot(ax1,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).speed_kph)
|
||||||
|
end
|
||||||
|
% plot 2: power [kW]
|
||||||
|
ax2 = nexttile(tl);
|
||||||
|
hold(ax2, "on")
|
||||||
|
grid(ax2, "on")
|
||||||
|
title(ax2, "Power [kW]")
|
||||||
|
for i = 1:length(selected_laps)
|
||||||
|
plot(ax2,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).ams_ptot)
|
||||||
|
end
|
||||||
|
% plot 3: Max Cell Temp [°C]
|
||||||
|
ax3 = nexttile(tl);
|
||||||
|
hold(ax3, "on")
|
||||||
|
grid(ax3, "on")
|
||||||
|
title(ax3, "Max Cell Temp [°C]")
|
||||||
|
for i = 1:length(selected_laps)
|
||||||
|
plot(ax3,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).ams_tmax)
|
||||||
|
end
|
||||||
|
% plot 4: State of charge [%]
|
||||||
|
ax4 = nexttile(tl);
|
||||||
|
hold(ax4, "on")
|
||||||
|
grid(ax4, "on")
|
||||||
|
title(ax4, "SOC")
|
||||||
|
for i = 1:length(selected_laps)
|
||||||
|
plot(ax4,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).ams_soc)
|
||||||
|
end
|
||||||
|
% link all x axes
|
||||||
|
linkaxes([ax1, ax2, ax3, ax4],"x")
|
||||||
|
|
||||||
|
% return null (not relevant for plots!)
|
||||||
|
outputArg = [];
|
||||||
|
end
|
||||||
|
|
59
season/FT25/plot_settings/plot_brakes.m
Normal file
59
season/FT25/plot_settings/plot_brakes.m
Normal file
@ -0,0 +1,59 @@
|
|||||||
|
function [outputArg] = plot_brakes(panel, selected_laps, pltData)
|
||||||
|
% create tiledlayout (R2023a and newer)
|
||||||
|
tl = tiledlayout(panel,"vertical");
|
||||||
|
|
||||||
|
% plot 1: speed
|
||||||
|
ax1 = nexttile(tl);
|
||||||
|
hold(ax1, "on")
|
||||||
|
grid(ax1, "on")
|
||||||
|
title(ax1, "Speed [km/h]")
|
||||||
|
for i = 1:length(selected_laps)
|
||||||
|
plot(ax1,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).speed_kph)
|
||||||
|
end
|
||||||
|
% plot 2: brake pressure front/rear [bar]
|
||||||
|
ax2 = nexttile(tl);
|
||||||
|
hold(ax2, "on")
|
||||||
|
grid(ax2, "on")
|
||||||
|
title(ax2, "Brake Pressure F/R [bar]")
|
||||||
|
for i = 1:length(selected_laps)
|
||||||
|
plot(ax2,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).brakePFront_bar)
|
||||||
|
plot(ax2,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).brakePRear_bar)
|
||||||
|
end
|
||||||
|
legend(ax2, "Front", "Rear")
|
||||||
|
% plot 3: longitudinal acceleration [g]
|
||||||
|
ax3 = nexttile(tl);
|
||||||
|
hold(ax3, "on")
|
||||||
|
grid(ax3, "on")
|
||||||
|
title(ax3, "Long Acc [g]")
|
||||||
|
for i = 1:length(selected_laps)
|
||||||
|
plot(ax3,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).acc_long_g)
|
||||||
|
end
|
||||||
|
% plot 4: Brake Temp [°C]
|
||||||
|
ax4 = nexttile(tl);
|
||||||
|
hold(ax4, "on")
|
||||||
|
grid(ax4, "on")
|
||||||
|
title(ax4, "Brake Temp [°C]")
|
||||||
|
for i = 1:length(selected_laps)
|
||||||
|
plot(ax4,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).brakeTFrontLeft_degC)
|
||||||
|
plot(ax4,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).brakeTFrontRight_degC)
|
||||||
|
plot(ax4,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).brakeTRearLeft_degC)
|
||||||
|
plot(ax4,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).brakeTRearRight_degC)
|
||||||
|
end
|
||||||
|
legend(ax4, "FL", "FR", "RL", "RR")
|
||||||
|
% plot 5: brake bias [%]
|
||||||
|
ax5 = nexttile(tl);
|
||||||
|
hold(ax5, "on")
|
||||||
|
grid(ax5, "on")
|
||||||
|
title(ax5, "Brake Bias [%]")
|
||||||
|
for i = 1:length(selected_laps)
|
||||||
|
plot(ax5,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).brakeBias_perc)
|
||||||
|
end
|
||||||
|
|
||||||
|
% link all x axes
|
||||||
|
linkaxes([ax1, ax2, ax3, ax4, ax5],"x")
|
||||||
|
|
||||||
|
|
||||||
|
% return null (not relevant for plots!)
|
||||||
|
outputArg = [];
|
||||||
|
end
|
||||||
|
|
43
season/FT25/plot_settings/plot_driver_braking.m
Normal file
43
season/FT25/plot_settings/plot_driver_braking.m
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
function [outputArg] = plot_driver_braking(panel, selected_laps, pltData)
|
||||||
|
% create tiledlayout (R2023a and newer)
|
||||||
|
tl = tiledlayout(panel,"vertical");
|
||||||
|
|
||||||
|
% plot 1: speed
|
||||||
|
ax1 = nexttile(tl);
|
||||||
|
hold(ax1, "on")
|
||||||
|
grid(ax1, "on")
|
||||||
|
title(ax1, "Speed [km/h]")
|
||||||
|
for i = 1:length(selected_laps)
|
||||||
|
plot(ax1,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).speed_kph)
|
||||||
|
end
|
||||||
|
% plot 2: accelerator pedal position [%]
|
||||||
|
ax2 = nexttile(tl);
|
||||||
|
hold(ax2, "on")
|
||||||
|
grid(ax2, "on")
|
||||||
|
title(ax2, "APP [%]")
|
||||||
|
for i = 1:length(selected_laps)
|
||||||
|
plot(ax2,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).app_percent)
|
||||||
|
end
|
||||||
|
% plot 3: brake pressure front [bar]
|
||||||
|
ax3 = nexttile(tl);
|
||||||
|
hold(ax3, "on")
|
||||||
|
grid(ax3, "on")
|
||||||
|
title(ax3, "Brake Pressure Front [bar]")
|
||||||
|
for i = 1:length(selected_laps)
|
||||||
|
plot(ax3,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).brakePFront_bar)
|
||||||
|
end
|
||||||
|
% plot 4: longitudinal acceleration [g]
|
||||||
|
ax4 = nexttile(tl);
|
||||||
|
hold(ax4, "on")
|
||||||
|
grid(ax4, "on")
|
||||||
|
title(ax4, "Long Acc [g]")
|
||||||
|
for i = 1:length(selected_laps)
|
||||||
|
plot(ax4,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).acc_long_g)
|
||||||
|
end
|
||||||
|
% link all x axes
|
||||||
|
linkaxes([ax1, ax2, ax3, ax4],"x")
|
||||||
|
|
||||||
|
% return null (not relevant for plots!)
|
||||||
|
outputArg = [];
|
||||||
|
end
|
||||||
|
|
43
season/FT25/plot_settings/plot_driver_general.m
Normal file
43
season/FT25/plot_settings/plot_driver_general.m
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
function [outputArg] = plot_driver_general(panel, selected_laps, pltData)
|
||||||
|
% create tiledlayout (R2023a and newer)
|
||||||
|
tl = tiledlayout(panel,"vertical");
|
||||||
|
|
||||||
|
% plot 1: speed
|
||||||
|
ax1 = nexttile(tl);
|
||||||
|
hold(ax1, "on")
|
||||||
|
grid(ax1, "on")
|
||||||
|
title(ax1, "Speed [km/h]")
|
||||||
|
for i = 1:length(selected_laps)
|
||||||
|
plot(ax1,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).speed_kph)
|
||||||
|
end
|
||||||
|
% plot 2: accelerator pedal position [%]
|
||||||
|
ax2 = nexttile(tl);
|
||||||
|
hold(ax2, "on")
|
||||||
|
grid(ax2, "on")
|
||||||
|
title(ax2, "APP [%]")
|
||||||
|
for i = 1:length(selected_laps)
|
||||||
|
plot(ax2,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).app_percent)
|
||||||
|
end
|
||||||
|
% plot 3: brake pressure front [bar]
|
||||||
|
ax3 = nexttile(tl);
|
||||||
|
hold(ax3, "on")
|
||||||
|
grid(ax3, "on")
|
||||||
|
title(ax3, "Brake Pressure Front [bar]")
|
||||||
|
for i = 1:length(selected_laps)
|
||||||
|
plot(ax3,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).brakePFront_bar)
|
||||||
|
end
|
||||||
|
% plot 4: steering angle [°]
|
||||||
|
ax4 = nexttile(tl);
|
||||||
|
hold(ax4, "on")
|
||||||
|
grid(ax4, "on")
|
||||||
|
title(ax4, "Steering Angle [°]")
|
||||||
|
for i = 1:length(selected_laps)
|
||||||
|
plot(ax4,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).steering_deg)
|
||||||
|
end
|
||||||
|
% link all x axes
|
||||||
|
linkaxes([ax1, ax2, ax3, ax4],"x")
|
||||||
|
|
||||||
|
% return null (not relevant for plots!)
|
||||||
|
outputArg = [];
|
||||||
|
end
|
||||||
|
|
46
season/FT25/plot_settings/plot_driver_statistics.m
Normal file
46
season/FT25/plot_settings/plot_driver_statistics.m
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
function [outputArg] = plot_driver_statistics(panel, selected_laps, pltData)
|
||||||
|
% create tiledlayout (R2023a and newer)
|
||||||
|
tl = tiledlayout(panel,"vertical");
|
||||||
|
|
||||||
|
% plot 1: speed
|
||||||
|
ax1 = nexttile(tl);
|
||||||
|
hold(ax1, "on")
|
||||||
|
grid(ax1, "on")
|
||||||
|
title(ax1, "speed [km/h]")
|
||||||
|
for i = 1:length(selected_laps)
|
||||||
|
plot(ax1,pltData(selected_laps(i)).xAxis,pltData(selected_laps(i)).speed_kph)
|
||||||
|
end
|
||||||
|
% plot 2: accelerator pedal position [%]
|
||||||
|
ax2 = nexttile(tl);
|
||||||
|
hold(ax2, "on")
|
||||||
|
grid(ax2, "on")
|
||||||
|
title(ax2, "APP [%]")
|
||||||
|
for i = 1:length(selected_laps)
|
||||||
|
plot(ax2,pltData(selected_laps(i)).xAxis,pltData(selected_laps(i)).app_percent)
|
||||||
|
end
|
||||||
|
linkaxes([ax1, ax2],"x")
|
||||||
|
% plot 3: accelerator pedal position histogram
|
||||||
|
ax3 = nexttile(tl);
|
||||||
|
hold(ax3, "on")
|
||||||
|
grid(ax3, "on")
|
||||||
|
title(ax3, "APP distribution")
|
||||||
|
ylabel(ax3, "\sigma [%]")
|
||||||
|
xlabel(ax3, "APP [%]")
|
||||||
|
for i = 1:length(selected_laps)
|
||||||
|
histogram(ax3,pltData(selected_laps(i)).app_percent,"Normalization","percentage")
|
||||||
|
end
|
||||||
|
% plot 4: brake pressure histogram
|
||||||
|
ax4 = nexttile(tl);
|
||||||
|
hold(ax4, "on")
|
||||||
|
grid(ax4, "on")
|
||||||
|
title(ax4, "BrakeP distribution")
|
||||||
|
ylabel(ax4, "\sigma [%]")
|
||||||
|
xlabel(ax4, "Brake Pressure Front [bar]")
|
||||||
|
for i = 1:length(selected_laps)
|
||||||
|
histogram(ax4,pltData(selected_laps(i)).brakePFront_bar,"Normalization","percentage")
|
||||||
|
end
|
||||||
|
|
||||||
|
% return null (not relevant for plots!)
|
||||||
|
outputArg = [];
|
||||||
|
end
|
||||||
|
|
42
season/FT25/plot_settings/plot_driver_steering.m
Normal file
42
season/FT25/plot_settings/plot_driver_steering.m
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
function [outputArg] = plot_driver_steering(panel, selected_laps, pltData)
|
||||||
|
% create tiledlayout (R2023a and newer)
|
||||||
|
tl = tiledlayout(panel,"vertical");
|
||||||
|
|
||||||
|
% plot 1: speed
|
||||||
|
ax1 = nexttile(tl);
|
||||||
|
hold(ax1, "on")
|
||||||
|
grid(ax1, "on")
|
||||||
|
title(ax1, "Speed [km/h]")
|
||||||
|
for i = 1:length(selected_laps)
|
||||||
|
plot(ax1,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).speed_kph)
|
||||||
|
end
|
||||||
|
% plot 2: steering angle [°]
|
||||||
|
ax2 = nexttile(tl);
|
||||||
|
hold(ax2, "on")
|
||||||
|
grid(ax2, "on")
|
||||||
|
title(ax2, "Steering Angle [°]")
|
||||||
|
for i = 1:length(selected_laps)
|
||||||
|
plot(ax2,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).steering_deg)
|
||||||
|
end
|
||||||
|
% plot 3: oversteer
|
||||||
|
ax3 = nexttile(tl);
|
||||||
|
hold(ax3, "on")
|
||||||
|
grid(ax3, "on")
|
||||||
|
title(ax3, "Oversteer")
|
||||||
|
% TODO!!
|
||||||
|
|
||||||
|
% plot 4: lateral acceleration [g]
|
||||||
|
ax4 = nexttile(tl);
|
||||||
|
hold(ax4, "on")
|
||||||
|
grid(ax4, "on")
|
||||||
|
title(ax4, "Lateral Acc [g]")
|
||||||
|
for i = 1:length(selected_laps)
|
||||||
|
plot(ax4,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).acc_lat_g)
|
||||||
|
end
|
||||||
|
% link all x axes
|
||||||
|
linkaxes([ax1, ax2, ax3, ax4],"x")
|
||||||
|
|
||||||
|
% return null (not relevant for plots!)
|
||||||
|
outputArg = [];
|
||||||
|
end
|
||||||
|
|
60
season/FT25/plot_settings/plot_inverter.m
Normal file
60
season/FT25/plot_settings/plot_inverter.m
Normal file
@ -0,0 +1,60 @@
|
|||||||
|
function [outputArg] = plot_inverter(panel, selected_laps, pltData)
|
||||||
|
% create tiledlayout (R2023a and newer)
|
||||||
|
tl = tiledlayout(panel,"vertical");
|
||||||
|
|
||||||
|
% plot 1: speed [km/h]
|
||||||
|
ax1 = nexttile(tl);
|
||||||
|
hold(ax1, "on")
|
||||||
|
grid(ax1, "on")
|
||||||
|
title(ax1, "Speed [km/h]")
|
||||||
|
for i = 1:length(selected_laps)
|
||||||
|
plot(ax1,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).speed_kph)
|
||||||
|
end
|
||||||
|
% plot 2: Inverter Temps [°C]
|
||||||
|
ax2 = nexttile(tl);
|
||||||
|
hold(ax2, "on")
|
||||||
|
grid(ax2, "on")
|
||||||
|
title(ax2, "Inverter Temp [°C]")
|
||||||
|
for i = 1:length(selected_laps)
|
||||||
|
plot(ax2,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).invL_temp)
|
||||||
|
plot(ax2,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).invR_temp)
|
||||||
|
end
|
||||||
|
legend(ax2, "Left", "Right")
|
||||||
|
% plot 3: Torque request / actual inverter left
|
||||||
|
ax3 = nexttile(tl);
|
||||||
|
hold(ax3, "on")
|
||||||
|
grid(ax3, "on")
|
||||||
|
title(ax3, "Left Torque")
|
||||||
|
for i = 1:length(selected_laps)
|
||||||
|
plot(ax3,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).invL_torqueDemand)
|
||||||
|
plot(ax3,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).invL_torqueActual)
|
||||||
|
end
|
||||||
|
legend(ax3, "Demand", "Actual")
|
||||||
|
% plot 4: Torque request / actual inverter right
|
||||||
|
ax4 = nexttile(tl);
|
||||||
|
hold(ax4, "on")
|
||||||
|
grid(ax4, "on")
|
||||||
|
title(ax4, "Right Torque")
|
||||||
|
for i = 1:length(selected_laps)
|
||||||
|
plot(ax4,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).invR_torqueDemand)
|
||||||
|
plot(ax4,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).invR_torqueActual)
|
||||||
|
end
|
||||||
|
legend(ax4, "Demand", "Actual")
|
||||||
|
% plot 5: Motor velocities
|
||||||
|
ax5 = nexttile(tl);
|
||||||
|
hold(ax5, "on")
|
||||||
|
grid(ax5, "on")
|
||||||
|
title(ax5, "Motor Velocities [1/min]")
|
||||||
|
for i = 1:length(selected_laps)
|
||||||
|
plot(ax5,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).motL_vel_rpm)
|
||||||
|
plot(ax5,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).motR_vel_rpm)
|
||||||
|
end
|
||||||
|
legend(ax5, "Left", "Right")
|
||||||
|
|
||||||
|
% link all x axes
|
||||||
|
linkaxes([ax1, ax2, ax3, ax4, ax5],"x")
|
||||||
|
|
||||||
|
% return null (not relevant for plots!)
|
||||||
|
outputArg = [];
|
||||||
|
end
|
||||||
|
|
58
season/FT25/plot_settings/plot_powertrain.m
Normal file
58
season/FT25/plot_settings/plot_powertrain.m
Normal file
@ -0,0 +1,58 @@
|
|||||||
|
function [outputArg] = plot_powertrain(panel, selected_laps, pltData)
|
||||||
|
% create tiledlayout (R2023a and newer)
|
||||||
|
tl = tiledlayout(panel,"vertical");
|
||||||
|
|
||||||
|
% plot 1: speed [km/h]
|
||||||
|
ax1 = nexttile(tl);
|
||||||
|
hold(ax1, "on")
|
||||||
|
grid(ax1, "on")
|
||||||
|
title(ax1, "Speed [km/h]")
|
||||||
|
for i = 1:length(selected_laps)
|
||||||
|
plot(ax1,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).speed_kph)
|
||||||
|
end
|
||||||
|
% plot 2: power [kW]
|
||||||
|
ax2 = nexttile(tl);
|
||||||
|
hold(ax2, "on")
|
||||||
|
grid(ax2, "on")
|
||||||
|
title(ax2, "Power [kW]")
|
||||||
|
for i = 1:length(selected_laps)
|
||||||
|
plot(ax2,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).ams_ptot)
|
||||||
|
end
|
||||||
|
% plot 3: Inverter Temps [°C]
|
||||||
|
ax3 = nexttile(tl);
|
||||||
|
hold(ax3, "on")
|
||||||
|
grid(ax3, "on")
|
||||||
|
title(ax3, "Inverter Temp [°C]")
|
||||||
|
for i = 1:length(selected_laps)
|
||||||
|
plot(ax3,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).invL_temp)
|
||||||
|
plot(ax3,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).invR_temp)
|
||||||
|
end
|
||||||
|
legend(ax3, "Left", "Right")
|
||||||
|
% plot 4: Motor Temps
|
||||||
|
ax4 = nexttile(tl);
|
||||||
|
hold(ax4, "on")
|
||||||
|
grid(ax4, "on")
|
||||||
|
title(ax4, "Motor Temp [°C]")
|
||||||
|
for i = 1:length(selected_laps)
|
||||||
|
plot(ax4,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).motL_temp)
|
||||||
|
plot(ax4,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).motR_temp)
|
||||||
|
end
|
||||||
|
legend(ax4, "Left", "Right")
|
||||||
|
% plot 5: Motor velocities
|
||||||
|
ax5 = nexttile(tl);
|
||||||
|
hold(ax5, "on")
|
||||||
|
grid(ax5, "on")
|
||||||
|
title(ax5, "Motor Velocities [1/min]")
|
||||||
|
for i = 1:length(selected_laps)
|
||||||
|
plot(ax5,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).motL_vel_rpm)
|
||||||
|
plot(ax5,pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).motR_vel_rpm)
|
||||||
|
end
|
||||||
|
legend(ax5, "Left", "Right")
|
||||||
|
|
||||||
|
% link all x axes
|
||||||
|
linkaxes([ax1, ax2, ax3, ax4, ax5],"x")
|
||||||
|
|
||||||
|
% return null (not relevant for plots!)
|
||||||
|
outputArg = [];
|
||||||
|
end
|
||||||
|
|
41
season/FT25/plot_settings/plot_suspension_histogram.m
Normal file
41
season/FT25/plot_settings/plot_suspension_histogram.m
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
function [outputArg] = plot_suspension_histogram(panel, selected_laps, pltData)
|
||||||
|
% create tiledlayout (R2023a and newer)
|
||||||
|
tl = tiledlayout(panel,"vertical");
|
||||||
|
% plot 1: position heave front [mm/s]
|
||||||
|
ax1 = nexttile(tl);
|
||||||
|
hold(ax1, "on")
|
||||||
|
grid(ax1, "on")
|
||||||
|
title(ax1, "Heave Front [mm/s]")
|
||||||
|
for i = 1:length(selected_laps)
|
||||||
|
histogram(ax1, pltData(selected_laps(i)).velocityHeaveFront_mmps,"Normalization","percentage")
|
||||||
|
end
|
||||||
|
% plot 2: position roll front [mm/s]
|
||||||
|
ax2 = nexttile(tl);
|
||||||
|
hold(ax2, "on")
|
||||||
|
grid(ax2, "on")
|
||||||
|
title(ax2, "Roll Front [mm/s]")
|
||||||
|
for i = 1:length(selected_laps)
|
||||||
|
histogram(ax2, pltData(selected_laps(i)).velocityHeaveFront_mmps,"Normalization","percentage")
|
||||||
|
end
|
||||||
|
% plot 3: position heave front [mm/s]
|
||||||
|
ax3 = nexttile(tl);
|
||||||
|
hold(ax3, "on")
|
||||||
|
grid(ax3, "on")
|
||||||
|
title(ax3, "Heave Rear [mm/s]")
|
||||||
|
for i = 1:length(selected_laps)
|
||||||
|
histogram(ax3, pltData(selected_laps(i)).velocityHeaveFront_mmps,"Normalization","percentage")
|
||||||
|
end
|
||||||
|
% plot 4: position roll front [mm/s]
|
||||||
|
ax4 = nexttile(tl);
|
||||||
|
hold(ax4, "on")
|
||||||
|
grid(ax4, "on")
|
||||||
|
title(ax4, "Roll Rear [mm/s]")
|
||||||
|
for i = 1:length(selected_laps)
|
||||||
|
histogram(ax4, pltData(selected_laps(i)).velocityHeaveFront_mmps,"Normalization","percentage")
|
||||||
|
end
|
||||||
|
linkaxes([ax1, ax2, ax3, ax4],"x")
|
||||||
|
|
||||||
|
% return null (not relevant for plots!)
|
||||||
|
outputArg = [];
|
||||||
|
end
|
||||||
|
|
41
season/FT25/plot_settings/plot_suspension_positions.m
Normal file
41
season/FT25/plot_settings/plot_suspension_positions.m
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
function [outputArg] = plot_suspension_positions(panel, selected_laps, pltData)
|
||||||
|
% create tiledlayout (R2023a and newer)
|
||||||
|
tl = tiledlayout(panel,"vertical");
|
||||||
|
% plot 1: position heave front [mm]
|
||||||
|
ax1 = nexttile(tl);
|
||||||
|
hold(ax1, "on")
|
||||||
|
grid(ax1, "on")
|
||||||
|
title(ax1, "Heave Front [mm]")
|
||||||
|
for i = 1:length(selected_laps)
|
||||||
|
plot(ax1, pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).damperHeaveFront_mm)
|
||||||
|
end
|
||||||
|
% plot 2: position roll front [mm]
|
||||||
|
ax2 = nexttile(tl);
|
||||||
|
hold(ax2, "on")
|
||||||
|
grid(ax2, "on")
|
||||||
|
title(ax2, "Roll Front [mm]")
|
||||||
|
for i = 1:length(selected_laps)
|
||||||
|
plot(ax2, pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).damperRollFront_mm)
|
||||||
|
end
|
||||||
|
% plot 3: position heave front [mm]
|
||||||
|
ax3 = nexttile(tl);
|
||||||
|
hold(ax3, "on")
|
||||||
|
grid(ax3, "on")
|
||||||
|
title(ax3, "Heave Rear [mm]")
|
||||||
|
for i = 1:length(selected_laps)
|
||||||
|
plot(ax3, pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).damperHeaveRear_mm)
|
||||||
|
end
|
||||||
|
% plot 4: position roll front [mm]
|
||||||
|
ax4 = nexttile(tl);
|
||||||
|
hold(ax4, "on")
|
||||||
|
grid(ax4, "on")
|
||||||
|
title(ax4, "Roll Rear [mm]")
|
||||||
|
for i = 1:length(selected_laps)
|
||||||
|
plot(ax4, pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).damperRollRear_mm)
|
||||||
|
end
|
||||||
|
linkaxes([ax1, ax2, ax3, ax4],"x")
|
||||||
|
|
||||||
|
% return null (not relevant for plots!)
|
||||||
|
outputArg = [];
|
||||||
|
end
|
||||||
|
|
41
season/FT25/plot_settings/plot_suspension_velocities.m
Normal file
41
season/FT25/plot_settings/plot_suspension_velocities.m
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
function [outputArg] = plot_suspension_velocities(panel, selected_laps, pltData)
|
||||||
|
% create tiledlayout (R2023a and newer)
|
||||||
|
tl = tiledlayout(panel,"vertical");
|
||||||
|
% plot 1: velocity heave front [mm/s]
|
||||||
|
ax1 = nexttile(tl);
|
||||||
|
hold(ax1, "on")
|
||||||
|
grid(ax1, "on")
|
||||||
|
title(ax1, "Heave Front [mm/s]")
|
||||||
|
for i = 1:length(selected_laps)
|
||||||
|
plot(ax1, pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).velocityHeaveFront_mmps)
|
||||||
|
end
|
||||||
|
% plot 2: velocity roll front [mm/s]
|
||||||
|
ax2 = nexttile(tl);
|
||||||
|
hold(ax2, "on")
|
||||||
|
grid(ax2, "on")
|
||||||
|
title(ax2, "Roll Front [mm/s]")
|
||||||
|
for i = 1:length(selected_laps)
|
||||||
|
plot(ax2, pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).velocityRollFront_mmps)
|
||||||
|
end
|
||||||
|
% plot 3: velocity heave front [mm/s]
|
||||||
|
ax3 = nexttile(tl);
|
||||||
|
hold(ax3, "on")
|
||||||
|
grid(ax3, "on")
|
||||||
|
title(ax3, "Heave Rear [mm/s]")
|
||||||
|
for i = 1:length(selected_laps)
|
||||||
|
plot(ax3, pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).velocityHeaveRear_mmps)
|
||||||
|
end
|
||||||
|
% plot 4: velocity roll front [mm/s]
|
||||||
|
ax4 = nexttile(tl);
|
||||||
|
hold(ax4, "on")
|
||||||
|
grid(ax4, "on")
|
||||||
|
title(ax4, "Roll Rear [mm/s]")
|
||||||
|
for i = 1:length(selected_laps)
|
||||||
|
plot(ax4, pltData(selected_laps(i)).xAxis, pltData(selected_laps(i)).velocityRollRear_mmps)
|
||||||
|
end
|
||||||
|
linkaxes([ax1, ax2, ax3, ax4],"x")
|
||||||
|
|
||||||
|
% return null (not relevant for plots!)
|
||||||
|
outputArg = [];
|
||||||
|
end
|
||||||
|
|
24
season/FT25/plot_settings/plot_tires_firctionCircle.m
Normal file
24
season/FT25/plot_settings/plot_tires_firctionCircle.m
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
function [outputArg] = plot_tires_firctionCircle(panel, selected_laps, pltData)
|
||||||
|
% create tiledlayout (R2023a and newer)
|
||||||
|
|
||||||
|
tl = tiledlayout(panel,"flow");
|
||||||
|
|
||||||
|
ax1 = nexttile(tl);
|
||||||
|
hold(ax1, "on")
|
||||||
|
grid(ax1, "on")
|
||||||
|
title(ax1, "Friction Circle")
|
||||||
|
ylabel(ax1, "Longitudinal Acc [g]")
|
||||||
|
xlabel(ax1, "Lateral Acc [g]")
|
||||||
|
colors = colororder(ax1);
|
||||||
|
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
|
||||||
|
|
||||||
|
% return null (not relevant for plots!)
|
||||||
|
outputArg = [];
|
||||||
|
end
|
||||||
|
|
21
season/FT25/plot_settings/sidebar_stats.m
Normal file
21
season/FT25/plot_settings/sidebar_stats.m
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
function [sidebarLabel] = sidebar_stats(pltData)
|
||||||
|
%SIDEBAR_STATS Summary of this function goes here
|
||||||
|
% Detailed explanation goes here
|
||||||
|
sidebarLabel = sprintf(...
|
||||||
|
"Statistics:\nEnergy\n Used: %.2f kWh\n" + ...
|
||||||
|
" Regen: %.2f kWh\n" + ...
|
||||||
|
" Total: %.2f kWh\n" + ...
|
||||||
|
"\nPower\n Peak: %.1f kW\n" + ...
|
||||||
|
" Peak (mean): %1.f kW\n" + ...
|
||||||
|
"\nDistance: %.2f km\n" + ...
|
||||||
|
"\nTopspeed: %.1f km/h\n", ...
|
||||||
|
pltData.energy_used_kwh, ...
|
||||||
|
pltData.energy_regen_kwh, ...
|
||||||
|
pltData.energy_kwh, ...
|
||||||
|
pltData.peakPower_kw, ...
|
||||||
|
pltData.peakPowerMean_kw, ...
|
||||||
|
pltData.distanceTotal_km, ...
|
||||||
|
pltData.maxSpeed_kph ...
|
||||||
|
);
|
||||||
|
end
|
||||||
|
|
122
season/FT25/sortdata.m
Normal file
122
season/FT25/sortdata.m
Normal file
@ -0,0 +1,122 @@
|
|||||||
|
function [pltData] = sortdata(data,start,stop)
|
||||||
|
date = dateshift(data.Time(1),'start','day');
|
||||||
|
time_hms = data.Time-date;
|
||||||
|
time_s = seconds(time_hms);
|
||||||
|
time_s = time_s - time_s(1); % set beginning of session to 0
|
||||||
|
|
||||||
|
% x-Axis:
|
||||||
|
pltData.time_s = time_s(start:stop)-time_s(start);
|
||||||
|
pltData.time_hms = time_hms(start:stop);
|
||||||
|
|
||||||
|
% distance calculation
|
||||||
|
speed_mps = movmean(data.ABX_Driver_ABX_Speed(start:stop),50); % TODO: test different speed filters for distance calculation
|
||||||
|
pltData.distance(1) = 0;
|
||||||
|
for i = 2:length(speed_mps)
|
||||||
|
pltData.distance(i) = speed_mps(i)*(pltData.time_s(i)-pltData.time_s(i-1)) + pltData.distance(i-1);
|
||||||
|
end
|
||||||
|
pltData.xAxis = pltData.time_s; % set time as default x-Axis for plotting
|
||||||
|
|
||||||
|
%% Misc
|
||||||
|
pltData.app_percent = data.ABX_Driver_ABX_APPS_percent(start:stop);
|
||||||
|
pltData.speed_kph = 3.6*movmean(data.ABX_Driver_ABX_Speed(start:stop),50); % same filter as for distance calculation ???
|
||||||
|
pltData.steering_deg = data.ABX_Driver_ABX_Steering_Angle(start:stop);
|
||||||
|
|
||||||
|
%% AMS:
|
||||||
|
pltData.ams_soc = data.AMS_Status_SOC(start:stop);
|
||||||
|
pltData.ams_tmax = data.AMS_Status_Max_cell_temp(start:stop);
|
||||||
|
pltData.ams_utot = data.Shunt_Voltage1_Shunt_Voltage1(start:stop);
|
||||||
|
pltData.ams_itot = data.Shunt_Current_Shunt_Current(start:stop);
|
||||||
|
% calculations:
|
||||||
|
pltData.ams_ptot = pltData.ams_utot.*pltData.ams_itot/1000;
|
||||||
|
|
||||||
|
%% Brakes
|
||||||
|
% brake pressure
|
||||||
|
pltData.brakePFront_bar = data.ABX_Driver_ABX_BrakeP_F(start:stop);
|
||||||
|
pltData.brakePRear_bar = data.ABX_Driver_ABX_BrakeP_R(start:stop);
|
||||||
|
% brake disc temperatures
|
||||||
|
pltData.brakeTFrontLeft_degC = data.ABX_BrakeT_ABX_BrakeT_FL(start:stop);
|
||||||
|
pltData.brakeTFrontRight_degC = data.ABX_BrakeT_ABX_BrakeT_FR(start:stop);
|
||||||
|
pltData.brakeTRearLeft_degC = data.ABX_BrakeT_ABX_BrakeT_RL(start:stop);
|
||||||
|
pltData.brakeTRearRight_degC = data.ABX_BrakeT_ABX_BrakeT_RR(start:stop);
|
||||||
|
% calculate brake bias [%]
|
||||||
|
minBrakeP = 5; % minimum brake pressure to avoid artifacts due to sensor noise near 0 bar
|
||||||
|
brakePFront = pltData.brakePFront_bar;
|
||||||
|
brakePFront(brakePFront < minBrakeP) = minBrakeP;
|
||||||
|
brakePRear = pltData.brakePRear_bar;
|
||||||
|
brakePRear(brakePRear < minBrakeP) = minBrakeP;
|
||||||
|
pltData.brakeBias_perc = 100*brakePFront./brakePRear; % check calculation!
|
||||||
|
|
||||||
|
%% Cooling system
|
||||||
|
|
||||||
|
%% Dampers
|
||||||
|
% damper positions
|
||||||
|
pltData.damper_FL_mm = data.ABX_Dampers_ABX_Damper_FL(start:stop); %Heave_F
|
||||||
|
pltData.damper_FR_mm = data.ABX_Dampers_ABX_Damper_FR(start:stop); %Roll_F
|
||||||
|
pltData.damper_RL_mm = data.ABX_Dampers_ABX_Damper_RL(start:stop); %Heave_R
|
||||||
|
pltData.damper_RR_mm = data.ABX_Dampers_ABX_Damper_RR(start:stop); %Roll_R
|
||||||
|
% calculate damper velocities
|
||||||
|
pltData.velocity_FL_mmps(1) = 0;
|
||||||
|
pltData.velocity_FR_mmps(1) = 0;
|
||||||
|
pltData.velocity_RL_mmps(1) = 0;
|
||||||
|
pltData.velocity_RR_mmps(1) = 0;
|
||||||
|
for i = 2:length(pltData.time_s)
|
||||||
|
timestep = pltData.time_s(i)-pltData.time_s(i-1);
|
||||||
|
pltData.velocity_FL_mmps(i) = pltData.damper_FL_mm(i)-pltData.damper_FL_mm(i-1)/timestep;
|
||||||
|
pltData.velocity_FR_mmps(i) = pltData.damper_FR_mm(i)-pltData.damper_FR_mm(i-1)/timestep;
|
||||||
|
pltData.velocity_RL_mmps(i) = pltData.damper_RL_mm(i)-pltData.damper_RL_mm(i-1)/timestep;
|
||||||
|
pltData.velocity_RR_mmps(i) = pltData.damper_RR_mm(i)-pltData.damper_RR_mm(i-1)/timestep;
|
||||||
|
end
|
||||||
|
% filter damper velocities ??? bessere Berechnung über mittelwert aus mehreren werten? Vorfilterung?
|
||||||
|
pltData.velocity_FL_mmps = movmean(pltData.velocity_FL_mmps,100);
|
||||||
|
pltData.velocity_FR_mmps = movmean(pltData.velocity_FR_mmps,100);
|
||||||
|
pltData.velocity_RL_mmps = movmean(pltData.velocity_RL_mmps,100);
|
||||||
|
pltData.velocity_RR_mmps = movmean(pltData.velocity_RR_mmps,100);
|
||||||
|
|
||||||
|
%% IMU
|
||||||
|
% Acceleration
|
||||||
|
% pltData.acc_long_g = movmean(data.XSens_Acceleration_XSens_accX(start:stop),100)/9.81;
|
||||||
|
% pltData.acc_lat_g = movmean(data.XSens_Acceleration_XSens_accY(start:stop),100)/9.81;
|
||||||
|
% Rate of turn
|
||||||
|
% pltData.rot_roll_degps = movmean(data.XSens_RateOfTurn_XSens_gyrX(start:stop),100);
|
||||||
|
% pltData.rot_pitch_degps = movmean(data.XSens_RateOfTurn_XSens_gyrY(start:stop),100);
|
||||||
|
% pltData.rot_yaw_degps = movmean(data.XSens_RateOfTurn_XSens_gyrZ(start:stop),100);
|
||||||
|
|
||||||
|
%% Inverters
|
||||||
|
% inverter temperatures
|
||||||
|
pltData.invL_temp = data.INV_L_TxPDO_1_T_Inv_L(start:stop);
|
||||||
|
pltData.invR_temp = data.INV_R_TxPDO_1_T_Inv_R(start:stop);
|
||||||
|
% motor temperatures
|
||||||
|
pltData.motL_temp = data.INV_L_TxPDO_1_T_Mot_L(start:stop);
|
||||||
|
pltData.motR_temp = data.INV_R_TxPDO_1_T_Mot_R(start:stop);
|
||||||
|
% motor velocities
|
||||||
|
pltData.motL_vel_rpm = 60*data.INV_L_TxPDO_4_Velocity_L(start:stop);
|
||||||
|
pltData.motR_vel_rpm = 60*data.INV_R_TxPDO_4_Velocity_R(start:stop);
|
||||||
|
% inverter torque demand
|
||||||
|
pltData.invL_torqueDemand = data.INV_L_TxPDO_3_DemandedTorque_L(start:stop)/10; % /10 to match autobox torque
|
||||||
|
pltData.invR_torqueDemand = data.INV_R_TxPDO_3_DemandedTorque_R(start:stop)/10;
|
||||||
|
% inverter actual torque
|
||||||
|
pltData.invL_torqueActual = data.INV_L_TxPDO_3_ActualTorque_L(start:stop)/10;
|
||||||
|
pltData.invR_torqueActual = data.INV_R_TxPDO_3_ActualTorque_R(start:stop)/10;
|
||||||
|
|
||||||
|
%% Wheelspeed
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
%% Statistics:
|
||||||
|
power_regen_kw = pltData.ams_ptot;
|
||||||
|
power_regen_kw(power_regen_kw > 0) = 0;
|
||||||
|
power_used_kw = pltData.ams_ptot;
|
||||||
|
power_used_kw(power_used_kw < 0) = 0;
|
||||||
|
pltData.energy_kwh = trapz(pltData.time_s, pltData.ams_ptot)/3600;
|
||||||
|
pltData.energy_regen_kwh = trapz(pltData.time_s, power_regen_kw)/3600;
|
||||||
|
pltData.energy_used_kwh = trapz(pltData.time_s, power_used_kw)/3600;
|
||||||
|
pltData.distanceTotal_km = trapz(pltData.time_s, pltData.speed_kph./3.6)/1000; % 1/3.6 for km/h to m/s and /1000 for km output
|
||||||
|
pltData.peakPower_kw = max(pltData.ams_ptot);
|
||||||
|
pltData.peakPowerMean_kw = max(movmean(pltData.ams_ptot,500));
|
||||||
|
|
||||||
|
pltData.maxSpeed_kph = max(pltData.speed_kph);
|
||||||
|
pltData.startTime = time_hms(start);
|
||||||
|
pltData.stopTime = time_hms(stop);
|
||||||
|
end
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user