Skip to content

Commit

Permalink
updates math to be more accurate, adds tooltips about variables, upda…
Browse files Browse the repository at this point in the history
…tes copy and title, removes animation to make switching between graphs cleaner
  • Loading branch information
sphawes committed Jan 31, 2024
1 parent 9c04e52 commit 28c0b91
Show file tree
Hide file tree
Showing 7 changed files with 282 additions and 74 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dist/
1 change: 0 additions & 1 deletion dist/assets/index-5f549ff5.css

This file was deleted.

1 change: 0 additions & 1 deletion dist/assets/index-e442241e.js

This file was deleted.

90 changes: 69 additions & 21 deletions dist/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<!-- Google Tag Manager -->

<title>LumenPnP Config Tool</title>
<title>LumenPnP vs. Hand Assembly</title>

<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>

Expand All @@ -24,54 +24,102 @@
<link rel="mask-icon" href="safari-pinned-tab.svg" color="#5bbad5">
<meta name="msapplication-TileColor" content="#da532c">
<meta name="theme-color" content="#ffffff">
<script type="module" crossorigin src="./assets/index-e442241e.js"></script>
<link rel="stylesheet" href="./assets/index-5f549ff5.css">
<script type="module" crossorigin src="./assets/index-8a98007c.js"></script>
<link rel="stylesheet" href="./assets/index-805d0264.css">
</head>
<body>



<div id="output"></div>
<div id="background-pane">
<div id="menu">
<h1>LumenPnP - Pays For Itself</h1>
<p style="text-align:left;">This calculator determines how many boards it takes to break even on a LumenPnP purchase, and compares the boards produced per hour against hand-population. It makes a few assumptions:</p>
<h1>LumenPnP vs. Hand Assembly</h1>
<p style="text-align:left;">This calculator compares manufacturing boards by hand vs using the LumenPnP. It makes a few assumptions:</p>
<ul>
<li>It takes approximately two hours to set up a LumenPnP for a job.</li>
<li>It takes about one minute to unload and load a board in the LumenPnP.</li>
<li>The LumenPnP is running at 1000 CPH</li>
<li>It takes approximately two and a half minutes to flip a job.</li>
<li>The LumenPnP is running at a conservative 800 CPH.</li>

</ul>

<br >
<div class="row">
<div class="col-left">
<h3>Operator Hourly Rate (in USD)</h3>
<div class="col">
<div class="help-tip help-tip-right">
<p>
As <a target="_blank" href="https://www.ziprecruiter.com/Salaries/Circuit-Board-Assembly-Salary">reported by ZipRecruiter</a>, the average hourly wage for a Circuit Board Assembly technician is $20 an hour.
</p>
</div>
<h3>Operator Hourly Rate (USD)</h3>
<input type="number" value="20" id="operator-rate"><br>
</div>
<div class="col-center">
<h3>Time to Hand-Assemble One Board (In Minutes)</h3>
<input type="number" value="45" id="hand-time"><br>
</div>
<div class="col-right">

<div class="col">
<div class="help-tip help-tip-left">
<p>
This number is how many <i>total components</i> need to be placed on each board.
</p>
</div>
<h3>Parts per Board</h3>
<input type="number" value="100" id="cpb"><br>
<input type="number" value="50" id="parts-per-board"><br>
</div>
<div class="col" >
<div class="help-tip help-tip-left">
<p>
If you're unsure how long this takes, a good conservative calculation is 40 seconds per component.
</p>
</div>
<h3>Hand-Assembly Time per Board (min)</h3>
<input type="number" value="30" id="hand-time"><br>
</div>
<div class="col">
<div class="help-tip help-tip-left">
<p>
If you are running multiple boards per job, either with panels or just separately mounting multiple PCBs, input the total number of boards you can fit on the LumenPnP for a single job.
</p>
</div>
<h3>Boards per Job</h3>
<input type="number" value="4" id="boards-per-job"><br>
</div>
</div>

<br>


<div id="button-wrapper">
<button id="calculate-button">Calculate</button>
</div>

<canvas style="height:0px;" id="myChart"></canvas>
<div class="row money-time">

<div id="order"></div>
<div class="slider-label">Time</div>

<canvas style="height:0px;" id="boardsChart"></canvas>
<label class="switch">
<input id="graph-type" type="checkbox">
<span class="slider round"></span>
</label>

<div id="bph-result"></div>
<div class="slider-label">Money</div>

</div>

<div id="cost-graph" class="graph-result">

<canvas style="height:0px;" id="myChart"></canvas>

<div id="order"></div>

</div>

<div id="time-graph" class="graph-result">

<canvas style="height:0px;" id="boardsChart"></canvas>

<div id="bph-result"></div>

</div>



</div>

<a href="https://www.opulo.io/"><div id="info">
Expand Down
53 changes: 39 additions & 14 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<!-- Google Tag Manager -->

<title>LumenPnP Config Tool</title>
<title>LumenPnP vs. Hand Assembly</title>

<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
<script src="script.js" type="module"></script>
Expand Down Expand Up @@ -32,27 +32,52 @@
<div id="output"></div>
<div id="background-pane">
<div id="menu">
<h1>LumenPnP - Pays For Itself</h1>
<p style="text-align:left;">This calculator determines how many boards it takes to break even on a LumenPnP purchase, and compares the boards produced per hour against hand-population. It makes a few assumptions:</p>
<h1>LumenPnP vs. Hand Assembly</h1>
<p style="text-align:left;">This calculator compares manufacturing boards by hand vs using the LumenPnP. It makes a few assumptions:</p>
<ul>
<li>It takes approximately two hours to set up a LumenPnP for a job.</li>
<li>It takes about one minute to unload and load a board in the LumenPnP.</li>
<li>The LumenPnP is running at 1000 CPH</li>
<li>It takes approximately two and a half minutes to flip a job.</li>
<li>The LumenPnP is running at a conservative 800 CPH.</li>

</ul>

<br >
<div class="row">
<div class="col-left">
<h3>Operator Hourly Rate (in USD)</h3>
<div class="col">
<div class="help-tip help-tip-right">
<p>
As <a target="_blank" href="https://www.ziprecruiter.com/Salaries/Circuit-Board-Assembly-Salary">reported by ZipRecruiter</a>, the average hourly wage for a Circuit Board Assembly technician is $20 an hour.
</p>
</div>
<h3>Operator Hourly Rate (USD)</h3>
<input type="number" value="20" id="operator-rate"><br>
</div>
<div class="col-center">
<h3>Time to Hand-Assemble One Board (In Minutes)</h3>
<input type="number" value="45" id="hand-time"><br>
</div>
<div class="col-right">

<div class="col">
<div class="help-tip help-tip-left">
<p>
This number is how many <i>total components</i> need to be placed on each board.
</p>
</div>
<h3>Parts per Board</h3>
<input type="number" value="100" id="cpb"><br>
<input type="number" value="50" id="parts-per-board"><br>
</div>
<div class="col" >
<div class="help-tip help-tip-left">
<p>
If you're unsure how long this takes, a good conservative calculation is 40 seconds per component.
</p>
</div>
<h3>Hand-Assembly Time per Board (min)</h3>
<input type="number" value="30" id="hand-time"><br>
</div>
<div class="col">
<div class="help-tip help-tip-left">
<p>
If you are running multiple boards per job, either with panels or just separately mounting multiple PCBs, input the total number of boards you can fit on the LumenPnP for a single job.
</p>
</div>
<h3>Boards per Job</h3>
<input type="number" value="4" id="boards-per-job"><br>
</div>
</div>

Expand Down
83 changes: 52 additions & 31 deletions script.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
// TWEEZERS vs LUMEN
/*
variables:
- operator hourly rate - 20 (ziprecruiter link)
- time to hand-assemble one board - 20min
- time to set up - 2 hours
- parts per board - 29
- boards per job - 4
assumptions:
- takes 2.5 minutes to flip a job
- cph 800
*/

document.getElementById ("calculate-button").addEventListener("click", calculate, false);

var activeChart;
Expand All @@ -15,12 +31,6 @@ document.getElementById("graph-type").onclick = function() {
}
};

// the first consideration is how much time it saves you from the tweezers, bottom up approach.

//the other is a cost consideration from the outsourcers

// i almost want a slider that lets you pick between time and money

function destroy(lumenChart, boardsChart){
if (typeof lumenChart !== 'undefined') {
lumenChart.destroy();
Expand All @@ -35,10 +45,10 @@ function calculateHandCost(x, operator_rate, time_to_hand_assemble_board) {
return hand_option_cost;
}

function calculateLumenCost(x, operator_rate) {
function calculateLumenCost(x, operator_rate, boards_per_job) {
var lumenpnp_cost = 1995; //in usd
var lumenpnp_setup_time = 2; //in hours
var human_time_per_lumenpnp_board = 1/60; //in hours
var lumenpnp_setup_time = 3; //in hours
var human_time_per_lumenpnp_board = (2.5/60) / boards_per_job; //in hours

var pnp_option_cost = lumenpnp_cost + (lumenpnp_setup_time * operator_rate) + (human_time_per_lumenpnp_board * operator_rate * x);
return pnp_option_cost;
Expand All @@ -49,9 +59,19 @@ function calculateHandBoards(h, time_to_hand_assemble_board){
return h / time_to_hand_assemble_board;
}

function calculateLumenBoards(h, chips_per_board){
var lumenCPH = 1000;
return h * (lumenCPH / chips_per_board);
function calculateLumenBoards(h, chips_per_board, boards_per_job){
if(h<4){
return 0;
}
else{
let hoursOfProduction = h - 3;

let humanTimePerBoard = (2.5/60) / boards_per_job;
let lumenTimePerBoard = (chips_per_board / 800);
let timePerBoard = humanTimePerBoard + lumenTimePerBoard;

return hoursOfProduction / timePerBoard;
}
}


Expand All @@ -64,8 +84,8 @@ function calculate(){

var operator_rate = document.getElementById("operator-rate").value;
var time_to_hand_assemble_board = document.getElementById("hand-time").value / 60;
console.log(time_to_hand_assemble_board);
var chips_per_board = document.getElementById("cpb").value;
var chips_per_board = document.getElementById("parts-per-board").value;
let boards_per_job = document.getElementById("boards-per-job").value;

//--------------------
// COST CALCULATION
Expand All @@ -81,12 +101,10 @@ function calculate(){
while(!cost_flipped){

hand_data[index - 1] = calculateHandCost(index, operator_rate, time_to_hand_assemble_board);
lumen_data[index - 1] = calculateLumenCost(index, operator_rate);
lumen_data[index - 1] = calculateLumenCost(index, operator_rate, boards_per_job);

x_axis[index - 1] = index;

console.log("hand data: " + hand_data[index - 1])

if(hand_data[index - 1] > lumen_data[index - 1]){
cost_flipped = true;
cost_flipped_point = index;
Expand All @@ -99,9 +117,9 @@ function calculate(){
}
}

while(index < cost_flipped_point*3){
while(index < cost_flipped_point*5){
hand_data[index - 1] = calculateHandCost(index, operator_rate, time_to_hand_assemble_board);
lumen_data[index - 1] = calculateLumenCost(index, operator_rate);
lumen_data[index - 1] = calculateLumenCost(index, operator_rate, boards_per_job);
x_axis[index - 1] = index;

index = index + 1;
Expand Down Expand Up @@ -170,6 +188,7 @@ function calculate(){
}
},
maintainAspectRatio: true,
animations: false,
aspectRatio: 2,
scales: {
y: {
Expand Down Expand Up @@ -206,7 +225,7 @@ function calculate(){
document.getElementById("order").style.display = "inline-block";

//--------------------
// BPH CALCULATION
// TIME CALCULATION

var lumen_boards = [];
var hand_boards = [];
Expand All @@ -215,17 +234,17 @@ function calculate(){
var index = 1;

while(index < 41){
hand_boards[index - 1] = calculateHandBoards(index, time_to_hand_assemble_board);
console.log(hand_boards[index-1]);
lumen_boards[index - 1] = calculateLumenBoards(index, chips_per_board);

x_axis_boards[index - 1] = index;
//calculate how many boards would be made at this hour
hand_boards[index - 1] = calculateHandBoards(index, time_to_hand_assemble_board);

//calculate how many board would be made on the lumen at this hour
lumen_boards[index - 1] = calculateLumenBoards(index, chips_per_board, boards_per_job);

index = index + 1;
//add x axis
x_axis_boards[index - 1] = index;

if(index > 5000){
break;
}
index = index + 1;

}

Expand Down Expand Up @@ -285,6 +304,7 @@ function calculate(){
}
},
maintainAspectRatio: true,
animations: false,
aspectRatio: 2,
scales: {
y: {
Expand Down Expand Up @@ -314,10 +334,11 @@ function calculate(){


});
// end chart
var speed_factor = lumen_boards[39] / hand_boards[39];

document.getElementById("bph-result").innerHTML = "<p>A LumenPnP assembles boards</p><div class='flipped-point'>" + speed_factor.toFixed(1) + "x</div><p>faster than hand-placing.</p>";
// conclusion data
var speed_factor = (lumen_boards[39]-lumen_boards[38]) / (hand_boards[39]-hand_boards[38]);

document.getElementById("bph-result").innerHTML = "<p>A LumenPnP assembles boards</p><div class='flipped-point'>" + speed_factor.toFixed(1) + "x</div><p>faster than hand-placing after setup.</p>";
document.getElementById("bph-result").style.display = "inline-block";

if (document.getElementById("graph-type").checked){
Expand Down
Loading

0 comments on commit 28c0b91

Please sign in to comment.