tag:blogger.com,1999:blog-96675632024-03-18T20:54:31.358-07:00Will Ware's blogTinkering with various electronics and software things, and a bit of math and science in general.Will Warehttp://www.blogger.com/profile/00852978068817644702noreply@blogger.comBlogger203125tag:blogger.com,1999:blog-9667563.post-73238708715518507962017-07-29T06:50:00.001-07:002017-07-29T06:50:40.602-07:00Ezevor and other robot arms<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
I stumbled across the <a href="https://www.kickstarter.com/projects/1474681136/evezor-open-source-robotic-arm-manufacturing-platf/description">Evezor Kickstarter page</a> recently and was fascinated to see the range of things this <a href="https://en.wikipedia.org/wiki/SCARA">SCARA arm</a> can do. It can 3d print, carve or mill like a CNC machine, laser-engrave, pick and place electronic parts, paint or draw, and more. It also appears on <a href="https://www.thingiverse.com/thing:2323187">Thingiverse</a>.<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgABHzTO2hZZAIWip-rmWLpjMlSiznsUJrKcuAZ1ol6PVTF9enz4wjiyb1spklof-Qfvwxg-xpLXJdHpSY3QdFPw2tPDzsY_9Z-FA4x56xLtlqTguYuSDhYEj0kyxasshZVyHboYQ/s1600/evezor-block-diagram.jpg" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" data-original-height="506" data-original-width="600" height="269" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgABHzTO2hZZAIWip-rmWLpjMlSiznsUJrKcuAZ1ol6PVTF9enz4wjiyb1spklof-Qfvwxg-xpLXJdHpSY3QdFPw2tPDzsY_9Z-FA4x56xLtlqTguYuSDhYEj0kyxasshZVyHboYQ/s320/evezor-block-diagram.jpg" width="320" /></a></div>
<br />
There are <a href="https://www.youtube.com/channel/UC-tU6l-nTdWPQbU-4Q3yjlA/videos">Youtube videos</a> of many of these operations. The resolution is good. The effective build volume is enormous. The speed is decent. As I watched more videos, I got a little bit obsessed with the whole thing and decided to blog about it.<br />
<br />
The Kickstarter campaign was regrettably unsuccessful. You can still <a href="http://store.evezor.com/product/evezor-robotic-arm/">pre-order one</a> for $2650, but I can't justify an expense like that currently, and I suspect the lead time would be substantial.<br />
<br />
In the midst of my obsession, I started poking around the interwebs to see what other similar projects might exist, and might be more affordable as well as open source, and came across quite a few.<br />
<br />
Several arms work like a Luxo lamp, using parallelograms along the arm segments to keep the end effector in a consistently vertical orientation.<br />
<ul style="text-align: left;">
<li><a href="https://www.thingiverse.com/thing:1454048">EEZYbot Arm MK2</a><br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjEkWOkkEdx6-T6KJhIxSVmfL3IXR5YLY9ENTOYhFZ5adSHwYJWb961xpNsxvDIxPZTXpVbaSVor0GnXDhpFpw39E6q0Ak5PzjOgfOr8XX92UfX5pWY8cXJUXWRaXkuDoxvBtB2UQ/s1600/eezybot-arm-mk2.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em; text-align: center;"><img border="0" data-original-height="472" data-original-width="628" height="150" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjEkWOkkEdx6-T6KJhIxSVmfL3IXR5YLY9ENTOYhFZ5adSHwYJWb961xpNsxvDIxPZTXpVbaSVor0GnXDhpFpw39E6q0Ak5PzjOgfOr8XX92UfX5pWY8cXJUXWRaXkuDoxvBtB2UQ/s200/eezybot-arm-mk2.jpg" width="200" /></a><br /></li>
<li><a href="https://www.thingiverse.com/thing:1652309">Tertiam</a>, built from an Ikea Tertial lamp (basically a Luxo lamp)<br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg_tQ-7_3ep1tihKjUt4gsjJucMcGnySB7hcjM38emRAKL_eCv3qN9o0CTeHOJ7jPaFrjcso1GKl0njfok7bE4nQr8HUKUmeRWok_jOFliWlBnJil2z-Tp363MVSJCadLyZHdVScQ/s1600/tertiarm.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em; text-align: center;"><img border="0" data-original-height="472" data-original-width="628" height="150" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg_tQ-7_3ep1tihKjUt4gsjJucMcGnySB7hcjM38emRAKL_eCv3qN9o0CTeHOJ7jPaFrjcso1GKl0njfok7bE4nQr8HUKUmeRWok_jOFliWlBnJil2z-Tp363MVSJCadLyZHdVScQ/s200/tertiarm.jpg" width="200" /></a><br /></li>
<li>A mostly-printed <a href="https://www.thingiverse.com/thing:1204552">desktop robot arm</a><br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhLDijamXE-9yElJ0PW8EmELBOA8pCCJFpK7FkbuqByq_Rqdadm_xKjIp9YR91VZTJoFsm2xU6KjuP5HfniVKbYvvdyXis5cpNZWzjiWh_rWM_WGBoiRb8NeI70Yes3qQOIvkMEtQ/s1600/desktop-arm.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em; text-align: center;"><img border="0" data-original-height="472" data-original-width="628" height="150" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhLDijamXE-9yElJ0PW8EmELBOA8pCCJFpK7FkbuqByq_Rqdadm_xKjIp9YR91VZTJoFsm2xU6KjuP5HfniVKbYvvdyXis5cpNZWzjiWh_rWM_WGBoiRb8NeI70Yes3qQOIvkMEtQ/s200/desktop-arm.jpg" width="200" /></a><br /></li>
<li>An early-model uArm, now <a href="https://www.sparkfun.com/products/13663">available at SparkFun</a> for $340<br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEihAM-tCpoEEzXQO6xjBVMka_L8EL7nETyHlnUmAtKAvON9mz-fMKyDFqAslUbfK3I-6DDHvBCYB83AugsViNq_tHr-ys98QDurSCviFPvWWaekcBn7L1U1Cq8wIp9OcLcQsxQfeA/s1600/sparkfun-uarm.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em; text-align: center;"><img border="0" data-original-height="600" data-original-width="600" height="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEihAM-tCpoEEzXQO6xjBVMka_L8EL7nETyHlnUmAtKAvON9mz-fMKyDFqAslUbfK3I-6DDHvBCYB83AugsViNq_tHr-ys98QDurSCviFPvWWaekcBn7L1U1Cq8wIp9OcLcQsxQfeA/s200/sparkfun-uarm.jpg" width="200" /></a><br /></li>
<li>One more, <a href="https://www.tindie.com/products/i-make-robots/3dof-robot-arm-50cm-reach-125g-payload/">available from Tindie</a> for $350<br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiZsvGv5f3IKsowSNRpbjYrXS-I_01cfiD4A4Z6lXylwkN2_E4-UMMhii232wQEp_C2_60ZAtFS5s1HaCI_UNrZo81p3A40XTaEU0es950uRfTbK-v9sWwcxTtU_PEEnVmmj3CIIA/s1600/tindie-arm.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em; text-align: center;"><img border="0" data-original-height="570" data-original-width="855" height="133" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiZsvGv5f3IKsowSNRpbjYrXS-I_01cfiD4A4Z6lXylwkN2_E4-UMMhii232wQEp_C2_60ZAtFS5s1HaCI_UNrZo81p3A40XTaEU0es950uRfTbK-v9sWwcxTtU_PEEnVmmj3CIIA/s200/tindie-arm.jpg" width="200" /></a></li>
</ul>
<div>
These are all appealing for cost reasons, but I worry about the resolution. They'd be fine for picking up small objects, and maybe some drawing, but I'd be surprised if they could do 3d printing or CNC milling with a Dremel tool.<br /><br />There are a couple other SCARA arms. These are more commercial and expensive, and don't appear to be open source. But for that price they probably have the resolution.<ul style="text-align: left;">
<li><a href="http://makerarm.com/">MakerArm</a>, $1900 to pre-order<br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj5US7W5hnoWzY3yZqflM4LPYv7K-ZPwa5BFF24rlvMist-y6eUTqlDnztMXcaDnlUBS60zRbvWvJwMj4BJfhO9df4pwUnvAnfSVrleGhbCgsVIGQRzHd7nAAR9Ut-9dmOYJBHaTA/s1600/makerarm.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em; text-align: center;"><img border="0" data-original-height="375" data-original-width="562" height="133" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj5US7W5hnoWzY3yZqflM4LPYv7K-ZPwa5BFF24rlvMist-y6eUTqlDnztMXcaDnlUBS60zRbvWvJwMj4BJfhO9df4pwUnvAnfSVrleGhbCgsVIGQRzHd7nAAR9Ut-9dmOYJBHaTA/s200/makerarm.jpg" width="200" /></a><br /></li>
<li><a href="http://www.dobot.cc/dobot-m1/product-overview.html">Dobot M1</a>, no obvious price on website<br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhmvtlo8x0gxlkIGWQq0paciof3STuI5_Oe5oM5-GMEuP7Bqdioas4mtmJ5haNV3pCexM4MyOBT3_K0yHXNQQFqHuSmFcpY7oittAW33q_YgiqV8pWs2LB0_SOIIbF3p2Agm-4Dbg/s1600/dobot-m1.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em; text-align: center;"><img border="0" data-original-height="800" data-original-width="800" height="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhmvtlo8x0gxlkIGWQq0paciof3STuI5_Oe5oM5-GMEuP7Bqdioas4mtmJ5haNV3pCexM4MyOBT3_K0yHXNQQFqHuSmFcpY7oittAW33q_YgiqV8pWs2LB0_SOIIbF3p2Agm-4Dbg/s200/dobot-m1.jpg" width="200" /></a></li>
</ul>
I found a couple more that were neither Luxo-style nor SCARA.<ul style="text-align: left;">
<li>An <a href="https://github.com/maxosprojects/open-dobot">"open dobot" project on Github</a>, probably from a deprecated older Dobot product.<br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiwGwlgAx_bTy669mfAGPgEG-2HWoDt3ihAX9xP2-8DpRY6xuI3eJF8OfZ8BTAqlJ4gb_9gYPUYAUf0Y6aRKUvO4F9velVz7X4Fkxls_hD42UqNQ41_-0GLydQ6E9ien5TpNsh_xg/s1600/open-dobot.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em; text-align: center;"><img border="0" data-original-height="766" data-original-width="1038" height="147" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiwGwlgAx_bTy669mfAGPgEG-2HWoDt3ihAX9xP2-8DpRY6xuI3eJF8OfZ8BTAqlJ4gb_9gYPUYAUf0Y6aRKUvO4F9velVz7X4Fkxls_hD42UqNQ41_-0GLydQ6E9ien5TpNsh_xg/s200/open-dobot.png" width="200" /></a><br /></li>
<li>The BCN3D Moveo on <a href="https://www.thingiverse.com/thing:1693444">Thingiverse</a><br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEheWWZ5iF94C0jvwM_m72-RMHCDIEktF6Jjw5O05qRuryUwBRC1-jtpUP6K00OZ6xt28XFzZG291qIB7X6OCjg3cWGGBUf8bofnkizBsQUdLY135-vwdf1xV5A-IzUW7jNyTaR9uw/s1600/bcn3d-moveo.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em; text-align: center;"><img border="0" data-original-height="472" data-original-width="628" height="150" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEheWWZ5iF94C0jvwM_m72-RMHCDIEktF6Jjw5O05qRuryUwBRC1-jtpUP6K00OZ6xt28XFzZG291qIB7X6OCjg3cWGGBUf8bofnkizBsQUdLY135-vwdf1xV5A-IzUW7jNyTaR9uw/s200/bcn3d-moveo.jpg" width="200" /></a><br /></li>
</ul>
So if you get obsessed with the original idea of a robot arm that can do a wide range of precision tasks with a potentially heavy payload (like a router for doing CNC milling), what should you do? My own inclination would be to print parts for an Ezevor. It would be interesting to see whether either the SparkFun arm or the Tindie arm could be a serviceable 3d printer. If not, I'd probably hunt around for a larger 3d printer than the one I have at home.</div>
</div>
Will Warehttp://www.blogger.com/profile/00852978068817644702noreply@blogger.com1tag:blogger.com,1999:blog-9667563.post-45744998191126229122016-01-09T08:11:00.000-08:002016-01-17T09:40:57.307-08:00Graceful shutdown for the Raspberry Pi<div dir="ltr" style="text-align: left;" trbidi="on">
The Raspberry Pi is a great little board, but because it runs Linux, you risk corrupting the file system on the SD card if you simply switch off the power. The standard advice is to type "sudo shutdown -h now" and wait until the shutdown process has finished, or has at least unmounted all the file systems, before switching off the power.<br />
<br />
What if the RPi is part of some embedded widget with no keyboard and screen? How then to initiate a shutdown, and how to know when it's finished? It was while contemplating the creation of just such an embedded widget that I hit upon this piece of brilliance. First, build this circuit.<br />
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEih-HdHcY2uTbvo3kJW-AkJsiw2xQ0Dol0fE1uNUIswJUwl3UGPxrbSyJpu2BKFqXvOre0gfbEokILLHmwfflnU2qFkkLSsq6rwCwysrfXaOR86dQ6Ez6j-8iSsEnfAlqpwq_fWQQ/s1600/RPiShutdown.png" imageanchor="1"><img border="0" height="186" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEih-HdHcY2uTbvo3kJW-AkJsiw2xQ0Dol0fE1uNUIswJUwl3UGPxrbSyJpu2BKFqXvOre0gfbEokILLHmwfflnU2qFkkLSsq6rwCwysrfXaOR86dQ6Ez6j-8iSsEnfAlqpwq_fWQQ/s320/RPiShutdown.png" width="320" /></a><br />
How does this work? When you plug in the wall wart, we don't want to draw power from the 9 volt battery yet, so we want Q1 to be off. This is accomplished by using Q4 to keep the Q2/Q3 Darlington turned off. The wall wart power flows thru the three diodes in parallel and operates the switching voltage regulator (I picked up a bunch of these from some Chinese outfit on eBay). Meanwhile C1 charges to around 9 volts.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://i.stack.imgur.com/TtuZH.gif" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="http://i.stack.imgur.com/TtuZH.gif" height="116" width="200" /></a></div>
What happens when you yank the wall wart? Why, magic of course. Magic happens. Specifically, Q4 turns off, and C1 begins to discharge thru R1 and R6, turning on the Darlington pair, which turns on Q1 so that now the switching regulator is running on battery power. The battery power remains on for some multiple of the RC time constant (100 uF * 500K = 50 secs), and you end up with about two minutes to get the Raspberry Pi to shutdown.<br />
<br />
I've started <a href="https://github.com/wware/rpi-shutdown">a Github repository</a> for this, and it includes the two scripts that make graceful shutdown a service that starts automatically when the RPi boots.<br />
<br /></div>
Will Warehttp://www.blogger.com/profile/00852978068817644702noreply@blogger.com0tag:blogger.com,1999:blog-9667563.post-44633044012230493522015-11-15T06:32:00.003-08:002015-11-15T09:56:44.912-08:00How does the Tooba's keyboard work?<div dir="ltr" style="text-align: left;" trbidi="on">
The question I was most frequently asked when exhibiting the Tooba was about how the keyboard works. I was asked this by people who were obviously intelligent, and I have a deep understanding of it myself, so you would think there would be no problem in communicating it.<br />
<br />
The short answer is, when you touch the copper contact, its effective capacitance increases, causing a change in an RC time constant which can be quickly measured with very simple electronics. The problem is that nearly zero otherwise intelligent people in our society understand capacitance.<br />
<br />
I tried several different ways to explain this to people. Usually I said, "it works the same way as the touch screen on your phone", and that's true but it doesn't explain anything. It only gives people a known reference point to indicate that it's not physically impossible.<br />
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh1zB_Wamhp4VzxfNGYIrq2VoC99V_1eGDvPoZeuh7-O8wUNXFrRO3PP0mI06tPtYieDk9chpFmXKq8WTA9RtW0leMH6C3WZcFdTY5RKtKLPtUkWztcvAxb0qJjVwy4Kg83abpOmA/s1600/cap.gif" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh1zB_Wamhp4VzxfNGYIrq2VoC99V_1eGDvPoZeuh7-O8wUNXFrRO3PP0mI06tPtYieDk9chpFmXKq8WTA9RtW0leMH6C3WZcFdTY5RKtKLPtUkWztcvAxb0qJjVwy4Kg83abpOmA/s1600/cap.gif" /></a><br />
<a href="https://en.wikipedia.org/wiki/Capacitance">Capacitance</a> is actually a pretty straightforward idea. You have two parallel metal plates. A battery or some other force pulls electrons out of one plate and pushes them into the other, so the first plate becomes positively charged and the second plate becomes negatively charged.<br />
<br />
Opposite charges attract, so there is a force pulling the plates together, but they are mechanically held apart, usually by a layer of insulating material. The attractive force therefore acts upon the charges themselves, the excess electrons in the negative plate and the "holes" where electrons are missing in the positive plate. The negative and positive charges want to stay where they are, a bit like inertia, and this manifests as a measurable voltage difference between the plates. The only way to change that inertia is a current, a flow of electrons, into one plate and out of the other. A flow of 6.24x10<sup>18</sup> electrons per second (or one coulomb per second) is one ampere.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
Capacitors can be big or small. Capacitance is the size C measured in farads. Great, what the hell does that mean? Remember that the inertia of charge is measurable as a voltage V. The amount of charge is Q, the number of coulombs originally pumped into the plates by the battery. Then the magic formula is Q = C x V, or V = Q / C. How this pertains to the Tooba is that if Q is the same and C gets bigger, then V gets smaller.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiqAZ70LSWbA77PunO7c2seYdyZHDLeBCtmT9yKse_1eqnteeiZJn9KC50-PcZkU9g8h4Mgeq1Gj_s-uSpiW9tKFW6ymejUadjwUOONlYHMKH4fusyu-TgtGEDMZrUzZkuyLXsH4w/s1600/Screen+Shot+2015-11-15+at+9.14.55+AM.png" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiqAZ70LSWbA77PunO7c2seYdyZHDLeBCtmT9yKse_1eqnteeiZJn9KC50-PcZkU9g8h4Mgeq1Gj_s-uSpiW9tKFW6ymejUadjwUOONlYHMKH4fusyu-TgtGEDMZrUzZkuyLXsH4w/s1600/Screen+Shot+2015-11-15+at+9.14.55+AM.png" /></a></div>
Here is the touch-sensor circuit in the Tooba. The input on the left and the output on the right are I/O pins of the microcontroller. The left one is an output that drives electrons into and out of the capacitor, and the right one is an input to measure the voltage on the capacitor. It's a crude measurement, just a comparison to a threshold voltage that gives a zero or one.<br />
<br />
<i>BRIEF DIVERSION: In electronics, current is actually the direction opposite to how electrons are moving. This backwards convention is (no kidding) because Benjamin Franklin didn't have know whether the carriers of charge were positive or negative; the observable behavior was the same to him. He guessed, with a fifty-fifty chance of getting it right, and got it wrong. His mistake got codified into all of electronics, forever and ever, amen.</i><br />
<br />
The output on the left is set to logical zero for a little while. The diode quickly discharges the capacitor to the same low output voltage representing a logical zero. Then the output is set to logical one, a higher voltage. The current flows to the right, against the direction of the one-way diode, so all the current flows through the resistor which slows down the movement of electrons. Here's the tricky part: if the capacitor is small, the voltage rises quickly, and if the capacitor is large, the voltage rises slowly. After a certain fixed amount of time, the voltage will just cross the zero-one threshold if your finger was not touching the copper, and the input will read a one. But if you touched the copper, the voltage will rise too slowly and the input will read a zero.<br />
<br />
There is one more tricky bit to this. You may have been told in school that you always need to complete a circuit. Pushing current into the top of the capacitor would require that the bottom of the capacitor is connected to the ground in the Tooba. It turns out that capacitors are the one exception to this "complete the circuit" rule. You can (briefly) push current into a single plate and it will behave like a capacitor even without a second plate. That's why you can play the Tooba (or use the touch screen of your phone) without having a wire attached to you to complete the circuit.<br />
<br />
Addendum - <a href="https://plus.google.com/+MattMcIrvin/posts">a friend</a> read this post and wrote:
<br />
<blockquote>
There's a missing piece in your explanation of capacitance: yes, the negative and positive charges do attract one another, but the charges in each plate also more strongly <i>repel</i> the same-sign charges in that same plate. That creates a restoring force that tries to push current back through the circuit to discharge the capacitor. </blockquote>
<blockquote>
The greater the capacitance, the <i>smaller</i> this net restoring force is. (You can think of a capacitor of higher capacitance as giving more room for the charges to spread out so they're not so crowded, or putting the plates closer together so that the "inertial" attraction across the gap is greater, or both.) </blockquote>
<blockquote>
If you touch one plate, a teeny bit of the charge can flow into your finger, or charges can become polarized in your finger so that some of the electric restoring force is cancelled out. Either way, it increases the capacitance by relieving some of the electric back-pressure through the circuit. And that's why you don't have to complete a circuit yourself.
</blockquote>
</div>
Will Warehttp://www.blogger.com/profile/00852978068817644702noreply@blogger.com0tag:blogger.com,1999:blog-9667563.post-4675705803972256962015-07-24T06:03:00.003-07:002015-11-15T05:33:32.105-08:00The Tooba<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg6rKmS76sCyXdJ345lpXMcQIHpl8iNxG8UAc_i95if8XECbnAJL0MjMZ-2YOINA8qk3jARbZSHeA6ZxBJ800i5_oOpfa5ewWRiziJTRlC_2VYTIQ0aSRyDNWD-Zs-VHpR7lElw/s400/buchla_controller.jpg" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" height="212" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg6rKmS76sCyXdJ345lpXMcQIHpl8iNxG8UAc_i95if8XECbnAJL0MjMZ-2YOINA8qk3jARbZSHeA6ZxBJ800i5_oOpfa5ewWRiziJTRlC_2VYTIQ0aSRyDNWD-Zs-VHpR7lElw/s400/buchla_controller.jpg" width="320" /></a></div>
Way back when, one of my friends in high school was a guy named <a href="http://www.matrixsynth.com/2010/08/rip-david-hillel-wilson-curator-of-new.html">Dave Wilson</a> whose father got him into Moog-style analog electronic music synthesizers. Dave created a museum of historical synthesizers in his home in Nashua, New Hampshire. Through my high school and college years, we exchanged ideas and circuits and bits of lore for various synthesizer hacks. These synthesizer modules were implementing mathematical functions that could be implemented in digital electronics. So we both at various points and in various contexts wrote code to do that.<br />
<br />
The Tooba is going to be some of that built into a short length of 3" PVC tubing. There will be a two or three-octave touch sensitive keyboard and some linear slide pots for various synth parameters. Sound will be generated in the same Teensy 3.1 controller board that scans the keyboard. Unless the poor little CPU gets overwhelmed, then maybe I'll put in a second Teensy for sound generation.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<iframe allowfullscreen="" class="YOUTUBE-iframe-video" data-thumbnail-src="https://i.ytimg.com/vi/mgM0fMjpAKs/0.jpg" frameborder="0" height="266" src="https://www.youtube.com/embed/mgM0fMjpAKs?feature=player_embedded" style="clear: right; float: right;" width="320"></iframe></div>
Here is a prototype, mostly testing the touch-sensitive keyboard. For this version the sound was generated by Timidity running on a Raspberry Pi, and the form factor is obviously different. The keyboard misbehaved in this video because of a sagging under-powered 12-volt supply.<br />
<br />
<span style="color: red;">UPDATE: Wrong! The keyboard misbehaved because of a programming error identified much later, now corrected.</span><br />
<br />
I'll add more to this post as the thing gets closer to completion.<br />
<br />
I had some confusion about the date for the Rhode Island Mini Maker Faire (last year it was a month after the NYC Maker Faire) so I had to hustle when I got the date correct. But I managed to pull it off and have got the thing working.<br />
<br />
I also had to figure out how to mount the copper hexagons on the PVC tubing. Eventually my technique got good enough, but by then I had a mix of well-soldered and poorly-soldered hexagons, and the latter periodically pop off. So in the video below you'll see some missing hexagons that I need to replace before I head down to Providence.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<iframe allowfullscreen="" class="YOUTUBE-iframe-video" data-thumbnail-src="https://i.ytimg.com/vi/QGhZ0tecp60/0.jpg" frameborder="0" height="266" src="https://www.youtube.com/embed/QGhZ0tecp60?feature=player_embedded" style="clear: left; float: left;" width="320"></iframe></div>
So that's the gadget. There is a lot of clean-up to do on the mechanical design. Now I feel it's stable enough to justify laying out a printed circuit board. And the inside wires should be replaced by ribbon cable. But hey, it's working.</div>
Will Warehttp://www.blogger.com/profile/00852978068817644702noreply@blogger.com1tag:blogger.com,1999:blog-9667563.post-80044951231760749002015-06-11T16:07:00.002-07:002015-09-04T07:23:32.920-07:00Eating without grains<div dir="ltr" style="text-align: left;" trbidi="on">
Recently a friend had me watch a talk by William Davis, a cardiologist who wrote a book called <a href="http://www.amazon.com/Wheat-Belly-Lose-Weight-Health/dp/1609614798">Wheat Belly</a>. If you have an hour, here are his thoughts on wheat.<br />
<div class="separator" style="clear: both; text-align: center;">
<iframe allowfullscreen="" class="YOUTUBE-iframe-video" data-thumbnail-src="https://i.ytimg.com/vi/UbBURnqYVzw/0.jpg" frameborder="0" height="266" src="https://www.youtube.com/embed/UbBURnqYVzw?feature=player_embedded" style="clear: right; float: right;" width="320"></iframe></div>
<br />
If you don't have an hour, here is the gist. Humans originally consumed grains in general and wheat in particular to avoid starvation. They saw <a href="http://en.wikipedia.org/wiki/Aurochs">aurochs</a> (predecessors to the modern cow) around them eating grasses, and lacking other food sources at the time, also tried eating grasses. They found that the only part of the grass that was digestible was the seeds, and they cultivated these grasses into the various grains we know today.<br />
<br />
A few problems. First, the first humans to eat grasses did not have the evolutionary adaptations that the aurochs and the cow have: special teeth, special multiple stomachs including one grinding stomach, special digestive enzymes. We still don't have those adaptations, and we probably wouldn't acquire them for hundreds of thousands or millions of years. Grasses have only been on the human menu for about 10,000 years, and our genotype doesn't change very quickly.<br />
<br />
Second, the seed of the grass is the one part that, from an evolutionary perspective, wants NOT to be digested. It has defensive proteins and enzymes intended to discourage (read "poison") any animal trying to eat it. Gluten allergies are human reactions to one of these poisons.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<a href="https://intensivedietarymanagement.com/wp-content/uploads/2014/08/Dwarf-Wheat.png" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" height="292" src="https://intensivedietarymanagement.com/wp-content/uploads/2014/08/Dwarf-Wheat.png" width="320" /></a>Third, what has been changed in recent decades. This is largely the work of <a href="http://en.wikipedia.org/wiki/Norman_Borlaug">Norman Borlaug</a>, undertaken to improve crop yield. Borlaug received a Nobel prize for his work in creating a dwarf form of wheat with a vastly increased yield. Farmers can no longer prosper growing the earlier tall wheat and so now all the wheat you eat in any form is Borlaug's dwarf wheat. This is true on a global scale, not just here in the United States.<br />
<br />
The problem is that this wheat has proven to be mismatched even more poorly to human nutritional needs, and that's why so many people are gluten intolerant, a condition that did not previously exist. It is looking likely that the modern epidemics of obesity and diabetes are also tied to dwarf wheat. Many have been mystified that these epidemics have spread outside the U.S. and this explains why that would happen.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<iframe allowfullscreen="" class="YOUTUBE-iframe-video" data-thumbnail-src="https://i.ytimg.com/vi/IvUgcLQOUSA/0.jpg" frameborder="0" height="266" src="https://www.youtube.com/embed/IvUgcLQOUSA?feature=player_embedded" style="clear: right; float: right;" width="320"></iframe></div>
<a href="http://en.wikipedia.org/wiki/Gliadin">Gliadin</a>, one of the proteins in wheat, is an opiate that stimulates appetite, contributing to obesity. This video by Joe Rignola goes into more detail of the damage that gliadin does to a person's intestines. This damage is not confined to the intestines. T cells (the part of the immune system that attack one's own body, responsible for inflammation) respond to gliadin by attacking both it and something that belongs in your gut called <a href="http://en.wikipedia.org/wiki/Transglutaminase">transglutaminase</a>. It turns out that transglutaminase is produced throughout the entire body and all areas come under attack as the T cells attempt to respond to the original gliadin injury. And so now you have a problem of broad spectrum inflammation.<br />
<br />
As if this all weren't enough, it turns out that wheat raises blood glucose substantially. Two slices of whole wheat bread raise blood glucose higher than six teaspoons of ordinary sugar. In the hour-long video, Davis goes on to enumerate more components of wheat that cause additional health problems. Elsewhere, he identifies health issues with all other grains as well. So the thing one wants to do is to adopt a grain-free diet. Here are a few resources that may be helpful if you are considering this.<br />
<ul style="text-align: left;">
<li><a href="https://www.pinterest.com/mommypotamus/grain-free-gaps-recipes/">https://www.pinterest.com/mommypotamus/grain-free-gaps-recipes/</a></li>
<li><a href="https://www.pinterest.com/novten_eep/gaps-diet-recipes-grain-free/">https://www.pinterest.com/novten_eep/gaps-diet-recipes-grain-free/</a></li>
<li><a href="http://www.amazon.com/Gluten-Free-Grain-Paleo-Lasagna/dp/B00A4PX3CI">http://www.amazon.com/Gluten-Free-Grain-Paleo-Lasagna/dp/B00A4PX3CI</a></li>
</ul>
The important thing is to identify foods that you can be certain are grain-free, for example meats, cheeses, fruits, vegetables, and nuts. Recall that grains did not enter the human diet until the very recent evolutionary past. Grains are not, as might be believed, necessary for good health. They are in fact detrimental to it.</div>
Will Warehttp://www.blogger.com/profile/00852978068817644702noreply@blogger.com0tag:blogger.com,1999:blog-9667563.post-22817687470096070682015-03-02T16:06:00.004-08:002023-10-10T06:07:05.440-07:00An overview of the 2014 printer<div dir="ltr" style="text-align: left;" trbidi="on">
People have been asking for an overview of the 3D printer that I showed at <a href="http://makerfaire.com/new-york-2014/">Makerfaire NYC 2014</a>. I designed it myself, borrowing a couple of ideas from other printers. My printer builds objects from a liquid resin that solidifies under ultraviolet light. Your dentist may use similar stuff to fill cavities. I get the ultraviolet light from an unmodified <a href="http://www.infocus.com/projectors/IN114a">conference room projector</a> that cost me about $350, the single biggest expense of the whole project. The most important design principle was that a person of very low craftsmanship like myself should be able to build the thing. It pretty much does not require precision at any point in the construction. There is <a href="https://github.com/wware/CylindricalPrinter">a Github repository</a> for all this stuff, including a DIY slicer.<br />
<br />
The idea to use a projector rather than <a href="https://en.wikipedia.org/wiki/Laser_scanning#Scanning_mirrors">steering a laser</a> came from the <a href="http://b9creator.com/">B9 Creator</a> printer. The <a href="http://www.peachyprinter.com/">Peachy printer</a> gave me the idea of floating resin on salt water and projecting the light onto the surface of the liquid. The idea to raise and lower the build platform using three threaded rods driven by a bicycle chain was my own, and it turned out not to be such a great idea.<br />
<br />
Soon I plan to post some of my plans for a 2015 printer. Right off the top of my head I can think of four worthwhile goals.<br />
<br />
<ul style="text-align: left;">
<li>Bring it to both the <a href="http://makerfaire.com/">Bay Area Makerfaire</a> and the NYC Makerfaire.</li>
<li>Replace the bicycle chain and those three threaded rods with something simpler and more reliable. The obvious candidate is <a href="https://www.adafruit.com/product/1184">GT2 belts</a> such as are sold by Adafruit.</li>
<li>Clean up the electronics and software so I don't need a laptop to control it.</li>
<li>Replace the orange bucket with something with transparent sides, like <a href="https://www.amazon.com/LYPHARD-AQUARIUMS-Aquarium-Thickness-Included/dp/B0C3LJQZXY">an aquarium tank</a>, so that people can watch the printing process.</li>
</ul>
<br />
<br />
<a href="http://2.bp.blogspot.com/-Blp89MQj2Rc/U_pFwHyuDpI/AAAAAAAAIMs/55kYRYPjAIQ/w771-h578-no/IMG_20140824_160446.jpg" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="149" src="http://2.bp.blogspot.com/-Blp89MQj2Rc/U_pFwHyuDpI/AAAAAAAAIMs/55kYRYPjAIQ/w771-h578-no/IMG_20140824_160446.jpg" width="200" /></a>With the bicycle chain not yet in place, the printer looks like this. Those gray sprockets engage the bicycle chain, which goes around in a sort of diamond shape. The orange bucket is one of the three-dollar buckets from Home Depot. The plywood, nuts and bolts, and threaded rods also came from Home Depot. At this particular point in the work, I thought I would suspend a mirror over the top of the bucket at 45 degrees, which is why you see a piece of wood in the upper right of the photo. But I didn't know about <a href="https://www.youtube.com/watch?v=IaEaaeajCSI&t=73s">first surface mirrors</a> then, and I lost enough UV going through the glass twice that I couldn't get the resin to solidify, so I then positioned the projector directly over the bucket, pointing downward.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://4.bp.blogspot.com/-Q9gRcKubsiY/VAuGuv2qS1I/AAAAAAAAIT0/KfAy2kZeQw4/w771-h578-no/IMG_20140906_181021.jpg" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="149" src="http://4.bp.blogspot.com/-Q9gRcKubsiY/VAuGuv2qS1I/AAAAAAAAIT0/KfAy2kZeQw4/w771-h578-no/IMG_20140906_181021.jpg" width="200" /></a></div>
The <a href="https://www.thingiverse.com/thing:426854">sprockets</a> were designed using <a href="http://www.openscad.org/">OpenSCAD</a> and initially the teeth were too pointy - correct in theory but too sticky for real-world bicycle chain, so you can see where I cut off the points, and later revised the design. If you order sprockets from <a href="https://www.shapeways.com/shops/wills-3d-stuff">my Shapeways store</a>, they should now work fine.<br />
<br />
<br />
<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://2.bp.blogspot.com/-8U4rDpjadLw/VBrXvVYTAtI/AAAAAAAAIlc/VtiqQaqBcfM/w434-h578-no/IMG_20140918_090031.jpg" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="200" src="http://2.bp.blogspot.com/-8U4rDpjadLw/VBrXvVYTAtI/AAAAAAAAIlc/VtiqQaqBcfM/w434-h578-no/IMG_20140918_090031.jpg" width="150" /></a></div>
Here is the printer fully assembled. The bicycle chain is driven by a stepper motor. Each revolution of the stepper motor (200 steps) raises or lowers the build platform by 1/20th of an inch because the thread on the threaded rods is 1/4-20.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://3.bp.blogspot.com/-haoZ79fuBV0/VAy_CSGnISI/AAAAAAAAIXk/KF5M_cVYyoI/w771-h578-no/IMG_20140907_161938.jpg" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="149" src="http://3.bp.blogspot.com/-haoZ79fuBV0/VAy_CSGnISI/AAAAAAAAIXk/KF5M_cVYyoI/w771-h578-no/IMG_20140907_161938.jpg" width="200" /></a></div>
When it's printing, it looks like this. Only where the light is the strongest is the resin solidified. The resin happily ignores ambient diffuse daylight in the room where I'm printing, so I don't need to use dark room lighting.<br />
<br />
Pictured below are some of the objects I've printed with the thing. I started out with a bottle of green resin and when that started getting low, I added a bottle of clear, so my things tend to vary between green and clear.<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://1.bp.blogspot.com/-zuCIF1KprXI/VBgfojCCRzI/AAAAAAAAIiU/ZSjU4fSwUNs/w771-h578-no/IMG_20140916_073045.jpg" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="149" src="http://1.bp.blogspot.com/-zuCIF1KprXI/VBgfojCCRzI/AAAAAAAAIiU/ZSjU4fSwUNs/w771-h578-no/IMG_20140916_073045.jpg" width="200" /> </a><a href="http://2.bp.blogspot.com/-VWQADYNjzHM/VBje30LQcrI/AAAAAAAAIjY/Ws53kIG8Zg4/w434-h578-no/IMG_20140916_210640.jpg" style="clear: left; display: inline; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="200" src="http://2.bp.blogspot.com/-VWQADYNjzHM/VBje30LQcrI/AAAAAAAAIjY/Ws53kIG8Zg4/w434-h578-no/IMG_20140916_210640.jpg" width="150" /></a><a href="http://4.bp.blogspot.com/-egQSnbgdX3s/VBaSEtXm-pI/AAAAAAAAIhI/y7feIuk7QqQ/w434-h578-no/IMG_20140915_031426.jpg" style="clear: left; display: inline; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="200" src="http://4.bp.blogspot.com/-egQSnbgdX3s/VBaSEtXm-pI/AAAAAAAAIhI/y7feIuk7QqQ/w434-h578-no/IMG_20140915_031426.jpg" width="150" /></a></div>
<div dir="ltr" style="text-align: left;" trbidi="on"><br /></div>Previous blog posts discussing this printer in its earlier stages</div><div dir="ltr" style="text-align: left;" trbidi="on"><ul style="text-align: left;"><li><a href="https://willware.blogspot.com/2014/07/homebrew-stereolithographic-3d-printer.html">The very first prototype</a></li><li><a href="https://willware.blogspot.com/2014/07/cleaning-up-sla-printer-design.html">Initial 3D cad sketch, cost breakdown, ideas (not all of them workable)</a></li><li><a href="https://willware.blogspot.com/2014/08/once-more-with-feeling.html">Moving from last-cut wooden gears to bicycle chain</a></li><li><a href="https://willware.blogspot.com/2014/08/of-bicycle-chain-and-sprockets.html">Bicycle chain details, particularly 3d printed sprocket design</a></li><li><a href="https://willware.blogspot.com/2014/09/tomorrow-i-start-new-job-with-formlabs.html">Final development work and first few really terrible prints</a></li><li><a href="https://willware.blogspot.com/2014/09/a-couple-of-recent-3d-printing-successes.html">A couple much better prints (also shown here)</a></li></ul></div>
Will Warehttp://www.blogger.com/profile/00852978068817644702noreply@blogger.com0tag:blogger.com,1999:blog-9667563.post-44173365278828628062014-09-16T05:37:00.001-07:002014-09-16T05:37:41.211-07:00A couple of recent 3D printing successes<div dir="ltr" style="text-align: left;" trbidi="on">
With a few last-minute improvements I've been able to substantially improve the performance of the printer. I slowed the stepper motor to reduce vibration, and I allowed a settling time after each motor movement before exposing the next layer of resin. I cleaned up the build platform, it is now a sheet of aluminum epoxied to the plywood. (And of course, within a couple of prints, it has gotten covered with a sheet of cured resin. Best laid plans...) I had been trying exposure times that were too short, so I went back to 60 seconds per layer.<br />
<br />
If you'd like to see these prints and others, and the printer that made them, come to <a href="http://makerfaire.com/">Maker Faire NYC</a> this weekend at the <a href="http://nysci.org/">New York Hall of Science</a> in Queens, NY.<br />
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjnM8EjWInFsAzSqfa0HJqoPYd-wfbGm9HE7NfnAhWC-WzV7p57nlt7LxIA0MVOjROG75XRoWAEGY1eDAYcAI8O07okjaw1FAwIUxEJCLayAUBiFFZZmQi62Wt8Yd-1A3coPvA_lw/s1600/printed_chess_rook.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjnM8EjWInFsAzSqfa0HJqoPYd-wfbGm9HE7NfnAhWC-WzV7p57nlt7LxIA0MVOjROG75XRoWAEGY1eDAYcAI8O07okjaw1FAwIUxEJCLayAUBiFFZZmQi62Wt8Yd-1A3coPvA_lw/s1600/printed_chess_rook.jpg" height="320" width="240" /></a>Here is a <a href="http://www.thingiverse.com/thing:99028">chess rook</a>. It has an interior spiral staircase. The windows are a bit misshapen and the bottom flat surface is covered with a big glob of cured resin. I don't know why those things happened, but the detail on the parts that came out well isn't too bad.<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgfqf1DWc14idMdHwZVqcy7mFi1MjUGU288DebxsqsfQA7Hf2Ufe2nb2VK4o3fP_pRd5W9O4vmIBMuFwMCeZbsS2yO1SxASkzGiDfsucqs27LYE1tHigeOf9sIiGsbtBeWqKu3k5A/s1600/big_dodecahedron.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgfqf1DWc14idMdHwZVqcy7mFi1MjUGU288DebxsqsfQA7Hf2Ufe2nb2VK4o3fP_pRd5W9O4vmIBMuFwMCeZbsS2yO1SxASkzGiDfsucqs27LYE1tHigeOf9sIiGsbtBeWqKu3k5A/s1600/big_dodecahedron.jpg" height="240" width="320" /></a></div>
This is a <a href="https://en.wikipedia.org/wiki/Dodecahedron">dodecahedron</a>, one of the five <a href="https://en.wikipedia.org/wiki/Platonic_solid">Platonic solids</a>. In the days of ancient Greece, this shape was the cause of some <a href="https://en.wikipedia.org/wiki/Hippasus#Irrational_numbers">controversy</a> because it could be used to prove the existence of irrational numbers, which ticked off <a href="https://en.wikipedia.org/wiki/Pythagoras">Pythagoras</a> something fierce. This was posted on <a href="http://www.thingiverse.com/thing:86869">Thingiverse</a>, as was the rook.<br />
<br />
More shapes to come soon, if all goes well.</div>
Will Warehttp://www.blogger.com/profile/00852978068817644702noreply@blogger.com1tag:blogger.com,1999:blog-9667563.post-55612662179228318222014-09-07T17:45:00.000-07:002014-09-07T18:27:50.800-07:00Finally, the thing is printing<div dir="ltr" style="text-align: left;" trbidi="on">
Tomorrow I start a new job with <a href="http://formlabs.com/en/">Formlabs</a>, a 3D printer company, and I'm psyched about that. Unfortunately, however, one of the conditions of my employment there is that I cease development on my own 3D printer. I spoke with their attorney and it all makes sense, it's the right thing to do, because my printer is entirely <a href="https://github.com/wware/CylindricalPrinter">open source</a> and they are selling a proprietary product. If I were to continue developing my printer, it would be too easy to unintentionally include pieces of their technology. So tonight I am putting the finishing touches on the Github repository.<br />
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhc3mWHvHNisIAn219RWQ3Ga1u6DXu6lEt618GCoKYfr0CnZhHBU0hO8fAbEs7tDff7kjrGBwxnI0JookZ5bntOWwo6Ccy-OHcnsWT3c-oodCFnIK8VdLEfC3aFm8wpKXHVF_HINw/s1600/bubble_bubble_toil_and_trouble.png" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhc3mWHvHNisIAn219RWQ3Ga1u6DXu6lEt618GCoKYfr0CnZhHBU0hO8fAbEs7tDff7kjrGBwxnI0JookZ5bntOWwo6Ccy-OHcnsWT3c-oodCFnIK8VdLEfC3aFm8wpKXHVF_HINw/s1600/bubble_bubble_toil_and_trouble.png" height="150" width="200" /></a>Today was the first time I made a successful print with this printer design. I had hoped to print four <a href="http://www.thingiverse.com/thing:86869">dodecahedra</a> at once. But I had some crud on the surface of my build plate, and I hadn't stirred the resin before printing, so only one of the four came out really well. Another was misshapen, and two of them never came together at all.<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhzUntN_cHsvWJeB_T_tW0YAbjQ5ZB8bKBKATFQPbd4MS6rwslnr_peWAS94aW9per5KoF_VSwqAqHtAo8ozkvh8Msng-sPi4ryVGPryyLyGxzjX2FRzE7wNHxn0sQ6JUv95IOJ7Q/s1600/dumpy_dour_dodecahedra.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhzUntN_cHsvWJeB_T_tW0YAbjQ5ZB8bKBKATFQPbd4MS6rwslnr_peWAS94aW9per5KoF_VSwqAqHtAo8ozkvh8Msng-sPi4ryVGPryyLyGxzjX2FRzE7wNHxn0sQ6JUv95IOJ7Q/s1600/dumpy_dour_dodecahedra.png" height="150" width="200" /></a></div>
Here are the two that were at least coherent solids. I think with a little more learning and practice, I'll get to where I can make four that all look as good as the one on the right.<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi7OK6MlpzunzYGjDw9YaGjhlTIh5uaDpI9RVSObbPluedPYNqSdrUTmKpoZAEYc6Ng_l5UAqcCma_D6RndiMQWZIpQjwsxH07vliKOnKGQ_QnS_qZNW-WRDa50g3fSpwiroJZuEA/s1600/projector_overhead.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi7OK6MlpzunzYGjDw9YaGjhlTIh5uaDpI9RVSObbPluedPYNqSdrUTmKpoZAEYc6Ng_l5UAqcCma_D6RndiMQWZIpQjwsxH07vliKOnKGQ_QnS_qZNW-WRDa50g3fSpwiroJZuEA/s1600/projector_overhead.png" height="320" width="240" /></a></div>
Here is the setup I'm using. If you've followed this blog, you'll recognize the stuff on the bucket. The box-like thing overhead was quickly cobbled together when I realized that my mirror wasn't reflecting enough UV light to make the resin cure properly, because the mirror's glass isn't transparent enough in the UV range. To remove the mirror from the optical path, I needed to put the projector directly over the bucket, pointing down.</div>
Will Warehttp://www.blogger.com/profile/00852978068817644702noreply@blogger.com0tag:blogger.com,1999:blog-9667563.post-63579194108886115132014-08-29T08:31:00.000-07:002014-10-03T14:15:17.689-07:00Of bicycle chain and sprockets<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<iframe allowfullscreen='allowfullscreen' webkitallowfullscreen='webkitallowfullscreen' mozallowfullscreen='mozallowfullscreen' width='320' height='266' src='https://www.youtube.com/embed/n--fgqwuTTI?feature=player_embedded' frameborder='0'></iframe></div>
Here is the best video I've found for working on bicycle chain. I haven't looked extensively but this one gave me the information I needed, starting at the <a href="https://www.youtube.com/watch?v=n--fgqwuTTI&t=34s">34-second mark</a>. I had to buy a length of chain and one of these tools shown in the video. I thought I might need a thing called a "master link" but that's really unnecessary. Bicycle chain is one example of <a href="http://en.wikipedia.org/wiki/Roller_chain">roller chain</a>, a mechanical engineering term for chains that follow the same principle.<br />
<br />
<div>
<a href="http://www.azusaeng.com/chain/chnIllus.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="http://www.azusaeng.com/chain/chnIllus.jpg" height="116" width="320" /></a></div>
The chain I'm using is 1/2"-1/8" single speed chain, also known as #410 chain. The first number (1/2") is the pitch, the distance between the centers of two consecutive rollers. The second number is the width, the distance between inner plates. These numbers, together with the roller diameter, determine the shape of the sprocket teeth. For #410 chain the maximum roller diameter is 5/16".<br />
<br />
<a href="http://www.gizmology.net/images/sprocket6.gif" imageanchor="1" style="clear: left; display: inline !important; float: left; margin-bottom: 1em; margin-right: 1em; text-align: center;"><img border="0" src="http://www.gizmology.net/images/sprocket6.gif" /></a>If you're going to build a gadget using bicycle chain as a drive chain, remember that you'll need a tensioner somewhere, something you can adjust to take up slack in the length of the chain. You'll need at least an inch of adjustment available (twice the pitch). In my design, I made the stepper motor moveable to take up chain slack.<br />
<br />
On to the topic of <a href="http://www.gizmology.net/sprockets.htm">sprocket</a> design. The approach I used is basically guided by the red curves in the diagram to the left. Some sprocket designs truncate the teeth, which reduces friction but engages each roller for a little less time. I probably should have done that but it's not really necessary. The <a href="http://www.openscad.org/">OpenSCAD</a> code for my sprocket design appears at the top of the <a href="https://github.com/wware/CylindricalPrinter/blob/master/mechanics/sprockets.scad">sprockets.scad</a> source file in the <a href="https://github.com/wware/CylindricalPrinter">Github repository</a> for my printer. I tested the sprocket (<a href="https://www.thingiverse.com/thing:426854">Thingiverse</a>, <a href="https://www.shapeways.com/model/2466717/stepper-sprocket.html">Shapeways</a>) to make sure that in the absence of unreasonable friction, the chain could freely engage and disengage the teeth as it moved around at fairly high speed (much faster than it will move on the printer most of the time) and that worked fine.<br />
<br />
There are a few different pieces, so let me step through it. The outer thing is a difference operation, which means that the first part (the union) establishes a block of stuff and the other parts are removed from it. So we begin with a rectangular solid stretching in the X direction from one roller to the next, with a Z height equal to the width of the chain. To that we add the "tooth" part, defined by the two upper red curves in the previous diagram. The first two pieces we remove are the cylindrical cutouts in which the rollers will sit when closest to the sprocket's center, defined by the two lower red curves. Finally, a couple of flat surfaces are cut out to taper the tooth in the Z direction, which allows the sprocket to still engage nicely when the chain isn't precisely coplanar.<br />
<br />
<pre><span style="font-size: x-small;">module sprocket_tooth() {
difference() {
union() {
translate([-1/4,0,-1/16])
cube([1/2,3/8,1/8]);
intersection() {
translate([1/4, 0, -1/16])
cylinder(h=1/8, d=1-5/16, $fn=30);
translate([-1/4, 0, -1/16])
cylinder(h=1/8, d=1-5/16, $fn=30);
}
}
translate([1/4, 0, -1/8])
cylinder(h=1/4, d=5/16, $fn=30);
translate([-1/4, 0, -1/8])
cylinder(h=1/4, d=5/16, $fn=30);
multmatrix(m = [
[1, 0, 0, -0.5],
[0, 1, 4, -1.3],
[0, 0, 1, 0],
[0, 0, 0, 1]
])
cube([1, 1, 1]);
multmatrix(m = [
[1, 0, 0, -0.5],
[0, 1, -4, 2.7],
[0, 0, 1, -1],
[0, 0, 0, 1]
])
cube([1, 1, 1]);
}
}</span></pre>
<br class="Apple-interchange-newline" />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiiJaWzod1L2azsaNg3PrSpMm-Uvv5ImGjGAznKmPd_-9xSffszBQfT1zuxwfjRKPAc5NkMNJSWQf_RdG7gtPbhoeUGvOmf5xY227K8LGj76D3zg-9QH5jNp1_kfZYvPfGfNULqjw/s1600/Screen+Shot+2014-08-29+at+11.28.58+AM.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiiJaWzod1L2azsaNg3PrSpMm-Uvv5ImGjGAznKmPd_-9xSffszBQfT1zuxwfjRKPAc5NkMNJSWQf_RdG7gtPbhoeUGvOmf5xY227K8LGj76D3zg-9QH5jNp1_kfZYvPfGfNULqjw/s1600/Screen+Shot+2014-08-29+at+11.28.58+AM.png" height="171" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<b><i>POSTSCRIPT</i></b><br />
<div>
<br /></div>
<div>
I found with the design above that those teeth can easily get stuck if one of the links in the bike chain is stiff. I haven't done a lot of bike chain work, and I would imagine that people who do probably get better at avoiding or fixing stiff links, but I'm not there yet. So one thing I did was to make much less "aggressive" sprocket teeth. For my application, I get away with much shallower teeth, and have updated both the Thingiverse design and the Shapeways store accordingly.</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh2z7-7Q-KoqMX8x9agHM306FkYZvk_HgwtRBUNOXHh62frYvWdfAbiwzb-omrVbi-VkfLIi6Fd6y4GKlWPgf3HhqDdoNzp7dZu2lobaovoKithDPhtCWW-xzg1fENE4LFjsg-Ouw/s1600/Screen+Shot+2014-10-03+at+5.12.10+PM.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh2z7-7Q-KoqMX8x9agHM306FkYZvk_HgwtRBUNOXHh62frYvWdfAbiwzb-omrVbi-VkfLIi6Fd6y4GKlWPgf3HhqDdoNzp7dZu2lobaovoKithDPhtCWW-xzg1fENE4LFjsg-Ouw/s1600/Screen+Shot+2014-10-03+at+5.12.10+PM.png" height="179" width="320" /></a></div>
<div>
I might have neglected to mention this elsewhere (though I think it's mentioned in both those places) that the sprocket for the stepper axle takes a 1/4-inch long 4-40 machine screw as a set screw.</div>
</div>
Will Warehttp://www.blogger.com/profile/00852978068817644702noreply@blogger.com7tag:blogger.com,1999:blog-9667563.post-88616249575010875902014-08-22T08:46:00.002-07:002014-09-02T08:59:15.733-07:00Once more, with feeling<div dir="ltr" style="text-align: left;" trbidi="on">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhYvJXTNyVPvzwFZiD502mhmXql1FOC5dSvp3VCB00MKI620gL7j6-zZxTlJ7PE4E2k0YdEBFANSOYsiCILYhB39S2m2By0HoIy3IRFfgBp0D11WHjva2I5aOjGd9hS_xLi655-Rw/s1600/Screen+Shot+2014-08-22+at+11.21.22+AM.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhYvJXTNyVPvzwFZiD502mhmXql1FOC5dSvp3VCB00MKI620gL7j6-zZxTlJ7PE4E2k0YdEBFANSOYsiCILYhB39S2m2By0HoIy3IRFfgBp0D11WHjva2I5aOjGd9hS_xLi655-Rw/s1600/Screen+Shot+2014-08-22+at+11.21.22+AM.png" height="145" width="200" /></a>My too-clever-by-half use of laser-cut plywood gears ended badly. Small errors repeatedly accumulated to make the gears fit unreliably. It was a mess. I needed another idea.<br />
<br />
<a href="http://www.uncommongoods.com/images/product/10144_zoom1.jpg" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" src="http://www.uncommongoods.com/images/product/10144_zoom1.jpg" height="160" width="200" /></a>I started thinking about timing belts, especially <a href="http://blog.reprap.org/2008/03/beaded-belt-drive-success.html">something clever</a> that Vik Olliver did on Rep Rap involving those ball chains used to switch ceiling lights on and off. I didn't really trust myself to be able to solder the ball chain together, and I continued scratching my head. Then I saw one of those bicycle chain bottle openers at a party, and realized that bicycle chain was the solution to my problem.<br />
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEizLNfjVelkY7Nqk2vVR8-7VWxVYRP5XQbrwpWLD1NTFEAEcGzjsd68RV1Uvn_d52deSH6YwbvebhlxCSN5Y4HAuPd8X2p-vk7gojJA5eF9k89FKZxvHeBC76xfSEjK45RFpz4jUA/s1600/stepper_sprocket_ouch.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEizLNfjVelkY7Nqk2vVR8-7VWxVYRP5XQbrwpWLD1NTFEAEcGzjsd68RV1Uvn_d52deSH6YwbvebhlxCSN5Y4HAuPd8X2p-vk7gojJA5eF9k89FKZxvHeBC76xfSEjK45RFpz4jUA/s1600/stepper_sprocket_ouch.jpg" height="150" width="200" /></a>I started learning about <a href="http://en.wikipedia.org/wiki/Roller_chain">roller chain and sprockets</a>. It turns out sprocket tooth design is <a href="http://www.gizmology.net/sprockets.htm">really pretty simple</a>, much simpler than <a href="http://en.wikipedia.org/wiki/Involute_gear">involute gear teeth</a>, and I was able to <a href="https://www.thingiverse.com/thing:426854">design some sprockets</a> with just a little study. It took a redesign because the first time, my stepper sprocket design assumed a friction fit would work, but when the part arrived, I discovered I'd need a set screw. In the picture to the left, I retrofitted a set screw on the initial sprocket design with sub-optimal results. This is probably adequate on a temporary basis, but an improved design is pending and should arrive by the end of August and should be in place for exhibition at Maker Faire.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiPRUnPeajijP57DZvCStIKDE-p7g16rpjQKEswGlWS5SSHoL7uZpnS-AzaYaavFV1piXqfIQiruiuwtTHPK8DlAWET9ZESUeT1QAvMmJmAmi043iMMRoWuKHGsdSYTFLceoOywzw/s1600/Screen+Shot+2014-08-22+at+11.19.03+AM.png" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiPRUnPeajijP57DZvCStIKDE-p7g16rpjQKEswGlWS5SSHoL7uZpnS-AzaYaavFV1piXqfIQiruiuwtTHPK8DlAWET9ZESUeT1QAvMmJmAmi043iMMRoWuKHGsdSYTFLceoOywzw/s1600/Screen+Shot+2014-08-22+at+11.19.03+AM.png" height="200" width="193" /></a></div>
So this is the new design. I think it retains the Steampunk flavor of the original design, if perhaps not quite as pronounced. It's a bit simpler and all the plywood cutting can be done by hand with a compass and a jigsaw. So my design goal that it should be buildable by a person of minimal craftsmanship (like myself) is intact.<br />
<br />
Barring some disaster, I expect to be exhibiting this printer (hopefully in operation) at Maker Faire NYC 2014, at the New York Hall of Science in Queens, on September 20th and 21st. If you're reading this, you're invited to come see it. If you can't make it, I'll try to post as much information here, on <a href="https://github.com/wware/CylindricalPrinter">Github</a>, and on Youtube as possible.<br />
<div class="separator" style="clear: both; text-align: center;">
<iframe allowfullscreen='allowfullscreen' webkitallowfullscreen='webkitallowfullscreen' mozallowfullscreen='mozallowfullscreen' width='320' height='266' src='https://www.youtube.com/embed/k0KcZ39T2KY?feature=player_embedded' frameborder='0'></iframe></div>
<br /></div>
Will Warehttp://www.blogger.com/profile/00852978068817644702noreply@blogger.com1tag:blogger.com,1999:blog-9667563.post-4654767133294605872014-07-09T20:20:00.001-07:002014-07-11T18:09:11.018-07:00Cleaning up the SLA printer design<div dir="ltr" style="text-align: left;" trbidi="on">
The stereolithographic printer described in my last post works, but it has a lot of room for improvement. Two obvious improvements are to use a stepper motor to raise and lower the build platform, allowing for automated operation, and to accept standard input files such as the <a href="http://en.wikipedia.org/wiki/STL_(file_format)">STL file format</a>.<br />
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEip_12P3dgQ0lXNOPGLD-t-SjuRPhkbV8SnzQ4Y4HRxAWuUddeOr98QV5GHQfgsdjQNNUmZx43UrjK_10s9bmYO_mRwj6fZ6kQ-1iNorwxm238Y6JyDmr9SWrW0csTwF-0xTfz1RQ/s1600/Screen+Shot+2014-07-11+at+8.45.43+PM.png" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEip_12P3dgQ0lXNOPGLD-t-SjuRPhkbV8SnzQ4Y4HRxAWuUddeOr98QV5GHQfgsdjQNNUmZx43UrjK_10s9bmYO_mRwj6fZ6kQ-1iNorwxm238Y6JyDmr9SWrW0csTwF-0xTfz1RQ/s1600/Screen+Shot+2014-07-11+at+8.45.43+PM.png" height="320" width="172" /></a>In this post, I'd like to look at improvements in the overall mechanical design, specifically intended to make this printer easy for other people to build. I envision this as a printer that could be easily and affordably built by an after-school club, at a price of less than $600. <a href="http://www.newegg.com/Product/Product.aspx?Item=0B1-00PJ-00003">The projector I used</a> cost me $350 and I'll assume that's the same price for others. Likewise I expect others would pay about $75 for a couple of bottles of <a href="http://makerjuice.com/product/subgplus/">UV-cured resin</a>. That leaves $75 for everything else. You have a <a href="https://www.sparkfun.com/products/10846">stepper motor</a>, a <a href="https://www.sparkfun.com/products/10267">stepper control board</a>, and a <a href="http://www.raspberrypi.org/">Raspberry Pi</a>. I have a little wiggle room left for laser-cut plywood, and a 5-gallon bucket from Home Depot. I get my laser-cutting done at <a href="http://dangerawesome.co/">danger!awesome</a> in Cambridge, MA. The bucket is bright orange, and that's the color I've used in this design, where the plywood is yellow and green (the green pieces having gear teeth that mesh). The pale blue stick-things are 1/4-20 threaded rods, cheaply available at Home Depot. The brighter blue thing is the stepper motor. The three green gears surrounding the threaded rods have captive nuts, allowing the stepper to raise and lower the threaded rods in lock-step. I'm kind of pleased with this design and I think this is what I'd like to show at <a href="http://makerfaire.com/">Maker Faire NYC</a> this year.<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEise13-HWXU3bfU8I_zJzDz-OQKgJNnj2H_lHKRk61G5SEWxIKanzIOTQsaxLXQ3dJnGYIdh6am5UMSCo2mnq7LHFE5eJKztFo1Gzz162Y5PEfjvQD-j2OJ9ohrAEAf89pUSaesHg/s1600/Screen+Shot+2014-07-11+at+8.48.40+PM.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEise13-HWXU3bfU8I_zJzDz-OQKgJNnj2H_lHKRk61G5SEWxIKanzIOTQsaxLXQ3dJnGYIdh6am5UMSCo2mnq7LHFE5eJKztFo1Gzz162Y5PEfjvQD-j2OJ9ohrAEAf89pUSaesHg/s1600/Screen+Shot+2014-07-11+at+8.48.40+PM.png" height="200" width="320" /></a></div>
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgwjA6r4cf7cUCcPs2cInrNAGKsjGiZU_qe3UXExibkhwP-4rfEI-N5n_srDaHnAer8CdpidNUtP-Kkg2AUd0pO-2_HM9jWNFFzT8asl8TA73sRuhZhpMj6b51WAbQmWGx5c5mu1g/s1600/Screen+Shot+2014-07-11+at+8.46.07+PM.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em; text-align: center;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgwjA6r4cf7cUCcPs2cInrNAGKsjGiZU_qe3UXExibkhwP-4rfEI-N5n_srDaHnAer8CdpidNUtP-Kkg2AUd0pO-2_HM9jWNFFzT8asl8TA73sRuhZhpMj6b51WAbQmWGx5c5mu1g/s1600/Screen+Shot+2014-07-11+at+8.46.07+PM.png" height="320" width="182" /></a><br />
<br />
Looking down into the bucket, we can see one more circular piece of plywood which is the build platform. When we raise the three threaded rods high enough, the build platform comes up out of the bucket, which holds a layer of resin floating atop a salt water bath (a trick I borrowed from the <a href="http://www.peachyprinter.com/">Peachy Printer</a>). And in fact, you could use this setup with a Peachy Printer rather than a projector, and you'd save money by doing so.<br />
<br />
These gorgeous pictures are courtesy of <a href="https://www.tinkercad.com/things/04ma49WANV9-cylindrical-printer">Tinkercad.com</a>. It's a pretty wonderful thing if you're doing 3D design. One last picture, showing the projector bouncing light off the mirror to illuminate the resin.<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjpKJWgW90a-iQVpouI3J7nhbkQquyNJxFlzFOQyK-NDRg8j1tShKkRZKpYgQTUPyHUGVni0Lyayg0NZhj-S8g3t7icW8zQLL68RwV2o5drcbyMQUKMuC97hjBSFPpKaninvK6Q_g/s1600/Screen+Shot+2014-07-11+at+8.57.39+PM.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em; text-align: center;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjpKJWgW90a-iQVpouI3J7nhbkQquyNJxFlzFOQyK-NDRg8j1tShKkRZKpYgQTUPyHUGVni0Lyayg0NZhj-S8g3t7icW8zQLL68RwV2o5drcbyMQUKMuC97hjBSFPpKaninvK6Q_g/s1600/Screen+Shot+2014-07-11+at+8.57.39+PM.png" height="320" width="305" /></a><br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<br /></div>
Will Warehttp://www.blogger.com/profile/00852978068817644702noreply@blogger.com0tag:blogger.com,1999:blog-9667563.post-66589974597933734072014-07-06T18:26:00.001-07:002014-07-12T06:30:37.602-07:00Homebrew stereolithographic 3D printer<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="separator" style="clear: both; text-align: center;">
<iframe allowfullscreen='allowfullscreen' webkitallowfullscreen='webkitallowfullscreen' mozallowfullscreen='mozallowfullscreen' width='320' height='266' src='https://www.youtube.com/embed/8ehlWYfdS70?feature=player_embedded' frameborder='0'></iframe></div>
I've been interested in hobbyist 3D printers for quite a while. A friend of mine, Jeff Keegan has an <a href="http://www.keegan.org/reprapblog/">exquisite blog</a> about his several-year hobby of building <a href="http://reprap.org/wiki/RepRap">RepRap</a>-style printers. He has donated a printer to the Boston Museum of Science. I took a stab at starting a RepRap-style printer years ago, but my level of dedication was not equal to the task.<br />
<br />
A RepRap-style printer (technically, a <a href="http://en.wikipedia.org/wiki/Fused_deposition_modeling">fused-deposition-modeling</a> printer) works by squeezing molten plastic out of a hot nozzle onto the workpiece, where the plastic cools, forming the next vertical layer. One FDM printer can create some of the parts for another FDM printer, or to replace its own parts when they get worn. This was the idea behind the RepRap project, that partially self-reproducing printers could be very cheap.<br />
<br />
Stereolithograhic 3D printers operate on a different principle, using ultraviolet light to cure resin. The video above illustrates this process.<br />
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhPq5pCcwlEqABFMgSB3Q20hRqXaxeM6ppMQ1of1pzGdtJhrPXbjKGupJxoagk1hzMT3FhyphenhyphenX_7x5gVuZ5iI3tHcoCpyCeF7T4rAJwc0ZOlMbmEaGYdTIPkfieSrnOQ0TSkDsjFR1Q/s1600/best_yet_sunday.png" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhPq5pCcwlEqABFMgSB3Q20hRqXaxeM6ppMQ1of1pzGdtJhrPXbjKGupJxoagk1hzMT3FhyphenhyphenX_7x5gVuZ5iI3tHcoCpyCeF7T4rAJwc0ZOlMbmEaGYdTIPkfieSrnOQ0TSkDsjFR1Q/s1600/best_yet_sunday.png" height="264" width="320" /></a>The past few weeks I have been spending way too much time trying to figure out how to build a stereolithographic printer of my own. I looked at a lot of things other people have done and started doodling some ideas. A few times I made or purchased parts for a particular approach and later realized that it wouldn't work for some reason. But after a lot of tinkering, I finally produced the octahedron on the right.<br />
<br />
My printer is pretty crude and is due for a lot of improvements in the days ahead. I had ordered a stepper motor controller board that didn't work, so I needed to manually rotate the threaded rod that lowers the workpiece into the resin bath.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhIiUgpucBQpNWtBaVfg-cgrta26F1Hm3cFf83Q2PahGWfeVuT4iLSVZ1Xmr66MqMLNayX8qh8kNFwdmKt9RTiU98UzN8pNFfLfOJoIe0hrBqtYPTiXYZ1RrMUpGDDIQt4mE3D8Qw/s1600/IMG_20140705_205713.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhIiUgpucBQpNWtBaVfg-cgrta26F1Hm3cFf83Q2PahGWfeVuT4iLSVZ1Xmr66MqMLNayX8qh8kNFwdmKt9RTiU98UzN8pNFfLfOJoIe0hrBqtYPTiXYZ1RrMUpGDDIQt4mE3D8Qw/s1600/IMG_20140705_205713.jpg" height="320" width="240" /></a></div>
Hopefully this picture isn't too confusing. A lot of this is stuff from the hardware store: a bucket, a lot of plywood, nuts and bolts, a piece of aluminum screen, a threaded rod, two straight rods. That black shape at the top held in place with a bungee cord is a pretty standard <a href="http://www.newegg.com/Product/Product.aspx?Item=0B1-00PJ-00003">conference-room projector</a>. When the thing is printing, the projector aims down into the bucket, which holds a quantity of resin floating on a much larger quantity of salt water. The ultraviolet light from the pattern projected onto the resin cures it in a particular shape, forming one layer of the product, and then the threaded rot rotates, moving the product down by one layer-height.<br />
<br />
Currently I'm using a layer-height of 1/40th of an inch, which turns out to be quite visible to the naked eye, so I want to go down to something more like 1/100th of an inch.<br />
<br />
I plan to post plans and software on <a href="https://github.com/">Github</a> and <a href="http://instructables.com/">Instructables</a> to enable anybody to build one of these printers for just a few hundred dollars. Most of the cost ($350) is the projector. I'd like to do the RepRap thing of using lots of pieces made by an identical printer, which would involve some redesign.<br />
<br /></div>
Will Warehttp://www.blogger.com/profile/00852978068817644702noreply@blogger.com4Framingham, MA 01701, USA42.3240042 -71.45368350000001142.2300842 -71.615045000000009 42.417924199999995 -71.292322000000013tag:blogger.com,1999:blog-9667563.post-84879896099402090842014-04-15T20:04:00.002-07:002014-04-16T09:11:12.434-07:00Espruino: JavaScript for embedded devices<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="separator" style="clear: both; text-align: center;">
<a href="http://www.espruino.com/images/espruino_board.jpg" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" src="http://www.espruino.com/images/espruino_board.jpg" height="161" width="320" /></a></div>
My <a href="http://willware.blogspot.com/2014/04/a-few-decades-progress-in-computers-and.html">last post</a> was really written primarily as background for this post. TL;DR: there is a lot we're doing right nowadays as software engineers, that we were screwing up badly 20 to 30 years ago.<br />
<br />
I am moved to write this post because I've been playing with the <a href="http://www.espruino.com/">Espruino</a> board (having pre-ordered one during <a href="https://www.kickstarter.com/projects/gfw/espruino-javascript-for-things">the Kickstarter campaign</a>), which runs JavaScript close to the metal on an ARM processor.<br />
<br />
JavaScript is a cool language because it draws upon a lot of the experience that engineers have gained over decades. Concurrent programming is hard, so JavaScript has a <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/EventLoop">bullet-proof concurrency model</a>. Every function <a href="http://en.wikipedia.org/wiki/Run_to_completion_scheduling">runs undisturbed to completion</a>, and communication is done by <a href="http://en.wikipedia.org/wiki/Shared_nothing_architecture">shared-nothing</a> <a href="http://en.wikipedia.org/wiki/Message_passing">message passing</a>. In the browser, JavaScript gracefully handles external events with unpredictable timing. That skill set is exactly what is required for embedded hardware control.<br />
<iframe allowfullscreen='allowfullscreen' webkitallowfullscreen='webkitallowfullscreen' mozallowfullscreen='mozallowfullscreen' width='320' height='266' src='https://www.youtube.com/embed/lrJJQ1uW3lA?feature=player_embedded' frameborder='0'></iframe><br />
<a href="http://www.crockford.com/">Crockford</a> once referred to JavaScript as "Scheme with C syntax". JavaScript has many of <a href="http://www.paulgraham.com/diff.html">the features</a> that distinguish Lisp and its derivatives, and which set apart Lisp as probably the most forward-looking language ever designed.<br />
<br />
This video is Gordon Williams, the creator of the Espruino board, speaking at a NodeJS conference in the UK. One of the great things he did was to write code that can run on several different boards. I'm particularly interested in <a href="https://www.youtube.com/watch?v=t_NQ0ZlgjMU">installing it</a> on the <a href="http://www.newark.com/stmicroelectronics/stm32f4discovery/stm32-f4-series-discovery-kit/dp/87T3791">STM32F4 Discovery</a> board because it costs very little and looks pretty powerful as ARM microcontrollers go. There is a <a href="https://www.youtube.com/playlist?list=PLa1tazUyp-oOELRUt6tSuZIoOCQYIqf5B">Youtube playlist</a> that includes these videos and others relating to the Espruino board.</div>
Will Warehttp://www.blogger.com/profile/00852978068817644702noreply@blogger.com0tag:blogger.com,1999:blog-9667563.post-61690111777800203552014-04-15T19:38:00.001-07:002014-07-09T20:21:52.112-07:00A few decades' progress in computers and electronics<div dir="ltr" style="text-align: left;" trbidi="on">
I got my bachelors degree in EE in 1981 and went to work doing board-level design. Most circuit assembly was wire-wrap back then, and we had <a href="http://en.wikipedia.org/wiki/Transistor%E2%80%93transistor_logic">TTL</a> and <a href="http://en.wikipedia.org/wiki/CMOS">CMOS</a> and <a href="http://en.wikipedia.org/wiki/8-bit">8-bit</a> <a href="http://en.wikipedia.org/wiki/Microcontroller">microcontrollers</a>. Most of the part numbers I remember from my early career are still available at places like <a href="http://www.digikey.com/">Digikey</a>. The job of programming the microcontroller or <a href="http://en.wikipedia.org/wiki/Microprocessor">microprocessor</a> on a board frequently fell to the hardware designer. In some ways it was a wonderful time to be an engineer. Systems were trivially simple by modern standards, but they were mysterious to most people so you felt like a genius to be involved with them at all.<br />
<div>
<br /></div>
<div>
After about 15 years of hardware engineering with bits of software development on an as-needed basis, I moved into software engineering. The change was challenging but I intuited that the years to come would see huge innovation in software engineering, and I wanted to be there to see it.</div>
<div>
<br /></div>
<div>
Around that time, the web was a pretty recent phenomenon. People were learning to write <a href="http://en.wikipedia.org/wiki/Static_web_page">static HTML pages</a> and <a href="http://en.wikipedia.org/wiki/Common_Gateway_Interface">CGI scripts</a> in <a href="http://en.wikipedia.org/wiki/Perl">Perl</a>. One of my big hobby projects around that time was a <a href="http://en.wikipedia.org/wiki/Java_applet">Java applet</a>. Some people talked about CGI scripts that talked to <a href="http://en.wikipedia.org/wiki/Database">databases</a>. When you wanted to search the web, you used Alta Vista. At one point I purchased a thick book of the websites known to exist at the time, I kid you not. Since many websites were run by individuals as hobbies, the typical lifespan of any given website was short.</div>
<div>
<br /></div>
<div>
Software development in the 80s and 90s was pretty hit-or-miss. <a href="http://en.wikipedia.org/wiki/The_Mythical_Man-Month">Development schedules</a> were almost completely unpredictable. Bugs were hard to diagnose. The worst bugs were <a href="http://stackoverflow.com/questions/352906/how-do-you-approach-intermittent-bugs">the intermittent ones</a>, things that usually worked but still failed often enough to be unacceptable. Reproducing bugs was tedious, and more than once I remember setting up logging systems to collect data about a failure that occurred during an overnight run. Some of the most annoying bugs involved <a href="http://en.wikipedia.org/wiki/Race_condition">race conditions</a> and other <a href="http://en.wikipedia.org/wiki/Concurrency_(computer_science)">concurrency</a> issues.</div>
<div>
<br /></div>
<div>
Things are very different now. I've been fortunate to see an insane amount of improvement. These improvements are not accidents or mysteries. They are the results of hard work by thousands of engineers over many years. With several years of hindsight, I can detail with some confidence what we're doing right today that we did wrong in the past.</div>
<div>
<br />
One simple thing is that we have an enormous body of open source code to draw upon, <a href="https://www.kernel.org/">kernels</a> and <a href="http://httpd.apache.org/">web servers</a> and <a href="http://gcc.gnu.org/">compilers</a> and <a href="http://en.wikipedia.org/wiki/List_of_open-source_programming_languages">languages</a> and applications for all kinds of tasks. These can be studied by students everywhere, and anybody can review and improve the code, and with rare exceptions they can be freely used by businesses. Vast new areas of territory open up every few years and are turned to profitable development.</div>
<div>
<br />
In terms of concurrent programming, we've accumulated a huge amount of wisdom and experience. We know now <a href="http://en.wikipedia.org/wiki/Concurrency_pattern">what patterns work</a> and what patterns fail, and when I forget, I can do a search on Stackoverflow or Google to remind myself. And we now embed that experience into the design of our languages, for instance, <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/EventLoop">message queues</a> as inter-thread communication in JavaScript.</div>
<div>
<br />
Testing and QA is an area of huge progress over the last 20 years. <a href="http://en.wikipedia.org/wiki/Ad_hoc_testing">Ad hoc random manual tests</a>, usually written as an afterthought by the developer, were the norm when I began my career, and many managers frowned upon <a href="http://en.wikipedia.org/wiki/Code_coverage">"excessive"</a> testing that we would now consider barely adequate. Now we have solid widespread expertise about how to write and manage <a href="http://en.wikipedia.org/wiki/Issue_tracking_system">bug reports</a> and organize workflows to resolve them. We have <a href="http://en.wikipedia.org/wiki/Test-driven_development">test-driven development</a> and <a href="http://en.wikipedia.org/wiki/Test_automation">test automation</a> and <a href="http://en.wikipedia.org/wiki/Unit_testing">unit testing</a> and <a href="http://en.wikipedia.org/wiki/Continuous_integration">continuous integration</a>. If I check in bad code today, I <a href="http://nathanbrixius.wordpress.com/2011/01/07/dont-break-the-build/">break the build</a>, suffer a bit of public humiliation, and fix it quickly so my co-workers can get on with their work.</div>
<div>
<br /></div>
<div>
I miss the simplicity of the past, and the feeling of membership in a priesthood, but it's still better to work in a field that can have a real positive impact on human life. In today's work environment that impact is enormously more feasible.</div>
</div>
Will Warehttp://www.blogger.com/profile/00852978068817644702noreply@blogger.com0tag:blogger.com,1999:blog-9667563.post-2452760336936127902014-04-13T16:53:00.004-07:002014-08-22T07:50:42.918-07:00The whole Heartbleed thing<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="color: #4e5665; font-family: Georgia, Times New Roman, serif;"><span style="background-color: #fafbfb; line-height: 14.079999923706055px;">Lots of times, these reports are much more about theoretical possibilities than real events. The nature of this vulnerability is that attackers can get peeks at blocks of memory in servers. That memory is changing all the time as the server is doing stuff. It's a possibility that the block of memory happens to have a copy of your password or other information when the attacker grabs it.</span></span><br />
<span style="color: #4e5665; font-family: Georgia, Times New Roman, serif;"><span style="background-color: #fafbfb; line-height: 14.079999923706055px;"><br /></span></span>
<span style="color: #4e5665; font-family: Georgia, Times New Roman, serif;"><span style="background-color: #fafbfb; line-height: 14.079999923706055px;">Criminals who do these kinds of attacks will act on anything they find very quickly, because they know that victims will respond quickly by changing passwords, shutting off credit cards, etc. They would leave evidence if it had happened in any significant numbers, and there are places you could reliably find that evidence discussed (<a href="https://www.schneier.com/blog/archives/2014/04/heartbleed.html">Bruce Schneier's blog</a>, the <a href="https://www.eff.org/deeplinks/2014/04/wild-heart-were-intelligence-agencies-using-heartbleed-november-2013">EFF website</a>) and the only mention is that certain big government agencies probably exploited the vulnerability, but it appears criminals probably haven't done so. The vulnerability existed for two years before it was publicly announced.</span></span><br />
<span style="color: #4e5665; font-family: Georgia, Times New Roman, serif;"><span style="background-color: #fafbfb; line-height: 14.079999923706055px;"><br /></span></span>
<span style="color: #4e5665; font-family: Georgia, Times New Roman, serif;"><span style="background-color: #fafbfb; line-height: 14.079999923706055px;">So the NSA has your passwords, but they probably had them anyway. The big question is, what information do you feel you MUST protect? Financials: online banking stuff, or credit card stuff, or your Paypal account, or the online access to your IRA or H&R Block. Medical: your doctor's patient portal website, any logins you have with hospitals or medical centers. Dating websites? Sexual fetish websites? I think I've exhausted the limits of my paltry imagination.</span></span><br />
<span style="color: #4e5665; font-family: Georgia, Times New Roman, serif;"><span style="background-color: #fafbfb; line-height: 14.079999923706055px;"><br /></span></span>
<span style="color: #4e5665; font-family: Georgia, Times New Roman, serif;"><span style="background-color: #fafbfb; line-height: 14.079999923706055px;">Those would be good passwords to change. You probably don't need to change your Facebook password, unless you're worried that NSA employees will get drunk and trash your Farmville farm.</span></span><br />
<span style="color: #4e5665; font-family: Georgia, Times New Roman, serif;"><span style="background-color: #fafbfb; line-height: 14.079999923706055px;"><br /></span></span>
<span style="color: #4e5665; font-family: Georgia, Times New Roman, serif;"><span style="background-color: #fafbfb; line-height: 14.079999923706055px;">More information at <a href="http://heartbleed.com/">http://heartbleed.com/</a> but it tends to run to the rather technical. You can test any website's vulnerability using the tool at <a href="http://filippo.io/Heartbleed/">http://filippo.io/Heartbleed/</a>.</span></span><br />
<span style="color: #4e5665; font-family: Georgia, Times New Roman, serif;"><span style="background-color: #fafbfb; line-height: 14.079999923706055px;"><br /></span></span>
<span style="color: #4e5665; font-family: Georgia, Times New Roman, serif;"><span style="background-color: #fafbfb; line-height: 14.079999923706055px;">Heartbleed is a buffer exploit, illustrated at <a href="http://xkcd.com/1354/">http://xkcd.com/1354/</a>. You tell the server you want some information which should be X letters long, but you ask for a much larger X, so that you get extra information from the server memory following what you asked for. The extra information might contain passwords and other profitable secrets.</span></span><br />
<span style="color: #4e5665; font-family: Georgia, Times New Roman, serif;"><span style="background-color: #fafbfb; line-height: 14.079999923706055px;"><br /></span></span>
<span style="color: #4e5665; font-family: Georgia, Times New Roman, serif;"><span style="background-color: #fafbfb; line-height: 14.079999923706055px;">Buffer exploits have been understood for years. What is supposed to happen is that the server's software should reject the too-large X value, but this stuff is programmed by fallible humans. <a href="http://blog.cryptographyengineering.com/2014/04/attack-of-week-openssl-heartbleed.html">Here</a> is a very good (but pretty technical) explanation of the programming mistake.</span></span></div>
Will Warehttp://www.blogger.com/profile/00852978068817644702noreply@blogger.com2tag:blogger.com,1999:blog-9667563.post-83082965022240921002013-12-11T09:16:00.002-08:002013-12-11T09:17:49.053-08:00ZeroMQ solves important problems<div dir="ltr" style="text-align: left;" trbidi="on">
<a href="http://zeromq.org/">ZeroMQ</a> solves <a href="http://zeromq.org/whitepapers:multithreading-magic">big problems</a> in concurrent programming. It does this by ensuring that state is never shared between threads/processes, and the way it ensures that is by passing messages through queues dressed up as POSIX sockets. You can download ZeroMQ <a href="http://zeromq.org/area:download">here</a>.<br />
<br />
The trouble with concurrency arises when state or resources are shared between multiple execution threads. Even if the shared state is only a single bit, you immediately run into the <a href="http://en.wikipedia.org/wiki/Test-and-set">test-and-set</a> problem. As more state is shared, a profusion of <a href="http://en.wikipedia.org/wiki/Lock_(computer_science)">locks</a><span id="goog_793285955"></span><span id="goog_793285956"></span><a href="http://www.blogger.com/"></a> grows exponentially. This business of using locks to identify critical sections of code and protect resources has a vast computer science literature, which tells you that it's a hard problem.<br />
<br />
Attempted solutions to this problem have included locks, monitors, semaphores, and mutexes. Languages (like <a href="http://docs.python.org/3/library/concurrency.html">Python</a> or <a href="http://en.wikipedia.org/wiki/Java_concurrency">Java</a>) have assumed the responsibility of packaging these constructs. But if you've actually attempted to write multithreaded programs, you've seen the nightmare it can be. These things don't scale to more than a few threads, and the human mind is unable to consider all the possible failure modes that can arise.<br />
<br />
Perhaps the sanest way to handle concurrency is via <a href="http://en.wikipedia.org/wiki/Message_passing">shared-nothing message passing</a>. The fact that no state is shared means that we can forget about locks. Threads communicate via queues, and it's not so difficult to build a system of queues that hide their mechanics from the threads that use them. This is exactly what ZeroMQ does, providing <a href="http://zeromq.org/bindings:_start">bindings</a> for C, Java, Python, and dozens of other languages.<br />
<br />
For decades now, programming languages have attempted to provide concurrency libraries with various strengths and weaknesses. Perhaps concurrency should have been identified as a language-neutral concern long ago. If that's the case, then the mere existence of ZeroMQ is progress.<br />
<br />
Here are some ZeroMQ <a href="https://github.com/imatix/zguide/tree/master/examples">working examples</a>. There's also a nice <a href="http://zguide.zeromq.org/page:all">guide</a> online, also available in book form from <a href="http://www.amazon.com/ZeroMQ-Messaging-Applications-Pieter-Hintjens/dp/1449334067">Amazon</a> and <a href="http://shop.oreilly.com/product/0636920026136.do">O'Reilly</a>.</div>
Will Warehttp://www.blogger.com/profile/00852978068817644702noreply@blogger.com0tag:blogger.com,1999:blog-9667563.post-8276566187879613222013-11-23T09:31:00.000-08:002013-11-23T17:52:15.447-08:00What's up with Docker?<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj9eVvQwEngmkaiLv2X3a7KaQNmPMv7QRru2U-GSGFIrVk-LHOroxBP5YcLPcwv_uSxP6VPvhsN2rLKat4S11qZKzFtUlquy3nHz36_1usHGDFaAsjysptD9yDAO5lPTryqzEqSIA/s1600/docker-top-logo.png" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj9eVvQwEngmkaiLv2X3a7KaQNmPMv7QRru2U-GSGFIrVk-LHOroxBP5YcLPcwv_uSxP6VPvhsN2rLKat4S11qZKzFtUlquy3nHz36_1usHGDFaAsjysptD9yDAO5lPTryqzEqSIA/s1600/docker-top-logo.png" /></a></div>
I've been hearing about <a href="http://www.docker.io/">Docker</a> lately. Fair disclosure: I am no Docker expert. I've just <a href="https://github.com/wware/stuff/tree/master/hack-docker">tinkered with it a little bit</a> so far and this post is part of my process of getting acquainted with it, and I'll probably update this post if I learn anything noteworthy.<br />
<br />
It seems to be an interesting and useful wrapper for <a href="http://en.wikipedia.org/wiki/LXC">Linux Containers</a>, a relatively new feature of the Linux kernel. Docker tries to solve the problem of providing a uniform execution environment across development and production.<br />
<br />
In the Python world, <a href="http://www.virtualenv.org/en/latest/">virtualenv</a> and <a href="http://www.pip-installer.org/en/latest/">pip</a> create a sandbox with specific version numbers for various Python packages, regardless of what may be installed globally on the machine. Docker creates a sandbox of an entire Linux environment, much like a virtual machine, but much lighter-weight than a virtual machine.<br />
<br />
Docker instances start in fractions of a second and occupy vastly smaller resources on your laptop or server than a virtual machine would. These days I work on a Macbook and run Linux in a <a href="https://www.virtualbox.org/">virtual machine</a>, and I'm told it will be practical to simultaneously run multiple Docker instances in the VM. So if you're somebody who's thought it would be fun to write software to run on multiple computers on a network but you haven't had the actual computers available, Docker is for you. I'm interested in <a href="http://redis.io/">Redis</a> as a distributed task queue.</div>
Will Warehttp://www.blogger.com/profile/00852978068817644702noreply@blogger.com0tag:blogger.com,1999:blog-9667563.post-42690168203437434182013-10-31T15:35:00.000-07:002014-01-16T10:25:52.685-08:00Some favorite crowd-funded projects<div dir="ltr" style="text-align: left;" trbidi="on">
There is a lot going on with crowd-funding these days. Over the past year or so, it has become huge. One might venture to say that it is a significant source of innovation in science, technology and art. Obviously there will be projects that cannot be crowd-funded; it is difficult to imagine a successfully crowd-funded Mars mission or cancer cure. But the space of feasible new projects is vast, and what follow are a few of my favorite crowd-funded projects.<br />
<br />
But first, there is a <a href="http://techcrunch.com/2013/10/23/crowdfunding-by-unaccredited-investors/">recent noteworthy development</a> from the <a href="http://www.sec.gov/">SEC</a>: previously allowed only to hand out rewards, crowd-funding campaigns will soon be able to award equity too. Equity had thus far been only for <a href="http://www.sec.gov/answers/accred.htm">accredited investors</a>, people with buckets of spare money in their garages and garden sheds. The possibility of investing in a successful venture rather than simply receiving a toy and a good feeling might make the already-fascinating crowd-funding scene a much more interesting place. It could play an important role in economic recovery.<br />
<br />
<b>OCULUS RIFT</b><br />
<br />
The <a href="http://www.oculusvr.com/">Oculus Rift</a> is a virtual-reality headset representing an enormous improvement in performance-to-price ratio. The head tracking is smooth and the graphics are good. This is one of the first crowd-funded projects I heard about, and the first one I contributed to. For $300, I got a headset with a very entertaining demo, and if I get up the energy I will do something myself with science education.<br />
<br />
By getting in early and having a huge success, the Oculus Rift set a precedent for big splashy projects, and probably helped Kickstarter as much as Kickstarter helped Oculus.<br />
<br />
<b>CastAR from TECHNICAL ILLUSIONS</b><br />
<br />
<a href="http://technicalillusions.com/">CastAR</a> is another virtual reality gadget, this time a pair of glasses that project an image onto a retroreflective surface in front of the user. One big innovation here is that the virtual reality can be mixed with actual reality, for instance using game pieces or other objects. Also, because the user is looking at things some distance away, eye strain is reduced. The head-tracking on CastAR follows both rotation and translation where the Oculus Rift only follows rotation.<br />
<br />
<b>BLEDUINO</b><br />
<br />
This is a <a href="http://bleduino.cc/">Bluetooth-enabled Arduino board</a>. Arduino is a cheap easy-to-use controller board for hobbyist projects and art installations. With Bluetooth, whatever you're building can connect to a phone or tablet.<br />
<br />
<b>ESPRUINO</b><br />
<br />
The <a href="http://www.espruino.com/">Espruino</a> is another Arduino-based controller board. What's unique is that it is designed to operate with a language called <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript">JavaScript</a>, which has been used in web browsers for a long time but has slowly been gaining momentum as a hardware control language.<br />
<br />
<b>CHINEASY</b><br />
<br />
This is <a href="http://chineasy.org/">an instructional program</a> to teach yourself Mandarin. There are flashcards and animations to learn the written characters, and audio materials to learn the spoken language.<br />
<br />
<b>STAR TREK: RENEGADES</b><br />
<br />
If you miss the pre-J-J-Abrams Star Trek franchise, this is for you. <a href="http://www.imdb.com/title/tt2621446/">This movie</a> brings back Walter Koenig (Chekhov from the original series) with several actors from Star Trek: Voyager. It is set ten years after Voyager's return to human space, and politics and hilarity ensue.<br />
<br />
<b>PEBBLE SMARTWATCH</b><br />
<br />
Another big success story, <a href="https://getpebble.com/">the Pebble</a> can now be purchased for $150 at Best Buy. It connects to your phone and can run Android apps on a very small screen. It has a magnetometer (compass), a three-axixs accelerometer, Bluetooth, ambient light sensors, a 144x168-pixel screen, and a week of battery life between charges. It connects via Bluetooth to your phone so the phone can stay in your pocket most of the time.<br />
<br />
<hr />
<br />
My long list below includes some projects that were already funded and have gained significant fame, like the Oculus Rift virtual reality headset, or the Pebble smartwatch now available at Best Buy.<br />
<h3>
Random projects</h3>
<ul>
<li><a href="http://www.kickstarter.com/projects/shaolanchineasy/chineasy-begins-0?ref=activity">Chineasy: The easiest way to learn Chinese by ShaoLan Hsueh — Kickstarter</a></li>
<li><a href="http://www.kickstarter.com/projects/tanttle/emotiv-insight-optimize-your-brain-fitness-and-per?ref=activity">EMOTIV INSIGHT: Optimize your brain fitness & performance by Tan Le — Kickstarter</a></li>
<li><a href="http://www.kickstarter.com/projects/821885354/animating-vasimr-the-future-of-spaceflight?ref=activity">Animating VASIMR®: The Future of Spaceflight by Ad Astra Rocket Company — Kickstarter</a></li>
<li><a href="http://www.indiegogo.com/projects/15mm-norse-irish-842-ad-1300-ad">15mm Norse Irish 842 AD-1300 AD | Indiegogo</a></li>
<li><a href="http://www.indiegogo.com/projects/why-am-i-so-fat-fundraiser--2">Why Am I So Fat? Fundraiser | Indiegogo</a></li>
<li><a href="http://www.indiegogo.com/projects/sigmo-talk-and-understand-in-more-than-25-languages">SIGMO - talk and understand in more than 25 languages!! | Indiegogo</a></li>
<li><a href="http://www.indiegogo.com/projects/star-trek-renegades">Star Trek: Renegades | Indiegogo</a></li>
<li><a href="http://www.indiegogo.com/projects/sprayable-energy">Sprayable Energy | Indiegogo</a></li>
<li><a href="http://www.indiegogo.com/projects/the-golem-of-havana-a-new-musical">THE GOLEM OF HAVANA, a new musical | Indiegogo</a></li>
<li><a href="http://www.indiegogo.com/projects/the-study-of-happiness">The Study of Happiness | Indiegogo</a></li>
<li><a href="http://www.kickstarter.com/projects/projecthexapod/stompy-the-giant-rideable-walking-robot-0">Stompy: The Giant, Rideable Walking Robot by Project Hexapod — Kickstarter</a></li>
<li><a href="http://www.kickstarter.com/projects/aresinstituteinc/lunarsail-the-worlds-first-crowdsourced-solar-sail?ref=card">LUNARSAIL: An Open-Source Cubesat & Solar Sail Lunar Orbiter by Matthew Travis — Kickstarter</a></li>
<li><a href="http://www.kickstarter.com/projects/1483824574/kapture-the-audio-recording-wristband?ref=category">Kapture: the audio-recording wristband by Kapture — Kickstarter</a></li>
<li><a href="http://www.kickstarter.com/projects/geartag/geartag-keep-track-of-your-gear?ref=category">GearTag - Keep track of your gear by GearTag — Kickstarter</a></li>
<li><a href="http://www.kickstarter.com/projects/254449872/pixy-cmucam5-a-fast-easy-to-use-vision-sensor?ref=category">Pixy (CMUcam5): a fast, easy-to-use vision sensor by Charmed Labs and Carnegie Mellon — Kickstarter</a></li>
<li><a href="http://www.kickstarter.com/projects/2025809969/the-new-ideological-footprint-project?ref=category">The New Ideological Footprint Project by James Addoms — Kickstarter</a></li>
<li><a href="http://www.kickstarter.com/projects/fabulas/fabulas-inspiring-the-world?ref=category">FABULAS - Inspiring the World by Steve Brodie — Kickstarter</a></li>
</ul>
<h3>
Phone and tablet</h3>
<ul>
<li><a href="http://www.kickstarter.com/projects/968523355/micro-phone-lens-cell-phone-based-microscope">Micro Phone Lens: Cell Phone Based Microscope by Thomas Larson — Kickstarter</a></li>
<li><a href="http://www.indiegogo.com/projects/enfojer-portable-smartphone-photographic-enlarger">ENFOJER - Portable Smartphone Photographic Enlarger | Indiegogo</a></li>
<li><a href="http://www.kickstarter.com/projects/597507018/pebble-e-paper-watch-for-iphone-and-android">Pebble: E-Paper Watch for iPhone and Android by Pebble Technology — Kickstarter</a></li>
<li><a href="http://www.kickstarter.com/projects/hunterleesoik/shadow-community-of-dreamers?ref=friends_backed">SHADOW | Community of Dreamers by hunter lee soik — Kickstarter</a></li>
<li><a href="http://www.indiegogo.com/projects/hexoskin-wearable-body-metrics">Hexoskin: wearable body metrics | Indiegogo</a></li>
<li><a href="http://www.kickstarter.com/projects/1663146472/isketchnote-from-pen-and-paper-to-your-ipad?ref=category">iSketchnote: from pen and paper to your iPad! by ISKN Team — Kickstarter</a></li>
<li><a href="http://www.indiegogo.com/projects/chargergenie">ChargerGenie | Indiegogo</a></li>
</ul>
<h3>
Electronics and computers</h3>
<ul>
<li><a href="http://www.kickstarter.com/projects/1608192864/rfduino-iphone-bluetooth-40-arduino-compatible-boa?ref=activity">Shrunk down an Arduino to the size of a finger-tip! by Open Source RF — Kickstarter</a></li>
<li><a href="http://www.kickstarter.com/projects/cloud-guys/plug-the-brain-of-your-devices?ref=activity">Lima: the brain of your devices by The CGC team — Kickstarter</a></li>
<li><a href="http://www.kickstarter.com/projects/2021474419/flutter-20-wireless-arduino-with-half-mile-1km-ran">Flutter: $20 Wireless Arduino with half mile (1km) range. by Flutter Wireless — Kickstarter</a></li>
<li><a href="http://www.kickstarter.com/projects/652945597/red-pitaya-open-instruments-for-everyone?ref=thanks">Red Pitaya: Open instruments for everyone by Red Pitaya — Kickstarter</a></li>
<li><a href="http://www.adapteva.com/products/eval-kits/parallella/">The Parallella Computer | Adapteva</a></li>
<li><a href="http://www.kickstarter.com/projects/swiftnav/piksi-the-rtk-gps-receiver?ref=activity">Piksi : The RTK GPS Receiver by Swift Navigation Inc. — Kickstarter</a></li>
<li><a href="http://www.kickstarter.com/projects/kytelabs/bleduino-bluetooth-40-ble-made-easy-arduino-compat?ref=activity">BLEduino: Bluetooth 4.0 (BLE) made easy (Arduino Compatible) by Kytelabs — Kickstarter</a></li>
<li><a href="http://www.indiegogo.com/projects/rocket-droid-pc-the-worlds-most-powerful-android-hdmi-tv-dongle">Rocket Droid Pc - The Worlds most powerful Android HDMI TV Dongle! | Indiegogo</a></li>
<li><a href="http://www.kickstarter.com/projects/48651611/espruino-javascript-for-things?ref=category">Espruino: JavaScript for Things by Gordon Williams — Kickstarter</a></li>
<li><a href="http://www.kickstarter.com/projects/311408456/rgb-123-led-matrices?ref=category">RGB-123 Led Matrices by Ryan O'Hara — Kickstarter</a></li>
<li><a href="http://www.kickstarter.com/projects/manukamakers/precision-gyroscope?ref=category">Precision Gyroscope by Manuka Makers — Kickstarter</a></li>
<li><a href="http://www.indiegogo.com/projects/auranova-the-only-bluetooth-necklace-headset-for-women">Auranova: The Only Bluetooth Necklace Headset for Women | Indiegogo</a></li>
<li><a href="http://www.kickstarter.com/projects/1368497725/massive-log-data-aggregation-processing-and-visual?ref=card">Massive Log Data Aggregation, Processing and Visualization by Israel Ekpo — Kickstarter</a></li>
<li><a href="http://www.kickstarter.com/projects/203272607/gnustep-project?ref=category">GNUstep Project by Gregory Casamento — Kickstarter</a></li>
<li><a href="http://www.kickstarter.com/projects/noflo/noflo-development-environment?ref=category">NoFlo Development Environment by The Grid — Kickstarter</a></li>
<li><a href="http://www.kickstarter.com/projects/robokindrobotics/zeno-r25-first-affordable-advanced-social-robot?ref=friends_backed">ZENO R25 - First Affordable Advanced Social Robot by RoboKind — Kickstarter</a></li>
</ul>
<h3>
Robots and Flying Things</h3>
<ul>
<li><a href="http://www.kickstarter.com/projects/1387330585/hex-a-copter-that-anyone-can-fly?ref=activity">Hex: A copter that anyone can fly! by Benjamin Black — Kickstarter</a></li>
<li><a href="http://www.kickstarter.com/projects/michaellaine/space-elevator-science-climb-to-the-sky-a-tethered?ref=activity">Space Elevator Science - Climb to the Sky - A Tethered Tower by Michael Laine — Kickstarter</a></li>
<li><a href="http://www.kickstarter.com/projects/914887915/spiri?ref=activity">Spiri, a programmable flying robot by Patrick Edwards-Daugherty — Kickstarter</a></li>
<li><a href="http://www.indiegogo.com/projects/sky-drone-fpv">Sky Drone FPV | Indiegogo</a></li>
</ul>
<h3>
Gaming</h3>
<ul>
<li><a href="http://www.kickstarter.com/projects/1153369046/play-ar?ref=friends_backed">Play AR by mark skwarek — Kickstarter</a></li>
<li><a href="http://www.kickstarter.com/projects/haptix/haptix-multitouch-reinvented?ref=activity">Haptix: Multitouch Reinvented by Haptix Touch — Kickstarter</a></li>
<li><a href="http://www.kickstarter.com/projects/danshapiro/robot-turtles-the-board-game-for-little-programmer">Robot Turtles: The Board Game for Little Programmers by Dan Shapiro — Kickstarter</a></li>
<li><a href="http://www.kickstarter.com/projects/technicalillusions/castar-the-most-versatile-ar-and-vr-system">castAR: the most versatile AR & VR system by Technical Illusions - Kickstarter</a></li>
<li><a href="http://www.kickstarter.com/projects/1523379957/oculus-rift-step-into-the-game">Oculus Rift: Step Into the Game by Oculus - Kickstarter</a></li>
</ul>
<h3>
Maker stuff</h3>
<ul>
<li><a href="http://www.kickstarter.com/projects/202240847/makerswarm-an-authoring-tool-for-the-internet-of-e?ref=friends_backed">MakerSwarm- An Authoring Tool for the Internet of Everything by MAYA Design Inc. — Kickstarter</a></li>
<li><a href="http://www.kickstarter.com/projects/formlabs/form-1-an-affordable-professional-3d-printer?ref=activity">FORM 1: An affordable, professional 3D printer by Formlabs — Kickstarter</a></li>
<li><a href="http://www.kickstarter.com/projects/pirate3d/the-buccaneer-the-3d-printer-that-everyone-can-use?ref=activity">The Buccaneer® - The 3D Printer that Everyone can use! by Pirate3D Inc — Kickstarter</a></li>
<li><a href="http://www.kickstarter.com/projects/45699157/fuel3d-a-handheld-3d-scanner-for-less-than-1000?ref=activity">Fuel3D: A handheld 3D scanner for less than $1000 by Fuel3D Inc. — Kickstarter</a></li>
<li><a href="http://www.kickstarter.com/projects/volumental/the-3d-scan-to-print-web-app?ref=activity">The 3D Scan-to-Print Web App by Volumental — Kickstarter</a></li>
<li><a href="http://www.kickstarter.com/projects/327919589/the-microfactory-a-machine-shop-in-a-box">The Microfactory: A machine shop in a box by Mebotics LLC — Kickstarter</a></li>
<li><a href="http://www.kickstarter.com/projects/1351910088/3doodler-the-worlds-first-3d-printing-pen">3Doodler: The World's First 3D Printing Pen by WobbleWorks LLC. — Kickstarter</a></li>
<li><a href="http://www.the3doodler.com/">3Doodler — pre-order yours here</a></li>
<li><a href="http://www.kickstarter.com/projects/1410146982/zim-the-first-dual-head-personal-3d-printer-fully?ref=category">Zim, the first dual head WiFi 3D printer fully plug & play by Zeepro — Kickstarter</a></li>
<li><a href="http://www.indiegogo.com/projects/fabtotum-personal-fabricator">FABtotum Personal Fabricator | Indiegogo</a></li>
</ul>
Here's an interesting list of crowd-funding resources: <a href="http://crowdfundingforum.com/showthread.php/6748-List-of-All-Crowdfunding-Sites-and-Platforms-Ever-Expanding">http://crowdfundingforum.com/showthread.php/6748-List-of-All-Crowdfunding-Sites-and-Platforms-Ever-Expanding</a><br />
<br />
The shortened URL for this post is <a href="http://goo.gl/ehfBQb">http://goo.gl/ehfBQb</a>.<br />
<ul>
</ul>
</div>
Will Warehttp://www.blogger.com/profile/00852978068817644702noreply@blogger.com0tag:blogger.com,1999:blog-9667563.post-25079097978988622612013-10-25T04:46:00.004-07:002016-02-24T10:37:54.050-08:00Bar Camp Boston 2013 talk on automation of science<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="separator" style="clear: both; text-align: center;">
<a href="http://3278as3udzze1hdk0f2th5nf18c1.wpengine.netdna-cdn.com/wp-content/uploads/2010/03/adam-robot-scientist.jpg" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><span style="font-family: inherit;"></span></a></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="http://www.wired.com/images_blogs/wiredscience/2011/04/robot-scientist-adam-ross-king-aberystwyth.jpg" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" src="http://www.wired.com/images_blogs/wiredscience/2011/04/robot-scientist-adam-ross-king-aberystwyth.jpg" height="213" width="320" /></a></div>
<span style="font-family: inherit;">This is an outline for a talk I gave at <a href="http://www.barcampboston.org/">Bar Camp Boston 8</a> on the automation of science. It's a topic I've blogged and spoken about before. The shortened URL for this post is <a href="http://goo.gl/rv3Xik">http://goo.gl/rv3Xik</a>.</span><br />
<span style="font-family: inherit;"><br /></span>
<span style="font-family: inherit;">In 2004, a <a href="http://en.wikipedia.org/wiki/Robot_Scientist">robot named Adam</a> became the first machine in history to discover new scientific knowledge independently of its human creators. Without human guidance, Adam can create hypotheses to explain observations, design experiments to test those hypotheses, run the experiments using laboratory robotics, interpret the experimental results, and repeat the cycle to generate new knowledge. The principal investigator on the Adam project was <a href="http://www.mib.ac.uk/people/staffprofile/KingR.aspx">Ross King</a>, now at Manchester University, who published a paper on the automation of science (<a href="http://commonsenseatheism.com/wp-content/uploads/2011/02/King-The-Automation-of-Science.pdf">PDF</a>) in 2009. Some of his other publications: <a href="http://bioinformatics.oxfordjournals.org/content/22/14/e464.full.pdf">1</a>, <a href="http://www.bioontology.org/sites/default/files/on%20the%20fomalization%20and%20reuse.pdf">2</a>, <a href="http://ceur-ws.org/Vol-611/paper10.pdf">3</a>.</span><br />
<span style="font-family: inherit;"><br /></span>
<span style="font-family: inherit;">Adam works in a very limited domain, in nearly complete isolation. There is plenty of laboratory automation but (apart from Adam) we don't yet have meaningful computer participation in the theoretical aspect of scientific work. A worldwide scientific collaboration of human and computer theoreticians working with human and computer experimentalists could advance science and medicine and solve human problems faster.</span><br />
<span style="font-family: inherit; line-height: 1.15; white-space: pre-wrap;"><br /></span>
<span style="font-family: inherit; line-height: 1.15; white-space: pre-wrap;">The first step is to formulate a <a href="http://en.wikipedia.org/wiki/Linked_data">linked</a> language of science that <a href="http://en.wikipedia.org/wiki/Knowledge_representation">machines can understand</a>. Publish papers in formats like </span><a href="http://www.w3.org/TeamSubmission/turtle/" style="font-family: inherit; line-height: 1.15; white-space: pre-wrap;">RDF/Turtle</a><span style="font-family: inherit; line-height: 1.15; white-space: pre-wrap;"> or </span><a href="http://www.json.org/" style="font-family: inherit; line-height: 1.15; white-space: pre-wrap;">JSON</a><span style="font-family: inherit; line-height: 1.15; white-space: pre-wrap;"> or <a href="http://json-ld.org/">JSON-LD</a> or </span><a href="http://yaml.org/" style="font-family: inherit; line-height: 1.15; white-space: pre-wrap;">YAML</a><span style="font-family: inherit; line-height: 1.15; white-space: pre-wrap;">. Link scientific literature to existing semantic networks (</span><a href="http://dbpedia.org/About" style="font-family: inherit; line-height: 1.15; white-space: pre-wrap;">DBpedia</a><span style="font-family: inherit; line-height: 1.15; white-space: pre-wrap;">, </span><a href="http://www.freebase.com/" style="font-family: inherit; line-height: 1.15; white-space: pre-wrap;">Freebase</a><span style="font-family: inherit; line-height: 1.15; white-space: pre-wrap;">, </span><a href="http://www.google.com/insidesearch/features/search/knowledge.html" style="font-family: inherit; line-height: 1.15; white-space: pre-wrap;">Google Knowledge Graph</a><span style="font-family: inherit; line-height: 1.15; white-space: pre-wrap;">, </span><a href="http://linkeddata.org/" style="font-family: inherit; line-height: 1.15; white-space: pre-wrap;">LinkedData.org</a><span style="font-family: inherit; line-height: 1.15; white-space: pre-wrap;">, <a href="http://schema.org/">Schema.org</a> etc). <a href="http://www.schema.org/docs/extension.html">Create schemas</a> for scientific domains and for the </span><a href="https://en.wikipedia.org/wiki/Scientific_method" style="font-family: inherit; line-height: 1.15; white-space: pre-wrap;">scientific method</a><span style="font-family: inherit; line-height: 1.15; white-space: pre-wrap;"> (hypotheses, predictions, experiments, data). Provide tutorials, tools and incentives to encourage researchers to publish machine-tractable papers. Create a distributed <a href="http://en.wikipedia.org/wiki/Graph_database">graph</a> or database of these papers, in the role of scientific journals, accessible to people and machines everywhere. Maybe use </span><a href="http://stackoverflow.com/" style="font-family: inherit; line-height: 1.15; white-space: pre-wrap;">Stackoverflow</a><span style="font-family: inherit; line-height: 1.15; white-space: pre-wrap;"> as a model for <a href="http://en.wikipedia.org/wiki/Peer_review">peer review</a>.</span><br />
<span style="font-family: inherit;"><br /></span>
<span style="font-family: inherit;">Begin with very limited scientific domains (</span><a href="https://en.wikipedia.org/wiki/List_of_physics_concepts_in_primary_and_secondary_education_curricula" style="font-family: inherit;">high school physics</a><span style="font-family: inherit;">, </span><a href="https://en.wikipedia.org/wiki/General_chemistry" style="font-family: inherit;">high school chemistry</a><span style="font-family: inherit;">) to avoid the full complexity and political wrangling of the professional scientific community in the initial stages. As this stuff approaches readiness for professional work, deploy it first in the domain of computer science and other scientific domains where it can hope to avoid overwhelming resistance.</span><br />
<span style="font-family: inherit; white-space: pre-wrap;"><br /></span>
<span style="font-family: inherit; white-space: pre-wrap;">Machine learning algorithms (</span><a href="http://en.wikipedia.org/wiki/Cluster_analysis" style="font-family: inherit; white-space: pre-wrap;">clustering</a><span style="font-family: inherit; white-space: pre-wrap;">, </span><a href="http://en.wikipedia.org/wiki/Statistical_classification" style="font-family: inherit; white-space: pre-wrap;">classification</a><span style="font-family: inherit; white-space: pre-wrap;">, </span><a href="http://en.wikipedia.org/wiki/Regression_analysis" style="font-family: inherit; white-space: pre-wrap;">regression</a><span style="font-family: inherit; white-space: pre-wrap;">) can find patterns in data and help to identify useful abstractions. </span><a href="http://en.wikipedia.org/wiki/Supervised_learning" style="font-family: inherit; white-space: pre-wrap;">Supervised learning</a><span style="font-family: inherit; white-space: pre-wrap;"> algorithms can provide tools of collaboration between people and computers.</span><br />
<span style="font-family: inherit;"><span style="vertical-align: baseline; white-space: pre-wrap;"><br /></span>
<span style="white-space: pre-wrap;">The computational chemistry folks have <a href="http://openbabel.org/wiki/Main_Page">a cool little program called Babel</a> which translates between a large number of different file formats for representing molecular structures. It does this with a rich internal representation of structures, and pluggable read and write modules for each file format. At some point, something like this for different file formats of scientific literature might become useful, and might help to build consensus among different approaches.</span></span><br />
<span style="font-family: inherit;"><span style="white-space: pre-wrap;"><br /></span></span>
<span style="font-family: inherit;"><span style="white-space: pre-wrap;">A treasure trove would be available in <a href="http://willware.blogspot.com/2012/11/a-semantic-network-of-patient-data.html">linked patient data</a>. In the United States this is problematic because of the privacy restrictions associated with <a href="http://en.wikipedia.org/wiki/Health_Insurance_Portability_and_Accountability_Act">HIPAA</a> regulation. In countries like Iceland and Norway which have <a href="http://en.wikipedia.org/wiki/Universal_health_care">universal health care</a>, there would be no equivalent of HIPAA, and those would be good places to initiate a Linked Patient Data project.</span></span></div>
Will Warehttp://www.blogger.com/profile/00852978068817644702noreply@blogger.com0tag:blogger.com,1999:blog-9667563.post-15853645378168301642013-10-17T11:28:00.000-07:002013-10-17T11:31:01.093-07:00The first neon sign I've ever wanted to own<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="separator" style="clear: both; text-align: center;">
<a href="http://upload.wikimedia.org/wikipedia/commons/1/18/Bayes'_Theorem_MMB_01.jpg" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" height="205" src="http://upload.wikimedia.org/wikipedia/commons/1/18/Bayes'_Theorem_MMB_01.jpg" width="320" /></a></div>
This sign appears in the Cambridge UK office of <a href="http://en.wikipedia.org/wiki/Autonomy_Corporation">Autonomy Corporation</a>. I want one. I need to talk to the people who make neon signs. There are a few online threads (<a href="http://www.quora.com/Shopping/Where-can-I-buy-the-neon-Bayes-Theorem-sign-found-in-Autonomys-Cambridge-offices">1</a>, <a href="https://plus.google.com/102786751626732213960/posts/1KerknvRCBY">2</a>) where people express curiosity about this sign.<br />
<br />
This equation is <a href="http://en.wikipedia.org/wiki/Bayes'_theorem">Bayes' Law</a>. Thomas Bayes (1701-1761) proposed it as a way to update one's beliefs based on new information. I saw this picture on a <a href="http://allendowney.blogspot.com/2011/10/all-your-bayes-are-belong-to-us.html">blog post</a> by Allen Downey, author of <a href="http://www.amazon.com/gp/product/1449370780"><i>Think Bayes</i></a>, and whom I recently had the pleasure of meeting briefly at a <a href="http://www.meetup.com/bostonpython/">Boston Python meetup</a>. Very interesting guy, also well versed in <a href="http://en.wikipedia.org/wiki/Digital_signal_processing">digital signal processing</a>, another interest shared with myself. Before the other night, I probably hadn't heard the word "<a href="http://en.wikipedia.org/wiki/Cepstrum">cepstrum</a>" in almost twenty years.<br />
<br />
Allen's blog is a cornucopia of delicious problems involving Bayes' Law and other statistical delights that I learned to appreciate while taking <a href="http://willware.blogspot.com/2007/05/6432-my-favorite-mit-course.html">6.432</a>, an MIT course on detection and estimation that I'm afraid may have been retired. The online course materials they once posted for it have been taken down.<br />
<br />
But imagine my satisfaction upon looking over <i>Think Bayes</i> and realizing that it is the missing textbook for that course! I haven't checked to see that it covers every little thing that was in 6.432, but it definitely covers the most important ideas. At a quick glance, I don't see much about <a href="http://en.wikipedia.org/wiki/Multivariate_random_variable">vectors as random variables</a>, but I think he's rightly more concerned with getting the ideas out there without the intimidation of extra mathematical complexity.</div>
Will Warehttp://www.blogger.com/profile/00852978068817644702noreply@blogger.com0tag:blogger.com,1999:blog-9667563.post-232248855859749682013-05-30T17:24:00.000-07:002013-05-30T17:25:45.858-07:00Still plugging away on the FPGA synthesizer<div dir="ltr" style="text-align: left;" trbidi="on">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhXCvxMpNE62QE1Qyf9vO0QE_ElES7P0RXKb_h6ByzDlhwQ0RCWk3iJmy4x4lL7ETjRpEMDgk2FUZQKlZzwYb1Su9WQaceikwIi-DNT2Y9IvJr-dMAv2yQcf0BD6zbjnSLVQ6Wv9Q/s1600/20130530_202053.jpg" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhXCvxMpNE62QE1Qyf9vO0QE_ElES7P0RXKb_h6ByzDlhwQ0RCWk3iJmy4x4lL7ETjRpEMDgk2FUZQKlZzwYb1Su9WQaceikwIi-DNT2Y9IvJr-dMAv2yQcf0BD6zbjnSLVQ6Wv9Q/s320/20130530_202053.jpg" width="320" /></a>I really bit off a good deal more than I could chew by trying to get that thing running as quickly as I did. A lot of what I'm doing now is going back over minute assumptions about what should work in real hardware, trying to get MyHDL's simulator to agree with Xilinx's ISE simulator (ISE Sim doesn't like datapaths wider than 32 bits) and trying to get the chip to agree with either of them. The chip seems to have a mind of its own. Very annoying.<br />
<br />
Anyway I've moved this stuff into its own <a href="https://github.com/wware/fpga-synth">Github repository</a> so you can show it to your friends and all stand around mocking it without the distraction of other software I've written over the years. So, for as long as it still doesn't work (and with, I hope, the good grace to do it behind my back), y'all can continue with that mocking. Once it actually does what it's supposed to do, all mocking must of course cease.</div>
Will Warehttp://www.blogger.com/profile/00852978068817644702noreply@blogger.com0tag:blogger.com,1999:blog-9667563.post-65143660177812876012013-05-18T08:39:00.001-07:002013-05-22T12:18:48.951-07:00My FPGA design skills are a little rustier than I thought<div dir="ltr" style="text-align: left;" trbidi="on">
Today I'm going to Makerfaire in the Bay Area. I'd had an idea percolating in my head to use an FPGA to implement fixed-point equivalents of the analog music synthesizer modules of the 1970s, and gave myself a couple of weeks to design and build a simple synthesizer. I'd been a synthesizer enthusiast in high school and college, having attended high school with the late <a href="http://m.matrixsynth.com/2010/08/rip-david-hillel-wilson-curator-of-new.html">David Hillel Wilson</a> and had many interesting discussions with him about circuit design for synthesizers, a passion he shared with his father. While he taught me what he knew about synthesizers, I taught him what I knew about electronics, and we both benefitted.<br />
<br />
Now I have to confess that since my switch to software engineering in the mid-90s, I haven't really done that much with FPGAs, but I've fooled around a couple of times with Xilinx's <a href="http://www.xilinx.com/products/design-tools/ise-design-suite/ise-webpack.htm">ISE WebPack software</a> and stumbled across <a href="http://myhdl.org/doku.php">MyHDL</a>, which dovetailed nicely with my long-standing interest in Python. So I ordered a <a href="http://papilio.cc/">Papilio board</a> and started coding up Python which would be translated into Verilog. My humble efforts appear on <a href="https://github.com/wware/stuff/tree/master/hack-myhdl">Github</a>.<br />
<ul style="text-align: left;">
<li><a href="https://github.com/wware/stuff/blob/master/hack-myhdl/wavegen.py">Waveform generator</a>, produces ramp, triangle, and variable-duty-cycle square waves</li>
<li><a href="https://github.com/wware/stuff/blob/master/hack-myhdl/amps_filters.py">"Voltage"-controlled amplifier</a></li>
<li>ADSR <a href="https://github.com/wware/stuff/blob/master/hack-myhdl/envgen.py">envelope generator</a></li>
<li>My <a href="https://github.com/wware/stuff/blob/master/hack-myhdl/output_stage.py">delta-sigma DAC, and a linear interpolator</a> between sound samples to try to reduce aliasing</li>
</ul>
There was a lot of furious activity over the two weeks before Makerfaire, which I hoped would produce something of interest, and I learned some new things, like about <a href="http://www.myhdl.org/doku.php/projects:dsx1000">delta-sigma DACs</a>. Being an impatient reader, I designed the delta-sigma DAC myself from scratch, and ended up diverging from how it's usually done. My design maintains a register with an estimate of the capacitor voltage on the RC lowpass driven by the output bit, and updates that register (requiring a multiplier because of the exp(-dt/RC) term) as it supplies bits. It works, but has a failure mode of generating small audible high frequency artifacts particularly when the output voltage is close to minimum or maximum. On the long boring flight out, I had plenty of time to think about that failure mode, and it seems to me the <a href="http://en.wikipedia.org/wiki/Delta-sigma_modulation#Digital_to_analog_conversion">classic delta-sigma design</a> would almost certainly suffer from it too. I think it could be reduced by injecting noise, breaking up the repetitive patterns that appear in the bitstream.<br />
<br />
I like Python a lot but I'm not sure I'm going to stay with the MyHDL approach. As I learn a little more about Verilog, it seems like a probably better idea to design directly in Verilog. The language doesn't look that difficult, as I study MyHDL's output, and while books on Verilog tend toward expensive, <a href="http://www.amazon.com/Introduction-to-Verilog-ebook/dp/B008TW0ZG0">some</a> of <a href="http://www.amazon.com/dp/B0051OE98Y/">them</a> are more affordable. Those books are on the Kindle, and a <a href="http://www.amazon.com/dp/0983497303/">couple</a> <a href="http://www.amazon.com/Verilog-Digital-Design-Frank-Vahid/dp/0470052627/">others</a> are affordable in paper form.<br />
<br />
MyHDL-translated designs do not implement Verilog modularity well, and I think it would be good to build up a library of Verilog modules in which I have high confidence. MyHDL's simulation doesn't always completely agree with what the Xilinx chip will do. And while MyHDL.org talks a lot about how great it is to write tests in Python, the Verilog language also provides substantial support for testing. Verilog supports signed integers, but as far I've seen, MyHDL doesn't (<span style="color: red;">this is <i>INCORRECT</i>, please see addendum below</span>), and for the fixed-point math in the synth modules, that alone would have steered me toward straight Verilog a lot sooner had I been aware of it.<br />
<br />
It appears the world of Verilog is much bigger and much more interesting than I'd originally thought. I've started to take a look at <a href="https://github.com/wware/gpl-cver">GPL Cver</a>, a Verilog interpreter that (I think) has debugger-like functions of setting breakpoints and single-stepping your design. I had been thinking about what features I'd put into a Verilog interpreter if I were writing one, and a little googling showed me that such a thing already existed. So I look forward to tinkering with CVer when I get home from Makerfaire.<br />
<br />
<i><span style="color: red;">EDIT</span></i>: Many thanks to <a href="http://www.programmableplanet.com/author.asp?section_id=2438&doc_id=250236">Jan Decaluwe</a>, the developer of MyHDL, for taking the time to personally respond to the challenges I encountered with it. Having had a couple of days to relax after the hustle and bustle of Makerfaire, and get over the disappointment of not getting my little gadget working in time, I can see that I was working in haste and neglected to give MyHDL the full credit it deserves. At the very least it explores territory that is largely uncharted, bringing modern software engineering to the HDL world where (like all those computational chemists still running Fortran code) things have tended to lag behind the times a bit.<br />
<br />
In my haste, I neglected the <a href="http://www.myhdl.org/doc/0.5.1/manual/conf-features-signed.html">documentation specifically addressing signed arithmetic</a> in MyHDL. I didn't take the time to read the docs carefully. As Jan points out in his writings and in the comment to this blog, MyHDL's approach to signed arithmetic is in fact simpler and more consistent than that of Verilog. What does signed arithmetic look like in MyHDL? It looks like this.<br />
<span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"><br /></span><span style="font-family: 'Courier New', Courier, monospace;"> # INCORRECT</span><br />
<span style="font-family: 'Courier New', Courier, monospace;"> >>> x = Signal(intbv(0)[8:])</span><br />
<span style="font-family: Courier New, Courier, monospace;"> >>> x.next = -1</span><br />
<span style="font-family: Courier New, Courier, monospace;"> Traceback (most recent call last):</span><br />
<span style="font-family: Courier New, Courier, monospace;"> ...blah blah blah...</span><br />
<span style="font-family: Courier New, Courier, monospace;"> ValueError: intbv value -1 < minimum 0</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"></span>
<span style="font-family: Courier New, Courier, monospace;"> # CORRECT, range is from min to max-1 inclusive</span><br />
<span style="font-family: Courier New, Courier, monospace;"> >>> x = Signal(intbv(0, min=-128, max=128))</span><br />
<span style="font-family: Courier New, Courier, monospace;"> >>> x.next = -1 # happy as a clam</span><br />
<br />
In the case where MyHDL's behavior appeared to diverge from that of the physical FPGA, my numerically-controlled amplifier circuit above uses one of the hardware multipliers in the XC3S500E, which multiplies two 18-bit unsigned numbers to produce a 36-bit unsigned product. When my music synthesizer was at one point unable to make any sound, I tracked it down to the amplifier circuit, which was working fine in simulation. There was already a hardware multiplier working in the delta-sigma DAC. I poked at things with a scope probe, and scratched my head and studied my code and studied other peoples' code and ultimately determined that I needed to latch the factors in registers just prior to the multiplier. Whether it's exactly that, I still can't say, but finally the amp circuit worked correctly.<br />
<br />
I wrongly concluded that it indicated some fault in MyHDL's veracity as a simulator. If it didn't work in the chip, it shouldn't have worked in simulation. But with more careful thought I can see that it's really an idiosyncrasy of the FPGA itself, or perhaps the ISE Webpack software. I would expect to run into the same issue if I'd been writing in Verilog. I might have seen it coming if I'd done post-layout simulation in Webpack, and I should probably look at doing that. Once the bits are actually inside the chip, you can only see the ones that appear on I/O pins.</div>
Will Warehttp://www.blogger.com/profile/00852978068817644702noreply@blogger.com2tag:blogger.com,1999:blog-9667563.post-32520471773344593122013-03-04T18:23:00.000-08:002013-03-10T08:04:13.337-07:00The Digi-Comp 1 rides again?<div dir="ltr" style="text-align: left;" trbidi="on">
<a href="http://abbydigital.com/images/Digicomp.jpg" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" height="169" src="http://abbydigital.com/images/Digicomp.jpg" width="320" /></a>As computer people go, I'm rather an old fart, and my favorite childhood toy was this plastic computer, the <a href="http://en.wikipedia.org/wiki/Digi-Comp_I">Digi-Comp 1</a>. See the three horizontal red things that run almost the full width? Those are <a href="http://en.wikipedia.org/wiki/Flip-flop_(electronics)">flipflops</a>, and the window on the left shows whether they are in the <a href="http://en.wikipedia.org/wiki/Bit">zero or one</a> position. The six vertical metal bars in front are <a href="http://en.wikipedia.org/wiki/AND_gate">AND gates</a>, and the little white tubes stuck onto the pegs on the fronts of the flipflops tell whether that bit is factored into the AND term. The six red plastic things on the top, together with similar stuff on the back, form three <a href="http://en.wikipedia.org/wiki/OR_gate">OR gates</a>, which drive the values of the flipflops on the next clock edge. The two white sliders on the bottom worked in opposition, providing a hand-powered two-phase clock to drive all this stuff.<br />
<br />
Over the past couple of days I placed an order with <a href="http://dangerawesome.co/">danger!awesome</a>, a laser cutter shop in Cambridge MA. They have a nifty collection of laser cutters and were happy to hear that design files are available on the <a href="http://www.thingiverse.com/">Thingiverse</a> website. So I ordered some stuff and picked it up this evening, and that was fun. I had hoped they could make me this marble binary adder, but the designer didn't supply design files they could use. So no marble adding machine for me. Darn.<br />
<div class="separator" style="clear: both; text-align: center;">
<iframe allowfullscreen='allowfullscreen' webkitallowfullscreen='webkitallowfullscreen' mozallowfullscreen='mozallowfullscreen' width='320' height='266' src='https://www.youtube.com/embed/GcDshWmhF4A?feature=player_embedded' frameborder='0'></iframe></div>
Thinking about that, my mind inevitably went back to the Digi-Comp 1. I started wondering whether I could build a Digi-Comp 1 using laser cut plywood, like the other trinkets I picked up this evening (a <a href="http://theportalwiki.com/wiki/Weighted_Companion_Cube">Companion Cube</a>, a <a href="http://www.thingiverse.com/thing:36673">desktop trebuchet</a>, a <a href="http://www.thingiverse.com/thing:36062">Shrimpbot</a>, and a few little animals). Could that be feasible? The Digi-Comp 1 was basically a <a href="http://en.wikipedia.org/wiki/Programmable_logic_array">programmable logic array</a>, which consists of two rectangular regions, one for AND gates and one for OR gates. On the Digi-Comp 1 these are respectively the front surface and the back surface of the device.<br />
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiqY-6P14uqdAvQLWsy1tx73E89T1xH9mWZR4XQwjyr93aeZg6zfx16eIYgC-ydV8aXf5y5UkjD9O2xGU_3T1EqrwqbisEQJL4lqAkJZeqDhyyvIVZZLPb5CKslljLml3hw4piViw/s1600/20130304_205512.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiqY-6P14uqdAvQLWsy1tx73E89T1xH9mWZR4XQwjyr93aeZg6zfx16eIYgC-ydV8aXf5y5UkjD9O2xGU_3T1EqrwqbisEQJL4lqAkJZeqDhyyvIVZZLPb5CKslljLml3hw4piViw/s320/20130304_205512.jpg" width="320" /></a>I thought about this for a while and came up with some very incomplete rough sketches to solve the problems of how the gates would work and how the binary values should be latched for one clock cycle. As with the Digi-Comp 1, this would be a rectangular thing with the AND plane on the front and the OR plane on the back. The flipflops would be horizontal bars along the front with two positions (left=0, right=1) and possibly the same window display that appears on the original Digi-Comp 1. The AND gates are vertical bars also on the front, connecting to vertical bars on the back. The OR bars on the back can move left and right if permitted. At a certain point in the clock cycle, the horizontal position of each OR bar is inverted with a little lever and latched as the new position for the corresponding flipflop. There is still a lot of mechanical engineering to think about. Should the bars be retracted with springs or rubber bands? There needs to be a lot of machinery to get everything to move when and where it's supposed to, and there needs to be a crank on the side to drive it. So there will be cams and gears and all sorts of fun stuff.<br />
<br />
UPDATE: I found a place called <a href="http://www.mindsontoys.com/kits.htm">Minds-On Toys</a> that is selling a Digi-Comp kit which reproduces the exact mechanical design of the original. Looks very nice, except for the labor-intensive-looking bit at the bottom about fabricating your own plastic tubes.</div>
Will Warehttp://www.blogger.com/profile/00852978068817644702noreply@blogger.com3tag:blogger.com,1999:blog-9667563.post-14936372087471753672013-02-02T11:08:00.000-08:002013-02-13T12:36:06.189-08:00Ruby and Rails and all that stuff<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: Helvetica, Arial, 'Droid Sans', sans-serif; font-size: 14px; line-height: 19.984375px;">At the suggestion of a recruiter, I'm learning Ruby on Rails this weekend. I was active on the comp.lang.python mailing list when </span><a data-mce-href="http://en.wikipedia.org/wiki/Yukihiro_Matsumoto" href="http://en.wikipedia.org/wiki/Yukihiro_Matsumoto" style="border: 0px; color: #047ac6; font-family: Helvetica, Arial, 'Droid Sans', sans-serif; font-size: 14px; line-height: 1.428571em; margin: 0px; padding: 0px;">Matz</a><span style="font-family: Helvetica, Arial, 'Droid Sans', sans-serif; font-size: 14px; line-height: 19.984375px;"> came around talking about </span><a data-mce-href="http://en.wikipedia.org/wiki/Ruby_(programming_language)" href="http://en.wikipedia.org/wiki/Ruby_(programming_language)" style="border: 0px; color: #047ac6; font-family: Helvetica, Arial, 'Droid Sans', sans-serif; font-size: 14px; line-height: 1.428571em; margin: 0px; padding: 0px;">Ruby</a><span style="font-family: Helvetica, Arial, 'Droid Sans', sans-serif; font-size: 14px; line-height: 19.984375px;">. It seemed like a good thing, but I mostly ignored Ruby for years because it seemed to be solving problems that I already had solutions for with Python. Likewise, Rails seemed to retread the same ground already covered by </span><a href="http://en.wikipedia.org/wiki/Django_(web_framework)" style="font-family: Helvetica, Arial, 'Droid Sans', sans-serif; font-size: 14px; line-height: 19.984375px;">Django</a><span style="font-family: Helvetica, Arial, 'Droid Sans', sans-serif; font-size: 14px; line-height: 19.984375px;">.</span><br />
<div style="border: 0px; font-family: Helvetica, Arial, 'Droid Sans', sans-serif; font-size: 14px; line-height: 19.984375px; margin: 0px; padding: 0px;">
<br /></div>
<div style="border: 0px; font-family: Helvetica, Arial, 'Droid Sans', sans-serif; font-size: 14px; line-height: 19.984375px; margin: 0px; padding: 0px;">
Motivated to take another look because of the wild popularity of Rails, I see there's something in Ruby that deserves attention, which is <a data-mce-href="http://www.robertsosinski.com/2008/12/21/understanding-ruby-blocks-procs-and-lambdas/" href="http://www.robertsosinski.com/2008/12/21/understanding-ruby-blocks-procs-and-lambdas/" style="border: 0px; color: #047ac6; line-height: 1.428571em; margin: 0px; padding: 0px;">blocks</a> (anonymous closures, or what Lispers would call lambda expressions). They function as <a data-mce-href="http://en.wikipedia.org/wiki/Closure_(computer_science)" href="http://en.wikipedia.org/wiki/Closure_(computer_science)" style="border: 0px; color: #047ac6; line-height: 1.428571em; margin: 0px; padding: 0px;">closures</a>, and any language that makes a closure a first-class object is a good language. There are <a data-mce-href="http://www.ruby-lang.org/en/documentation/" href="http://www.ruby-lang.org/en/documentation/" style="border: 0px; color: #047ac6; line-height: 1.428571em; margin: 0px; padding: 0px;">a ton of good Ruby tutorials</a>. I myself am partial to <a data-mce-href="http://www.ruby-lang.org/en/documentation/quickstart/" href="http://www.ruby-lang.org/en/documentation/quickstart/" style="border: 0px; color: #047ac6; line-height: 1.428571em; margin: 0px; padding: 0px;">Ruby in Twenty Minutes</a>. There are also a <a data-mce-href="http://guides.rubyonrails.org/getting_started.html" href="http://guides.rubyonrails.org/getting_started.html" style="border: 0px; color: #047ac6; line-height: 1.428571em; margin: 0px; padding: 0px;">good Rails tutorial</a> (and I'm sure there are several others). Another notable thing in the Ruby community is <a data-mce-href="http://rdoc.rubyforge.org/RDoc/Markup.html" href="http://rdoc.rubyforge.org/RDoc/Markup.html" style="border: 0px; color: #047ac6; margin: 0px; padding: 0px;">RDoc</a>, an unusually good documentation tool.</div>
<div style="border: 0px; font-family: Helvetica, Arial, 'Droid Sans', sans-serif; font-size: 14px; line-height: 19.984375px; margin: 0px; padding: 0px;">
<span style="line-height: 1.428571em;"></span></div>
<div style="border: 0px; font-family: Helvetica, Arial, 'Droid Sans', sans-serif; font-size: 14px; line-height: 19.984375px; margin: 0px; padding: 0px;">
<br data-mce-bogus="1" /></div>
<div style="border: 0px; font-family: Helvetica, Arial, 'Droid Sans', sans-serif; font-size: 14px; line-height: 19.984375px; margin: 0px; padding: 0px;">
I'll be installing Ruby and Rails on an Ubuntu 12.04 machine. I don't like how old the packages are in the official Ubuntu repository, so I'll install from Ruby websites instead. The first thing to do is install <a data-mce-href="https://rvm.io/" href="https://rvm.io/" style="border: 0px; color: #047ac6; line-height: 1.428571em; margin: 0px; padding: 0px;">RVM</a> with these two commands:</div>
<div style="border: 0px; font-family: Helvetica, Arial, 'Droid Sans', sans-serif; font-size: 14px; line-height: 19.984375px; margin: 0px; padding: 0px;">
<span style="font-family: 'courier new', courier; line-height: 1.428571em;">$ curl -L https://get.rvm.io | bash -s stable --ruby</span></div>
<div style="border: 0px; font-family: Helvetica, Arial, 'Droid Sans', sans-serif; font-size: 14px; line-height: 19.984375px; margin: 0px; padding: 0px;">
<span style="font-family: 'courier new', courier; line-height: 1.428571em;">$ source /home/wware/.rvm/scripts/rvm</span><br />
Later I reversed my decision about the official repositories, when I discovered I could install "ruby1.9.3". What RVM offers is an ability to run multiple Ruby environments on the same machine, like Python's <a href="http://pypi.python.org/pypi/virtualenv">virtualenv</a>.<br />
<br /></div>
<div style="border: 0px; font-family: Helvetica, Arial, 'Droid Sans', sans-serif; font-size: 14px; line-height: 19.984375px; margin: 0px; padding: 0px;">
So now Ruby is installed and you can type "irb" to begin an interactive Ruby session. Next install Rails, and some additional things you'll need soon:</div>
<div style="border: 0px; font-family: Helvetica, Arial, 'Droid Sans', sans-serif; font-size: 14px; line-height: 19.984375px; margin: 0px; padding: 0px;">
<span style="font-family: 'courier new', courier; line-height: 1.428571em;">$ gem install -V rails</span></div>
<div style="border: 0px; font-family: Helvetica, Arial, 'Droid Sans', sans-serif; font-size: 14px; line-height: 19.984375px; margin: 0px; padding: 0px;">
<span style="font-family: 'courier new', courier; line-height: 1.428571em;">$ sudo apt-get install libsqlite3-dev nodejs nodejs-dev</span></div>
<div style="border: 0px; font-family: Helvetica, Arial, 'Droid Sans', sans-serif; font-size: 14px; line-height: 19.984375px; margin: 0px; padding: 0px;">
Now you can jump to step 3.2 of the <a data-mce-href="http://guides.rubyonrails.org/getting_started.html" href="http://guides.rubyonrails.org/getting_started.html" style="border: 0px; color: #047ac6; line-height: 1.428571em; margin: 0px; padding: 0px;">Rails tutorial</a> and you should be good to go. Or you can go to the <a href="https://github.com/wware/RFZ2-ZombieTweets">Github repository</a> (<a href="https://github.com/wware/RFZ2-ZombieTweets/blob/master/README.rst">README</a>) which I cloned from the <a href="http://railsforzombies.org/">railsforzombies.org folks</a>, and that's where I'm going to be tinkering for a while.<br />
<br />
When debugging Rails controller code, you'll want to uncomment "gem debugger" in Gemfile, insert "<a href="http://guides.rubyonrails.org/debugging_rails_applications.html">debugger</a>" into your code, and then reload the page in your browser, and it will stop the development server and put you into an interactive shell with all the variables available in mid-process. You'll also have GDB commands like "step", "next", "continue", and breakpoints.<br />
<br />
When you're ready to deploy, consider <a href="http://www.heroku.com/">Heroku</a>, a Rails hosting service that lets you use one virtual machine for free. I've deployed my <a href="http://quiet-atoll-5922.herokuapp.com/">Zombie Twitter app</a> there, and after a few initial bumps, things have gone pretty smoothly.<br />
<br />
Here's a custom search for Ruby and Rails:</div>
<script>
(function() {
var cx = '011219760606307198866:z6mn7psqscw';
var gcse = document.createElement('script'); gcse.type = 'text/javascript';
gcse.async = true;
gcse.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') +
'//www.google.com/cse/cse.js?cx=' + cx;
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(gcse, s);
})();
</script>
<gcse:search></gcse:search>
</div>
Will Warehttp://www.blogger.com/profile/00852978068817644702noreply@blogger.com1tag:blogger.com,1999:blog-9667563.post-24895311940604019252013-01-26T08:23:00.000-08:002013-03-10T06:11:39.265-07:00Setting up an RDF server in VirtualBox, part 2<div dir="ltr" style="text-align: left;" trbidi="on">
This is the second part of a two-part (maybe N-part?) series about setting up an RDF server in a VirtualBox instance with the Ubuntu 12.04 server distribution. In this part, I'll set up Mediawiki as a place to conveniently edit RDF/Turtle documents.<br />
<br />
You might be thinking, what about <a href="http://semantic-mediawiki.org/">Semantic Mediawiki</a>? Doesn't this already exist? My experience with SMW was disappointing. The source syntax for creating links is pretty straightforward, and the silly naming scheme for importing external ontologies doesn't seem too bad. But when you want to do any real work with external ontologies, it gets difficult. After a few days of hacking around I couldn't find a way to say that a predicate defined in my SMW instance was <span style="font-family: "Courier New",Courier,monospace;">owl:sameAs</span> some predicate defined externally. At that point, I decided to strike out on my own.<br />
<br />
The results of that effort are on GitHub at <a href="https://github.com/wware/stuff/tree/master/semantic-wiki">https://github.com/wware/stuff/tree/master/semantic-wiki</a>. The setup script is to be run in the VirtualBox instance after the Ubuntu 12.04 server installation (with LAMP and SSH servers enabled) has completed.<br />
<br />
This is a work in progress. When I've got it beaten into presentable shape, I'll put it up at <a href="http://willware.net/">http://willware.net</a> with more explanatory material.</div>
Will Warehttp://www.blogger.com/profile/00852978068817644702noreply@blogger.com0