kopia lustrzana https://github.com/miguelvaca/vk3cpu
Added 5943001601 as FT122-43
rodzic
a0284f9855
commit
24aa704a4b
Plik binarny nie jest wyświetlany.
177
antenna.html
177
antenna.html
|
@ -76,12 +76,18 @@
|
|||
var ground_plane = 0;
|
||||
var height_above_ground = 0;
|
||||
|
||||
class Antennas {
|
||||
// Recalculate all variables. Triggered whenever the system parameter inputs are changed:
|
||||
function recalculate() {
|
||||
// Read all inputs and store values in wavelengths:
|
||||
|
||||
// Create segments of all the wires with appropriate lengths:
|
||||
|
||||
// Create 3D representation and reload the scene:
|
||||
}
|
||||
|
||||
class AntennaTypes {
|
||||
//
|
||||
constructor() {
|
||||
this.wires = [];
|
||||
this.Z = [];
|
||||
this.Y = [];
|
||||
this.frequency = 3e8;
|
||||
|
||||
this.antenna_types = {
|
||||
|
@ -181,15 +187,6 @@
|
|||
//console.log(this.current_type);
|
||||
}
|
||||
|
||||
// Recalculate all variables:
|
||||
recalculate() {
|
||||
// Read all inputs and store values in wavelengths:
|
||||
|
||||
// Create segments of all the wires with appropriate lengths:
|
||||
|
||||
// Create 3D representation and reload the scene:
|
||||
}
|
||||
|
||||
solve() {
|
||||
// Fill the impedance Z matrix:
|
||||
// Invert Z to produce admittance Y matrix:
|
||||
|
@ -204,6 +201,97 @@
|
|||
this.current_type = antenna_type;
|
||||
}
|
||||
|
||||
// Return the wire elements for solving:
|
||||
getWires() {
|
||||
this.wires = [];
|
||||
//
|
||||
var ws = this.antenna_types['antennas'][this.current_type]['wires'];
|
||||
var vs = this.antenna_types['antennas'][this.current_type]['vertex'];
|
||||
|
||||
ws.forEach(w => {
|
||||
//
|
||||
var ww = {};
|
||||
// ww.length = ;
|
||||
// ww.seg_len = ;
|
||||
ww.radius = 0.0001;
|
||||
ww.points = [];
|
||||
for (let index = 0; index < (w.length-1); index++) {
|
||||
const wire_length = Math.sqrt(
|
||||
(vs[w[index]][0] - vs[w[index+1]][0])**2 +
|
||||
(vs[w[index]][1] - vs[w[index+1]][1])**2 +
|
||||
(vs[w[index]][2] - vs[w[index+1]][2])**2
|
||||
);
|
||||
// Minimum of 10 segments per half-wavelength => 0.05
|
||||
const max_segment_length = 0.05;
|
||||
const segments = Math.round(wire_length / max_segment_length);
|
||||
ww.seg_len = wire_length / segments;
|
||||
for (let ii = 0; ii < segments; ii++) {
|
||||
var frac = 1.0 * ii / segments;
|
||||
var x = vs[w[index]][0] * (1.0 - frac) + frac * vs[w[index+1]][0];
|
||||
var y = vs[w[index]][1] * (1.0 - frac) + frac * vs[w[index+1]][1];
|
||||
var z = vs[w[index]][2] * (1.0 - frac) + frac * vs[w[index+1]][2];
|
||||
ww.points.push([x,y,z]);
|
||||
|
||||
frac = 1.0 * (ii + 0.5) / segments;
|
||||
x = vs[w[index]][0] * (1.0 - frac) + frac * vs[w[index+1]][0];
|
||||
y = vs[w[index]][1] * (1.0 - frac) + frac * vs[w[index+1]][1];
|
||||
z = vs[w[index]][2] * (1.0 - frac) + frac * vs[w[index+1]][2];
|
||||
ww.points.push([x,y,z]);
|
||||
}
|
||||
}
|
||||
// Add the final point:
|
||||
x = vs[w[w.length-1]][0];
|
||||
y = vs[w[w.length-1]][1];
|
||||
z = vs[w[w.length-1]][2];
|
||||
ww.points.push([x,y,z]);
|
||||
//retval.push(ww);
|
||||
this.wires.push(ww);
|
||||
});
|
||||
return this.wires;
|
||||
}
|
||||
|
||||
//
|
||||
getThreeObject3D = function () {
|
||||
const material = new THREE.LineBasicMaterial({ color: 0xffff00, linewidth: 1 });
|
||||
const antenna_view = new THREE.Group();
|
||||
//
|
||||
const ww = this.antenna_types['antennas'][this.current_type]['wires'];
|
||||
const vv = this.antenna_types['antennas'][this.current_type]['vertex'];
|
||||
ww.forEach(wire => {
|
||||
//console.log(wire);
|
||||
var vertices = new Float32Array(wire.length * 3);
|
||||
var vidx = 0;
|
||||
const scale_factor = 200.0; // Roughly pixels per wavelength
|
||||
// Copy the vertex locations across into a Float32Array for the geometry:
|
||||
wire.forEach((vertex) => {
|
||||
//console.log(vertex, vv[vertex]);
|
||||
vertices[vidx++] = (vv[vertex][0] * scale_factor);
|
||||
vertices[vidx++] = (vv[vertex][1] * scale_factor);
|
||||
vertices[vidx++] = (vv[vertex][2] * scale_factor);
|
||||
});
|
||||
//
|
||||
const geometry = new THREE.BufferGeometry();
|
||||
geometry.setAttribute('position', new THREE.BufferAttribute(vertices, 3));
|
||||
// create a new wire with
|
||||
const wire_line = new THREE.Line(geometry, material);
|
||||
antenna_view.add(wire_line);
|
||||
});
|
||||
// Add the antenna into the scene:
|
||||
return antenna_view;
|
||||
};
|
||||
}
|
||||
|
||||
class WireAntennaModel {
|
||||
// constructor:
|
||||
constructor(ws, vs) {
|
||||
// Object variables:
|
||||
this.wires = [];
|
||||
this.Z = [];
|
||||
this.Y = [];
|
||||
|
||||
}
|
||||
|
||||
//
|
||||
psi(seg_n, seg_m, point_n, point_m) {
|
||||
var retval = 0.0;
|
||||
const k = 2.0 * Math.PI; // Normalised wavelength is equal to 1.0 - otherwise 2*pi/wavelength
|
||||
|
@ -340,53 +428,16 @@
|
|||
return 1.0;
|
||||
}
|
||||
|
||||
// Return the wire elements for solving:
|
||||
getWires() {
|
||||
this.wires = [];
|
||||
//
|
||||
var ws = this.antenna_types['antennas'][this.current_type]['wires'];
|
||||
var vs = this.antenna_types['antennas'][this.current_type]['vertex'];
|
||||
|
||||
ws.forEach(w => {
|
||||
//
|
||||
var ww = {};
|
||||
// ww.length = ;
|
||||
// ww.seg_len = ;
|
||||
ww.radius = 0.0001;
|
||||
ww.points = [];
|
||||
for (let index = 0; index < (w.length-1); index++) {
|
||||
const wire_length = Math.sqrt(
|
||||
(vs[w[index]][0] - vs[w[index+1]][0])**2 +
|
||||
(vs[w[index]][1] - vs[w[index+1]][1])**2 +
|
||||
(vs[w[index]][2] - vs[w[index+1]][2])**2
|
||||
);
|
||||
// Minimum of 10 segments per half-wavelength => 0.05
|
||||
const max_segment_length = 0.05;
|
||||
const segments = Math.round(wire_length / max_segment_length);
|
||||
ww.seg_len = wire_length / segments;
|
||||
for (let ii = 0; ii < segments; ii++) {
|
||||
var frac = 1.0 * ii / segments;
|
||||
var x = vs[w[index]][0] * (1.0 - frac) + frac * vs[w[index+1]][0];
|
||||
var y = vs[w[index]][1] * (1.0 - frac) + frac * vs[w[index+1]][1];
|
||||
var z = vs[w[index]][2] * (1.0 - frac) + frac * vs[w[index+1]][2];
|
||||
ww.points.push([x,y,z]);
|
||||
}
|
||||
|
||||
frac = 1.0 * (ii + 0.5) / segments;
|
||||
x = vs[w[index]][0] * (1.0 - frac) + frac * vs[w[index+1]][0];
|
||||
y = vs[w[index]][1] * (1.0 - frac) + frac * vs[w[index+1]][1];
|
||||
z = vs[w[index]][2] * (1.0 - frac) + frac * vs[w[index+1]][2];
|
||||
ww.points.push([x,y,z]);
|
||||
}
|
||||
}
|
||||
// Add the final point:
|
||||
x = vs[w[w.length-1]][0];
|
||||
y = vs[w[w.length-1]][1];
|
||||
z = vs[w[w.length-1]][2];
|
||||
ww.points.push([x,y,z]);
|
||||
//retval.push(ww);
|
||||
this.wires.push(ww);
|
||||
});
|
||||
return this.wires;
|
||||
class WireAntennaView {
|
||||
// constructor:
|
||||
constructor() {
|
||||
//
|
||||
}
|
||||
|
||||
loadAntenna(wire_segments) {
|
||||
//
|
||||
}
|
||||
|
||||
//
|
||||
|
@ -656,12 +707,11 @@
|
|||
const gui = new dat.GUI();
|
||||
|
||||
// Add a mode selector. View is to change perspective. Edit allows moving vertices. Solve runs the EM solver. (Maybe should be edit+solve?)
|
||||
/*
|
||||
gui.add(parameters, 'mode', ['view', 'edit', 'solve'])
|
||||
.setValue('view')
|
||||
.onChange(function(value){ console.log(value); });
|
||||
|
||||
// Create the Antennas object, which holds all the antenna types and creates the visual model on-request
|
||||
ant = new Antennas();
|
||||
*/
|
||||
|
||||
// Ground-plane
|
||||
const geometry = new THREE.CircleGeometry( 150, 32 );
|
||||
|
@ -695,6 +745,9 @@
|
|||
pattern.setVisibility(value);
|
||||
});
|
||||
|
||||
// Create the AntennaTypes object, which holds all the antenna types and creates the visual model on-request
|
||||
ant = new AntennaTypes();
|
||||
|
||||
gui.add( parameters, 'w', ant.antenna_types['order'])
|
||||
.setValue(ant.current_type)
|
||||
.name('Types')
|
||||
|
|
32
mom.html
32
mom.html
|
@ -283,11 +283,21 @@
|
|||
return retval;
|
||||
}
|
||||
|
||||
function calculateImpedance() {
|
||||
var retval = [];
|
||||
var x_axis = 0.0;
|
||||
for(var i=0; i<I.length; i++) {
|
||||
x_axis += wire.seg_len;
|
||||
const Z = (V[i].toPolar().r) / (I[i].toPolar().r);
|
||||
retval.push({x:x_axis, y:Z});
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
/* Next is Three.js related code functions/methods: */
|
||||
|
||||
/* Now run the code: */
|
||||
|
||||
// Create a half-wavelength long wire, with a radius of 0.001 lambda, and segmented into 10 pieces:
|
||||
// Create a half-wavelength long wire, with a radius of 0.0001 lambda, and segmented into 10 pieces:
|
||||
wire = createWire(0.5, 0.0001, 45);
|
||||
//console.log(wire);
|
||||
//console.log(wire);
|
||||
|
@ -355,6 +365,15 @@
|
|||
data: calculateCurrent(),
|
||||
borderWidth: 1,
|
||||
yAxisID: 'currentID'
|
||||
},
|
||||
{
|
||||
label: 'Impedance',
|
||||
fill: false,
|
||||
borderColor: 'black',
|
||||
backgroundColor: 'black',
|
||||
data: calculateImpedance(),
|
||||
borderWidth: 1,
|
||||
yAxisID: 'impedanceID'
|
||||
}]
|
||||
},
|
||||
options: {
|
||||
|
@ -392,6 +411,17 @@
|
|||
},
|
||||
position: 'left',
|
||||
id: 'currentID'
|
||||
},{
|
||||
type: 'linear',
|
||||
display: 'auto',
|
||||
scaleLabel: {
|
||||
display: true,
|
||||
labelString: 'Z',
|
||||
fontColor: 'black',
|
||||
fontStyle: 'bold'
|
||||
},
|
||||
position: 'left',
|
||||
id: 'impedanceID'
|
||||
}]
|
||||
},
|
||||
showLines: true,
|
||||
|
|
|
@ -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.2<br></header>
|
||||
<header>Miguel <a href="mailto:vk3cpu@gmail.com">VK3CPU</a> - RF Toroid Calculator v1.3<br></header>
|
||||
<section class="gridLayoutClass">
|
||||
<div id="chart-container" class="chart-container">
|
||||
<canvas id="chartCanvas" class="chartCanvasClass">
|
||||
|
@ -61,7 +61,7 @@
|
|||
RF Toroid Calculator was developed to help users predict the RF characteristics of a ferrite or powdered-iron toroid wound as an inductor or suppressor.
|
||||
It uses the manufacturer's (Fair-Rite & Micrometals) published data including the toroid's dimensions and complex permeability characteristics
|
||||
to predict the component's characteristics.<br>
|
||||
The calculator has 4 separate display areas. At the top is the chart display for showing frequency-dependent characteristics. Next is the
|
||||
The calculator has 3 separate display areas. At the top is the chart display for showing frequency-dependent characteristics. Next is the
|
||||
schematic display, where a scaled image of the toroid and windings is presented to help with intuitive design. Next is the control panel
|
||||
section, where the user can select the application type, toroid material, toroid size, wire size, number of windings and excitation voltage.<br><br>
|
||||
<b><u>Inputs via the select widgets:</u></b>
|
||||
|
@ -155,6 +155,8 @@
|
|||
</ul>
|
||||
<br>
|
||||
<b><u>Change history:</u></b><br>
|
||||
<b>[4-Sep-23] - v1.3</b> <br>
|
||||
* Added 5943001601 which I have called the "FT122-43" <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>
|
||||
|
@ -504,6 +506,8 @@
|
|||
'FT140x2' : { PN:'5943002701', A:35.55, B:23.00, C:25.4, W:66.0, CC:5.60, le:8.90, Ae:1.58, Ve:14.00, Al:1770.0 },
|
||||
'FT140' : { PN:'5943002701', A:35.55, B:23.00, C:12.7, W:33.0, CC:11.20, le:8.90, Ae:0.79, Ve:7.00, Al:885.0 },
|
||||
'FT125' : { PN:'5943001701', A:31.75, B:19.05, C:9.50, W:23.0, CC:12.90, le:7.60, Ae:0.59, Ve:4.50, Al:775.0 },
|
||||
'FT122x2' : { PN:'5943001601', A:31.10, B:19.05, C:15.80, W:36.0, CC:8.10, le:7.60, Ae:0.94, Ve:7.06, Al:1240.0 },
|
||||
'FT122' : { PN:'5943001601', A:31.10, B:19.05, C:7.90, W:18.0, CC:16.20, le:7.60, Ae:0.47, Ve:3.53, Al:620.0 },
|
||||
'FT114x2' : { PN:'5943001001', A:29.00, B:19.00, C:15.0, W:26.0, CC:9.90, le:7.30, Ae:0.74, Ve:5.40, Al:1020.0 },
|
||||
'FT114' : { PN:'5943001001', A:29.00, B:19.00, C:7.50, W:13.0, CC:19.80, le:7.30, Ae:0.37, Ve:2.70, Al:510.0 },
|
||||
'FT102B' : { PN:'2643102002', A:25.90, B:12.80, C:28.60, W:55.0, CC:3.11, le:5.60, Ae:1.80, Ve:10.07, Al:3296.0 },
|
||||
|
|
Ładowanie…
Reference in New Issue