The L-unit

This is not about space-travel. I’m still fiddling with my mirrors.

In frustration of not getting anything remotely like sharp a peak in my spectra, I’ve been playing with my CNC in a slow move to replace plastic with aluminium.

I realize CNC mills aren’t as accessible to many as 3D-printers are, and good dog it certainly takes longer to manufacture a part in metal than in plastic. However, there’s a nice satisfaction in making a precision part in aluminium. It would be even more enjoyable if weren’t for manually creating the gcode, the breaking of expensive tools, and the anodizing post-process.

The OAP holders were already in aluminium, but recently they have been remade using the CNC, and are now more aligned than ever. I imagine being aligned is like being pregnant – either you are, or you aren’t. I guess you could argue my mirrors are poorly aligned, I hope no one is poorly pregnant.

Here’s my progress with the other mirrors:


The L-unit. The coin is for scale, but in case you haven’t seen a D-mark in a few years (it was the only coin I could find in the flat), the piece is 32×42 mm. The holes are 18 mm apart.

Continue reading

Mirror alignment. Don’t touch!

The new OAPs in protected aluminium have arrived. The rotating CCD-mount is complete. In other words, it’s time to play.

Figuring out how to align a plane mirror isn’t so bad. It’s still challenging to carry out though, not least because my flat is from 1936, two years before the 90° angle and the level floor-board was invented.

Figuring out how to align two off-axis parabolic mirrors (OAP)  was less easy, and I’m still not convinced I’ve done it right. But judge for yourself (and let me know if you find it wanting).

Continue reading

Picking (something) up where (one) left off

If you’re a recurrent guest you’ll have noticed that the activity has been low lately. It’s not my fault, it’s runs in my family to slow down and never complete anything. But no one want’s to become their parents, and I’m not an exception, so here we go:

The last thing I worked on was the cold tip. I couldn’t get it as cold as I wanted, so here’s what I’ve been on and off up to.

Continue reading

New toy day

Ok, so my CNC-mill actually arrived a few weeks ago, and I completed the control electronics last week (with quite a bit of delay, thanks to a set of burnt motor drivers).

In the meantime I’ve been trying to get my head around coordinate systems of the CNC-world, FreeCAD, GRBL, bCNC, gcode, climb-milling and conventional milling and possibly other things as well. I’ve tried to collect my thoughts here. It’s still a work in progress, but the CNC-mill is now up and running and I have the pictures to prove it:

Here’s the cold-tip for the CCD:



There are track-marks from the CNC. You can see them, but not feel them (and not just because you are sitting behind a screen), so I’m curious to see how it will respond when I anodise it black tomorrow.

The cold-tip is just one third of the entire rotating thermoelectrically cooled CCD-mount. The other two parts will be much less work. It’s basically just cutting two appropriately sized pieces of aluminium and drilling 13 holes. A task that would have been tedious and impossible (I’m still not good enough with my drill press that I can drill within the tolerances I want/need).


STM32F103 driving the TCD1304

Thanks to Zied Guermazi for showing me some time ago, that the STM32F103 “blue pill” can drive the TCD1304. Back then, he ported my UART-firmware for the STM32F401 to the STM32F103.

This week, while waiting for my small CNC mill to arrive (still waiting), I’ve been looking at GRBL. It was originally made for arduino, but fortunately there’s a port for the STM32F103. I first thought it was an STM32duino build, but it’s actually made with the standard peripherals library, so I became curious how USB was implemented.

After realizing that STMicro has a USB-library for the STM32F1xx, I quickly fell into the rabbit-hole.

There were two things that didn’t make me jump on Zied’s port back when he made it:

  1. The STM32F103 doesn’t have 32-bit timers, meaning the integration time is quite limited. Even with the slowest MCLK supported by the CCD it’s:
    tint (max) = 2¹⁶ / MCLK = 2¹⁶ / 800 kHz = 82 ms
  2. UART isn’t that convenient without the nucleo-board’s built-in USB->UART connection.

So I dug into the datasheet, reference manual and USB-library for the STM32F103. It took me some time to get USB working, especially how to send more than 64 bytes at a time.

I still haven’t solved the issue of the 32-bit timer. First I thought I could chain TIM3 and TIM1, and use TIM1’s capability for complementary outputs.

Using TIM1 in slave mode means timer’s counter is only increased when TIM3 overflows (that’s the whole point of chaining them together), however that also means the pulse-length is dependent on the period of TIM3. So I’ve put that idea on the shelf.

I left the 32-bit timer configuration intact, so if someone wants to implement the SH- and ICG-pulses manually through TIM1’s update interrupt, they can.

Back to what’s working:

The STM32F103 presents itself as a virtual com port, so the command-line interface, and the python-interface works out of the box. And here’s the first capture using the blue pill:


Yes. It’s a cork-screw:


And here’s the whole setup:


The firmware runs the CCD at 800 kHz, so the timer violation warnings given by the pyCCDGUI shouldn’t be taken to seriously, just remember to keep SH and ICG smaller than 65536. I will probably add a radio-button or something in the pyCCDGUI to choose between the STM32F103 and STM32F40x.

Oh, and for good measure, here’s the pinout :

  • OS – PA1
  • ICG – PA10
  • SH – PB4
  • fM – PA15

Download the firmware over at

I will most likely make a TCD1304-shield for the blue pill with all the credit I’ve saved up over at dirtyPCBs from whenever people order one of my designs. Which side of the blue pill should the CCD be on?

Learning from mistakes – A new cold tip

3D-printing is not exactly fast, but at least my effective work-time is limited to drawing up the parts in openscad. Working in metal, however, is tedious and at times hard work too (I hate that).

So mistakes when making metal parts are expensive in time and money (but mostly time). I can’t remember when I figured out that 3D-printed drill-templates are a dog-send (I’m slow, so probably far too late).

But why stop at that.  I’ve invested in a small CNC-mill (Proxxon MF 70), so I’ll have to draw the parts anyway, and I might as well make 3D-printed dummies of the rotating heat-sink, before putting the CNC to work.

My 3D-printer is at work (in fact, it’s not my printer any longer, the school acquired it from after an amusing mistake where management claimed that the school possessed a 3D-printer), so printing will have to wait until Monday, but I can still show of the drawings:


From the top: CCD-PCB, cold-tip, peltier-element, rotating heat-sink, fixed heat-sink.

The top layers will be fixed relative to each, and hopefully look something like this:


Notice the hole in the center of the bottom part. This is the rotational axis, and the hole will be threaded and used to secure the assembly to the part of the heat-sink fixed to the chassis of the spectrometer.

Hopefully printing dummies will help me catch any mistakes before they are permanently manifested in aluminium.

Someone beat me to it!

I’ve previously shared this link:

and if you didn’t check it out back then, you definitely should now. While I’ve been working on-again-off-again on this project for the past 3-4 years, this guy built a working diy raman spectrometer in few months time.

He makes it look so simple, that I can’t help feel slightly depressed.

But science is a collaboration (I tell myself, while eating consolation-ice-cream), and I’m excited to see that he has achieved clear spectre with a 5 mW laser, and a sensor smaller than the TCD1304.

I hope my setup will be as good, after all I ditched my first spectrograph design for something fancier (maybe I shouldn’t have done that, seeing how well this particular design performs in the hands of someone better than me). If not, there’s always more ice-cream.