Simulate a servo mechanism.

This might be used to control blade pitch in any wind turbine.

------------------------------------------------------------------------
See also Plot2D, TimeLabl, RK4
------------------------------------------------------------------------

Contents

%---------------------------------------------------------------------------
%   Copyright (c) 2007 Princeton Satellite Systems, Inc.
%   All rights reserved.
%---------------------------------------------------------------------------

Initialize the data

nSim            = 100;
dT              = 0.1;

xP              = zeros(1,nSim);

d.betaRef       = 22*pi/180;
d.betaLimit     = 26*pi/180;
d.betaRateLimit = 0.06;
d.k             = 1;

beta = 0;

Run the simulation

for k = 1:nSim
  xP(1,k) = beta;

  beta = RK4('PitchServoRHS',beta,dT,0,d);
end

Plot results

[t, tL] = TimeLabl( (0:(nSim-1))*dT );
Plot2D( t, xP*180/pi, tL, 'Beta (deg)', 'Pitch Servo Test')


%--------------------------------------
% $Date$
% $Id: 9c9f2451b321ff640cc70f3e56d204fd3b0a4bdb $