Question about Tire-Road Interaction (Magic Formula)

9 commentaires
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.

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.
Réponses (0)
Catégories
En savoir plus sur Tires and Vehicles dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!