% MotionGenesis file: MGVehicleSkidFBD.txt % Copyright (c) 2018 Motion Genesis LLC. All rights reserved. % Problem: Analysis of Skidding Vehicle. %-------------------------------------------------------------------- % Physical declarations. NewtonianFrame N % Newtonian reference frame (ground). RigidBody A % Vehicle chassis (Ao is center of axle). RigidBody B, C % Vehicle's rolling wheels. Point BN( B ) % Point of wheel B in contact with N. Point CN( C ) % Point of wheel C in contact with N. %-------------------------------------------------------------------- % Mathematical declarations (constants and variables). Constant b = 0.75 m % Distance between Ao and Bcm (or Ao and Ccm). Constant R = 0.35 m % Wheel radii. Constant a = 1.64 m % Distance from Ao to Acm (A's mass center). Constant g = 9.8 m/s^2 % Earth's gravitational acceleration. Variable v' % Ax> measure of Ao's velocity in N. Variable wB' % Ay> measure of B's angular velocity in A. Variable wC' % Ay> measure of C's angular velocity in A. Variable theta'' % Vehicle heading angle (car yaw). Variable FBx, FBy % Rolling contact forces on wheel B (Ax>, Ay> directions). Variable FCx, FCy % Rolling contact forces on wheel C (Ax>, Ay> directions). %-------------------------------------------------------------------- % Mass and inertia. A.SetMass( mA = 640 kg ) B.SetMass( m = 30 kg ) C.SetMass( m ) A.SetInertia( Acm, IAxx, IAyy, IAzz = 166 kg*m^2) B.SetInertia( Bcm, A, K, J = 2.0 kg*m^2, K = 1.0 kg*m^2 ) C.SetInertia( Ccm, A, K, J, K ) %-------------------------------------------------------------------- % Rotational kinematics. A.RotateZ( N, theta ) B.SetAngularVelocityAcceleration( A, wB*Ay> ) C.SetAngularVelocityAcceleration( A, wC*Ay> ) %-------------------------------------------------------------------- % Translational kinematics. Ao.SetVelocityAcceleration( N, v*Ax> ) Acm.Translate( Ao, a*Ax> ) Bcm.Translate( Ao, -b*Ay> ) Ccm.Translate( Ao, b*Ay> ) BN.SetPositionVelocity( Bcm, -R*Az> ) CN.SetPositionVelocity( Ccm, -R*Az> ) %-------------------------------------------------------------------- % Rolling constraints (relates wB and wC to v and theta'). RollingConstraint[1] = Dot( BN.GetVelocity(N), Ax> ) RollingConstraint[2] = Dot( CN.GetVelocity(N), Ax> ) SolveDt( RollingConstraint = 0, wB, wC ) %-------------------------------------------------------------------- % Add relevant forces (only some of these appear in dynamic equations). % Note: Gravity and normal contact forces do not appear in dynamic. System.AddForceGravity( -g*Az> ) BN.AddForce( FBx*Ax> + FBy*Ay> ) CN.AddForce( FCx*Ax> + FCy*Ay> ) %-------------------------------------------------------------------- % Form equations of motion via MG road-maps. Dynamics[1] = Dot( Ax>, System(A,B,C).GetDynamics() ) Dynamics[2] = Dot( Az>, System(A,B,C).GetDynamics(Ao) ) Dynamics[3] = Dot( Ay>, B.GetDynamics(Bcm) ) Dynamics[4] = Dot( Ay>, C.GetDynamics(Ccm) ) %-------------------------------------------------------------------- % For maximum simplification, solve for FBx, FCx first. Solve( Dynamics[3:4] = 0, FBx, FCx ) Solve( Dynamics[1:2] = 0, v', theta'' ) %-------------------------------------------------------------------- % Differential equations governing x and y. Variable x' = Dot( Ao.GetVelocity(N), Nx> ) Variable y' = Dot( Ao.GetVelocity(N), Ny> ) %-------------------------------------------------------------------- % Integration parameters and initial values. Input tFinal = 1 sec, tStep = 0.01 sec, absError = 1.0E-07 Input theta = 0 deg, x = 0 m, y = 0 m Input theta' = 0.01 rad/sec % Perturbation in angular rate. Input v = -25 m/s % Approximately 55 miles/hour. %-------------------------------------------------------------------- % List output quantities and solve ODEs. Output t sec, x m, y m, v m/sec, theta deg, theta' rad/sec ODE() MGVehicleSkidFBD % Plot MGVehicleSkidFBD.1 %-------------------------------------------------------------------- Save MGVehicleSkidFBD.html Quit