Contents
Demonstrate the bristle friction model with a velocity ramp.
------------------------------------------------------------------------
See also Plot2D, TimeGUI, RK4, FrictionBristle
------------------------------------------------------------------------
Global for the TimeGUI
global simulationAction
simulationAction = ' ';
Simulation parameters
dT = 0.0125;
nSim = 2000;
d.friction(1).fStatic = 0.005;
d.friction(1).fCoulomb = 0.005/2;
d.friction(1).vStribeck = 0.1;
d.friction(1).sigma0 = 1;
d.friction(1).sigma1 = 1e-4;
d.friction(1).sigma2 = 4.0585e-05;
d.friction(1).maxC = 1/dT;
Initialize the time display
[ ratioRealTime, tToGoMem ] = TimeGUI( nSim, 0, [], 0, dT, 'Bristle Friction Simulation' );
Initial conditions
xPlot = zeros(3,nSim);
t = 0;
x = 0;
v = linspace(0,1,nSim);
for k = 1:nSim
[ ratioRealTime, tToGoMem ] = TimeGUI( nSim, k, tToGoMem, ratioRealTime, dT );
d.friction(1).v = v(k);
x = RK4( 'FrictionBristle', x, dT, 0, d.friction );
tPlot(k) = t;
[zDot, f, c] = FrictionBristle( x, 0, d.friction );
xPlot(:,k) = [x;f;c];
t = t + dT;
switch simulationAction
case 'pause'
pause
simulationAction = ' ';
case 'stop'
return;
case 'plot'
break;
end
end
xPlot = [xPlot;d.friction(1).maxC*ones(1,nSim)];
yLbl = [ 'Bristle ';...
'Friction';...
'CZDamp '];
Plot2D( v, xPlot, 'Velocity (rad/sec)', yLbl, 'Bristle Friction','lin',['1 ';'2 ';'3:4'])