Update BOM script to account for quantity better

This commit is contained in:
Matt McWilliams 2024-11-28 11:37:58 -05:00
parent 7ed69df73d
commit e1c8a7bc3c
5 changed files with 35 additions and 29 deletions

View File

@ -7,6 +7,7 @@ electronics_panel,6,M3 sliding t slot nut,N/A,Attach the frame to the electronic
electronics_panel,6,M3 hex cap bolt 8mm,N/A,Attach the electronics_panel to the frame electronics_panel,6,M3 hex cap bolt 8mm,N/A,Attach the electronics_panel to the frame
electronics_panel,1,L298N Motor driver module,N/A,Control the 3 motors using 2 channels electronics_panel,1,L298N Motor driver module,N/A,Control the 3 motors using 2 channels
electronics_panel,1,ESP32 Dev board,N/A,Control the contact_printer electronics_panel,1,ESP32 Dev board,N/A,Control the contact_printer
sprocketed_roller_invert_solid,1,608-RS Ball Bearing,608-RS,Reduces wobble in the rollers spin
sprocketed_roller_invert_solid,1,M3 hex cap bolt 12mm,N/A,Attaches the sprocketed_roller to the geared motor sprocketed_roller_invert_solid,1,M3 hex cap bolt 12mm,N/A,Attaches the sprocketed_roller to the geared motor
takeup_panel_stock,6,M3 sliding t slot nut,N/A,Attach the frame to the takeup_panel_stock takeup_panel_stock,6,M3 sliding t slot nut,N/A,Attach the frame to the takeup_panel_stock
takeup_panel_stock,6,M3 hex cap bolt 8mm,N/A,Attach the takeup_panel_stock to the frame takeup_panel_stock,6,M3 hex cap bolt 8mm,N/A,Attach the takeup_panel_stock to the frame

1 module quantity part part_id description
7 electronics_panel 6 M3 hex cap bolt 8mm N/A Attach the electronics_panel to the frame
8 electronics_panel 1 L298N Motor driver module N/A Control the 3 motors using 2 channels
9 electronics_panel 1 ESP32 Dev board N/A Control the contact_printer
10 sprocketed_roller_invert_solid 1 608-RS Ball Bearing 608-RS Reduces wobble in the rollers spin
11 sprocketed_roller_invert_solid 1 M3 hex cap bolt 12mm N/A Attaches the sprocketed_roller to the geared motor
12 takeup_panel_stock 6 M3 sliding t slot nut N/A Attach the frame to the takeup_panel_stock
13 takeup_panel_stock 6 M3 hex cap bolt 8mm N/A Attach the takeup_panel_stock to the frame

View File

@ -1,14 +1,15 @@
quantity,part,part_id,price quantity,part,part_id,price
4,"M4 hex bolt 40mm",N/A,500 4,"M4 hex bolt 40mm",N/A,240
25,"M3 sliding t slot nut",N/A,150 25,"M3 sliding t slot nut",N/A,125
25,"M3 hex cap bolt 8mm",N/A,225 25,"M3 hex cap bolt 8mm",N/A,200
8,"M3 hex cap bolt 6mm",N/A,56 8,"M3 hex cap bolt 6mm",N/A,56
1,"M3 hex cap bolt 12mm",N/A,0 1,"M3 hex cap bolt 12mm",N/A,0
1,"L298N Motor driver module",N/A,289 1,"L298N Motor driver module",N/A,287
1,"ESP32 GPIO breakout board",N/A,599 1,"ESP32 GPIO breakout board",N/A,599
1,"ESP32 Dev board",N/A,666 1,"ESP32 Dev board",N/A,666
1,"608-RS Ball Bearing",608-RS,17
2,"250RPM DC geared motor",JSX40-370,2998 2,"250RPM DC geared motor",JSX40-370,2998
2,"2020 Aluminum extrusion 420mm",N/A,522 2,"2020 Aluminum extrusion 420mm",N/A,510
4,"2020 Aluminum extrusion 260mm",N/A,644 4,"2020 Aluminum extrusion 260mm",N/A,640
1,"100RPM DC geared motor with encoder",N/A,1702 1,"100RPM DC geared motor with encoder",N/A,1619
75,N/A,TOTAL,8351 76,TOTAL,N/A,7957

1 quantity part part_id price
2 4 M4 hex bolt 40mm N/A 500 240
3 25 M3 sliding t slot nut N/A 150 125
4 25 M3 hex cap bolt 8mm N/A 225 200
5 8 M3 hex cap bolt 6mm N/A 56
6 1 M3 hex cap bolt 12mm N/A 0
7 1 L298N Motor driver module N/A 289 287
8 1 ESP32 GPIO breakout board N/A 599
9 1 ESP32 Dev board N/A 666
10 1 608-RS Ball Bearing 608-RS 17
11 2 250RPM DC geared motor JSX40-370 2998
12 2 2020 Aluminum extrusion 420mm N/A 522 510
13 4 2020 Aluminum extrusion 260mm N/A 644 640
14 1 100RPM DC geared motor with encoder N/A 1702 1619
15 75 76 N/A TOTAL TOTAL N/A 8351 7957

View File

@ -1,13 +1,14 @@
part,part_id,price,url part,part_id,price,quantity,url
M3 hex nut,N/A,3,https://amzn.to/4hAnwjc M3 hex nut,N/A,999,300,https://amzn.to/4hAnwjc
M3 hex cap bolt 6mm,N/A,7,https://amzn.to/3AwiZxo M3 hex cap bolt 6mm,N/A,726,100,https://amzn.to/3AwiZxo
M3 hex cap bolt 8mm,N/A,9,https://amzn.to/3YEvWNB M3 hex cap bolt 8mm,N/A,899,100,https://amzn.to/3YEvWNB
M3 sliding t slot nut,N/A,6,https://amzn.to/48GRrSU M3 sliding t slot nut,N/A,599,105,https://amzn.to/48GRrSU
2020 Aluminum extrusion 260mm,N/A,161,https://amzn.to/4ehSolE 2020 Aluminum extrusion 260mm,N/A,7399,46,https://amzn.to/418OicC
2020 Aluminum extrusion 420mm,N/A,261,https://amzn.to/4ehSolE 2020 Aluminum extrusion 420mm,N/A,7399,29,https://amzn.to/418OicC
100RPM DC geared motor with encoder,N/A,1702,https://amzn.to/3UF707G 100RPM DC geared motor with encoder,N/A,1619,1,https://amzn.to/3UF707G
250RPM DC geared motor,JSX40-370,1499,https://amzn.to/3NWkcRL 250RPM DC geared motor,JSX40-370,1499,1,https://amzn.to/3NWkcRL
ESP32 Dev board,N/A,666,https://amzn.to/3NXCvGj ESP32 Dev board,N/A,1999,3,https://amzn.to/3NXCvGj
L298N Motor driver module,N/A,289,https://amzn.to/4ellssy L298N Motor driver module,N/A,1149,4,https://amzn.to/4ellssy
ESP32 GPIO breakout board,N/A,599,https://amzn.to/3UFjpbO ESP32 GPIO breakout board,N/A,1199,2,https://amzn.to/3UFjpbO
M4 hex bolt 40mm,N/A,125,https://www.homedepot.com/p/M4-0-7-x-40-mm-Class-8-8-Zinc-Plated-Hex-Bolt-801298/204273654 M4 hex bolt 40mm,N/A,609,10,https://amzn.to/4ikpYL8
608-RS Ball Bearing,608-RS,1779,100,https://amzn.to/4fKxDA7
1 part part_id price quantity url
2 M3 hex nut N/A 3 999 300 https://amzn.to/4hAnwjc
3 M3 hex cap bolt 6mm N/A 7 726 100 https://amzn.to/3AwiZxo
4 M3 hex cap bolt 8mm N/A 9 899 100 https://amzn.to/3YEvWNB
5 M3 sliding t slot nut N/A 6 599 105 https://amzn.to/48GRrSU
6 2020 Aluminum extrusion 260mm N/A 161 7399 46 https://amzn.to/4ehSolE https://amzn.to/418OicC
7 2020 Aluminum extrusion 420mm N/A 261 7399 29 https://amzn.to/4ehSolE https://amzn.to/418OicC
8 100RPM DC geared motor with encoder N/A 1702 1619 1 https://amzn.to/3UF707G
9 250RPM DC geared motor JSX40-370 1499 1 https://amzn.to/3NWkcRL
10 ESP32 Dev board N/A 666 1999 3 https://amzn.to/3NXCvGj
11 L298N Motor driver module N/A 289 1149 4 https://amzn.to/4ellssy
12 ESP32 GPIO breakout board N/A 599 1199 2 https://amzn.to/3UFjpbO
13 M4 hex bolt 40mm N/A 125 609 10 https://www.homedepot.com/p/M4-0-7-x-40-mm-Class-8-8-Zinc-Plated-Hex-Bolt-801298/204273654 https://amzn.to/4ikpYL8
14 608-RS Ball Bearing 608-RS 1779 100 https://amzn.to/4fKxDA7

View File

@ -468,12 +468,13 @@ module gate_blank () {
module gate_carrier (pos = [0, 0, 0], rot = [0, 0, 0]) { module gate_carrier (pos = [0, 0, 0], rot = [0, 0, 0]) {
X = 15.4; X = 15.4;
GateCarrierZ = 22;
SidesX = 2; SidesX = 2;
SidesY = -1.2; SidesY = -1.2;
translate(pos) rotate(rot) { translate(pos) rotate(rot) {
difference () { difference () {
union () { union () {
rotate([90, 0, 0]) rounded_cube([30, 20, 5], d = 4, center = true, $fn = 40); rotate([90, 0, 0]) translate([0, 1, -1]) rounded_cube([30, GateCarrierZ, 5], d = 4, center = true, $fn = 40);
translate([-12.5, 2.5, 10]) difference () { translate([-12.5, 2.5, 10]) difference () {
rotate([0, 0, 180]) cylinder(r = R(5), h = 3, center = true, $fn = 3); rotate([0, 0, 180]) cylinder(r = R(5), h = 3, center = true, $fn = 3);
translate([0, 5 / 2, 0]) cube([5, 5, 5 + 1], center = true); translate([0, 5 / 2, 0]) cube([5, 5, 5 + 1], center = true);
@ -481,11 +482,11 @@ module gate_carrier (pos = [0, 0, 0], rot = [0, 0, 0]) {
} }
lamp_rails_voids([0, 0, LampRailsOffsetZ], [90, 0, 0], h = 11); lamp_rails_voids([0, 0, LampRailsOffsetZ], [90, 0, 0], h = 11);
translate([0 ,0, 1]) difference () { translate([0 ,0, 1]) difference () {
cube([X, 10 + 1, 20], center = true); cube([X, 10 + 1, GateCarrierZ], center = true);
translate([(X / 2) + SidesX, SidesY, 0]) rotate([0, 0, 45]) cube([5, 5, 20 + 1], center = true); translate([(X / 2) + SidesX, SidesY, 0]) rotate([0, 0, 45]) cube([5, 5, 20 + 1], center = true);
translate([(-X / 2) - SidesX, SidesY, 0]) rotate([0, 0, 45]) cube([5, 5, 20 + 1], center = true); translate([(-X / 2) - SidesX, SidesY, 0]) rotate([0, 0, 45]) cube([5, 5, 20 + 1], center = true);
difference () { difference () {
translate([0, 6.7, 0]) cube([X + 1, 10 + 1, 20], center = true); translate([0, 6.7, 0]) cube([X + 1, 10 + 1, GateCarrierZ], center = true);
translate([0, 0, 0]) cube([X - 5, 10 + 1, 16], center = true); translate([0, 0, 0]) cube([X - 5, 10 + 1, 16], center = true);
} }
} }
@ -494,9 +495,10 @@ module gate_carrier (pos = [0, 0, 0], rot = [0, 0, 0]) {
rotate([0, 0, 30]) m4_nut(5); rotate([0, 0, 30]) m4_nut(5);
} }
translate([-LampRailsSpacingX / 2, -3, LampRailsOffsetZ]) rotate([90, 0, 0]) { translate([-LampRailsSpacingX / 2, -3, LampRailsOffsetZ]) rotate([90, 0, 0]) {
cylinder(r = R(5), h = 20, center = true, $fn = 40); cylinder(r = R(5), h = GateCarrierZ, center = true, $fn = 40);
} }
} }
filter_carrier([0, 5, 0], [180, 0, 0]);
} }
} }
@ -1251,6 +1253,7 @@ module sprocketed_roller_upright_solid (pos = [0, 0, 0]) {
} }
//BOM: 1, M3 hex cap bolt 12mm, N/A, Attaches the sprocketed_roller to the geared motor //BOM: 1, M3 hex cap bolt 12mm, N/A, Attaches the sprocketed_roller to the geared motor
//BOM: 1, 608-RS Ball Bearing, 608-RS, Reduces wobble in the rollers spin
//PRINT: 1 //PRINT: 1
module sprocketed_roller_invert_solid (pos = [0, 0, 0]) { module sprocketed_roller_invert_solid (pos = [0, 0, 0]) {
D = (FrameC * Sprockets) / PI; D = (FrameC * Sprockets) / PI;
@ -1592,8 +1595,8 @@ module debug_lamp () {
lamp_single([0, 10, 2]); lamp_single([0, 10, 2]);
translate([0, -30, 3.5]) rotate([0, 0, 10]) sprocketed_roller_invert_solid(); translate([0, -30, 3.5]) rotate([0, 0, 10]) sprocketed_roller_invert_solid();
lamp_LEDs([0, 19, 11]); lamp_LEDs([0, 19, 11]);
filter_carrier([0, 9, 11]); //filter_carrier([0, 9, 11]);
picture_gate([0, -6.2, 11], Type = "standard"); //standard //picture_gate([0, -6.2, 11], Type = "standard"); //standard
gate_carrier([0, -2.5, 11]); gate_carrier([0, -2.5, 11]);
} }

View File

@ -52,7 +52,7 @@ done
echo "quantity,part,part_id,price" > "${TOTAL}" echo "quantity,part,part_id,price" > "${TOTAL}"
sqlite3 :memory: -cmd '.mode csv' -cmd ".import ${DESTINATION} bom" -cmd ".import ${PRICES} prices"\ sqlite3 :memory: -cmd '.mode csv' -cmd ".import ${DESTINATION} bom" -cmd ".import ${PRICES} prices"\
'SELECT SUM(quantity),part,part_id, SUM(quantity) * (COALESCE((SELECT prices.price FROM prices WHERE prices.part = bom.part LIMIT 1), 0)) as price FROM bom GROUP BY part ORDER BY part DESC;' >> "${TOTAL}" 'SELECT SUM(quantity),part,part_id, SUM(quantity) * (COALESCE((SELECT CEIL(prices.price / prices.quantity) FROM prices WHERE prices.part = bom.part LIMIT 1), 0)) as price FROM bom GROUP BY part ORDER BY part DESC;' >> "${TOTAL}"
sqlite3 :memory: -cmd '.mode csv' -cmd ".import ${TOTAL} bom" -cmd '.mode markdown' \ sqlite3 :memory: -cmd '.mode csv' -cmd ".import ${TOTAL} bom" -cmd '.mode markdown' \
"SELECT part as Part, quantity as Qty, CAST(price / 100.00 as MONEY) as 'Cost (USD)' FROM bom ORDER BY part DESC;" "SELECT part as Part, quantity as Qty, CAST(price / 100.00 as MONEY) as 'Cost (USD)' FROM bom ORDER BY part DESC;"
@ -61,4 +61,4 @@ sqlite3 :memory: -cmd '.mode csv' -cmd ".import ${TOTAL} bom" -cmd '.mode markdo
"SELECT 'TOTAL', SUM(quantity), CAST(SUM(price) / 100.00 as MONEY) FROM bom;" | grep -v 'SUM(' "SELECT 'TOTAL', SUM(quantity), CAST(SUM(price) / 100.00 as MONEY) FROM bom;" | grep -v 'SUM('
sqlite3 :memory: -cmd '.mode csv' -cmd ".import ${TOTAL} bom"\ sqlite3 :memory: -cmd '.mode csv' -cmd ".import ${TOTAL} bom"\
"SELECT SUM(quantity),'N/A','TOTAL', SUM(price) FROM bom;" | tr -d '"' >> "${TOTAL}" "SELECT SUM(quantity), 'TOTAL', 'N/A', SUM(price) FROM bom;" | tr -d '"' >> "${TOTAL}"