Contents

clear all

define constants

f = 10^7;
omega = 2*pi*f;
Uo = 4*pi*10^-7; % Uo = magnetic permeability of free space
Eo = 8.85*10^-12;
rho = 1.68 * 10^-8; % rho = resistivity of copper
C1 = 1; % coefficient 1
C2 = 2.46; % coefficient 2
C3 = 0; % coefficient 3
C4 = 0.2; % coefficient 4
layers = input('Enter number of layers\n'); % number of layers in coil

define paramters

N = 1:60;
s = 0;
w = .00032;
DIn = .015;
t = w+s;
DOut = DIn + 2.*((N).*w + N.*s);
t = w+s;
a = 100*(DOut+DIn)/4; % Average radius in cm
b = N.*t*100; % thickness of total turns in cm
c = layers*w*100; % thickness of total layers in cm
n = N*layers; % total number of turns
l = 2*pi*(a/100).*N;
skindepth = sqrt((2*rho)/(omega*Uo))*sqrt(sqrt(1+(rho*omega*Eo)^2)+rho*omega*Eo)*10;

define equations

l = l*layers;
Ac = pi*(w/2).^2; % cross sectional area of conductor in coil
sigma = (DOut - DIn)./(DOut + DIn); % sigma = fill ratio of coil
DAvg = (DOut + DIn)./2; % Davg = mean diameter

define resistance of coil

Rdc = rho.*l./Ac; % Rdc = dc resistance of coil
Rskin = (l*rho)/(pi*(w-skindepth)*skindepth);
R = Rdc;

define inductance of planar spiral coil

%Mohan, S., Hershenson, M., Boyd, S., Lee, T.,
%Simple Accurate Expressions for Planar Spiral Inductances,
%In IEEE Journal of solid-state circuits, Vol. 34, No. 10, October 1999
L1 = (Uo.*((layers*N).^2).*DAvg.*C1)./2 .* (log(C2./sigma) + C3.*sigma + C4 .* sigma.^2);

define inductance of planar spiral coil (Wheeler)

DInE = DIn .* 39.3701; % convert to meters to inches
tE = t .* 39.3701;
A = (DInE + (N+1).*tE)/2;
L2 = ((layers*N).^2.*A.^2)./((30.*A-11.*DInE).*10^6);

define inductance of multi-layered coil

Kim, J., Basham, E., Pedrotti, K. Geometry-based optimization of radio-frequency coils for powering neuroprosthetic implants International Federation for Medical and Biological Engineering October 21, 2012

L3 = (a.^2.*n.^2)./(2.53*(9*a+10*b)*10^6);

define parasitic capacitance of coil

C = 50*10^-15;

define resonance frequency

fo = 1./(2*pi*sqrt(L1.*C));
% RES2 = 1./(2*pi*sqrt(L1.*C2));

define quality

Q1 = (L1.*omega)./R;
Q2 = (L2.*omega)./R;

create differential vectors

Rm = R.*ones(size(N));

Rdiff = diff(Rm)./ diff(N);
Ldiff = diff(L1)./ diff(N);
Qdiff = diff(Q1)./ diff(N);
Fdiff = diff(fo)./ diff(N);

plot result

clf;
subplot(2,4,1)
plot(N,L1*10^6,N,L2*10^6,N,L3*10^6,Nm,Lm,'r*')
xlabel('# of turns')
ylabel('Inductance (uH)')

subplot(2,4,5)
plot(N,[Ldiff NaN])
xlabel('# of turns')
ylabel('delta L')

subplot(2,4,2)
plot(N,R,Nm,Rmeas,'r*')
xlabel('# of turns')
ylabel('Resistance')

subplot(2,4,6)
plot(N,[Rdiff NaN])
xlabel('# of turns')
ylabel('delta R')

subplot(2,4,3)
plot(N,Q1,N,Q2,Nm,omega*(Lm*10^-6./Rmeas),'r*')
xlabel('# of turns')
ylabel('Quality')

subplot(2,4,7)
plot(N,[Qdiff NaN])
xlabel('# of turns')
ylabel('delta Q')

subplot(2,4,4)
plot(N,fo)
xlabel('# of turns')
ylabel('Resonant frequency')

subplot(2,4,8)
plot(N,[Fdiff NaN])
xlabel('# of turns')
ylabel('delta Fo')

set(gcf,'Units','normalized','Position',...
[0.00 0.0322 0.92 0.92])