MFeval (Magic Formula evaluation) has been created to provide a robust way to evaluate Magic Formul tyre models.
The toolbox contains the function with the same name (mfeval.m) used to evaluate tyre property files with the Magic Formula 5.2, 6.1 or 6.2 equations. A tyre property file (.tir) contains the magic formula parameters that define the tyre's force and moment characteristics.
Marco Furlan (2021). MFeval (https://www.mathworks.com/matlabcentral/fileexchange/63618-mfeval), MATLAB Central File Exchange. Retrieved .
Hi Marc, please email me your .tir file to see if I can spot the error. You can find my email typing "help mfeval" in the command window
Thank you very much for your work.
So far I have used tir files from MF 6.x. However, I am now using an older version MF 5.2. Unfortunately, Simulink now gives me an error message:
Error in 'Modell/Tiremodell MFeval/CPI tyre':
Failed to evaluate mask initialization commands.
Can you please help me?
Thank you very much!
Amazing work. Thanks Marco!
firstly, i appreciate well written and documented codes
i am trying to use STI tire same way as TNO tire for simscape multiibody. unfortunately, it doesn't work. Can you provide some suggestions on it
Updates in version 4.2.0:
◾ mfeval.coefficientCheck uses the correct nominal pressure parameter (P0 = MFStruct.NOMPRES)
◾ The Mx formulation does not allow the parameter sets QSX1 to QSX11 and QSX12 to QSX14 to be both non-zero
◾ The Mz combined formulation under high inclination angles has been improved to match TNO (parameter Gyk_sub0)
A MESSAGE TO ALL MFEVAL USERS:
Thank you for posting and asking questions. But please note that I don't receive any notification when a comment is posted here.
If your question is urgent or needs a lengthy explanation please send your queries to the email address that can be found in the documentation or by typing "help mfeval" in the command window.
Release notes for version 4.1.0:
◾ Typo in .tir file names fixed
◾ Mz combined with camber improved after using starVar_sub0 to calculate Fy
◾ Contact patch global positions x, y, z are now calculated in STI
◾ Saturation block for FZ has been changed to only apply a lower bound.
◾ In STI a more robust transformation from ISOW to ISOC has been implemented.
◾ In STI the tratmat input order has been changed to match TNO
◾ The saturation of the pressure input in CPI has been removed to improve the effective radius and slip ratio correlation with TNO
Hi,Macro,thanks for sharing this.
In the fitting example, I have fitted the lateral force Fy. Could you give me some instruction on how to fit the self aligning moment Mz. How to modified in the fitting example, so that the Mz reslut can be obtained?
Very nice package!
Thanks a lot for your sharing.
Firstly, thank you for providing this library; it is extremely useful. However, when I use the library in a iterator subsystem I get multiple errors due to the continuous formulation of the library (e.g. iterators need to be changed for sample time reasons, computation errors that need to be fixed with delays etc). Even though I did manage to do changes in order to make it work, the results are not the best. I would like to ask if there is a guideline for us to use in order to make it compatible with iterative subsystems?
MFeval offers the same functionality as other paid-for models but is open source with good documentation and support from the author. Take the time to learn how to implement MFeval into your project and have fun!!!
Great tool! Gracias Marco
Thanks for your comment, and for contributing to the development of MFeval.
You are right. In the line 1580:
% Evaluate Gyk with gamma = 0 and phit = 0
[~,Gyk_sub0] = obj.calculateFy(..., Fyo, muy)
I pass the vectors "Fyo" and "muy" that include camber effects, so technically is not correct. However, "Fyo" and "muy" are not used to calculate "Gyk_sub0" so the result is not affected by this typo.
Even though the result will be the same, I will change the order to evaluate "Fyo_sub0" before "Gyk_sub0" to pass the right inputs (Fyo_sub0 and muy_sub0) and to make it easier to understand.
Hi Marco. You done very useful job. Thank you so much. I have a question:
In Solver61.m. when calculating Mz:
% Evaluate Gyk with gamma = 0 and phit = 0
[~,Gyk_sub0] = obj.calculateFy(tirParams, postProInputs_sub0, internalParams_sub0, modes, starVar, incrVar, Fyo, muy);
gamma is included in Fyo and muy, but when you calculate Fyo and muy you don't set gamma in zero. It is right?
Release notes - Version 2.2.0:
◾ Road position implemented in STI
◾ Road velocity implemented in STI
◾ Some MATLAB Function blocks have been replaced with inbuilt Simulink blocks
◾ The switch case to select the dynamics mode in CPI is done upstream to avoid unnecessary calculations
◾ The passband frequency of the low pass filters has been increased to 100 Hz
◾ Simulink library names updated. This will brake the links from old models and needs to be updated
Since version 2.0 mfeval is written in Object Oriented. The function readTIR is now a method of mfeval and should be called as:
params = mfeval.readTIR('ExampleFile.tir');
I am getting an 'unexpected MATLAB expression' when trying to run the readTIR script. Do you know why this might be the case? The first line of readTIR.m is below, showing what I tried.
function tirParams = readTIR('front.tir')
I use this tool for its import feature to my own scripts, which works well and is really easy to use!
very help thanks
Nice job Marco, very helpful!
Sorry for the delay, but I don't receive a notification when a new comment is posted here.
Modelling is a hard and complex task. First of all you will need good quality tyre data. This data is difficult and expensive to obtain. The data can be measured with a roller drum bench, with a flat belt machine (like Calspan TIRF), with a test trailer (like TNO) or with a wheel force transducer mounted in a real car.
It's very probable that you will have to post-process and crop somehow the data. E.g. separate FreeRolling tests to fit pure lateral Fy, Mz and Mx; use BrakeDrive data to fit Fx and combined forces and moments; use the Spring Rate tests to fit the loaded radius model, etc. You should basically use the right data for the right equation.
Once you are happy with the data you can use a MATLAB fitting function like lsqnonlin to find the correct MF6.1 parameters for your model (or TIR file).
x = lsqnonlin(fun,x0)
Where "x" are your optimized parameters packed in a structure and "fun" is your cost function. Your cost function should calculate the error of the model vs the data. For example error = FYmodel – Fydata (use mfeval in your cost function to calculate FYmodel)
You should later plot your model against the data to see if you have a good fitting. Check if the model is stable in all the operating conditions. It can happen that the operating conditions in your simulation are outside of the tested range, so be sure that the model is able to extrapolate in a stable way.
Finally remember that it’s important to follow a certain order when you are fitting a full Magic Formula model. For example, you can’t fit the Fy combined parameters before the Fy pure parameters.
This is a vague overview of the process, hope it helps.
Firstly I would like to congratulate you for the amazing job done
Do you have some tips to find all the Magic Formula coefficients so that I can create the TIR file?
thank you. I already worked with that paper, but couldn't make any progress on Mz with it. I'll inform you if we do!
I'm still working on the turn slip model, in particular on parking efforts at very low speeds.
I haven't been able to reproduce TNO results yet, but I suggest you to read the following paper:
Lugaro, C., Schmeitz, A., Ogawa, T., Murakami, T. et al., "Development of a Parameter Identification Method for MF-Tyre/ MF-Swift Applied to Parking and Low Speed Manoeuvres," SAE Int. J. Passeng. Cars - Mech. Syst. 9(2):2016, doi:10.4271/2016-01-1645.
Hope it helps, as soon as I can validate parking efforts I will publish MFeval 1.5.
If you find something interesting I would be very interested to know.
Hi Marco, great tool! Thank you for publishing. I am working in a MF6.2 tool to parameterize tires with measurements, done on our inner drum test bench at the KIT. I also got issues with the Turnslip of Mz. Did you make any progress on that topic?
Remember to type "help mfeval" in the command window to see the documentation and learn how to use it.
Thanks for sharing this amazing work!
With your approval, I will use it in my Bachelor Tesis developed with Adams Car (Formula Student model)
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!