Waves at Bessel-on-Sea

This is a lasercut version of the Bessel Functions, as a handy desk ornament:

Bessel mono crop v03.JPG

The helical diffraction theory, (and hence the Bessel functions) were the major key to solving the structure of DNA.

In 1952 (well before the DNA structure was solved) Francis Crick & Bill Cochran wrote a paper explaining how the expected form of X-ray diffraction from a helix is the sum of various Bessel functions:
https://onlinelibrary.wiley.com/doi/10.1107/S0365110X52001635

Quick bit of background. When you’re using X-rays & film to find the structure of something, what you get when the film is developed isn’t a picture of the structure. Instead, it’s (more or less) the Fourier Transform of the structure.

We can simulate this in python like so. Let’s say we have a simple helix, (which we’ll assume is smoothly continuous, and not made up of any yucky atoms). The pattern we get looks like this:

CrickCochran_ContinuousHelix.PNG

A continuous helix (left) has a diffraction pattern like a big X (right)

and then if we take a photo of a helix which is made up of a discrete atoms, we see a pattern like this: :

CrickCochran_30AtomHelix.PNG

A discontinuous helix (left) has a diffraction pattern which is a series of diamonds (right)

The way the maths works out is something like this; the ‘dotty helix‘ can be thought of as the (piece-wise) multiplication of two functions:

  • H – a helix with constant radius
  • K – a function for the ‘planes’, which is zero everywhere except at a plane every ‘p’ units

Cochran crick maths - real space v01.png

and the result in the ‘Reciprocal Space’ (i.e. what the X-ray picture will look like) can be neatly expressed as the convolution of the [Fourier transform of H] with [the Fourier transform of K].

Cochran crick maths - reciprocal space v01.png

In other words, the big ‘X’ is “stamped” on the image every where the red planes are. The result looks like a series of diamonds.

Let’s make a larger diagram. If we sketch out the expected pattern for a continuous helix, we’ll see an x-shaped pattern, roughly like:

cochran crick sketch - platonic helix v01.jpg

And if the helix is made up of discrete units (atoms or rungs), then we’ll see the above pattern ‘stamped out’ multiple times on the image.

For example, if we have a helix which has 10 layer lines per twist (like real DNA),  we’d expect to see a pattern like this:

cochran crick sketch - 10 layer repeate helix v01.jpg

Expected diffraction pattern for a discontinuous helix which has one twist every 10 rungs

That’s an amazingly good match for this (terrible quality) photo of the real thing :

Photo_51_x-ray_diffraction_image.jpg

Source here

You can see most of the characteristic features. The double diamond (4+ diamonds, really). Note that they meet up on the 10th line, indicating that every 10 rungs the helix makes one turn.

There’s a whole bunch more cool stuff covered in the Cochran/Crick paper, like:

  • They explicitly consider cases where the number of rungs per turn isn’t a neat integer
  • They do worked examples to show how it explains features in the Pauling’s recently discovered alpha helix
  • They propose practical methods for analog computing via paper charts and movable masks in order for people to be able to quickly synthesize patterns for arbitrarily complex helicices in the future.

 

Side note: the mathematician Alexander Stokes had also worked out the helical diffraction theory at around the same time, but didn’t bother to publish it. He famously did the work on the train on the way home, and presented it to the lab the next morning. You can see the lovely sketch he did here:

http://dnaandsocialresponsibility.blogspot.com/2011/03/short-and-simple-ish-guide-to-x-ray.html

Which Wilkins was so impressed with, that he stuck it on the lab notice board, with the name “Waves at Bessel-on-sea”.

It was after seeing Stoke’s picture, that I decided I wanted to make my own copy of Bessel-on-Sea for my coffee table:

Bessel crop v02.JPG

Files here for anyone that wants to make their own:

https://www.thingiverse.com/thing:3872197

Posted in Uncategorized | Leave a comment

The Crystallographer’s Watch

Finished product v01.JPG

Here’s a project I made almost accidentally on the way to a later design. I’ve wanted to make my own watch for a while now. It’d allow me to pick and choose all the features I really want, and it’s a fun exercise in design to try and figure out which features work smoothly, that I’d appreciate having everyday, and which features are more ‘fads’ that I can do without.

I have a metal CNC machine, so carving the watch body from solid metal is doable (if somewhat fiddly and time consuming). And it’s really cheap to design and make your own circuit boards these days, so the electronics are fairly easy.

But it occurred to me that this is still a multi-stage process, which plenty of opportunity to loose energy or procrastinate. If I wouldn’t get that reinforcing emotional feedback/reward until WATCH_CASE_DESIGN + MILLING + ELECTRONICS + SOFTWARE are all done, that’s a very long chain with plenty of ways it can fail.

So, as a way to break the the project into chunks, I figured I’d start with the circuit board only.
I bought a large men’s watch 2nd hand watch on gumtree and pulled out the guts, this left me with a big empty enclosure I can fill with my custom electronics.
Unmodified watch v01.JPG

I measured up the internal space I can use, and I lasercut a couple of ‘dummy’ cylinders of the same size:

Internal case dimensions v01.JPGdummy cylinder v01.JPG

The idea is that as long as whatever electronics I come up with are smaller than the dummy cylinders, I’ll have no surprises when it comes to assembly.

At that point I realised that the empty watch was essentially a wrist mounted display case.

The other day I’d been playing around with small ball bearings, to make a ‘bubble raft’ style display like those popularized by Sir Lawrence Bragg.

I figured that with a bit of fiddling, I could make a watch mounted version I could take anywhere. So I laser cut another plug, and some circular rings hold off the wood from the glass, which allowed the balls to move freely.

Ball bearing insert v02.JPG
It took a bit of tweaking to ensure the balls didn’t have enough space to ‘double pack’ when tilted. Brett and I had to have several rounds of taking it apart, sanding the ring down carefully, then reassembling before it worked nicely.

There’s a lot of interesting structure in the raft. You can see how the balls pack in regular order at a local scale, but don’t line up on a global scale.

Raft coloured v01.JPG

Grain boundaries and sphere packing

(Also note the red areas with square packing, everywhere else seems to be the more efficient hexagonal packing).

Every time you look at your wrist you’ll see a different pattern. Sometimes regular, sometimes chaotic. And by tapping and jiggling, you can often ‘anneal’ the structure into a lower energy state. Here’s one pattern that’s been annealed a bit.

Raft coloured v02.JPG

The watch annealed into a much more regular shape

(Note the lovely grain boundary, and two large grains which have steadfastly refused to merge together).

The semi-randomness of the pattern is quite appealing. The eye has no problems picking up the detail, and you can often see grain boundaries more easily than the individual balls. And with a quick flick, you can get a whole new arrangement. Sort of a wrist mounted I-Ching.

I’ve been wearing it for two days now, and it’s rather soothing. In fact it’s an anti-watch.
(Since a regular watch tells you the time and makes you stressed. This tells you absolutely nothing, but makes you calmer)

 

 

 

Posted in Uncategorized | Leave a comment

The Dichroic Confuse-O-Scope

This is the ‘Confuse-O-Scope’, a device which allows you to enjoy all the fun of having mis-aligned RGB in real life! Guaranteed to cause both confusion and irritation in anyone that’s worked in TV, printing or theatre lighting!

Example view 01.JPG

If only I could make a telescope that messed with Kerning.

It uses the same dichroic beamsplitter cubes as my previous project, but arranges 3 in a row:

case inside 02.JPG

With the result that; while any colour light from the world can get to your eye, the red, green and blue colours all travel via different paths. And because of parallax effects the view of each will be slightly different:

example view 02.JPG

You can also flex the frame a bit and change the RGB alignment, making it overlap or separate.

Here’s what the view looks like from the other side:

image split v01.JPG

Files here for anyone that wants to make their own:

https://www.thingiverse.com/thing:3591363

case overview v02.JPG

Posted in Uncategorized | Leave a comment

Dichroic Moving Sculpture

This is a quick project I made to explore dichroic filters. I just love the colours that can be produced, and wanted a way to display it easily.

In the last few years, these dichroic cubes have appeared on eBay. They’re used inside projectors to combine red, green & blue colour channels into a full image. And, apparently making them isn’t a perfect process, so a bunch of defective ones regularly end up for sale.

IMG_2368.JPG

I used a couple of stepper motors to allow the cubes to be rotated at a slow yet precise speed, and used the same unwise technique from before to simplify wiring. I then used some high power LEDS to provide illumination:

Side note: The ‘unwise technique’ still seems to be paying off surprisingly well. Everything you see in the video is running straight off the arduino, via USB with no other power supply.

To collimate the light from the LED I used some lenses from eBay jeweller’s loupes (which were so terrible that their main value is for parts), and made a lasercut holder for the lens. The light assemblies are mounted on thin brass shims to allow bending and positioning them by hand:

box behind v01.JPG

Files up here for anyone that wants to make their own:

https://www.thingiverse.com/thing:3591151

 

Posted in Uncategorized | Leave a comment

A Planetary/Harmonic Hybrid Gearbox

I recently saw this amazing idea from Darren Schwenke on Hackaday.io:

https://hackaday.io/project/164732-mprt-modified-planetary-robotics-transmission

Which is (so far as I know) a brand new type of gearbox, inspired by a well known concept called a  “Harmonic-Drive“. Harmonic drives have been around for years and were used whenever light weight or small size was required (on the moon rover, for example). They work via the deformation of a flexible ‘strain wave gear’ to enforce the meshing between two gears with nearly matching numbers of teeth. This allows very small reduction ratios, in a compact space:

240px-HarmonicDriveAni.gif

Image from Wikimedia Commons, here

The red strain wave gear is where output goes. The downside is that a strong and really flexible gear like that is hard to make, and also difficult to couple the output from easily. Most designs I’ve seen require custom spring steel ‘cups’ which are precision manufactured via electro discharge machining or similar. (Although there are several awesome 3D printed versions out there. )

Darren’s idea with the MPRT gearbox is to take the basic concept of the harmonic drive, but remove the complicated strain wave gear and instead substitute ordinary planetary gears, which then do the same job of enforcing the meshing of the two outer rings at several key points:

Gear sketch v01.jpeg

The final gear ratio for this is around 66:1 reduction, which is amazing for a single stage:

IMG_2322.JPG

I liked his design, but didn’t want to wait a long time to 3D print it, so I drew up this one for my laser. I created the gears just using the involute generator in inkscape, then added all the bits and bobs to hold it on the motor and mount reliably. I laser cut the pieces out of bamboo ply, and screwed them together with M3 fasteners.

A NEMA 17 stepper motor sits underneath and drives the whole assembly:

IMG_2323.JPG

Also, I’d like to mention one of my favourite construction techniques, using M3 nylon standoffs as thumbscrews. I’ve had to put various bits of the gearbox together and pull them apart half a dozen times while prototyping, and being able to fasten bits securely by hand is a huge time saver.

I used a few dollops of furniture wax, which seemed to make it run smoother:

IMG_2328.JPG

The torque is large but not ridiculous, and I can make it stall by hand if I really try, but overall it’s still remarkable for a single stage gearbox. (Also, not many moving devices have sliding wood-on-wood surfaces, so if you made this out literally almost any other material you’d likely have better results. )

Files up here for anyone that wants to make their own:

https://www.thingiverse.com/thing:3576090

 

Posted in Uncategorized | Leave a comment

Unwisely driving 17 stepper motors from a bare arduino

This is a quick and dirty way to get a whole bunch (up to 17) small stepper motors working off a single arduino, with no extra circuitry whatsoever.

Why would you want to do that? Maybe you want to make a wall display, a clock or some other interactive object, and you can’t afford thousands of dollars for motors, and hundreds of hours spent wiring up boards for ‘proper’ drivers.

(Side note, the back story to this is for a while now I’ve been wanting to make a big-ish display simulating vector fields, and I was scratching my head trying to come up with a way to do it that wasn’t ridiculously expensive. I ended up finding one that was not only cheap, but lazy too!)

Anyway, here’s the finished display:

finished display.JPG

The main ingredient is the 28BYJ-48 stepper motors, which is a geared motor which is dirt cheap. They’re mass produced and apparently designed for air conditioning louvres?

Ordinarily when you use a stepper motor you need a dedicated constant-current driver to avoid damage. The essence of this project is how to avoid the cost and complexity of a driver.

The cost of the parts were:

  • $3 each for the driver and motor pair , from Little Bird Electronics.  (If you really wanted to, you could get them even cheaper in bulk, and also by not including the driver)
  • $10 for the arduino, from eBay.

I used 17 motors, so it was $61 AUD all up. Which is ridiculously cheap for something with almost twenty channels of precise motion control.

Here’s what it looks like inside:

A smarter person would have numbered them so they were correct as viewed from the front. Next time, Gadget, next time.

Also, the wiring is also about as simple as you can imagine, I basically just jammed the motor wires into the arduino’s digital pins and slammed the box shut before they could fall out again:

Science

Here’s how to do it yourself. But, before we begin:

If you try this, you might break your arduino.

If you try this, you might break your arduino.

If you try this, you might break your arduino.

And also,

If you try this, you might break your arduino.

Everybody clear?

This approach works*, but relies on several things which might not occur all the time. Don’t assume you can get away with this in other designs.

*Actually, I’ve really no idea if this will work long term, all I can say is that my one has been running for several hours now, and the arduino hasn’t yet caught fire, appeared broken, or visibly lost steps on the motor. Win!

Trick 1: The arduino digital outputs have a non-zero resistance

This is the reason you often see people getting away with plugging LEDs in to the arduino pins directly, without a current limiting resistor.

(For years I thought it the ATMEGA chip had actual current limiting circuitry, but turns out it’s just the internal resistance or something? At any rate, don’t assume you can abuse other chips in the same way. )

I don’t know for sure this is required, but I’ve found in the past the ATMEGA/arduino is way more tolerant than microcontrollers for badly connected loads, so I’ll assume it’s relevant.

Trick 2: We convert the motor from unipolar, to bipolar,

(This has the nice side effect of doubling the resistance of the motor, further reducing it to the point where the arduino chip can drive it without circuitry).

The motor from the factory has a coil arrangement we want to change from this, to this:

We do this by:

  • opening up the back cover,
  • cutting off the centre tap ( red wire)
  • Dremelling out the circuit board to disconnect the two pairs of coils from each other

Trick 3: The 28BYJ-48 stepper motor is crap. And that’s good news for you!

Or, to be more precise, the motor has (before the gearbox) only 32 steps per rev, or 11.25 degree step size.

Why this is relevant is that we want to be able to power down each motor’s coils between movement, so that the arduino is only powering a single motor at a time. But we also want the motor to not lose steps the next time it’s powered up again.

A big 400 step NEMA17 motor (such as you might find in a good 3D printer) has 0.9 degree step size. If you power on and off a big 400 step motor repeatedly, it’ll jiggle slightly. If it jiggles more than 0.45 degrees, then when it’s started it’ll be dragged to the next notch in the rotor, and hence the wrong  location. This will happen most when under mechanical load, or the influence of belt tension, etc. So ordinarily, turning motors off translates into lost steps, and poor position accuracy. Hence for a 3D printer, they typically leave the motors powered up, or under a reduced current whenever they need it to hold position correctly.

Because the 28BY-48 motor has a huge 11 degree step size, (and it’s behind a gearbox) it’s really unlikely any mechanical jiggling is going to move it far enough to be a whole step away from where it should be. So the next time it’s powered up, it’ll be pulled back to the exact location it was before!

And that’s it. With code to carefully avoid running more than one motor at once, it can be scaled up to as many motors as you like, and you only need to stop when you run out of arduino pins.

I think am going to enjoy making displays with this technique, and it’s quite satisfying to watch the dials spin around in person.

 

Files and code here for anyone that wants to make their own:

https://www.thingiverse.com/thing:3544304

Have fun, but don’t blame me if you damage stuff by trying this.

Edit: I’m still playing around, but it seems like you can get loss-free movement of at least 6,  8, 10+ motors at a time. Damn, this works way better than I have any right to expect. 

 

Posted in Uncategorized | 2 Comments

Tangent Ruler – Draw circles passing through two points

Unintentionally I’m going to continue my tradition of making projects involving rulers.

I saw this picture online: https://imgur.com/t/aiko/mu96ohu and I thought it was too cute a technique not to try out for myself. I did a couple of minutes sketching in Inkscape, and then had it lasercut shortly thereafter.

Here’s how to use it. First, simply drive a couple of nails through your favourite table or work surface:

IMG_2031.JPG

Then, using a pen, draw out the circle while keeping the ruler pressed against the two nails:

IMG_2033.JPG

You should end up with a perfect(ish) circle that passes smoothly through both nails.

I’m going to try to remember this trick, I can see it being useful for laying out parts for machining, or to make shapes based off existing features.

Files here for anyone that wants to make their own:

https://www.thingiverse.com/thing:3405583

 

Posted in Uncategorized | Leave a comment