This repository has been archived by the owner on Dec 27, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmotor_perf.html
97 lines (84 loc) · 2.33 KB
/
motor_perf.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
<style>
label {
font-size: .75rem;
font-style: italic;
}
canvas {
background-color: black;
display:none;
}
#container div {
margin-bottom: .5rem;
}
</style>
<h1>Motor Performance</h1>
<div class=flxwd>
<div style='white-space: nowrap; padding-right:1rem'>
<div>
Line Frequency <em>(Hz)</em>
<label><input name=line type=radio value=0> 50</label>
<label><input name=line type=radio value=1> 60</label>
</div>
Motor Power <em id=unit_pow></em>
<div><input name=motor_rated_power data-vd-rng></div>
Speed <em>(rpm)</em>
<div><input name=motor_rated_speed data-vd-rng></div>
<div>
Efficiency Class
<label><input name='efficiency_class' type=radio value=0> Standard</label>
<label><input name='efficiency_class' type=radio value=1> Energy</label>
<label><input name='efficiency_class' type=radio value=2> Custom </label>
<span><input name='efficiency'> <em>(%)</em></span>
</div>
Voltage <em>(V)</em>
<div><input name=motor_rated_voltage data-vd-rng></div>
Full-load Current <em>(A)</em>
<div><input name='flc'> <button onclick='estFLC(this)'>EST</button></div>
<button id=plot_btn onclick='plot()'>PLOT</button>
</div>
<canvas id=plot width="700" height="500"></canvas>
</div>
<script>//# sourceURL=*pump_eff
function estFLC(e) {// estimate full load current
nm('flc').val(flc(cvtArg(MotorPerf)));
}
// plot
function plot() {
P = {
padX: 25,
stepX: 10,
cntX: 12,
padY: 50,
stepY: 10,
cntY: 12
}
const ctx = setupPlot('Motor Shaft Load (%)','Efficiency (%)');
ctx.fillStyle = '#1F82BB';
ctx.fillText("Power Factor (%)",P.cnv.width-P.padX,P.padY-5-15);
ctx.fillStyle = 'white';
ctx.fillText("Current (% FLC)",P.cnv.width-P.padX,P.padY-5-30);
P.getYobj = x =>
api('motorPerformance',{
load_factor: (x==0 ? .1 : x)/100
});
curveMulti('efficiency');
curveMulti('current','white');
curveMulti('pf','#1F82BB');
}
// init
function effChg() {// efficiency field change
nm('efficiency').parent().toggle(nm('efficiency_class').filter(':checked')
.parent().text().trim()=='Custom');
}
pg('#unit_pow').text(`(${unit(POWER)})`)
setCtls(MotorPerf);
nm('efficiency_class').change(effChg);
setupVd();
nmAll().change((ev)=>{
$('canvas').hide();
$('#plot_btn').show();
setFromCtl(MotorPerf,ev.target);
save();
});
effChg();
</script>