5 (displayln total-cost
))
7 ;; the robot is made of a bunch of items, like a screw or a motor.
9 ;; this is a description of items in general.
11 (;; each item has a natural language description what the part is.
14 ;; how many units of this item are on a single robot
17 ;; how much does a single unit of these items cost
20 ;; how many days will it take to get the item
23 ;; how to obtain the item
26 ;; any special notes about the item
29 ;; estimate of the cost of pla in dollars per cubic centimeter
31 ;; this cost is an estimate taken from this site
32 ;; http://www.toybuilderlabs.com/
33 ;; blogs/news/13053117-filament-volume-and-length
36 ;; usually, the above code would be enough for describing a bunch of
37 ;; items. unfortunately, the last argument, for the parameter 'note',
38 ;; must be supplied in the default item constructor created above.
39 ;; this constructor below, called 'make-item', allows creating
40 ;; items without supplying the argument for the parameter 'note'. if
41 ;; the 'note' argument is not supplied, it will be replaced by the
44 description quantity unit-cost max-lead-days where-to-get
46 (item description quantity unit-cost max-lead-days where-to-get note
))
48 ;; TODO: add sonar sensor cable making supplies
49 ;; TODO: add actual cost for screws, nuts, and other estimated parts
50 ;; TODO: add male-female jump wires for connecting sonar sensors
51 ;; TODO: add ball caster
52 ;; TODO: checkout the following, if it's not a fraud, buy for next class
54 ;;; "http://www.ebay.com/itm/UNO-R3-Development-Board-MEGA328P-"
55 ;;; "ATMEGA16U2-For-Arduino-Compatible-USB-Cable/201090526898")
56 ;;; only $9.99 for arduino uno r3 + usb!!
57 (define bill-of-materials
59 ;; the construction of the first item is heavily commented.
60 ;; the higher amount of commenting is intended to make it clear
61 ;; how the code works to new readers
62 (make-item (string-append
63 ;; this is the argument for the parameter 'description'.
64 ;; it's a description of the orange wire. this is for
66 "solid core orange 22 awg wire, male-male jump wire."
67 " units in mm. makes electrical connection between"
68 " arduino and motor controller, used for backwards"
71 ;; this is the argument for the parameter 'quantity'.
72 ;; this is the number of millimeters of orange wire
73 ;; in a single robot kit.
74 ;; there are 2 orange wires, one for each motor.
75 ;; the 120 mm wire reaches to the far side of the
79 ;; this is the argument for the parameter 'unit-cost'.
80 ;; the cost on jameco is 7.95 for 100 feet.
81 ;; this calculation converts from dollars per foot to
82 ;; dollars per millimeter.
83 ;; there are 100 feet, 12 inches per foot, 2.54 cm / inch,
85 ;; the product of all these numbers is the number of
86 ;; millimeters purchased with $7.95
87 (/ 7.95 (* 100 12 2.54 10))
89 ;; this is the argument for the parameter 'max-lead-days'.
90 ;; since the part is at jameco, i can pick it up same day.
93 ;; this is the argument for the parameter 'where-to-get'.
94 ;; it is a url where the part can be purchased.
96 "http://www.jameco.com/webapp/wcs/stores/servlet/Product"
97 "_10001_10001_2154871_-1"))
99 (make-item (string-append
100 "solid core blue 22 awg wire, male-male jump wire."
101 " units in mm. connects motor controller and arduino,"
102 " used for forwards enabling.")
104 (/ 7.95 (* 100 12 25.4))
107 "http://www.jameco.com/webapp/wcs/stores/servlet/Product"
108 "_10001_10001_36768_-1"))
109 (make-item (string-append
110 "solid core white 22 awg wire, male-male jump wire."
111 " units in mm. connects motor controller and arduino,"
112 " used for speed signal.")
115 (/ 7.95 (* 100 12 25.4))
118 "http://www.jameco.com/webapp/wcs/stores/servlet/Product"
119 "_10001_10001_36881_-1")
120 (string-append "unit cost goes down for large orders,"
121 " see page for specifics"))
122 (make-item (string-append
123 "solid core green 22 awg wire, male-male jump wire."
124 " units in mm. connects motor to breadboard.")
126 (/ 7.95 (* 100 12 25.4))
129 "http://www.jameco.com/webapp/wcs/stores/servlet/Product"
130 "_10001_10001_36822_-1"))
131 (make-item (string-append
132 "solid core yellow 22 awg wire, male-male jump wire."
133 " units in mm. connects motor to breadboard.")
135 (/ 7.95 (* 100 12 25.4))
138 "http://www.jameco.com/webapp/wcs/stores/servlet/Product"
139 "_10001_10001_36920_-1"))
140 (make-item (string-append
141 "solid core red 22 awg wire, male-male jump wire."
142 " units in mm. connects power for all components.")
144 (/ 7.95 (* 100 12 25.4))
147 "http://www.jameco.com/webapp/wcs/stores/servlet/Product"
148 "_10001_10001_36856_-1"))
149 (make-item (string-append
150 "solid core black 22 awg wire, male-male jump wire."
151 " units in mm. connects ground for all components.")
152 (+ (* 30 2) (* 4 25) 25 55)
153 (/ 7.95 (* 100 12 25.4))
156 "http://www.jameco.com/webapp/wcs/stores/servlet/Product"
157 "_10001_10001_36792_-1"))
158 (make-item "9v battery"
161 "https://www.jameco.com/webapp/wcs/stores/servlet/Product"
162 "_10001_10001_151095_-1")
164 (make-item "9v battery holder"
167 "http://www.jameco.com/webapp/wcs/stores/servlet/Product"
168 "_10001_10001_2128067_-1")
170 (make-item "AA battery"
172 "http://www.frys.com/product/6292850"
174 (make-item "4xAA battery holder"
177 "http://shop.evilmadscientist.com/"
178 "productsmenu/partsmenu/422")
180 "can get in store. unit cost goes down for large orders"
181 ", see page for specifics."))
182 (make-item "angle bracket, 1/2 inch sides with #6-32 threaded hole"
185 "http://shop.evilmadscientist.com/productsmenu/partsmenu"
188 "can get in store. unit cost goes down for large orders"
189 ", see page for specifics."))
190 (make-item "Arduino(tm) Uno board"
193 "http://www.colorapples.com/2012-new-arduino-uno-r3-boar"
194 "d-atmega328-with-usb-cable-p-89818.html#.U3Lz5nJKyzA")
196 "comes with USB A to B cable. unit cost goes down for"
197 " large orders, see page for specifics."))
198 (make-item "gm3 motor 224:1 90 degree shaft"
200 "https://solarbotics.com/product/gm3/")
201 (make-item "transparent 400 point (half) BreadBoard"
204 "http://www.jameco.com/webapp/wcs/stores/servlet/"
205 "Product_10001_10001_2123830_-1"))
206 (make-item "jumper wire female/male" 1/5 6 2
207 (string-append "http://www.nexuscyber.com/7-premium-40-"
208 "pin-male-to-female-jumper-wires"))
209 (make-item "deck 8x8 inches"
211 ;; cost of entire 24x48 inch pegboard is 55.25
212 ;; each deck is only 8x8 inch
213 (/ 55.25 (* (/ 24 8) (/ 48 8)))
216 "http://www.homedepot.com/p/"
217 "Triton-1-4-in-Custom-Painted-Blissful-White-Pegboard"
218 "-Wall-Organizer-Set-of-2-TPB-2W/205192313#specifications"))
219 (make-item "small squares of double sided tape"
222 "http://www.officedepot.com/a/products/495242/"
223 "Scotch-Permanent-Double-Sided-Foam-Tape/"))
224 ;; TODO: get actual cost of #4-40 phillips 1&1/4" screws
225 (make-item "#4-40 Phillips 1 pan stl zn cr3, magnetic"
227 "olander PN:4C100PPMZR"
228 "price is an estimate. can pick up in person")
229 ;; TODO: get actual cost of #4-40 hex lock nuts
230 (make-item "#4-40 hex lock nuts"
232 "olander" "price is an estimate. can pick up in person")
233 ;; TODO: get actual cost of #6-32 3/8" screws
234 (make-item "#6-32 button hex head socket 3/8 inch"
236 "olander" "price is an estimate. can pick up in person")
237 (make-item "motor controller"
239 "http://www.ebay.com/itm/like/180976411359?lpid=82")
240 (make-item "sonar sensor hc-sr04"
242 "http://www.ebay.com/itm/161156018270")
243 (make-item "caster standoff"
244 1 (* 8.2 pla-$
/cm^
3) 1
247 2 (* 11.3 pla-$
/cm^
3) 1
249 (make-item "deck holder"
250 2 (* 4.0 pla-$
/cm^
3) 1
252 (make-item "sonar holder"
253 2 (* 2.4 pla-$
/cm^
3) 1
254 "3d print at home" "price of filament is an estimate")
255 (make-item "motor mount"
256 2 (* 3.1 pla-$
/cm^
3) 1
257 "3d print at home")))
260 (apply + (for/list
([thing bill-of-materials
])
261 (* (item-quantity thing
) (item-unit-cost thing
)))))