X-Git-Url: http://challenge-bot.com/repos/?p=challenge-bot;a=blobdiff_plain;f=bill-of-materials.rkt;h=cb1f2432936d64b0b77a074f0505182cc937b207;hp=55e6c5e24c264eae87f32b16a03f618de1031fa7;hb=cda2696c27471566a3ff23c6aa9bd64a7dc6c9f3;hpb=5e2e135ea16d68d70f9592a457d00e3ee844ea18 diff --git a/bill-of-materials.rkt b/bill-of-materials.rkt index 55e6c5e..cb1f243 100755 --- a/bill-of-materials.rkt +++ b/bill-of-materials.rkt @@ -4,61 +4,257 @@ (module+ main (displayln total-cost)) -;; TODO: describe in detail what each field is +;; the robot is made of a bunch of items, like a screw or a motor. + +;; this is a description of items in general. (struct item - (description quantity unit-cost max-lead-days where-to-get note)) + (;; each item has a natural language description what the part is. + description + + ;; how many units of this item are on a single robot + quantity + + ;; how much does a single unit of these items cost + unit-cost + + ;; how many days will it take to get the item + max-lead-days + + ;; how to obtain the item + where-to-get + + ;; any special notes about the item + note)) + +;; estimate of the cost of pla in dollars per cubic centimeter +(define pla-$/cm^3 + ;; this cost is an estimate taken from this site + ;; http://www.toybuilderlabs.com/ + ;; blogs/news/13053117-filament-volume-and-length + (/ 25 800)) + +;; usually, the above code would be enough for describing a bunch of +;; items. unfortunately, the last argument, for the parameter 'note', +;; must be supplied in the default item constructor created above. +;; this constructor below, called 'make-item', allows creating +;; items without supplying the argument for the parameter 'note'. if +;; the 'note' argument is not supplied, it will be replaced by the +;; empty string, "". (define (make-item description quantity unit-cost max-lead-days where-to-get [note ""]) (item description quantity unit-cost max-lead-days where-to-get note)) + +;; TODO: add sonar sensor cable making supplies +;; TODO: add actual cost for screws, nuts, and other estimated parts +;; TODO: add male-female jump wires for connecting sonar sensors +;; TODO: add ball caster +;; TODO: checkout the following, if it's not a fraud, buy for next class +;;; (string-append +;;; "http://www.ebay.com/itm/UNO-R3-Development-Board-MEGA328P-" +;;; "ATMEGA16U2-For-Arduino-Compatible-USB-Cable/201090526898") +;;; only $9.99 for arduino uno r3 + usb!! (define bill-of-materials (list - ;; TODO: add solid core wires - ;; TODO: add male-female jump wires for connecting sonar sensors - ;; TODO: add 4x AA batteries - ;; TODO: add 4x AA battery holder - ;; TODO: add 3d printer filament cost for wheel, sonar sensor holders, - ;; caster standoff - ;; TODO: add ball caster - ;; TODO: add angle bracket from evil mad science - (make-item "Arduino(tm) board" + ;; the construction of the first item is heavily commented. + ;; the higher amount of commenting is intended to make it clear + ;; how the code works to new readers + (make-item (string-append + ;; this is the argument for the parameter 'description'. + ;; it's a description of the orange wire. this is for + ;; documentation. + "solid core orange 22 awg wire, male-male jump wire." + " units in mm. makes electrical connection between" + " arduino and motor controller, used for backwards" + " enabling.") + + ;; this is the argument for the parameter 'quantity'. + ;; this is the number of millimeters of orange wire + ;; in a single robot kit. + ;; there are 2 orange wires, one for each motor. + ;; the 120 mm wire reaches to the far side of the + ;; motor controller + (+ 120 90) + + ;; this is the argument for the parameter 'unit-cost'. + ;; the cost on jameco is 7.95 for 100 feet. + ;; this calculation converts from dollars per foot to + ;; dollars per millimeter. + ;; there are 100 feet, 12 inches per foot, 2.54 cm / inch, + ;; and 10 mm / cm. + ;; the product of all these numbers is the number of + ;; millimeters purchased with $7.95 + (/ 7.95 (* 100 12 2.54 10)) + + ;; this is the argument for the parameter 'max-lead-days'. + ;; since the part is at jameco, i can pick it up same day. + 1 + + ;; this is the argument for the parameter 'where-to-get'. + ;; it is a url where the part can be purchased. + (string-append + "http://www.jameco.com/webapp/wcs/stores/servlet/Product" + "_10001_10001_2154871_-1")) + + (make-item (string-append + "solid core blue 22 awg wire, male-male jump wire." + " units in mm. connects motor controller and arduino," + " used for forwards enabling.") + (+ 120 90) + (/ 7.95 (* 100 12 25.4)) + 1 + (string-append + "http://www.jameco.com/webapp/wcs/stores/servlet/Product" + "_10001_10001_36768_-1")) + (make-item (string-append + "solid core white 22 awg wire, male-male jump wire." + " units in mm. connects motor controller and arduino," + " used for speed signal.") + (+ 120 90) + ;; cost of 1 mm + (/ 7.95 (* 100 12 25.4)) + 1 + (string-append + "http://www.jameco.com/webapp/wcs/stores/servlet/Product" + "_10001_10001_36881_-1") + (string-append "unit cost goes down for large orders," + " see page for specifics")) + (make-item (string-append + "solid core green 22 awg wire, male-male jump wire." + " units in mm. connects motor to breadboard.") + (* 2 175) + (/ 7.95 (* 100 12 25.4)) + 1 + (string-append + "http://www.jameco.com/webapp/wcs/stores/servlet/Product" + "_10001_10001_36822_-1")) + (make-item (string-append + "solid core yellow 22 awg wire, male-male jump wire." + " units in mm. connects motor to breadboard.") + (* 2 175) + (/ 7.95 (* 100 12 25.4)) + 1 + (string-append + "http://www.jameco.com/webapp/wcs/stores/servlet/Product" + "_10001_10001_36920_-1")) + (make-item (string-append + "solid core red 22 awg wire, male-male jump wire." + " units in mm. connects power for all components.") + (+ (* 2 30) 25 25) + (/ 7.95 (* 100 12 25.4)) + 1 + (string-append + "http://www.jameco.com/webapp/wcs/stores/servlet/Product" + "_10001_10001_36856_-1")) + (make-item (string-append + "solid core black 22 awg wire, male-male jump wire." + " units in mm. connects ground for all components.") + (+ (* 30 2) (* 4 25) 25 55) + (/ 7.95 (* 100 12 25.4)) + 1 + (string-append + "http://www.jameco.com/webapp/wcs/stores/servlet/Product" + "_10001_10001_36792_-1")) + (make-item "9v battery" + 1 1.29 1 + (string-append + "https://www.jameco.com/webapp/wcs/stores/servlet/Product" + "_10001_10001_151095_-1") + "can get in store") + (make-item "9v battery holder" + 1 (/ 1.25 10) 1 + (string-append + "http://www.jameco.com/webapp/wcs/stores/servlet/Product" + "_10001_10001_2128067_-1") + "can get in store") + (make-item "AA battery" + 4 (/ 17.99 100) 1 + "http://www.frys.com/product/6292850" + "can get in store") + (make-item "4xAA battery holder" + 1 2.25 1 + (string-append + "http://shop.evilmadscientist.com/" + "productsmenu/partsmenu/422") + (string-append + "can get in store. unit cost goes down for large orders" + ", see page for specifics.")) + (make-item "angle bracket, 1/2 inch sides with #6-32 threaded hole" + 4 0.75 1 + (string-append + "http://shop.evilmadscientist.com/productsmenu/partsmenu" + "/465-bracket") + (string-append + "can get in store. unit cost goes down for large orders" + ", see page for specifics.")) + (make-item "Arduino(tm) Uno board" 1 16.98 8 (string-append - "http://www.colorapples.com/2012-new-arduino-uno-r3-board" - "-atmega328-with-usb-cable-p-89818.html#.U3Lz5nJKyzA") - "comes with USB A to B cable") - (make-item "motor" 2 6 7 "https://solarbotics.com/product/gm3/") + "http://www.colorapples.com/2012-new-arduino-uno-r3-boar" + "d-atmega328-with-usb-cable-p-89818.html#.U3Lz5nJKyzA") + (string-append + "comes with USB A to B cable. unit cost goes down for" + " large orders, see page for specifics.")) + (make-item "gm3 motor 224:1 90 degree shaft" + 2 6 7 + "https://solarbotics.com/product/gm3/") (make-item "transparent 400 point (half) BreadBoard" 1 5.95 1 (string-append "http://www.jameco.com/webapp/wcs/stores/servlet/" "Product_10001_10001_2123830_-1")) (make-item "jumper wire female/male" 1/5 6 2 - (string-append "http://www.nexuscyber.com/" - "7-premium-40-pin-male-to-female-jumper-wires")) + (string-append "http://www.nexuscyber.com/7-premium-40-" + "pin-male-to-female-jumper-wires")) + (make-item "deck 8x8 inches" + 1 + ;; cost of entire 24x48 inch pegboard is 55.25 + ;; each deck is only 8x8 inch + (/ 55.25 (* (/ 24 8) (/ 48 8))) + 1 + (string-append + "http://www.homedepot.com/p/" + "Triton-1-4-in-Custom-Painted-Blissful-White-Pegboard" + "-Wall-Organizer-Set-of-2-TPB-2W/205192313#specifications")) (make-item "small squares of double sided tape" 1/30 12 1 (string-append - "http://www.officedepot.com/" - "a/products/495242/Scotch-Permanent-Double-Sided-Foam-Tape/")) + "http://www.officedepot.com/a/products/495242/" + "Scotch-Permanent-Double-Sided-Foam-Tape/")) ;; TODO: get actual cost of #4-40 phillips 1&1/4" screws - (make-item "#4-40 Phillips 1 1/4 inch screws" - 3 .1 1 - "olander" "price is an estimate. can pick up in person") + (make-item "#4-40 Phillips 1 pan stl zn cr3, magnetic" + 4 0.1 1 + "olander PN:4C100PPMZR" + "price is an estimate. can pick up in person") ;; TODO: get actual cost of #4-40 hex lock nuts (make-item "#4-40 hex lock nuts" - 6 .1 1 + 6 0.1 1 "olander" "price is an estimate. can pick up in person") ;; TODO: get actual cost of #6-32 3/8" screws (make-item "#6-32 button hex head socket 3/8 inch" - 12 .1 1 + 12 0.1 1 "olander" "price is an estimate. can pick up in person") (make-item "motor controller" 1 (/ 5.2 5) 10 "http://www.ebay.com/itm/like/180976411359?lpid=82") (make-item "sonar sensor hc-sr04" 2 1.39 7 - "http://www.ebay.com/itm/161156018270"))) + "http://www.ebay.com/itm/161156018270") + (make-item "caster standoff" + 1 (* 8.2 pla-$/cm^3) 1 + "3d print at home") + (make-item "wheel" + 2 (* 11.3 pla-$/cm^3) 1 + "3d print at home") + (make-item "deck holder" + 2 (* 4.0 pla-$/cm^3) 1 + "3d print at home") + (make-item "sonar holder" + 2 (* 2.4 pla-$/cm^3) 1 + "3d print at home" "price of filament is an estimate") + (make-item "motor mount" + 2 (* 3.1 pla-$/cm^3) 1 + "3d print at home"))) (define total-cost (apply + (for/list ([thing bill-of-materials])