Make a detailed demonstration spacecraft with two solar arrays.

The spacecraft has three bodies, a core and two rotating solar arrays. Actuators including array drives, RWAs, and magnetic torquers. Sensors include a star camera, magnetometer, two axis sun sensor, and earth sensor. The model includes a fuel tank and 12 hydrazine thrusters. The model is stored in the file TwoArraySC.mat ------------------------------------------------------------------------- See also BuildCADModel, CreateBody, CreateComponent, QLVLH, U2Q, FindDirectory, SaveStructure, CosD, SinD -------------------------------------------------------------------------

Contents

%-------------------------------------------------------------------------------
%  Copyright (c) 2001-2002, 2006 Princeton Satellite Systems, Inc.
%  All rights reserved.
%-------------------------------------------------------------------------------
%  2018.1 Fix obsolete sun sensor component
%-------------------------------------------------------------------------------

Model Data

%------------

% Orbit
%------
r                  = 7000;
v                  = sqrt(3.98600436e5/r);
rECI               = [r;0;0];
vECI               = [0;v;0];
qLVLH              = QLVLH( rECI, vECI );
q                  = [1;0;0;0];
omega              = [0;-v/r;0];

cMToM              = 0.01;

% Core box
%---------
coreX              = 0.8;
coreY              = 1.0;
coreZ              = 0.5;
corePosition       = [0; 0; 0];

% Solar arrays
%-------------
strutLength        = 0.7;
arrayLength        = 3;
arrayWidth         = 1;
arrayY             = coreY/2 + arrayLength/2 + strutLength;
bX                 = [1 0 0;0 0 -1;0 1 0]';
bY                 = [-1 0 0;0 1 0;0 0 -1];

% Torque rods
%------------
torqueRodLength    = 0.8*coreZ;
torqueRodWidth     = 0.05*coreZ;
torqueRodDipole    = 10;
xTorquerLoc        = [0;-(coreY-torqueRodWidth)/2;(coreZ - torqueRodWidth)/2];
yTorquerLoc        = [-(coreX-torqueRodWidth)/2;0;(coreZ - torqueRodWidth)/2];
zTorquerLoc        = [-(coreX-torqueRodWidth)/2;-(coreY-torqueRodWidth)/2;0];

% Reaction wheels
%----------------
lRWA               = 0.114; % From RWA Model
dRWA               = 0.0485;
rWAXLoc            = [coreX/2-lRWA;coreY/3;coreZ/3];
rWAYLoc            = [coreX/4;coreY/2-lRWA;coreZ/4];
rWAZLoc            = [coreY/4;coreX/4;coreZ/2 - lRWA];

% Command and data handling box
%------------------------------
xCDH               = 0.2;
yCDH               = 0.1;
zCDH               = 0.2;
cDHLoc             = [-(coreX - xCDH)/4;(coreY-yCDH)/2;(coreZ-zCDH)/2];

% Earth sensor
%-------------
eSABoresight = [0;0;1];
eSALoc       = [0;coreY/4;coreZ/2];

% Sun sensor
%----------
sSABoresight = [1;0;0];
sSALoc       = [coreX/2;0;0];

% Star tracker
%------------
sTBoresight  = [0;-CosD(46.5);-SinD(46.5)];
sTLoc        = [-coreX/2-0.1;0;0];

% Magnetometer
%-------------
magnetometerY      = coreY*(7/40);
magnetometerXZ     = coreZ*(2/40);

Initialize BuildCADModel

%--------------------------
BuildCADModel( 'initialize' );

% Add spacecraft properties
%--------------------------
BuildCADModel( 'set name' ,      'Demo Spacecraft' );
BuildCADModel( 'set units',      'mks'  );
BuildCADModel( 'set rECI' ,      rECI   );
BuildCADModel( 'set vECI' ,      vECI   );
BuildCADModel( 'set qLVLH',      qLVLH  );
BuildCADModel( 'set qECIToBody', q      );
BuildCADModel( 'set omega',      omega  );

Create bodies first

%--------------------

% Core
%-----
m = CreateBody( 'make', 'name', 'Core' );
BuildCADModel('add body', m );

m = CreateBody( 'make', 'name', 'Solar Array 1', 'bHinge', struct( 'b', eye(3),...
                'axis', 2 ), 'previousBody', 1, 'rHinge', [0;coreY/2;0] );
BuildCADModel('add body', m );

m = CreateBody( 'make', 'name', 'Solar Array 2', 'bHinge', struct( 'b', eye(3),...
                'axis', 2 ), 'previousBody', 1, 'rHinge', [0;-coreY/2;0] );
BuildCADModel('add body', m );

% This creates the connections between the bodies
%------------------------------------------------
BuildCADModel( 'compute paths' );

Add Components

%---------------

% Solar Array 1
%-----------------------------------------------------------------------------------------------
m           = CreateComponent( 'make', 'solar array front', 'z', arrayLength, 'x', arrayWidth, 'nZ', 1, 'nX', 1, 'dirZ', 1,...
                               'theta', 0, 'electricalConversionEfficiency', 0.18, 'b', bY*bX,...
                               'rA', [0.01;strutLength;0], 'mass', 10, 'cM', [0;0;0],...
                               'name', 'Solar Array +Y Front', 'body', 2, 'faceColor', 'solar cell',...
                               'inside',0);
BuildCADModel( 'add component', m );

m           = CreateComponent( 'make', 'solar array back', 'z', arrayLength, 'x', arrayWidth, 'nZ', 1, 'nX', 1, 'dirZ', 1,...
                               'theta', 0, 'b', bY*bX,...
                               'rA', [-0.01;strutLength;0], 'mass', 10, 'cM', [0;0;0],...
                               'name', 'Solar Array +Y Back', 'body', 2, 'faceColor', 'black',...
                               'inside',0 );
BuildCADModel( 'add component', m );

m           = CreateComponent( 'make', 'box', 'x', 0.01 , 'y', strutLength, 'z', 0.01,...
                               'b', eye(3), 'rA', [0; strutLength/2; 0], 'mass', 1, 'cM', [0;0;0],...
							                 'name', 'Support', 'body', 2, 'faceColor', 'aluminum',...
                               'inside',0 );
BuildCADModel( 'add component', m );

% Solar Array 2
%-----------------------------------------------------------------------------------------------
m           = CreateComponent( 'make', 'solar array front', 'z', arrayLength, 'x', arrayWidth, 'nZ', 1, 'nX', 1, 'dirZ', 1,...
                               'theta', 0, 'electricalConversionEfficiency', 0.18, 'b', bX',...
                               'rA', [0.01;-strutLength;0], 'mass', 10, 'cM', [0;0;0],...
                               'name', 'Solar Array -Y Front', 'body', 3, 'faceColor', 'solar cell',...
                               'inside',0 );
BuildCADModel( 'add component', m );

m           = CreateComponent( 'make', 'solar array back', 'z', arrayLength, 'x', arrayWidth, 'nZ', 1, 'nX', 1, 'dirZ', 1,...
                               'theta', 0, 'b', bX',...
                               'rA', [-0.01;-strutLength;0], 'mass', 10, 'cM', [0;0;0],...
                               'name', 'Solar Array -Y Back', 'body', 3, 'faceColor', 'black',...
                               'inside',0 );
BuildCADModel( 'add component', m );

m           = CreateComponent( 'make', 'box', 'x', 0.01 , 'y', strutLength, 'z', 0.01,...
                               'b', eye(3), 'rA', [0; -strutLength/2; 0], 'mass', 1, 'cM', [0;0;0],...
							                 'name', 'Support', 'body', 3, 'faceColor', 'aluminum',...
                               'inside',0 );
BuildCADModel( 'add component', m );

% Core
%-----------------------------------------------------------------------------------------------
m = CreateComponent( 'make', 'box', 'x', coreX, 'y', coreY, 'z', coreZ, 'faceColor', 'gold foil',...
                     'rA', corePosition, 'mass', 10, 'name', 'Panels', 'body', 1,...
                     'inside',0 );
BuildCADModel( 'add component', m );

%%%%%%%%%%%%%

Actuators

%%%%%%%%%%%%%

% Array drives
%-------------
m = CreateComponent( 'make', 'single axis drive', 'mass',4, ...
                     'rA', [0; coreY/2; 0], 'name', 'Drive +Y', 'body', 1, 'faceColor', [0.6 0.6 0.6],...
                     'unitVector',[0; 1; 0],'drivenBody',2,'inside',0);
BuildCADModel( 'add component', m );

m = CreateComponent( 'make', 'single axis drive', 'mass',4,...
                     'rA', [0; -coreY/2; 0], 'name', 'Drive -Y', 'body', 1, 'faceColor', [0.6 0.6 0.6],...
                     'unitVector',[0; -1; 0],'drivenBody',3,'inside',0);
BuildCADModel( 'add component', m );

% RWA X
%--------------
m  = CreateComponent( 'make', 'reaction wheel', 'model', 'hr04', 'unitVector', [1;0;0],...
 					   'rA', rWAXLoc, 'mass', 1.5, 'name', 'RWA X', 'body', 1, 'inside', 1, 'faceColor', 'aluminum' );
BuildCADModel( 'add component', m );


% RWA Y
%--------------
m  = CreateComponent( 'make', 'reaction wheel', 'model', 'hr04', 'unitVector', [0;1;0],...
 					  'rA', rWAYLoc, 'mass', 1.5, 'name', 'RWA Y', 'body', 1, 'inside', 1, 'faceColor', 'aluminum' );
BuildCADModel( 'add component', m );

% RWA Z
%--------------
m  = CreateComponent( 'make', 'reaction wheel', 'model', 'hr04', 'unitVector', [0;0;1],...
 					   'rA', rWAZLoc, 'mass', 1.5, 'name', 'RWA Z', 'body', 1, 'inside', 1, 'faceColor', 'aluminum' );
BuildCADModel( 'add component', m );

% X Torquer
%--------------
m = CreateComponent( 'make', 'magnetic torquer', 'x', torqueRodLength, 'y', torqueRodWidth, 'z', torqueRodWidth, 'faceColor', [0 0.5 0],...
                     'residualDipoleFraction', 0.00, 'dipole', [torqueRodDipole;0;0],...
                     'rA', xTorquerLoc, 'mass', 1, 'name', 'Torque Rod X', 'body', 1, 'inside', 1 );
BuildCADModel( 'add component', m );

% Y Torquer
%--------------
m = CreateComponent( 'make', 'magnetic torquer', 'x', torqueRodWidth, 'y', torqueRodLength, 'z', torqueRodWidth, 'faceColor', [0 0.5 0],...
                     'residualDipoleFraction', 0.00, 'dipole', [0;torqueRodDipole;00],...
                     'rA', yTorquerLoc, 'mass', 1, 'name', 'Torque Rod Y', 'body', 1, 'inside', 1 );
BuildCADModel( 'add component', m );

% Z Torquer
%--------------
m = CreateComponent( 'make', 'magnetic torquer', 'x', torqueRodWidth, 'y', torqueRodWidth, 'z', torqueRodLength, 'faceColor', [0 0.5 0],...
                     'residualDipoleFraction', 0.00, 'dipole', [0;0;torqueRodDipole],...
                     'rA', zTorquerLoc, 'mass', 1, 'name', 'Torque Rod Z', 'body', 1, 'inside', 1 );
BuildCADModel( 'add component', m );

% Chassis
%--------
m = CreateComponent( 'make', 'box', 'x', xCDH, 'y', yCDH, 'z', zCDH, 'faceColor', [0 0.5 0.5],...
                     'rA', cDHLoc, 'mass', 1, 'name', 'C&DH Box', 'body', 1, 'inside', 1 );
BuildCADModel( 'add component', m );

% Battery
%--------------
batteryZ = 0.15;
m        = CreateComponent( 'make', 'battery', 'x', 0.25, 'y', 0.25, 'z', batteryZ, 'faceColor', 'aluminum',...
                            'rA', [0; 0; (coreZ+batteryZ)/2], 'mass', 1, 'name', 'Battery', 'body', 1 );
BuildCADModel( 'add component', m );

%%%%%%%%%%%

Sensors

%%%%%%%%%%%

% Star Camera
%--------------
m          = CreateComponent( 'make', 'star camera', 'model', 'ct633', 'boresight', sTBoresight,...
                              'rA', sTLoc, 'name', 'Star Tracker CT633', 'body', 1, 'faceColor', 'aluminum',...
                              'qBToS',{U2Q([0;0;1], sTBoresight)}, 'catalogName', 'FK5',...
                              'inside',0 );
BuildCADModel( 'add component', m );

% Magnetometer
%--------------
m = CreateComponent( 'make', 'magnetometer', 'x', magnetometerXZ, 'y',...
                      magnetometerY, 'z', magnetometerXZ, 'rA', [-coreX/2;coreY/2;coreZ/2],...
                      'name', 'Magnetometer', 'body', 1, 'faceColor', [1 0 1],...
                      'inside',0 );
BuildCADModel( 'add component', m );

% Sun Sensor
%--------------
m         = CreateComponent( 'make', 'camera', 'rA', sSALoc,...
                             'name', 'Sun Sensor Assembly', 'body', 1, 'faceColor', [0.5 1 0],...
                             'unitVector',sSABoresight,...
                             'inside',0 );
BuildCADModel( 'add component', m );

% Earth Sensor
%--------------
m         = CreateComponent( 'make', 'earth sensor', ...
                             'rA', eSALoc, 'name', 'Earth Sensor Assembly',...
                             'body', 1, 'faceColor', [0.5 1 0], 'boresight', eSABoresight,...
                             'inside',0 );
BuildCADModel( 'add component', m );

%%%%%%%%%%%%%%

Propulsion

%%%%%%%%%%%%%%

% Fuel tank
%--------------
massFuel  = 0.06*1000;
m         = CreateComponent( 'make', 'fuel tank', 'radius', coreX/3, 'rA', [0;0;0],...
                             'name', 'Fuel Tank', 'body', 1, ...
                             'volume', 0.06, 'massPressurant', 0.0729, ...
                             'rPress', 2078.65,'massFuel', massFuel,'mass',6,...
                             'densityFuel', 1000.0,'temperatureTank', 300,...
                             'inside',1);
BuildCADModel( 'add component', m );

% Thrusters
%----------
thrust = ones(1,12);
iBit   = 0.02*thrust;
u      = [ 1  1  1  1 -1 -1 -1 -1  0  0  0  0;...
		   0  0  0  0  0  0  0  0  1  1  1  1;...
		   0  0  0  0  0  0  0  0  0  0  0  0];

clear r

r(1,:) = [-1 -1 -1 -1  1  1  1  1  1  1 -1 -1]*coreX/2;
r(2,:) = [-1  1 -1  1 -1  1 -1  1 -1 -1 -1 -1]*coreY/2;
r(3,:) = [-1 -1  1  1 -1 -1  1  1  1 -1  1 -1]*coreZ/2;

uECoefficient.iSP        = [120 110];
uECoefficient.pulsewidth = 2;
thrustCoefficient        = 1/(6895*350);

type   = 'mr-103c';
for k = 1:length(thrust)
  m = CreateComponent( 'make', 'hydrazine thruster', 'model', type,...
                       'name', sprintf('Thruster %i',k), 'body', 1,...
                       'unitVector', u(:,k), 'rA', r(:,k), ...
                       'uECoefficient', uECoefficient, 'thrustCoefficient',  thrustCoefficient,...
                       'positionVector', r(:,k), 'pressureNominal', 400*6895,...
                       'inside',0 );
  BuildCADModel( 'add component', m );
end

Add subsystems

%---------------
BuildCADModel( 'add subsystem', 'acs',        {'earth','sun','magnetometer','torque','rwa','tracker','wheel'} );
BuildCADModel( 'add subsystem', 'propulsion', {'thruster','tank'} );
BuildCADModel( 'add subsystem', 'tt&c',       {'C&DH'} );
BuildCADModel( 'add subsystem', 'mechanism',  {'drive'} );
BuildCADModel( 'add subsystem', 'power',      {'solar array','battery'} );
BuildCADModel( 'add subsystem', 'structure',  {'support', 'panel'} );

All components have been created, get the finished model

%---------------------------------------------------------
g = BuildCADModel( 'get cad model' );

dName = FindDirectory('SCModels');
SaveStructure( g, fullfile(dName,'TwoArraySC') )

ShowCAD(g);


%-------------------------------------------------------------------------------
% PSS internal file version information
%--------------------------------------