Skip to content

Commit

Permalink
adds outsourcing option
Browse files Browse the repository at this point in the history
  • Loading branch information
sphawes committed May 20, 2024
1 parent bfb3387 commit c9dcbe6
Show file tree
Hide file tree
Showing 3 changed files with 277 additions and 71 deletions.
185 changes: 117 additions & 68 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,94 +31,143 @@

<div id="output"></div>
<div id="background-pane">
<div id="menu">
<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 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">
<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 id="toggle"><h4>Compare Against Outsourcing Instead</h4></div>

<div id="hand" class="tab">
<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 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">
<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">
<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="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>
<h3>Operator Hourly Rate (USD)</h3>
<input type="number" value="20" id="operator-rate"><br>
</div>


<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="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 id="button-wrapper">
<button id="calculate-button">Calculate</button>
</div>
</div>



<div id="button-wrapper">
<button id="calculate-button">Calculate</button>
</div>
<div class="row money-time">

<div class="row money-time">
<div class="slider-label">Time</div>

<div class="slider-label">Time</div>
<label class="switch">
<input id="graph-type" type="checkbox">
<span class="slider round"></span>
</label>

<label class="switch">
<input id="graph-type" type="checkbox">
<span class="slider round"></span>
</label>
<div class="slider-label">Money</div>

<div class="slider-label">Money</div>
</div>

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

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

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

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

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

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

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

</div>
</div>

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

</div>

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

<h1>LumenPnP vs. Outsourcing</h1>
<p style="text-align:left;">This calculator compares outsourcing PCBA production vs using the LumenPnP. It makes a few assumptions:</p>
<ul>
<li>It uses online quote tools as a benchmark for outsource pricing.</li>
<li>It assumes a conservative 3 hour LumenPnP setup time and 800 CPH.</li>
<li>It adds 16 hours to the LumenPnP timeline for every 8 hours of production to consider non-work hours.</li>
</ul>

<br >
<div class="row">
<div class="col">
<div class="help-tip help-tip-right">
<p>
The number of PCBAs needed.
</p>
</div>
<h3>Number of Boards</h3>
<input type="number" value="20" id="num-of-boards-outsourcing"><br>
</div>

<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="30" id="parts-per-board-outsourcing"><br>
</div>
</div>

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

</div>
<div id="time-graph-outsource-container" class="graph-result">

<canvas style="height:0px;" id="outsource-graph"></canvas>

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

</div>
</div>

</div>

<a href="https://www.opulo.io/"><div id="info">
<img style="width: 120px;" src="opulo-black-alpha.png" />
Expand Down
121 changes: 120 additions & 1 deletion script.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,129 @@ assumptions:
*/

document.getElementById ("calculate-button").addEventListener("click", calculate, false);
//joint data
/*
variables:
- parts per board
assumptions (could be editable under dropdown):
- takes 2 minutes to flip a job
- cph 800
- hand assembly time per part assumption
- boards per job (just assume four, customer wont necessarily know what they could fit)
- outsourced cost per smt part
*/


document.getElementById("toggle").addEventListener("click", toggle, false);

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

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

var activeChart;
var boardsChart;
var outsourcedChart;
var handActive = true;

function calculate_outsource(){

if (typeof outsourcedChart !== 'undefined') {
outsourcedChart.destroy();
}
var numOfBoards = document.getElementById("num-of-boards-outsourcing").value;
var partsPerBoard = document.getElementById("parts-per-board-outsourcing").value;

let out = 9+((numOfBoards-100)/250);

let lumenwork = (3/24)+(numOfBoards*partsPerBoard/800/24)

console.log(lumenwork)

let lumen = Math.floor(lumenwork/(.33))*0.66 + lumenwork;

console.log(lumen)


var timelines = [out, lumen];

var ctx = document.getElementById("outsource-graph");
const labels = ["Outsourced", "LumenPnP"]
const data = {
labels: labels,
datasets: [
{
label: 'Days',
data: timelines,
}
]
};

outsourcedChart = new Chart(ctx, {
type: 'bar',
data: data,
options: {
indexAxis: 'y',
plugins: {
title: {
display: true,
text: 'Time to Produce',
padding: {
top: 30,
bottom: 10
},
font: {
size: 20
}
},
legend: {
display: false,
}
},
maintainAspectRatio: true,
animations: false,
aspectRatio: 2,
scales: {
y: {

display: true,

},
x: {
title: {
display: true,
text: "Days"
}
}
}
}
});


}

function toggle(){
if(handActive){
//hide hand, show outsource
document.getElementById("hand").style.display = "none";
document.getElementById("outsource").style.display = "block";
//change copy in toggle
document.getElementById("toggle").innerHTML = "Compare Against Hand Placing Instead";

handActive = false;
}
else{
//hide outsource, show hand
document.getElementById("outsource").style.display = "none";
document.getElementById("hand").style.display = "block";
//change copy in toggle
document.getElementById("toggle").innerHTML = "Compare Against Outsourcing Instead";

handActive = true;

}
}

document.getElementById("graph-type").onclick = function() {
if (this.checked) {
Expand Down
Loading

0 comments on commit c9dcbe6

Please sign in to comment.