VSDC Spring 2016 Homework 01
VSDC Spring 2016 Homework 01
VSDC Spring 2016 Homework 01
the following:
(a) Work through the steps in the model derivation and add a rolling resistance force.
Answer (by hand):
(b) Create a Matlab code and model the rolling resistance using a linear longitudinal
damping force. Use your simulation to tune the damping coefficient to reach a
steady-state velocity of 0.25 m/sec.
Answer:
The Matlab code used to this problem was based on initial code provided as an example
(from slides presented in previous lectures)
The Matlab simulation can be used to tune the rolling resistance through a linear
longitudinal damping force B when the steady-state velocity is 0.25 m/sec.
(c) Estimate the linear damping coefficient found in (b) using the analytical solution (provided in the slides).
Answer:
In that case (vx,ss=0.25 m/sec), B=Ft/vx,ss=827.9N.s/m. Note: In this case Nr and Nf are
constants (Fr is applied to the CG).
(d) Change the rolling resistance force to be a nonlinear function of the forward velocity
and also dependent on a parameter related to the `lawn properties'. Rationalize your
model for this case and run simulations comparing two different cases (e.g., heavy vs.
light), and compare the power requirements for these cases.
Answer:
The rolling resistance force is modeled by the relation, Fr = fr*N.
Where:
fr: It consists of the dimensionless rolling resistance coefficient
N: it is the normal load (The normal load may be the contact force for a wheel/tire or if
the rolling resistance force is to be applied at the CG of a vehicle body then N is typically
taken as the total vehicle weight).
The vehicle forward velocity is , so modeling the rolling resistance force as a nonlinear
function of this velocity just means
.
For example, if the rolling resistance coefficient was found to be dependent on velocity,
, and n can be any exponent based on the correlation (Note: Problem
then
3.1 in the Wong book shows an example where n = 2).
A way to model the effects of lawn properties is to take A and B to be parameters that
depend on. For example, the height of the grass. These parameters might be functions of a
fixed height or they could vary with the location of the mower, possibly in a randomlyvarying manner
Note: Effects Fr on the Nr and Nf relations time.
All previous cases considers the resistance force when applied at the vehicle CG. Modeling
the effective load applied in other points different of the CG will require additional values,
such as the wheel radius, for example.
In this case, the model equations are derived considering a force, Fr, applied along the
centerline of the wheels.
.
The normal contact force on the rear wheels is,
/ /
and the
. The front axle load, Nf will also change with Fr. So,
.
traction force is
It implies that Nr and Nf are not constant anymore as shown in the plots below.
Problem 2: The single rigid wheel is to be driven up a rigid embankment as shown below.
(a) What is the minimum coefficient of friction, , that would allow this simple
maneuver? Assume the wheel has mass, m. State any assumptions made in your
analysis.
Answer (by hand):
(b) How does the situation change if this is a two-axle vehicle and either the rear or front
wheel(s) can be driven?
Answer (by hand):
Problem 3: Study the model for the 2D differentially-steered vehicle presented in the
lecture slides. Complete the following:
(a) Provide details on how the body-fixed velocity vector components (vx, vy, and z) are
derived.
Answer (by hand):
(b) Study the derivation for the velocity vector in the inertial frame and justify those
kinematic differential equations.
Answer:
Let a 2D differentially driven single axle vehicle
Assuming:
- X-Y is an inertial frame
- Wheels roll without friction
- Small
- Lateral forces on wheels constrain side-slip
- Negligible force at front caster/pivot.
The force, F, must satisfy the constraint that there be no lateral slip. This requires,
and the constraint that velocity be zero along rear axle:
0
Velocitiesinthelocal(bodyfixed)referenceframearerelatedwiththeinertialframeby
therotationmatrix
representedbelow:
0
0
1
So,
2
2
0
0
1
(c) Study the Matlab simulation code provided for plotting the 2D trajectory of the CG.
Reproduce the results.
Answer:
Using the Matlab code provided in class as an example.
The simulation uses the following parameters:
Wheel radius = 0.05 m
Axle track width = 0.18 m
Right wheel angular velocity = 4 rad/sec
Left wheel angular velocity = 2 rad/sec
(d) Explain how you would design a sequence of open loop wheel speed commands so
that the vehicle could traverse a square of a given size over in a given time period.
Answer:
-
First, provide the physical parameters associated to the vehicle, like: Length, distance
between wheels, maximum speed, wheels radius, gear ratio, etc.
Next, to calculate the dynamic behavior of the vehicle based on its physical parameters
defined previously, Example: engine max speed, wheels max. speed, etc.
Define the vehicles trajectory to be used in the path planning (in this case with a
square format). The length of one side could be used as input, for example.
With the path (and size of the trajectory), and determined the time used to accomplish
the trajectory, it is possible to calculate the proper speed used by the vehicle (of course,
it is necessary a verification related to the vehicles physical parameters).
The vehicle will run straight over each side of the square using the calculated speed,
at the end change its trajectory (left/right) using the steering angle.
(e) Change the baseline code from (c) to implement the square driving algorithm. It
may also be a good idea to change the solver to use a fixed step routine rather than
a variable step solver (i.e., code is shown using ode45(); use rk4fixed() instead). Be
careful not to use too large a time step. Experiment with completing the square over
different total elapsed times.
Answer:
The Matlab code below, shows the main parts used to implement the square drive algorithm
and the velocity and steering command strategy proposed in (d). It is possible to change
the steering angle for better curves (Note: Not all code is included!).
% Physical parameters of the vehicle
L = 2.040; % [m]
B = 1.164; % Distance between the rear wheels [m]
m_max_rpm = 5000; % Motor max speed [rpm]
gratio = 20; % Gear ratio
R_w = 13/39.37; % Radius of wheel [m]
% Parameters related to vehicle
m_max_rads = m_max_rpm*2*pi/60; % Motor max speed [rad/s]
w_max_rads = m_max_rads/gratio; % Wheel max speed [rad/s]
v_max = w_max_rads*R_w; % Max vehicle speed [m/s]
% desired turn radius
R_turn = 3*L;
delta_max_rad = L/R_turn; % Maximum steering angle [deg]
% velocity and steering commands (open loop)
v = v_max*ones(1,n+1); % Velocity vector (n+1 components)
delta_rad = delta_max_rad*ones(1,n+1); % Steering angle vector (n+1
%components) [rad]
psi_rad0 = psi_deg0*pi/180; % Initial orientation [rad]
v0 = v(1); % Initial velocity [m/s]
delta_rad0 = delta_rad(1); % Initial steering angle [rad]
q0 = [x0, y0, psi_rad0]; % Initial state vector
u0 = [v0, delta_rad0]; % Initial control vector
fig1 = figure(1); % Figure set-up (fig1)
axis([-R_turn R_turn -0*R_turn 2*R_turn]); axis('square')
hold on;
% Acquire the configuration of vehicle for plot
[xb, yb, xfw, yfw, xrlw, yrlw, xrrw, yrrw] = vehicle_state(q0, u0);
plotqb = plot(xb, yb); % Plot vehicle base
plotqfw = plot(xfw, yfw, 'r'); % Plot front wheel
plotqrlw = plot(xrlw, yrlw, 'r'); % Plot rear left wheel
plotqrrw = plot(xrrw, yrrw, 'r'); % Plot rear right wheel
q1 = q0; % Set initial state for simulation
% Parameters related to simulations
t_max = 10; % Simulation time [s]
n = 100; % Number of iterations
dt = t_max/n; % Time step interval
t = [0:dt:t_max]; % Time vector (n+1 components)
% Beginning of simulation
for i = 1:n+1
v(i) = v_max*cos(2*delta_rad(i));
u = [v(i), delta_rad(i)]; % Set control input
vc = u(1);
delta_radc = u(2);
to = t(i); tf = t(i)+dt;
[t2,q2]=rk4fixed('ks_vehicle_kv',[to tf],q1',2);
t1 = t2(2);
q1 = q2(2,:);
% Acquire the configuration of vehicle for plot
[xb, yb, xfw, yfw, xrlw, yrlw, xrrw, yrrw] = vehicle_state(q1, u);
% Plot vehicle position
set(plotqb,'xdata',xb);
set(plotqb,'ydata',yb);
set(plotqfw,'xdata',xfw);
set(plotqfw,'ydata',yfw);
set(plotqrlw,'xdata',xrlw);
set(plotqrlw,'ydata',yrlw);
set(plotqrrw,'xdata',xrrw);
set(plotqrrw,'ydata',yrrw);
% drawnow
pause(0.1); % Small Pause
end
References
[1]
[2]
Meriam, J.L., and L.G. Kraige, Engineering Mechanics: Dynamics (4th ed.), Wiley
and Sons, Inc., NY, 1997.
[3]