Question about Tire-Road Interaction (Magic Formula)

Refer to help document of matlab, it said that when velocity is lowwer than a specific value, the block saturates the slip denominator as Vlow.So,When velocity is close to 0, sliping will be occured even if there is no driving torque input in this mathod.since Fx is calculated by Fz and Slipping, Fx will be more than 0. what i want to ask is how to solve this, avoiding Fx>0 at no torque and no velocity point.

9 commentaires

Lorenzo
Lorenzo le 2 Août 2024
Hello Tao,
Could you kindly tell me at which specific block you are looking at right now? There are several tire blocks and I am not sure which block has this documentaiton.
Thank you in advance,
Lorenzo
Tao
Tao le 5 Août 2024
Hello Lorenzo,
Thanks for your reply.
The formular above is referred to document of (Simscape / Driveline / Tires & Vehicles / Tire Subcomponents/)Tire-Road Interaction (Magic Formula) .
Umar
Umar le 5 Août 2024

Hi @ Tao,

Referring to help document of matlab, a modification in the calculation method is required. One approach is to introduce a conditional check to adjust Fx when the velocity is close to zero. Here is a simplified example in Matlab to demonstrate how this adjustment can be implemented:

function adjustedFx = calculateLongitudinalForce(Vx, Fz, slippingThreshold)

    if abs(Vx) < slippingThreshold
        adjustedFx = 0; % Set Fx to 0 when velocity is below the slipping threshold
    else
        % Calculate Fx based on Fz and slipping
        % Add your Fx calculation logic here
        adjustedFx = yourFxCalculationFunction(Vx, Fz);
    end

end

% Parameters

Vx = 0.1; % Example velocity

Fz = 100; % Example vertical force

slippingThreshold = 0.01; % Define the slipping threshold

% Calculate adjusted longitudinal force

adjustedFx = calculateLongitudinalForce(Vx, Fz, slippingThreshold); disp(adjustedFx);

So, the function calculateLongitudinalForce, the slippingThreshold parameter is used to determine when the velocity is considered close to zero. If the absolute velocity Vx is below this threshold, the longitudinal force Fx is set to zero to avoid undesired positive values. By incorporating this conditional check in your longitudinal force calculation routine, you can ensure that Fx remains within the desired range even at points with no torque and low velocities, effectively addressing the issue raised in the question.Feel free to adjust the slipping threshold and further customize the calculation logic based on your specific requirements and system dynamics.

Tao
Tao le 5 Août 2024
Thanks for your advice @Umar.
Refer to your advice , I have add function like you said ,but it cannot work out.
Since the vehicle will be accelerated from 0m/s to a specific velocity(about 26m/s) as we expect. limting Fx under slippingThreshold will load to no force to vehicle. That means no acceleration to vehicle ,the vehicle will remain at 0m/s in whole simulation.
Looking forward to more discussion with you!
Anyway ,thank you very much!
Lorenzo
Lorenzo le 5 Août 2024
Hello Tao,
I guess you already have your answer from the post of Umar. Nevertheless I want to add some more infromation.
For the add-on products, in some cases (and the Tire-Road Interaction is one of them) you can access the source code of the component. In the Simscape source code you can look at how the equations are implemented, hereby finding the answer to your question. If we select the component and go to the Tab "Description", we can see that there is a link named "Source Code".
Clicking on the link will open the source code of the component where you can implement the changes proposed by Umar and see how the block is exaclty implemented.
You won't be able to overwrite the original code (is protected) but you can save it with another name and use it in a Simscape Component. Make sure you save your version of the code with the .ssc extension otherwise it will not work.
Best,
Lorenzo
Tao
Tao le 5 Août 2024
Thanks for your advice @Lorenzo
Since I have to waite Simscape licsence for another 2 months,i cannot look what is under the block now. what i want is to clarify how to built my own submodel referring to documents provided by Mathwork.
And as above I wrote, i cannot solve it by setting another threshold vealue for velocity of vehicle!
I appreciate you for your answers.
Umar
Umar le 5 Août 2024

Hi @Tao,

To adress your query regarding, “ what i want is to clarify how to built my own submodel referring to documents provided by Mathwork”

To build a submodel in Simscape for tire roll and slip, you need to consider the forces and characteristic functions that govern tire behavior. The key components include the longitudinal force on the tire (Fx), vertical load (Fz), wheel slip (k), and the relationship between slip velocity and longitudinal force. The submodel incorporates Magic Formula coefficients based on empirical tire data for different road conditions. These coefficients (B, C, D, E) are used to calculate the longitudinal force based on the tire slip and vertical load. Here is a simplified example of how you can implement the tire roll and slip submodel in Simscape using MATLAB code:

function [Fx] = calculateLongitudinalForce(k, Fz, roadCondition)

    % Magic Formula Coefficients based on road condition
    coefficients = getMagicFormulaCoefficients(roadCondition);
    % Calculate longitudinal force using Magic Formula
    Fx = coefficients.B * atan(coefficients.C * k - coefficients.D * (coefficients.C * k - atan(coefficients.C * k))) + coefficients.E * Fz;

end

function [coefficients] = getMagicFormulaCoefficients(roadCondition)

    % Define Magic Formula coefficients based on road condition
    switch roadCondition
        case 'Dry Tarmac'
            coefficients.B = 10;
            coefficients.C = 1.9;
            coefficients.D = 1;
            coefficients.E = 0.97;
        case 'Wet Tarmac'
            coefficients.B = 12;
            coefficients.C = 2.3;
            coefficients.D = 0.82;
            coefficients.E = 1;
        case 'Snow'
            coefficients.B = 5;
            coefficients.C = 2;
            coefficients.D = 0.3;
            coefficients.E = 1;
        case 'Ice'
            coefficients.B = 4;
            coefficients.C = 2;
            coefficients.D = 0.1;
            coefficients.E = 1;
    end

end

By defining the Magic Formula coefficients and implementing the longitudinal force calculation based on tire slip and road conditions, you can create a robust submodel in Simscape for simulating tire roll and slip behavior accurately.

Now, going back to, “ And as above I wrote, i cannot solve it by setting another threshold vealue for velocity of vehicle!”

Here is an enhanced version of the calculateLongitudinalForce function with a refined conditional logic to facilitate vehicle acceleration:

function adjustedFx = calculateLongitudinalForce(Vx, Fz, slippingThreshold, accelerationThreshold)

    if abs(Vx) < slippingThreshold
        adjustedFx = 0; % Set Fx to 0 when velocity is below the slipping threshold
    else
        if abs(Vx) < accelerationThreshold
            % Linearly increase Fx for smooth acceleration
            adjustedFx = someCoefficient * Vx; % Adjust someCoefficient as needed
        else
            % Calculate Fx based on Fz and slipping
            % Add your Fx calculation logic here
            adjustedFx = yourFxCalculationFunction(Vx, Fz);
        end
    end
end

% Parameters Vx = 0.1; % Example velocity Fz = 100; % Example vertical force slippingThreshold = 0.01; % Define the slipping threshold accelerationThreshold = 5; % Define the threshold for acceleration

% Calculate adjusted longitudinal force adjustedFx = calculateLongitudinalForce(Vx, Fz, slippingThreshold, accelerationThreshold); disp(adjustedFx);

So, in this modified code, I added a new parameter accelerationThreshold to control the point at which the vehicle starts accelerating.When the velocity is below accelerationThreshold, the Fx is linearly increased to enable smooth acceleration.You can adjust the someCoefficient value to control the rate of acceleration based on the velocity. By incorporating these changes, the vehicle should now accelerate from 0 m/s to the desired velocity while considering the slipping and acceleration thresholds. Feel free to adjust the parameters and coefficients to fine-tune the acceleration behavior according to your simulation requirements.

Tao
Tao le 5 Août 2024
Thanks @Umar,
Refer to “% Parameters Vx = 0.1; % Example velocity Fz = 100; % Example vertical force slippingThreshold = 0.01; % Define the slipping threshold accelerationThreshold = 5; % Define the threshold for acceleration” The function [calculateLongitudinalForce] will meet first condition ,Fx=0. and the vehicle will be able to accelerate from 0 to accelerationThreshold (= 5)
And if set slippingThreshold as a bigger value in order to meet 2nd conditon, the vehicle will be acclerate from 0 to accelerationThreshold without anypower from powertrain or brake system ,apparently, it is not logica.
Umar
Umar le 5 Août 2024
Hi @Tao,
Refer to “% Parameters Vx = 0.1; % Example velocity Fz = 100; % Example vertical force slippingThreshold = 0.01; % Define the slipping threshold accelerationThreshold = 5; % Define the threshold for acceleration” The function [calculateLongitudinalForce] will meet first condition ,Fx=0. and the vehicle will be able to accelerate from 0 to accelerationThreshold (= 5)
I agree with you on this 100%.
And if set slippingThreshold as a bigger value in order to meet 2nd conditon, the vehicle will be acclerate from 0 to accelerationThreshold without anypower from powertrain or brake system ,apparently, it is not logica.
I do agree with that part as well and my code snippet is work in process. Hence, this is how software works to implement modifications to the code logic when more conditions are added over the time. I mean you don’t learn all the aspects of vechile driving in one day, it takes some time. So, one approach could involve adjusting the conditions and calculations within the function to ensure that the longitudinal force behaves as expected under different scenarios of velocity and acceleration thresholds and test the modified function with various input values to ensure its correctness and adherence to the desired behavior just like when you test drive a car before you make a decision to buy it.

Connectez-vous pour commenter.

Réponses (0)

Catégories

Produits

Question posée :

Tao
le 2 Août 2024

Commenté :

le 5 Août 2024

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by