Porównaj commity

...

5 Commity

Autor SHA1 Wiadomość Data
miguel 9a98c0534c Reduce N for ferrites to 1/4 of before 2023-05-03 15:10:21 +10:00
miguel c12eb61506 Update toroid.html 2023-05-02 23:12:14 +10:00
miguel fde6cb68da Minor clean ups. Back to N instead of Nd. 2023-05-02 23:11:10 +10:00
miguel d25030d7ce Update toroid.html 2023-05-02 22:41:40 +10:00
miguel dc5b3be95a Create .DS_Store 2023-05-02 22:23:09 +10:00
2 zmienionych plików z 17 dodań i 23 usunięć

BIN
.DS_Store vendored 100644

Plik binarny nie jest wyświetlany.

Wyświetl plik

@ -7,7 +7,7 @@
<link rel="stylesheet" href="toroid.css">
</head>
<body>
<header>Miguel <a href="mailto:vk3cpu@gmail.com">VK3CPU</a> - RF Toroid Calculator v1.1<br></header>
<header>Miguel <a href="mailto:vk3cpu@gmail.com">VK3CPU</a> - RF Toroid Calculator v1.2<br></header>
<section class="gridLayoutClass">
<div id="chart-container" class="chart-container">
<canvas id="chartCanvas" class="chartCanvasClass">
@ -28,20 +28,13 @@
<select name="toroids" id="toroid-select" onchange="setToroid()">
<!--option value="FT240">FT240</option>
<option value="FT140">FT140</option>
<option value="FT114">FT114</option>
<option value="FT82">FT82</option>
<option value="FT50">FT50</option>
<option value="FT37">FT37</option-->
</select>
<select name="materials" id="material-select" onchange="setMaterial()">
<!--option value="75">75 [&#956;i=5000]</option>
<option value="78">78 [&#956;i=2300]</option>
<option value="77">77 [&#956;i=2000]</option>
<option value="79">79 [&#956;i=1400]</option>
<option value="43" selected='true'>43 [&#956;i=800]</option>
<option value="80">80 [&#956;i=600]</option>
<option value="52">52 [&#956;i=250]</option>
<option value="61">61 [&#956;i=125]</option>
<option value="67">67 [&#956;i=40]</option-->
</select>
</div>
@ -50,7 +43,7 @@
<input type="range" id="conductor_diameter_slider" min="2" max="38" value="20" step="1">
</div>
<div class="sliders">
<label for="loop_turns_slider">Nd:</label>
<label for="loop_turns_slider">N:</label>
<input type="range" id="loop_turns_slider" min="0.0" max="1.0" value="0.15" step="0.005">
</div>
<div class="sliders">
@ -81,7 +74,7 @@
<b><u>Inputs via the slider widgets:</u></b>
<ul>
<li>AWG : Select the wire gauge. Sliding L-R changes AWG from 40-0. (Defaults to 20 AWG)</li>
<li>Nd : Winding density at the toroid inner-diameter. Controls how many single-layer turns can be achieved around the core.
<li>N : Winding density at the toroid inner-diameter. Controls how many single-layer turns can be achieved around the core.
Maximum (100%, slider to hard-right) is reached when the turns are adjacent at the toroid's inner radius. (Defaults to 15%)</li>
<li>Vrms : The RMS voltage applied to the inductor (Volts). Determines the flux-density (B) and field-intensity (H) within the ferrite toroid. (Defaults to 10Vrms)</li>
<li>f : Shifts the frequency of interest of the chart display from left-to-right. Left towards kHz, right towards GHz. </li>
@ -162,7 +155,7 @@
</ul>
<br>
<b><u>Change history:</u></b><br>
<b>[2-May-23] - v1.1</b> <br>
<b>[2-May-23] - v1.2</b> <br>
* Added 2646102002 which I have called the "FT102B-61" <br>
<b>[1-May-23] - v1.1</b> <br>
* Added 2643102002 which I have called the "FT102B-43" <br>
@ -641,6 +634,7 @@
var i_after = this.cores[this.material].complex_mu.freq.length-1;
var i = Math.floor((i_after + i_before)/2);
// Divide-and-conquer. Find the indices before and after the value. Use them for interpolation later.
while((i_before+1) < i_after) {
if(frequency >= this.cores[this.material].complex_mu.freq[i]) {
i_before = i;
@ -659,15 +653,14 @@
return [mu_1, mu_2];
};
this.getInductance = function (frequency) {
const mu = this.getComplexPermeability(frequency);
const L = mu[0] * 4.0 * Math.PI * toroid.N**2 * 1e-9 / toroid.core.CC;
this.getInductance = function (frequency, mu) {
// const mu = this.getComplexPermeability(frequency);
const L = mu[0] * 4.0 * Math.PI * this.N**2 * 1e-9 / this.core.CC;
return L;
};
this.getImpedance = function (frequency) {
const mu = this.getComplexPermeability(frequency);
//console.log(mu);
this.getImpedance = function (frequency, mu) {
// const mu = this.getComplexPermeability(frequency);
const Lo = 4.0 * Math.PI * this.N**2 * 1e-9 / this.core.CC;
const Rs = 2.0 * Math.PI * frequency * Lo * mu[1];
const Xs = 2.0 * Math.PI * frequency * Lo * mu[0];
@ -701,7 +694,7 @@
// Frequency independent characteristics:
this.N_max = Math.PI / (Math.atan2(0.5e3 * this.cond_diameter_meters, (0.5 * this.core.B - 0.5e3 * this.cond_diameter_meters)));
this.N = 1 + Math.round(loop_turns_slider.value * (this.N_max - 1));
this.N = 1 + Math.round(loop_turns_slider.value * (this.N_max - 1) * 0.25);
//this.cond_length_meters = this.N * (2*this.core.C + this.core.A - this.core.B) * 1e-3;
//this.cond_length_meters = 2e-3 * Math.sqrt ( (Math.PI * 0.5 * (this.core.A + this.core.B))**2 + (this.N * (2*this.core.C + this.core.A - this.core.B))**2 );
@ -733,7 +726,8 @@
frequencies.forEach(freq => {
const mu = this.getComplexPermeability(freq);
const Z = this.getImpedance(freq);
const L = this.getInductance(freq, mu);
const Z = this.getImpedance(freq, mu);
// Make freq in kHz from Hz:
freq *= 1e-3;
@ -741,8 +735,8 @@
this.mu1_vs_f.push({x:freq, y:mu[0]});
this.mu2_vs_f.push({x:freq, y:mu[1]});
//this.L_vs_f.push({x:freq, y:(Math.sqrt(mu[0]**2 + mu[1]**2) * 4.0 * Math.PI * this.N**2 * 1e-3 / this.core.CC)});
this.L_vs_f.push({x:freq, y:(mu[0] * 4.0 * Math.PI * this.N**2 * 1e-3 / this.core.CC)});
//this.L_vs_f.push({x:freq, y:(mu[0] * 4.0 * Math.PI * this.N**2 * 1e-3 / this.core.CC)});
this.L_vs_f.push({x:freq, y:L});
this.R_vs_f.push({x:freq, y:Z.real});
this.X_vs_f.push({x:freq, y:Z.imag});
@ -1067,7 +1061,6 @@
};
this.getInductance = function (frequency, Bpk) {
//const mu = this.getMuFromFreq(frequency);
// const L = this.core.Al * this.N**2 * 1e-9;
// New method because using Ae and le did not match Al with N^2.
const L = this.getMuFromFreq(frequency) * this.getMuFromBpk(Bpk) * 1e-2 * (this.core.Al / this.mat.mu_i) * this.N**2 * 1e-9;
@ -2479,7 +2472,8 @@
fctx.font = "bold 16px courier";
fctx.fillText((40-conductor_diameter_slider.value).toString() + " AWG", loopx, 20);
//fctx.fillText("N = " + controller.toroid.N.toString() + " : Nd = " + (loop_turns_slider.value*100).toFixed(0) + "%", loopx, win_height - 28);
fctx.fillText("Nd = " + (loop_turns_slider.value*100).toFixed(0) + "% : N = " + controller.toroid.N.toString(), loopx, win_height - 28);
//fctx.fillText("Nd = " + (loop_turns_slider.value*100).toFixed(0) + "% : N = " + controller.toroid.N.toString(), loopx, win_height - 28);
fctx.fillText("N = " + controller.toroid.N.toString(), loopx, win_height - 28);
fctx.font = "12px arial";
fctx.fillText("wire = " + (controller.toroid.cond_length_meters*100.0).toFixed(1)+ " cm (" + (3.2808399*controller.toroid.cond_length_meters).toFixed(2)+ "\')", loopx, win_height - 14);