Added structure and reorg script and first model

This commit is contained in:
Tim Korjakow 2023-12-25 13:54:00 +01:00
commit d5dc5129d2
5 changed files with 302 additions and 0 deletions

3
.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
/raw_data/*.mat
/raw_data/*/*.mat
/sorted_data

1
README.md Normal file
View File

@ -0,0 +1 @@
# ft24_pacejka_tyre

View File

@ -0,0 +1 @@
Drop the TTC Data here such that all cornering runs are in subfolders

73
scripts/reorganize_data.m Normal file
View File

@ -0,0 +1,73 @@
function reorganize_data()
basePath = '../';
rawDataPath = fullfile(basePath, 'raw_data');
% Get all .mat files in the rawDataPath
files = dir(fullfile(rawDataPath, '**/*.mat'));
for i = 1:length(files)
filePath = fullfile(files(i).folder, files(i).name);
data = load(filePath);
if isfield(data, 'tireid') && isfield(data, 'testid')
tireid = data.tireid;
testType = formatTestType(data.testid);
newDir = fullfile('../sorted_data', tireid);
if ~exist(newDir, 'dir')
mkdir(newDir);
end
newFilePath = fullfile(newDir, sprintf('%s.mat', testType));
if exist(newFilePath, 'file')
mergeData(newFilePath, filePath);
else
copyfile(filePath, newFilePath);
end
else
warning('Required fields not found in %s', filePath);
end
end
end
function testType = formatTestType(testid)
switch lower(testid)
case 'cornering'
testType = 'cornering';
case 'drive/brake/combined'
testType = 'drivebrake';
otherwise
error('Unknown testid: %s', testid);
end
end
function mergeData(mergedFilePath, newFilePath)
% Load existing and new data
existingData = load(mergedFilePath);
newData = load(newFilePath);
% Merge logic with error checking for singular values
fieldNames = fieldnames(newData);
for i = 1:length(fieldNames)
fieldName = fieldNames{i};
if isnumeric(newData.(fieldName)) || islogical(newData.(fieldName))
if numel(newData.(fieldName)) == 1 % Singular value
if isfield(existingData, fieldName) && existingData.(fieldName) ~= newData.(fieldName)
error('Mismatch in singular value for field "%s" between existing and new data.', fieldName);
end
elseif isfield(existingData, fieldName)
existingData.(fieldName) = [existingData.(fieldName); newData.(fieldName)];
else
existingData.(fieldName) = newData.(fieldName);
end
elseif ~strcmp(fieldName, 'tireid') && ~strcmp(fieldName, 'testid')
if isfield(existingData, fieldName) && ~isequal(existingData.(fieldName), newData.(fieldName))
error('Mismatch in non-array field "%s" between existing and new data.', fieldName);
end
existingData.(fieldName) = newData.(fieldName);
end
end
% Save the merged data
save(mergedFilePath, '-struct', 'existingData');
end

View File

@ -0,0 +1,224 @@
[MDI_HEADER]
FILE_TYPE = 'tir'
FILE_VERSION = 3
FILE_FORMAT = 'ASCII'
$-----------------------------------------------------------------units
[UNITS]
LENGTH = 'meter'
FORCE = 'newton'
ANGLE = 'radians'
MASS = 'kg'
TIME = 'second'
$-----------------------------------------------------------------model
[MODEL]
FITTYP = 61
TYRESIDE = 'LEFT'
LONGVL = 10
VXLOW = 1
$-------------------------------------------------------------dimension
[DIMENSION]
UNLOADED_RADIUS = 0.2286
$--------------------------------------------------operating conditions
[OPERATING_CONDITIONS]
NOMPRES = 100000
$---------------------------------------------------------------inertia
[INERTIA]
$--------------------------------------------------------------vertical
[VERTICAL]
FNOMIN = 1500
$------------------------------------------------------------structural
[STRUCTURAL]
$---------------------------------------------------------contact patch
[CONTACT_PATCH]
$----------------------------------------------inflation pressure range
[INFLATION_PRESSURE_RANGE]
$--------------------------------------------------vertical force range
[VERTICAL_FORCE_RANGE]
$-------------------------------------------------------long slip range
[LONG_SLIP_RANGE]
$------------------------------------------------------slip angle range
[SLIP_ANGLE_RANGE]
$-----------------------------------------------inclination angle range
[INCLINATION_ANGLE_RANGE]
$--------------------------------------------------scaling coefficients
[SCALING_COEFFICIENTS]
LFZO = 1
LCX = 1
LMUX = 1
LEX = 1
LKX = 1
LHX = 1
LVX = 1
LCY = 1
LMUY = 1
LEY = 1
LKY = 1
LHY = 1
LVY = 1
LTR = 1
LRES = 1
LXAL = 1
LYKA = 1
LVYKA = 1
LS = 1
LKYC = 1
LKZC = 1
LVMX = 1
LMX = 1
LMY = 1
LMP = 1
$---------------------------------------------longitudinal coefficients
[LONGITUDINAL_COEFFICIENTS]
PCX1 = 1.5
PDX1 = 1.9208
PDX2 = -0.17852
PDX3 = 3.9292
PEX1 = -0.6473
PEX2 = -0.67795
PEX3 = 0.6
PEX4 = -0.9
PKX1 = 23.6691
PKX2 = 18.5248
PKX3 = -1.6735
PHX1 = -0.0044404
PHX2 = -0.0017213
PVX1 = -0.024192
PVX2 = -0.1
PPX1 = -2.3463
PPX2 = -2.7112
PPX3 = -0.74204
PPX4 = -0.7617
RBX1 = 5.99
RBX2 = 5.99
RBX3 = 0
RCX1 = 1
REX1 = -1
REX2 = -0.1
RHX1 = 0
$----------------------------------------------overturning coefficients
[OVERTURNING_COEFFICIENTS]
QSX1 = 0
QSX2 = 1.5
QSX3 = 0.1
QSX4 = 0.1
QSX5 = 0
QSX6 = 0
QSX7 = 0.1
QSX8 = 0
QSX9 = 0
QSX10 = 0
QSX11 = 0
QSX12 = 0
QSX13 = 0
QSX14 = 0
PPMX1 = 0
$--------------------------------------------------lateral coefficients
[LATERAL_COEFFICIENTS]
PCY1 = 1.5
PDY1 = 2.4789
PDY2 = -0.5
PDY3 = 10
PEY1 = 1.2322
PEY2 = 0.47308
PEY3 = -0.3052
PEY4 = -7.8434
PEY5 = -115.0383
PKY1 = -21.5408
PKY2 = 1.2661
PKY3 = -0.59067
PKY4 = 2
PKY5 = -25.9435
PKY6 = -2.5098
PKY7 = 0.61093
PHY1 = -0.0083677
PHY2 = -0.0052997
PVY1 = -0.16592
PVY2 = 0.071875
PVY3 = -0.74422
PVY4 = -3.5858
PPY1 = 0.32063
PPY2 = 1.3726
PPY3 = -0.2143
PPY4 = -0.032422
PPY5 = -1.5161
RBY1 = 5
RBY2 = 2.99
RBY3 = 0.02
RBY4 = 0
RCY1 = 1
REY1 = -0.1
REY2 = 0.1
RHY1 = 0
RHY2 = 0
RVY1 = 0
RVY2 = 0
RVY3 = 0
RVY4 = 0
RVY5 = 0
RVY6 = 0
$--------------------------------------------------rolling coefficients
[ROLLING_COEFFICIENTS]
QSY1 = 0
QSY2 = 0
QSY3 = 0
QSY4 = 0
QSY5 = 0
QSY6 = 0
QSY7 = 0
QSY8 = 0
$-------------------------------------------------aligning coefficients
[ALIGNING_COEFFICIENTS]
QBZ1 = 0.10008
QBZ2 = 0.00023246
QBZ3 = 0.00029086
QBZ4 = -0.0031101
QBZ5 = -0.0031102
QBZ9 = 1.5088
QBZ10 = -0.19344
QCZ1 = 0.11987
QDZ1 = 0.1152
QDZ2 = 0.0047181
QDZ3 = 0.96498
QDZ4 = -0.73585
QDZ6 = -0.0036203
QDZ7 = -0.050338
QDZ8 = -0.084844
QDZ9 = 5.8235
QDZ10 = 1.612
QDZ11 = -0.47189
QEZ1 = -0.025293
QEZ2 = -0.096812
QEZ3 = -0.090171
QEZ4 = -0.0044756
QEZ5 = -0.0044755
QHZ1 = 0.01593
QHZ2 = -0.0020194
QHZ3 = -0.002358
QHZ4 = 0.0013057
PPZ1 = 0
PPZ2 = 0
SSZ1 = 0
SSZ2 = 0
SSZ3 = 0
SSZ4 = 0
$-------------------------------------------------turnslip coefficients
[TURNSLIP_COEFFICIENTS]
PDXP1 = 0
PDXP2 = 0
PDXP3 = 0
PKYP1 = 0
PDYP1 = 0
PDYP2 = 0
PDYP3 = 0
PDYP4 = 0
PHYP1 = 0
PHYP2 = 0
PHYP3 = 0
PHYP4 = 0
PECP1 = 0
PECP2 = 0
QDTP1 = 0
QCRP1 = 0
QCRP2 = 0
QBRP1 = 0
QDRP1 = 0