Skip to content
Snippets Groups Projects
Commit 14f9ab7a authored by Arthur Reis's avatar Arthur Reis
Browse files

v0.2.9 - performance enhancement

parent 5734bbf6
No related branches found
No related tags found
No related merge requests found
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
File added
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
clear; clear;
acme = AcmeSim('sgrs_1dof',1e3+1,1e3+1); acme = AcmeSim('sgrs_1dof_2020a',1e6,1e6);
%% Accelerometer Parameters %% Accelerometer Parameters
l = 0.03; l = 0.03;
...@@ -13,38 +12,30 @@ Cf = 10e-12; %F ...@@ -13,38 +12,30 @@ Cf = 10e-12; %F
Kp = 10; Kp = 10;
Ki = 0.0; Ki = 0.0;
Kd = 0.2; Kd = 0.2;
% Kp = 0
% Ki = 0
% Kd = 0
% %%
% % % If is drag-free:
% driverGain = 0;
% V_TM = 0.5;
% Vp = 0; %V polarizing
% If is non-drag-free:1000
%driverGain = -1;
%V_TM = 0.5;
%Vp = 0; %V polarizing
TM = acme.addTestMass('TM',l,gap,'density',density); TM = acme.addTestMass('TM',l,gap,'density',density);
%el = addElectrodeSF(obj, BlockName, Sides, pos0, V_DC, channels, V_ACs)
Vx = 10; Vx = 10;
elXA = acme.addElectrode('elXA', [0,l,l], [+(l/2+g), 0, 0], Vx, ["x"], [0]); elXA = acme.addElectrode('elXA', [0,l,l], [+(l/2+g), 0, 0], Vx, ["x"], [0]);
elXB = acme.addElectrode('elXB', [0,l,l], [-(l/2+g), 0, 0], Vx, ["x"], [0]); elXB = acme.addElectrode('elXB', [0,l,l], [-(l/2+g), 0, 0], Vx, ["x"], [0]);
%
capXA = acme.addCapacitor('capXA',elXA, [+l/2, 0, 0]); capXA = acme.addCapacitor('capXA',elXA, [+l/2, 0, 0]);
capXB = acme.addCapacitor('capXB',elXB, [-l/2, 0, 0]); capXB = acme.addCapacitor('capXB',elXB, [-l/2, 0, 0]);
sat = Satellite;
%sat.altitude = 450; %edit here if needed. These are the defaults for GFO
% sat.mass = 470
% sat.Cd = 2.25
% sat.area = 0.9
[a, v] = actuationRequirementSimplified(sat,TM,capXA);
Vx0 = 2*v;
acme.checkBlocks; acme.checkBlocks;
%fCar = 1e5;
%% Noises %% Noises
capdcbias = 0; capdcbias = 0;
%CapNoiseASD = @(f) 1.854e-22 ./f + 5.0124e-19; %F/sqrt(hz)
% Capacitive Noise
% Capacitive Noise
VspASD = @(f) 30e-6*f.^0 + 0.7e-8*1./f; %V/sqrt(Hz) Pollack 2008 VspASD = @(f) 30e-6*f.^0 + 0.7e-8*1./f; %V/sqrt(Hz) Pollack 2008
CapNoiseASD = @(f) 51e-9.*f.^0 + capdcbias; %F/sqrt(hz) CapNoiseASD = @(f) 51e-9.*f.^0 + capdcbias; %F/sqrt(hz)
CPDnoiseASD = @(f) capXA.force_from_CPD(10e-3)*f.^0; %worst case CPDnoiseASD = @(f) capXA.force_from_CPD(10e-3)*f.^0; %worst case
...@@ -52,13 +43,10 @@ CPDnoiseASD = @(f) capXA.force_from_CPD(10e-3)*f.^0; %worst case ...@@ -52,13 +43,10 @@ CPDnoiseASD = @(f) capXA.force_from_CPD(10e-3)*f.^0; %worst case
CapNoiseTS = acme.noiseTS(CapNoiseASD); CapNoiseTS = acme.noiseTS(CapNoiseASD);
CPDnoiseTS = acme.noiseTS(CPDnoiseASD); CPDnoiseTS = acme.noiseTS(CPDnoiseASD);
% Cf = 10e-12; %F
% Actuation Noise % Actuation Noise
p = 1e-5; %Pa
GasThermalNoiseASD = @(f) gasBrownianNoise(p,acme.T,TM.l.x,TM.gap.x).*f.^0 + TM.mass*1.6e-15./sqrt(f);
GasThermalNoiseTS = acme.noiseTS(GasThermalNoiseASD);
ActuationNoiseASD = @(f) v * 1e-6*f.^0; %V/sqrt(hz)
ActuationNoiseTS = acme.noiseTS(ActuationNoiseASD);
% Electrostatic Noise % Electrostatic Noise
e = 1.6e-19; e = 1.6e-19;
lambdaeff = 1100; lambdaeff = 1100;
...@@ -76,138 +64,115 @@ Sa = electrostaticNoise(acme, TM, capXA, Qmax*e, Vi, Vc, SxLPF, Sq, Svc, Svi); % ...@@ -76,138 +64,115 @@ Sa = electrostaticNoise(acme, TM, capXA, Qmax*e, Vi, Vc, SxLPF, Sq, Svc, Svi); %
ElectrostaticNoiseASD = sum(Sa(1:end,:)); ElectrostaticNoiseASD = sum(Sa(1:end,:));
ElectrostaticNoiseTS = acme.noiseTS(ElectrostaticNoiseASD); ElectrostaticNoiseTS = acme.noiseTS(ElectrostaticNoiseASD);
% Low Frequency Noise % TO REMOVE % Gas noise
%LoFreqNoiseASD = @(f) 1e-18.*f.^-2; %arbitrary p = 1e-5; %Pa
%LoFreqNoiseTS = acme.noiseTS(LoFreqNoiseASD); GasThermalNoiseASD = @(f) gasBrownianNoise(p,acme.T,TM.l.x,TM.gap.x).*f.^0 ...
+ TM.mass*1.6e-15./sqrt(f);
GasThermalNoiseTS = acme.noiseTS(GasThermalNoiseASD);
sat = Satellite;
%sat.altitude = 450; %edit here if needed. These are the defaults for GFO
% sat.mass = 470
% sat.Cd = 2.25
% sat.area = 0.9
[a, v] = actuationRequirementSimplified(sat,TM,capXA);
Vx0 = 2*v;
%p = 1e-5; %Pa
ActuationNoiseASD = @(f) v * 1e-6*f.^0; %V/sqrt(hz)
ActuationNoiseTS = acme.noiseTS(ActuationNoiseASD);
FNGGM = [1e-5 1.8e-4 1e-3]; % Thermal stability noise
%STterp = interp1(xData,ST,FNGGM);
TASH = [7.82e-12 3.61e-11 1.16e-10]; %m/s2 K
DTASH = [2.8e-10 5.01e-11 1.07e-11];%m/s2 K
TFEEU = [4.60e-11 4.60e-11 4.6e-11];%m/s2 K
T = 293; T = 293;
stbocon = 5.670374419e-8; stbocon = 5.670374419e-8;
l = 0.03; l = 0.03;
m = 0.54; m = 0.54;
p = 1e-5; p = 1e-5;
c = 299792458; c = 299792458;
% General model: % from GFO:
ST = @(x) 0.001*x.^0+ 1.09e-10*x.^-2; ST = @(x) 0.001*x.^0+ 1.09e-10*x.^-2;
% a = 0.001 (-0.01835, 0.02035) %from Lobo 2006:
% b = 1.09e-10 (1.069e-10, 1.111e-10)
%ST = fitresult(xData);
Sa =((T^3 *16*l^2*stbocon)/(3*m*c) + (p*l^2)/ (2*m*T)) .* ST(acme.frequencies); Sa =((T^3 *16*l^2*stbocon)/(3*m*c) + (p*l^2)/ (2*m*T)) .* ST(acme.frequencies);
thermalStabilityNoiseASD = @(f) 7.0732e-11.*(0.001*f.^0+ 1.09e-10*f.^-2); thermalStabilityNoiseASD = @(f) 7.0732e-11.*(0.001*f.^0+ 1.09e-10*f.^-2);
thermalStabilityNoiseTS = acme.noiseTS(thermalStabilityNoiseASD); thermalStabilityNoiseTS = acme.noiseTS(thermalStabilityNoiseASD);
% fitresult =
%
% %CapNoiseASD = @(f) 1.854e-22 ./f + 5.0124e-19; %F/sqrt(hz) % Thermal stability couplings
% CapNoiseASD = @(f) 51e-9.*f.^0; %F/sqrt(hz) % from ONERA poster:
% CapNoiseTS = acme.noiseTS(CapNoiseASD); FNGGM = [1e-5 1.8e-4 1e-3]; % Hz
% TASH = [7.82e-12 3.61e-11 1.16e-10]; % m/s2 K
% VspASD = @(f) 30e-6*f.^0 + 0.7e-8*1./f; %V/sqrt(Hz) Pollack 2008 DTASH = [2.8e-10 5.01e-11 1.07e-11]; % m/s2 K
% TFEEU = [4.60e-11 4.60e-11 4.6e-11]; % m/s2 K
% CPDnoiseASD = @(f) cap1.force_from_CPD(10e-3)*f.^0; %worst case
% CPDnoiseTS = acme.noiseTS(CPDnoiseASD); % power fit
% Cf = 10e-12; %F TASHNoiseASD = @(f) 5.3173e-09 * f .^0.5574 .* ST(f);
%% DTASHNoiseASD = @(f) 1.5420e-13* f.^-0.6521 .* ST(f);
%NoiseASD = @(f) 1e-8*f.^0; TFEEUNoiseASD = @(f) 4.6000e-11 *f.^0 .* ST(f);
%XNoiseTS = acme.noiseTS(NoiseASD);
%YNoiseTS = acme.noiseTS(NoiseASD); TASHNoiseTS = acme.noiseTS(TASHNoiseASD);
%ZNoiseTS = acme.noiseTS(NoiseASD); DTASHNoiseTS = acme.noiseTS(DTASHNoiseASD);
%NoiseASD = @(f) 1e-8*f.^0; TFEEUNoiseTS = acme.noiseTS(TFEEUNoiseASD);
%RollNoiseTS = acme.noiseTS(@(f) 1e-10*f.^0);
%PitchNoiseTS = acme.noiseTS(@(f) 1e-10*f.^0);
%YawNoiseTS = acme.noiseTS(@(f) 1e-10*f.^0);
Ktranslational = 1e6; Ktranslational = 1e6;
%Ktranslational = 0; %Ktranslational = 0;
Krot = -1e15; Krot = -1e15;
%Krot = 0 %Krot = 0
%% %% simulations
tic tic
mdlOutput = sim(acme.modelName) mdlOutput = sim(acme.modelName)
toc toc
%% %%
io(2) = linio(strcat(acme.modelName,'/capsensSum'),1,'output'); % io(2) = linio(strcat(acme.modelName,'/BPF'),1,'output');
io(1) = linio(strcat(acme.modelName,'/Sum1'),1,'input'); % io(1) = linio(strcat(acme.modelName,'/Sum1'),1,'input');
readout2accTF = getTFresponse(acme.modelName, io, acme.frequencies); % % readout2accTF = getTFresponse(acme.modelName, io, acme.frequencies); %
%% % %%
vq = interp1(mdlOutput.simout.Time,mdlOutput.simout.Data(:,1),acme.time); % vq = interp1(mdlOutput.simout.Time,mdlOutput.simout.Data(:,1),acme.time);
%ts = mdlOutput.simout.Data;%(10000:end); % %ts = mdlOutput.simout.Data;%(10000:end);
[axx,fxx] = flpsd('ts', vq, acme.flpsdOpts{:}); % [axx,fxx] = flpsd('ts', vq, acme.flpsdOpts{:});
readout2accTF = getTFresponse(acme.modelName, io, fxx); % readout2accTF = getTFresponse(acme.modelName, io, fxx);
r = readout2accTF(1,:)'; % r = readout2accTF(1,:)';
%
loglog(fxx, axx) % loglog(fxx, axx./readout2accTF)
%% % %%
% NoiseBudget demo: free-running calibration % % NoiseBudget demo: free-running calibration
% Click on this annotation to run the following: % % Click on this annotation to run the following:
% mdl = 'OLvsCL'; % % mdl = 'OLvsCL';
% dof = 'OL displacement'; % % dof = 'OL displacement';
freq = logspace(-5, 1, 100); % freq = logspace(-5, 1, 100);
[noises, sys] = nbFromSimulink(acme.modelName, freq, 'dof', 'x'); % [noises, sys] = nbFromSimulink(acme.modelName, freq, 'dof', 'x');
nb = nbGroupNoises(acme.modelName, noises, sys); % nb = nbGroupNoises(acme.modelName, noises, sys);
matlabNoisePlot(nb); % matlabNoisePlot(nb);
%
%% % %%
%
t = tiledlayout(3,2); % t = tiledlayout(3,2);
%
% Top plot % % Top plot
ax1 = nexttile; % ax1 = nexttile;
plot(out.tout, out.forces.Data(:,1)); % plot(out.tout, out.forces.Data(:,1));
title(ax1, 'force X'); % title(ax1, 'force X');
ylabel(ax1, 'N') % ylabel(ax1, 'N')
%
%ax1.YLim = [-1.5e-10 1.5e-10]; % %ax1.YLim = [-1.5e-10 1.5e-10];
%
ax2 = nexttile; % ax2 = nexttile;
plot(out.tout, out.torques.Data(:,1)) % plot(out.tout, out.torques.Data(:,1))
title(ax2, 'torque roll'); % title(ax2, 'torque roll');
ylabel(ax2, 'Nm') % ylabel(ax2, 'Nm')
%ax2.YLim = [-1.5e-10 1.5e-10]; % %ax2.YLim = [-1.5e-10 1.5e-10];
%
ax3 = nexttile; % ax3 = nexttile;
plot(out.tout, out.forces.Data(:,2)) % plot(out.tout, out.forces.Data(:,2))
title(ax3, 'force y'); % title(ax3, 'force y');
ylabel(ax3, 'N'); % ylabel(ax3, 'N');
%ax3.YLim = [-1.5e-10 1.5e-10]; % %ax3.YLim = [-1.5e-10 1.5e-10];
% Bottom plot % % Bottom plot
ax4 = nexttile; % ax4 = nexttile;
plot(out.tout, out.torques.Data(:,2)) % plot(out.tout, out.torques.Data(:,2))
title(ax4, 'torque pitch'); % title(ax4, 'torque pitch');
ylabel(ax4, 'Nm'); % ylabel(ax4, 'Nm');
%ax4.YLim = [-1.5e-10 1.5e-10]; % %ax4.YLim = [-1.5e-10 1.5e-10];
ax5 = nexttile; % ax5 = nexttile;
plot(out.tout, out.forces.Data(:,3)) % plot(out.tout, out.forces.Data(:,3))
title(ax5, 'force z'); % title(ax5, 'force z');
ylabel(ax5, 'N'); % ylabel(ax5, 'N');
xlabel(ax5, 's') % xlabel(ax5, 's')
%ax5.YLim = [-1.5e-10 1.5e-10]; % %ax5.YLim = [-1.5e-10 1.5e-10];
ax6 = nexttile; % ax6 = nexttile;
plot(out.tout, out.torques.Data(:,3)) % plot(out.tout, out.torques.Data(:,3))
title(ax6, 'torque yaw'); % title(ax6, 'torque yaw');
ylabel(ax6, 'Nm'); % ylabel(ax6, 'Nm');
xlabel(ax6, 's') % xlabel(ax6, 's')
%ax6.YLim = [-1.5e-10 1.5e-10]; % %ax6.YLim = [-1.5e-10 1.5e-10];
%
linkaxes([ax1,ax3,ax5],'x'); % linkaxes([ax1,ax3,ax5],'x');
linkaxes([ax2,ax4,ax6],'x'); % linkaxes([ax2,ax4,ax6],'x');
title(t,"Resulting forces and torques on the TM after 1nN step @ 10s in X axis"); % title(t,"Resulting forces and torques on the TM after 1nN step @ 10s in X axis");
\ No newline at end of file \ No newline at end of file
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
TM_length = 0.03;
rho_Al = 2700;%kg/m3
TM_mass = TM_length^3 * rho_Al;
arm_length = 0.13;
momentOfInertia = (TM_mass*arm_length^2)% + m*l/12 bar component
gap =
rho_Al = 2700;%kg/m3
pendulum_length =
g =
T =
TM_mass =
% Hello Arthur, the capacitance of 1.3pF is the capacitance between one of the capacitor plates and the test mass, when the TM is 1mm off center following the formula C- = ε0A/(d0+x), where A = (3*10^(-2) meter)^2 is the area of the capacitor plate, d0 = 5 mm is the distance to the plates if the TM is centered and x is the 1mm. This is just a rough estimate and for the other plate it should then be -x in the formula, i.e. around 2pF.
%
% The arm length of the pendulum bar is 13cm, the tungsten wire 1.5m long. The whole TP weighs about 0.25kg right now and with the cross shape in the future it will be 0.46kg. Except for the wire it is made of aluminum.
%
% At the moment one of the capacitor plates is used for sensing and actuation, while the other pair is only sensing. The TM is connected to ground through some high resistance in a high-pass filter. Yes, the actuation signals on both sides are just inverse to each other. The amplitude of the 6kHz injection signal on the TM has an amplitude of 10V.
%
% For the graph I attached the graph Gerald showed you in the meeting. This data is not up to date anymore, but we are currently gathering new data with our updated setup now that we can differentiate between rz-motion (rotation around z-axis, i.e. torsion mode) and x-motion (swing mode of the pendulum).
%
% About your drawing that you put in the mail: As explained above, the actuation in the lower part is just the inverse of the upper one, so it can just be connected to the "-"-pole of the DC_actuation. And the "sensing" voltage supply you inserted should connect ot the TM directly and not to two points after the capacitor plates.
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment