Demonstrate the ABC machine model for a permanent magnet generator
This model works in phase current coordinates and demonstrates how one simulates and electrical machine.
------------------------------------------------------------------------ See also Plot2D, TimeLabl, RK4 ------------------------------------------------------------------------
Contents
%-------------------------------------------------------------------------- % Copyright (c) 2009 Princeton Satellite Systems, Inc. % All rights reserved. %--------------------------------------------------------------------------
Initialize the data
nSim = 5000; dT = 0.00001; x = zeros(5,1); d.lM = 0.0009; % Mutual inductance d.psiM = 0.069; % Permanent magnet flux d.lSS = 0.001; % Stator self inductance d.rS = 0.5; % Stator resistance d.p = 2; % Number of poles (1/2 pole pairs) d.tL = 0.3; % Load torque d.bM = 0.000015; % Viscous damping (Nm/rad/s) d.j = 0.000017; % Inertia uM = 40; xP = zeros(8,nSim); dTh = [0; -2*pi/3; 2*pi/3];
Run the simulation
for k = 1:nSim thetaR = 0.5*d.p*x(5); d.u = sqrt(2)*uM*cos(thetaR + dTh); xP(:,k) = [x;d.u]; x = RK4( 'PMABCMachineRHS', x, dT, 0, d ); end xP(4:5,:) = xP(4:5,:)/d.p;
Generate the time history plots
[t, tL] = TimeLabl( (0:(nSim-1))*dT ); Plot2D( t, xP(1:3,:), tL, {'i_a' 'i_b' 'i_c'}, 'Currents'); Plot2D( t, xP(4:5,:), tL, {'\omega_m' '\theta_m'}, 'Mechanical'); Plot2D( t, xP(6:8,:), tL, {'u_a' 'u_b' 'u_c'}, 'Phase Voltages'); set(gca,'ylim',[-60 60]) %-------------------------------------- % PSS internal file version information %--------------------------------------


