VehicleDynamics.Wheels.Utilities

VehicleDynamics.Wheels.Utilities.WheelData VehicleDynamics.Wheels.Utilities.BaseWheel

NameDescription
WheelData Data needed for all wheel types
BaseWheel Properties common to all types of wheels and tyres
interpolate1 Interpolate linearly between two points
interpolate2 Interpolate quadratically between two points, such that y(0)=0
interpolate2b Interpolate quadratically between two points, such that y(0)=0
interpolate2c Interpolate quadratically between two points, such that y(0)=0


VehicleDynamics.Wheels.Utilities.WheelData VehicleDynamics.Wheels.Utilities.WheelData

Data needed for all wheel types

Parameters

NameDefaultDescription
R00.3undeformed radius of wheel [m]
Rrim0.2radius of rim [m]
width0.19width of wheel (>0) [m]
m10mass of wheel [kg]
Iyy1wheel inertia with respect to wheel axis [kg.m2]
Ixx1wheel inertia with respect to axis perpendicular to wheel axis [kg.m2]

Modelica definition

record WheelData "Data needed for all wheel types" 
  import SI = Modelica.SIunits;
  parameter SI.Radius R0=0.3 "undeformed radius of wheel";
  parameter SI.Radius Rrim=0.2 "radius of rim";
  parameter SI.Length width=0.19 "width of wheel (>0)";
  parameter SI.Mass m=10 "mass of wheel";
  parameter SI.Inertia Iyy=1 "wheel inertia with respect to wheel axis";
  parameter SI.Inertia Ixx=1 
    "wheel inertia with respect to axis perpendicular to wheel axis";
  
end WheelData;

VehicleDynamics.Wheels.Utilities.BaseWheel VehicleDynamics.Wheels.Utilities.BaseWheel

Properties common to all types of wheels and tyres

VehicleDynamics.Wheels.Utilities.BaseWheel

Information

This element is a superclass of wheel/tyre
systems. It contains all the equations which are independent of the
tyre model. Especially, the contact point of wheel and road, as well
as the contact velocities are computed.
The frames of this object have the following meaning:
Frame carrierFrame is fixed in the carrier of the wheel
and is located on the spin axis of the wheel in the
middle point of the wheel. This point is also approximately
used as the center-of-mass of the wheel.
It is temporarily assumed that the road lies in the
x-y plane of the inertial frame! This restriction can
be removed by defining the road properties via inner/outer
functions.
Flange XXX is used to drive the wheel with a 1D-drive train.
This element is realized according to the description:
  Georg Rill: Simulation von Kraftfahrzeugen, Vieweg, 1994

Parameters

NameDefaultDescription
n[3]{0,1,0}Unit vector in direction of spin axis (same direction for left and right wheel)
leftWheeltruetrue, if left wheel, otherwise right wheel
exactfalsefalse if influence of bearing acceleration is neglected
wheelDataredeclare Wheels.Utilities.WheelData wheelData 

Modelica definition

partial model BaseWheel 
  "Properties common to all types of wheels and tyres" 
  import SI = Modelica.SIunits;
  import Car;
  // PARAMETERS COMMON FOR ALL WHEELS
  parameter Real n[3]={0,1,0} 
    "Unit vector in direction of spin axis (same direction for left and right wheel)";
  parameter Boolean leftWheel=true "true, if left wheel, otherwise right wheel";
  parameter Boolean exact=false 
    "false if influence of bearing acceleration is neglected";
  
  final parameter Real nShape[3]=if leftWheel then n else -n;
  
  constant SI.Velocity v_eps=1.e-10;
  
  // Modelica.Constants.eps "1/v_eps should be representable on the machine";
  
  // GEOMETRIC VARIABLES  
  SI.Angle camberAngle "Angle between wheel plane and contact normal";
  Real cosCamberAngle "Cosine of camber angle";
  
  SI.Radius Rdym "Distance between wheel center point and contact point";
  
  SI.Length delta_r 
    "= R0 - Rdym, where R0 is the undeformed wheel radius and Rdym is the distance between wheel center point and contact point";
  Real Sroad[3, 3] "Transformation matrix from road frame to inertial frame";
  Real S[3, 3] "Transformation matrix from wheel carrier frame to road frame";
  Real S2[3, 3] " S2: Transformation matrix from road frame to frame_b";
  
  SI.Position rRoad0[3] 
    "Position vector from inertial to road frame, resolved in inertial frame";
  SI.Position Cr[3] 
    "Position vector from road frame to C-Frame, resolved in road frame";
  SI.Position Wr[3] 
    "Position vector from road frame to W-Frame, resolved in road frame";
  SI.Position rP0[3] 
    "Position vector from road frame to point P0, resolved in road frame";
  SI.Position rP1[3] 
    "Position vector from road frame to point P1, resolved in road frame";
  SI.Position rC_P1[3] 
    "Position vector from C-frame to point P1, resolved in road frame";
  SI.Position rC_W[3] 
    "Position vector from C-frame to W-frame, resolved in road frame";
  
  Real nn[3] 
    "Normalized vector of wheel spin axis, resoved in wheel carrier frame";
  Real Ce_x[3] "Unit vector in x-direction of C-Frame, resolved in road frame";
  Real Ce_y[3] "Unit vector in y-direction of C-Frame, resolved in road frame";
  Real Ce_z[3] "Unit vector in z-direction of C-Frame, resolved in road frame";
  Real Ce_z_0[3](start={0,0,1}) "Initial guess for Ce_z";
  
  Real We_x[3] "Unit vector in x-direction of W-Frame, resolved in road frame";
  Real We_y[3] "Unit vector in y-direction of W-Frame, resolved in road frame";
  Real We_z[3] "Unit vector in z-direction of W-Frame, resolved in road frame";
  
  SI.AngularVelocity w "Rotational speed of wheel around wheel axis";
  SI.Angle phi "Rotational position of wheel around wheel axis";
  SI.AngularVelocity wWheel[3] 
    "Absolute angular velocity of the rotating wheel, resolved in frame road";
  SI.Velocity Cv[3] 
    "Absolute velocity of wheel center point, resolved in frame road";
  SI.Velocity ddelta_r "Derivative of delta_r (= -der(Rdym))";
  SI.Velocity Wv_x 
    "Absolute velocity of contact point in longitudinal direction We_x";
  SI.Velocity Wv_y 
    "Absolute velocity of contact point in lateral direction We_y";
  SI.Velocity v_x 
    "Absolute velocity of wheel in longitudinal direction We_x";
  SI.Velocity v_y "Absolute velocity of wheel in lateral direction We_y";
  
protected 
  Real aux1[3] "Auxiliary vector 1 (vector perpendicular to Ce_y and We_z)";
  Real aux2[3] "Auxiliary vector 2";
  
  // THESE FORCES AND TORQUES SHOULD BE GENERATED BY THE TOTAL TYRE MODEL
public 
  SI.Force F_x "Tyre/contact force at origin of W-frame in x-direction";
  SI.Force F_y "Tyre/contact force at origin of W-frame in y-direction";
  SI.Force F_z "Tyre/contact force at origin of W-frame in z-direction";
  SI.Force M_x "Tyre/contact torque at origin of W-frame in x-direction";
  SI.Force M_y "Tyre/contact torque at origin of W-frame in y-direction";
  SI.Force M_z "Tyre/contact torque at origin of W-frame in z-direction";
  // ********************************************************************
  
  // RESULTANT FORCES ANS TORQUES
  SI.Force Wf[3] 
    "Tyre/contact force at origin of W-frame, resolved in road frame";
  SI.Torque Wt[3] "Tyre/contact torque at W-frame, resolved in road frame";
  SI.Torque Ct[3] 
    "Tyre torque acting at wheel center, resolved in wheel_body frame";
  SI.Torque Ct_tyre 
    "Tyre torque acting at wheel center in direction of spin axis";
  
  // *********************************************************************  
  
  Road road;
  Road road2;
  Real mueRoad;
  Real altitudeRoad;
  Real normalRoad[3];
  
public 
  outer block Road = Environments.Interfaces.TyreRoadInterface;
  
public 
  replaceable Wheels.Utilities.WheelData wheelData;
  
  ModelicaAdditions.MultiBody.Forces.ExtForce tyreForceWheelCenter;
  ModelicaAdditions.MultiBody.Forces.ExtTorque tyreTorqueWheelCenter;
  ModelicaAdditions.MultiBody.Interfaces.Frame_a carrierFrame;
  Modelica.Mechanics.Rotational.Interfaces.Flange_a driveShaft1D;
  Modelica.Mechanics.Rotational.Torque drivingTyreTorque;
  ModelicaAdditions.MultiBody.Joints.Revolute hub(n={0,1,0});
  ModelicaAdditions.MultiBody.Parts.Body2 wheel_body(
    m=wheelData.m, 
    I11=wheelData.Ixx, 
    I22=wheelData.Iyy, 
    I33=wheelData.Ixx);
equation 
  road.x = Wr[1];
  road.y = Wr[2];
  //road.v = 0;
  //temporarilly
  road.mue = mueRoad;
  road.z = altitudeRoad;
  road.n = normalRoad;
  
  connect(wheel_body.frame_a, hub.frame_b);
  connect(hub.frame_a, carrierFrame);
  connect(drivingTyreTorque.flange_b, hub.axis);
  connect(driveShaft1D, hub.axis);
  
  /* Definition of road:
      1. A road frame is defined which is fixed in the inertial frame and
         which is defined relatively to the inertial frame. This frame is
         defined as:
           Sroad : Transformation matrix from road frame to inertial frame.
           rroad0: Position vector from inertial frame origin to the
                   origin of the road frame, resolved in the inertial frame.
      2. The z-axis of the road frame points upwards. The road surface
         is defined as (Wr_z, We_z) = f(Wr_x, Wr_y), where
            Wr_x, rWy, rWz are the x-, y-, z-coordinates of the wheel/road
            contact point with respect to the road frame and
            We_z is the unit vector at the contact point which is
            perpendicular to the surface and points upwards.
      Temporarily it is assumed that the road is a plane at z=0 of the inertial
      frame. Still, the equations below are written for a general road profile.
      This assumption should be replaced later.
      The friction coefficient mue of the road is temporarily set to the
      nominal friction coefficient data.mue_max of the tyre.
      The determination of the contact point of wheel and road requires
      the solution of a nonlinear system of equations. However, since the
      contact area of the tyre of a car is a rectangle with about 10 cm x 20 cm
      area and the road is approximated in the order of centimeters, it does not
      make much sense to determine the "virtual" contact point very exactly.
      Below one iteration of a fixed point iteration scheme is used to solve
      this nonlinear system of equations. This works well, provided a good
      initial guess Ce_z_0 for the unit vector Ce_z (normalized vector from
      wheel center point to contact point), is available. A good guess is
      - a unit vector which is fixed in the main car body and points
        into the z-direction of the road frame when the car is at rest.
      - a unit vector which is fixed in the wheel carrier and points
        into the z-direction of the road frame when the car is at rest.
      - the value of Ce_z at the previous integration step.
      Temporarily, this initial guess is set for the case that
      the road is a plane at z=0.
      Note, that the exact nonlinear system of equations is constructed
      by replacing the equation for Ce_z_0 below by the equation:
          Ce_z = Ce_z_0;
      and by using an appropriate initial guess for Ce_z_0.
   */
  Sroad = identity(3);
  rRoad0 = zeros(3);
  //Ce_z_0 = Ce_z;
  Ce_z_0 = {0,0,1};
  //mueRoad = 0.7;
  //(mueRoad,altitude) = Road(Wr[1], Wr[2], sqrt(Wv_x*Wv_x + Wv_y*Wv_y));
  /* Definition of the ISO coordinate systems of the wheel:
      Frame C (ISO-C, TYDEX C axis system) is fixed to the wheel carrier.
        - The origin is described by vector Cr, from the origin of the
          road frame to the wheel center, resolved in the road frame.
        - The x-axis (= unit vector Ce_x) is parallel to the road tangent plane
          within the wheel plane
        - The y-axis (= unit vector Ce_y) is normal to the wheel plane and
          therefore parallel to the wheels spin axis.
        - The z-axis (= unit vector Ce_z) is orthogonal to the x- and y-axis, i.e.,
          it is a unit vector along the line from the contact point to
          the wheel center point.
      Frame W (ISO-W, TYDEX W axis system) is fixed at the contact point
      of the wheel and the road.
        - The origin is described by vector Wr, from the origin of the
          road frame to the tyre contact point, resolved in the road frame.
        - The x-axis (= unit vector We_x) lies in the local road tangent plane
          along the intersection of the wheel plane and the local road plane,
          i.e., it is parallel to the x-axis of frame C.
        - The z-axis (= unit vector We_z) is perpendicular to the local
          road tangent plane and points upward.
        - The y-axis (= unit vector We_y) lies in the local road plane and
          is perpendicular to the x- and z-axis.
      All vectors describing frame C and frame W are resolved in the
      road frame. Note, that We_x = Ce_x (but We_y <> Ce_y)
   */
  
  /* Determine C-frame, where all vectors are resolved in the road frame.
       n: spin-axis in wheel carrier frame;
       S: transformation matrix from wheel carrier frame to road frame).
    */
  S = transpose(Sroad)*carrierFrame.S;
  nn = n/sqrt(n*n);
  Ce_x = We_x;
  Ce_y = S*n;
  Ce_z = cross(Ce_x, Ce_y);
  Cr = transpose(Sroad)*(carrierFrame.r0 - rRoad0);
  
  /* Determine W-frame, where all vectors are resolved in the road frame.
       As shortly discussed above, this is performed by one iteration of a
       fixed point iteration scheme, constructing three points P0, P1, P2:
       Point P0: Defined by position vector Wr_0 which is computed using
                 the initial guess We_z_0 for We_z.
       Point P1: P0 is usually not on the road. The x-,y-coordinates of P0
                 are used for P1. The z-coordinate is computed by using
                 the road surface function. In point P1 the contact frame W
                 is constructed. This defines especially the contact plane.
       Point P2: P1 is moved in the constructed contact plane, such that
                 it is the intersection of the contact plane with the line
                 along Ce_z, i.e., along the line from the wheel-center point
                 to the contact point (which is computed above as cross
                 product of the wheel spin axis Ce_y and of We_x computed
                 for point P1).
       rP0     : Position vector from road frame origin to point P0.
       rP1     : Position vector from road frame origin to point P1.
                 Temporarily, rP1[3] is set to 0 and We_z is set to {0,0,1}.
                 Later the road surface function should be used to calculate
                 these values.
       Rdym    : Distance between wheel center point and contact point.
       rC_W    : Position vector from C-frame origin to W-frame origin.
                 During the contact point calculation (iteration), this is
                 the vector from C-frame origin to point P2.
                   rC_W = -Rdym*Ce_z
                        = rC_P1 + a*We_x + b*We_y;
                      multiply rC_W with We_z
                   We_z*rC_W = -Rdym*We_z*Ce_z
                             = We_z*rC_P1  (We_z is perpendicular to We_x and We_y)
                      solve for Rdym
                   Rdym = -(We_z*rC_P1)/(We_z*Ce_z)
    */
  rP0 = Cr - wheelData.R0*Ce_z_0;
  
  //road has to be called twice
  road2.x = rP0[1];
  road2.y = rP0[2];
  //road2.v = 0;
  rP1 = {rP0[1],rP0[2],road2.z};
  // general road: rP1[3] = f(rP1[1], rP1[2]);
  We_z = road2.n;
  //{0,0,1};
  // general road: We_z = f(rP1[1], rP1[2]);
  aux1 = cross(Ce_y, We_z);
  We_x = aux1/noEvent(sqrt(aux1*aux1));
  We_y = cross(We_z, We_x);
  
  rC_P1 = rP1 - Cr;
  cosCamberAngle = We_z*Ce_z;
  Rdym = -(We_z*rC_P1)/cosCamberAngle;
  rC_W = -Rdym*Ce_z;
  Wr = Cr + rC_W;
  
  /* Compute characteristic values of the contact:
       delta_r    : Distance between undeformed wheel point and contact point
                    R0 = Rdym + delta_r
       delta_z    : Radial tyre deflection
                    (= wheel deformation in z-direction of C-frame)
                    delta_z = delta_r if the wheel is in contact with the road
       camberAngle: Angle between wheel plane and We_z
                    (cos(pi/2 - camberAngle) = Ce_y*We_z)
    */
  delta_r = wheelData.R0 - Rdym;
  camberAngle = Modelica.Math.asin(Ce_y*We_z);
  
  /* Determine contact point velocities
       wWheel  : Absolute angular velocity of the rotating wheel, resolved in frame road
       ddelta_r: derivative of delta_r (= -der(Rdym))
       Cv      : Absolute velocity of wheel center point, resolved in frame road
       Wv      : Absolute velocity of contact point, resolved in frame road
                   Wv = der(Wr)
                      = der(Cr) + cross(wWheel, rC_W) + der(abs(rCW))*(-Ce_z)
                      = Cv + cross(wWheel, rC_W) + der(R0 - delta_r)*(-Ce_z)
                      = Cv + cross(wWheel, rC_W) + der(delta_r)*Ce_z
                   Wv has to be in the road plane. Therefore We_z*Wv = 0
                     0 = We_z*Wv = We_z*(Cv + cross(wWheel, rC_W)) + We_z*Ce_z*ddelta_r
                     ddelta_r = -We_z*(Cv + cross(wWheel, rC_W)) / (We_z*Ce_z)
       Wv_x  : Absolute velocity of contact point in longitudinal direction
               = We_x*Wv
               = We_x*(Cv + cross(wWheel, rC_W) + ddelta_r*Ce_z)
               = We_x*(Cv + cross(wWheel, rC_W))
               since We_x*Ce_z = Ce_x*Ce_z = 0
       Wv_y  : Absolute velocity of contact point in lateral direction
               = We_y*Wv
               = We_y*(Cv + cross(wWheel, rC_W) + ddelta_r*Ce_z)
       Wv_z  : Absolute velocity of contact point in normal direction
               = 0
    */
  wWheel = S*(carrierFrame.w + n*w);
  Cv = S*carrierFrame.v;
  aux2 = Cv + cross(wWheel, rC_W);
  ddelta_r = -We_z*aux2/cosCamberAngle;
  Wv_x = We_x*aux2;
  Wv_y = We_y*(aux2 + ddelta_r*We_z);
  
  //DETERMINE THE WHEEL CONTACT POINT VELOCITY
  v_x = Cv*We_x;
  v_y = Cv*We_y;
  
  //STATES OF WHEEL ROTATION
  w = hub.qd;
  phi = hub.q;
  
  //EXPRESSIONS FOR F_x, F_y, F_z, M_x, M_y, M_z AT EACH WHEEL MODEL
  Wf = We_x*F_x + We_y*F_y + We_z*F_z;
  Wt = We_x*M_x + We_y*M_y + We_z*M_z;
  
  // tyre forces shall act at wheel center point
  // S2: Transformation matrix from road frame to frame_b
  S2 = transpose(hub.frame_a.S)*Sroad;
  Ct = S2*(cross(rC_W, Wf) + Wt);
  Ct_tyre = nn*Ct;
  tyreForceWheelCenter.inPort.signal = S2*Wf;
  tyreTorqueWheelCenter.inPort.signal = Ct - nn*Ct_tyre;
  drivingTyreTorque.inPort.signal = {Ct_tyre};
  
  connect(tyreForceWheelCenter.frame_b, carrierFrame);
  connect(tyreTorqueWheelCenter.frame_b, carrierFrame);
end BaseWheel;

VehicleDynamics.Wheels.Utilities.interpolate1

Interpolate linearly between two points

Modelica definition

function interpolate1 "Interpolate linearly between two points" 
  
  input Real x "abszissa value to be interpolated";
  input Real x1 "abszissa value of point 1";
  input Real y1 "ordinate value of point 1";
  input Real x2 "abszissa value of point 2";
  input Real y2 "ordinate value of point 2";
  output Real y "ordinate value of x, i.e., y(x)";
algorithm 
  y := y1 + (y2 - y1)*((x - x1)/(x2 - x1));
end interpolate1;

VehicleDynamics.Wheels.Utilities.interpolate2

Interpolate quadratically between two points, such that y(0)=0

Modelica definition

function interpolate2 
  "Interpolate quadratically between two points, such that y(0)=0" 
  
  input Real x "abszissa value to be interpolated";
  input Real x1 "abszissa value of point 1 (<> 0 required)";
  input Real y1 "ordinate value of point 1";
  input Real x2 "abszissa value of point 2 (x2 <> x1 required)";
  input Real y2 "ordinate value of point 2";
  output Real y "ordinate value of x, i.e., y(x)";
algorithm 
  y := ((y2*x1/x2 - y1*x2/x1)*(x1 - x)/(x1 - x2) + y1*x/x1)*x/x1;
end interpolate2;

VehicleDynamics.Wheels.Utilities.interpolate2b

Interpolate quadratically between two points, such that y(0)=0

Modelica definition

function interpolate2b 
  "Interpolate quadratically between two points, such that y(0)=0" 
  
  input Real x "abszissa value to be interpolated";
  input Real x1 "abszissa value of point 1 (<> 0 required)";
  input Real y1 "ordinate value of point 1";
  input Real x2 "abszissa value of point 2 (x2 <> x1 required)";
  input Real y2 "ordinate value of point 2";
  output Real y "ordinate value of x, i.e., y(x)";
algorithm 
  y := (((y2 - y1*(x2/x1)*(x2/x1))/((x2/x1)*(1 - (x2/x1)))) + (x/x1)*(y1 - ((y2
     - y1*(x2/x1)*(x2/x1))/((x2/x1)*(1 - (x2/x1))))))*(x/x1);
end interpolate2b;

VehicleDynamics.Wheels.Utilities.interpolate2c

Interpolate quadratically between two points, such that y(0)=0

Modelica definition

function interpolate2c 
  "Interpolate quadratically between two points, such that y(0)=0" 
  
  input Real x "abszissa value to be interpolated";
  input Real x1 "abszissa value of point 1 (<> 0 required)";
  input Real y1 "ordinate value of point 1";
  input Real x2 "abszissa value of point 2 (x2 <> x1 required)";
  input Real y2 "ordinate value of point 2";
  output Real y "ordinate value of x, i.e., y(x)";
protected 
  Real k;
  Real a;
  Real b;
  Real xx;
algorithm 
  k := x2/x1;
  a := (y2 - y1*k*k)/(k*(1 - k));
  b := y1 - a;
  xx := x/x1;
  y := (a + xx*b)*xx;
end interpolate2c;

VehicleDynamics.Wheels.Utilities.BaseWheel.Road VehicleDynamics.Wheels.Utilities.BaseWheel.Road

Modelica definition

outer block Road = Environments.Interfaces.TyreRoadInterface;

HTML-documentation generated by Dymola Fri Jul 11 13:27:41 2003 .