Commit 2414e7a2 authored by Stewart Thomas's avatar Stewart Thomas
Browse files

Adds support scripts and BOM

parent 1b1868b0
% EXAMPLE OF READING IN S1P FILE FORMAT
dir = 'C:\Users\sthoma11\Desktop\';
fname = 'hw2problem3.s1p';
H = dlmread([dir, fname], ' ', 3, 0);
f = H(:, 1);
db = H(:, 2);
angdeg = H(:, 3);
mag = 10 .^ (db ./ 20);
Gre = mag .* cos(pi*angdeg/180);
Gim = mag .* sin(angdeg*pi/180);
Gamma = Gre + 1j*Gim;
Zl = 50 * (1 + Gamma)./(1 - Gamma);
figure(1);clf;
smithchart()
h = plot(Gamma);
set(h, 'linewidth', 2)
n = length(f);
fc = f(n/2);
fprintf('The impedance at %3.2f MHz is %.2f + %.2fj Ohms\n', fc*1e-6, real(Zl(n/2)), imag(Zl(n/2)));
% implement matching
l1 = 10e-9;
l2 = 28e-9;
c1 = 10e-12;
Rl1 = (2 * pi * f * l1) ./ (20);
Rl2 = (2 * pi * f * l2) ./ (20);
Rc1 = 1 ./ (2 * pi * f * c1);
Zl1 = Rl1 + 1j*2*pi*f*l1;
Zl2 = Rl2 + 1j*2*pi*f*l2;
Zc2 = Rc1 + 1 ./ (1j * 2 * pi * f * c1);
% For ignoring Q
%Zl1 = 0 + 1j*2*pi*f*l1;
%Zl2 = 0 + 1j*2*pi*f*l2;
%Zc2 = 0 + 1 ./ (1j * 2 * pi * f * c1);
% add shunt l
Zm1 = 1 ./ ( (1 ./ Zl) + ( 1 ./ Zl1) );
gm1 = (Zm1 - 50) ./ (Zm1 + 50);
plot(gm1)
% add series l
Zm2 = Zl2 + Zm1;
gm2 = (Zm2 - 50) ./ (Zm2 + 50);
plot(gm2)
h = plot(gm2(n/2));
set(h, 'linewidth', 4, 'marker', 'o', 'color', 'r', 'linestyle', 'none');
legend(h, 'Matched 915 MHz')
clear all;
syms('r');
fmhz = 915;
s = fmhz / 300;
dBm = 27;
pt = 10^(dBm/10); % mW
dbi = 8; % ant. gain (dBi)
eqn = fmhz/300 == pt * 10^(dbi/10) / (4 * pi * (r)^2);
soln = solve(eqn, r);
dist = eval( soln(soln > 0));
fprintf('********\nMaximum permissible exposure:\n')
fprintf('Distance is %.3f cm\n', dist);
fprintf('or rather, %.3f feet\n', dist * 0.0328084 );
eqn = fmhz/1500 == pt * 10^(dbi/10) / (4 * pi * (r)^2);
soln = solve(eqn, r);
dist = eval( soln(soln > 0));
fprintf('********\nLimits for general population:\n')
fprintf('Distance is %.3f cm\n', dist);
fprintf('or rather, %.3f feet\n', dist * 0.0328084 );
\ No newline at end of file
% EXAMPLE OF READING IN S1P FILE FORMAT
dir = 'C:\Users\sthoma11\vnaJ.3.1\export\';
fname = 'VNA_160906_152229.s1p';
H = dlmread([dir, fname], ' ', 3, 0);
f = H(:, 1);
db = H(:, 2);
angdeg = H(:, 3);
mag = 10 .^ (db ./ 20);
Gre = mag .* cos(pi*ang/180);
Gim = mag .* sin(ang*pi/180);
Gamma = complex(Gre, Gim);
plot(real(Gamma), imag(Gamma));
xlim([-1, 1]);
ylim([-1, 1]);
axis equal;
\ No newline at end of file
addpath('C:\Program Files\bladeRF\matlab');
%dev = bladeRF();
%bladeRF_rx_gui;
clear;
fprintf('\nWelcome to the BladeRF Power Exhibitor 9000\nShould you have any questions, please do not consult the help file.\nThis MATLAB program has not been tested or validated by the FCC to be safe for human consumption. Or use.\nHappy Hacking!\n -Rick Ley\n\n');
fprintf('**********\n');
try
dev = bladeRF();
catch ME
if(strfind(ME.message, 'error (-7)'))
fprintf(ME.message);
fprintf('\n ***\n## Did you remember to plug it in? ##\n');
return;
end
end
%%
% equation is: output power = -15 + vga1 + vga2
fc = 915e6;
fs = 10e6;
bw = 1e6;
vga1 = -15;
vga2 = 25;
%pw = 0.88274 * vga2 + (vga1 -14.1670);
while(1)
pw = input('Enter power in dBm (leave blank to exit):');
%pw = str2num(strPow);
if isempty(pw)
break;
end
if (pw < -28) || (pw > -8)
fprintf('I''m sorry, but that is out of range.\nPlease provide a power level bewteen -28 and -8 dBm\n');
continue;
end
% calculate new power level
vga2 = (pw - (vga1 -14.1670))/0.88274;
dev.tx.stop();
dev.tx.frequency = fc;
dev.tx.samplerate = fs;
dev.tx.bandwidth = bw;
dev.tx.vga1 = vga1; % max of -4, min of -25
dev.tx.vga2 = vga2; % max of 25, min of 0
dev.tx.config.num_buffers = 64;
dev.tx.config.buffer_size = 16384;
dev.tx.config.num_transfers = 16;
dev.tx.start();
dev.transmit(ones(fs,1));
end
%%
fprintf('**********\n');
fprintf('**********\n');
fprintf('Thanks, and remember to drink your Ovaltine!\n\n')
dev.tx.stop();
clear('dev');
This diff is collapsed.
% Friis model, for LOS + GROUND + CEILING
%
clear all;
figure(1);clf;
f = 915e6;
c = 3e8;
y = 1.5;
ceil = 4;
%%
d = linspace(3, 25, 5000);
wl = c/f;
theta = 2*pi*f/c * d;
pl = 1./(4*pi*d.^2);
CHANNEL = pl;
gdbi = 6;
pt = 1;
gant = 10^(gdbi/10);
pr = pt * gant * gant * wl^2 / (4*pi) * CHANNEL;
plot(d, 30+10*log10(pr));
grid on;
%% ADD IN GROUND
y = 3;
gd = 2 * sqrt(d.^2/4 + y^2);
plg = 1./(4*pi*gd.^2);
thetag = 2*pi*f/c * gd;
a = pl.*exp(1j*theta);
b = plg.*exp(1j*thetag);
CHANNEL = abs(a + b);
prg = pt * gant * gant * wl^2 / (4*pi) * CHANNEL;
hold all;
plot(d, 30+10*log10(prg));
%% ADD IN CEILING
cd = 2 * sqrt(d.^2/4 + (ceil-y)^2);
plc = 1./(4*pi*cd.^2);
thetac = 2*pi*f/c * cd;
c = plc.*exp(1j*thetac);
CHANNEL = abs(a + b + c);
prc = pt * gant * gant * wl^2 / (4*pi) * CHANNEL;
hold all;
plot(d, 30+10*log10(prc));
set(gca, 'fontsize', 14);
xlabel('distance (m)');
ylabel('Received power (dBm)')
legend('Friis - Line of sight', 'line of sight + ground', 'line of sight + ground + ceiling')
print('-dpng', 'out.png')
This diff is collapsed.
[CAM Processor Job]
Description[de]="<b>Erzeugt Extended-Gerber-Format (RS274X)</b><p>\nDieser CAM-Job besteht aus fünf Arbeitsschritten und erzeugt Fertigungsdaten für eine zweilagige Platine.<p><p>\nDie fünf Gerberdateien enthalten Daten für:<br>\nBestückungsseite *.cmp<br>\nLötseite *.sol<br>\nBestückungsdruck oben *.plc<br>\nLötstoplack Bestückungsseite *.stc<br>\nLötstoplack Lötseite *.sts<br>"
Description[en]="<b>Generates Extended Gerber Format</b><p>\nThis CAM job consists of five sections that generate data for a two layer board.<p><p>\nYou will get five gerber files that contain data for:<br>\ncomponent side *.cmp<br>\nsolder side *.sol<br>\nsilkscreen component side *.plc<br>\nsolder stop component side *.stc<br>\nsolder stop solder sid *.sts<br>"
Section=Sec_1
Section=Sec_2
Section=Sec_3
Section=Sec_4
Section=Sec_5
Section=Sec_6
Section=Sec_7
Section=Sec_8
[Sec_1]
Name[de]="Bestückungsseite"
Name[en]="Component side"
Prompt[en]=""
Device="GERBER_RS274X"
Wheel=".whl"
Rack=""
Scale=1
Output="%P/Gerber/%N.cmp"
Flags="0 0 0 1 0 1 1"
Emulate="0 0 0"
Offset="0.0mil 0.0mil"
Sheet=1
Tolerance="0 0 0 0 0 0"
Pen="0.0mil 0"
Page="12000.0mil 8000.0mil"
Layers=" 1 17 18"
Colors=" 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 6 6 4 8 8 8 8 8 8 8 8 8 8 8 8 8 4 4 1 1 1 1 3 3 1 2 6 8 8 5 8 8 8 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 4 2 4 3 6 6 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0"
[Sec_2]
Name[de]="Lötseite"
Name[en]="Solder side"
Prompt[en]=""
Device="GERBER_RS274X"
Wheel=".whl"
Rack=""
Scale=1
Output="%P/Gerber/%N.sol"
Flags="0 0 0 1 0 1 1"
Emulate="0 0 0"
Offset="0.0mil 0.0mil"
Sheet=1
Tolerance="0 0 0 0 0 0"
Pen="0.0mil 0"
Page="12000.0mil 8000.0mil"
Layers=" 16 17 18"
Colors=" 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 6 6 4 8 8 8 8 8 8 8 8 8 8 8 8 8 4 4 1 1 1 1 3 3 1 2 6 8 8 5 8 8 8 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 4 2 4 3 6 6 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0"
[Sec_3]
Name[de]="Bestückungsdruck"
Name[en]="Silk screen CMP"
Prompt[en]=""
Device="GERBER_RS274X"
Wheel=".whl"
Rack=""
Scale=1
Output="%P/Gerber/%N.plc"
Flags="0 0 0 1 0 1 1"
Emulate="0 0 0"
Offset="0.0mil 0.0mil"
Sheet=1
Tolerance="0 0 0 0 0 0"
Pen="0.0mil 0"
Page="12000.0mil 8000.0mil"
Layers=" 20 21 51"
Colors=" 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 6 6 4 8 8 8 8 8 8 8 8 8 8 8 8 8 4 4 1 1 1 1 3 3 1 2 6 8 8 5 8 8 8 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 4 2 4 3 6 6 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0"
[Sec_4]
Name[de]="Bestückungsdruck"
Name[en]="Silk screen SOL"
Prompt[en]=""
Device="GERBER_RS274X"
Wheel=".whl"
Rack=""
Scale=1
Output="%P/Gerber/%N.pls"
Flags="0 0 0 1 0 1 1"
Emulate="0 0 0"
Offset="0.0mil 0.0mil"
Sheet=1
Tolerance="0 0 0 0 0 0"
Pen="0.0mil 0"
Page="12000.0mil 8000.0mil"
Layers=" 20 22 26"
Colors=" 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 6 6 4 8 8 8 8 8 8 8 8 8 8 8 8 8 4 4 1 1 1 1 3 3 1 2 6 8 8 5 8 8 8 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 4 2 4 3 6 6 1 1 1 1 1 1 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 1 1 1 1 1 1 1 1 1 1 1 1 0"
[Sec_6]
Name[de]="Lötstopmaske Lötseite"
Name[en]="Board Outline OLN"
Prompt[en]=""
Device="GERBER_RS274X"
Wheel=".whl"
Rack=""
Scale=1
Output="%P/Gerber/%N.oln"
Flags="0 0 0 1 0 1 1"
Emulate="0 0 0"
Offset="0.0mil 0.0mil"
Sheet=1
Tolerance="0 0 0 0 0 0"
Pen="0.0mil 0"
Page="12000.0mil 8000.0mil"
Layers=" 20"
Colors=" 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 6 6 4 8 8 8 8 8 8 8 8 8 8 8 8 8 4 4 1 1 1 1 3 3 1 2 6 8 8 5 8 8 8 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 4 2 4 3 6 6 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0"
[Sec_7]
Name[de]="Lötstopmaske Lötseite"
Name[en]="Solder stop mask SOL"
Prompt[en]=""
Device="GERBER_RS274X"
Wheel=".whl"
Rack=""
Scale=1
Output="%P/Gerber/%N.sts"
Flags="0 0 0 1 0 1 1"
Emulate="0 0 0"
Offset="0.0mil 0.0mil"
Sheet=1
Tolerance="0 0 0 0 0 0"
Pen="0.0mil 0"
Page="12000.0mil 8000.0mil"
Layers=" 20 30"
Colors=" 1 2 1 2 1 2 1 2 1 2 1 2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 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment