[UM2] Laser Addon

I am currently thinking about adding a laser to our Ultimaker 2 at work. Primary use case would be exposing PCBs to etch them on our own.

For this task we need some UV laser on the printhead. Well the chinese sellers on aliexpress.com sell them for less than 2€ including P&P, why not use them?
So i disassembled a standard 405nm blue-ish purple laser i had lying around and checked what is in there.

Ideal would be if these cheap laser pointers had a 24V capable constant current driver that allows PWM dimming using the UM2’s cooling fan output. Yeah that would be a bit too much to expect, but we are not far away. In mine I found a SOT-23-6 with marking “AN=P1U” which seems to be a Richtec RT8285B. The website tells me that the marking should be “AN-P1U” and not “AN=P1U”. But the circuit fits just well.

Here the hand-drawn “DaveCAD” compatible circuit.


As i didn’t unsolder the trimmable resistor, i couldn’t measure its resistance. This would be needed to really know the max current etc. Edit: It was trimmed to 400 Ohm and its total resistance was 4.7 kOhm or 47 kOhm, don’t exactly remember.
But it’s already enough to build what we need. The datasheet explains that the EN pin of the B-version, which is thankfully active high, allows to dim the current by applying a PWM. Yay.
So just add a 56kOhm / 10kOhm voltage divider to get from 24V PWM to <5V and we can use the UM2’s fan speed control to dim the laser power.

Just the supply voltage with 5V maximum rating needs some extra circuitry. Perhaps its a good idea to low-pass filter the PWM signal, buffer it with a capacitor and use some cheap step down (like the LM2596) to get a good 5V supply.

But for the first tries, 3V batteries will to their job ;)

This is where I plan to put the laser (yellow). The UM2 guys initially wanted to add dual extrusion support, dropped that idea afterwards due to temperature issues that were to expect. So let’s use that hole for our plans.



I designed that mount using OnShape, a free-for-makers online CAD tool which is absolutely easy to use by the way. I am going to print it that week and test a bit. Idea is to place the laser above the hotend area where it will – surprise – get hot during normal prints. So the diode can be left mounted during prints – or unmounted with the ease of just unplugging the adapter (light blue).

Then only the software thing is remaining. I am wondering if i should create a 1-layer 3D object from the PCB and let a slicer like cura do its job. After the slicer router the “ideal” print head movement, post process the g-code to disable material feeding and insert fan speed commands that corellate to the feeder speed.

Or should i just export the PCB into a bitmap(BMP/PNG/…) and code a custom tool that read the bitmap, raster-scans it and creates g-code from it.
Of course it should be intelligent to follow the paths with “laser on” pixels first until it cannot go further anymore, turn off laser and move to the next position where we need to expose and do the same here. This looks necessary to me because i don’t know how long the PWM stuff will take until the laser reaches the desired power. For fast head movements and thin lines i am sure miliseconds will matter.

It wouldn’t be as intelligent as a slicer that knows outlines and will draw continuous lines and uses zig-zag for infill. But it allows us to generate g-code from just a bitmap and gives us fine grained control over things like z position etc. Just imagine we could shift the z-offset to draw thicker lines ;)

We will see how far this will get.


[ESP8266] Xmas tree lights


This year I improved my christmas tree LED lights from last year (https://plus.google.com/106975890398198714969/posts/EaUEFXzoxED)

I removed the Infineon MCU (XMC1100) which already was at it’s limits and replaced it with an ESP8266.
So i put the cool and versatile WiFi enabled MCU under my xmas tree, featuring an ugly, crude web interface using ESP8266WebServer (i am no web dev at all) and ported the old code from the XMC1100 over.
Porting was just a task of ten minutes to be honest.

The most time consuming part was all the stuff like adding SPIFFS+JSON based configuration saving, configuration parameter web interface, NTP time sync with ON/OFF times, and a dozen hours of debugging resets.

Using the Arduino port for ESP8266 development is very easy, but be warned:
Even if you just use 70% of your RAM, all the new/delete stuff of C++ will
fragment that memory so fast that you might face reboots every day.

In my case using the webinterface’s setup screen once allocated so many objects that all further allocations led just one step further to heap exhaustion.
then weird things happen.

Anyway, it was a nice this year’s xmas project and looks very appealing.
A beautiful purple light with smooth transitions fading slowly up and down from time to time makes it very special.

Here a short video showing some different modes (more or less pretty ones)

(and it uses the same code base as my kitchen floor lights https://youtu.be/ea7AFVHCEq0)
Here some screenshots:

[GSM] Source code of RX-FFT and GSM-Analyzer

Long time ago I coded tools to capture, demodulate, decode and decrypt data from an Software Defined Radio (SDR).
As i dont see any reason to keep it private, i decided to release the source code.

I mainly used a device that is comparable to the USRP, but designed by a friend of mine. Still these tools can work with .cfile that are saved from USRP. There is also a prototypic implementation for the HiQ-SDR device that is not tested a lot.

Nearly all the code is written by myself with these exceptions that come into my mind right now:
– Viterbi decoder (OpenBTS)
– FireCRC (GNU Radio)
– CryptA5 (Marc Briceno et al)

The two main tools in this project are:
RX-FFT, a windows (DirectX) based broadband FFT visualizer and
GSM-Analyzer that can decode (and with kraken-win32 even decrypt) GSM data live from the air or from/to files

You may use it for your own projects (non-commercial, commercial) after you informed me about your project.
If you have use for this code, you can also send some money to [email protected] to show me how much you liked it.

How to use it with USRP .cfile files?
1. Get some information about your used .cfile: crystal frequency: 64MHz, 100MHz,  decimation rate (usually visible in the filename as …_d174_… for decimation rate 174) (sample file)
2. Select “Open”, “IQ Wave file” in GSM Analyzer
3. If the fields are not correctly autodetected, correct them
4. Go into “Options” and press “A” or “B” in “Burst length correction type”. One of them is the correct one for your provider (O2 sometimes uses B)
5. Press “Play”
6. You should see now all traffic happening on the channel
7. In “Filter” menu select those entries that shall be ignored to prevent flooding the log


source: http://svn.g3gg0.de/svn/default/trunk/EZ-USB/RX-FFT/
user: rx-fft
pass: rx-fft

its on bitbucket: https://bitbucket.org/g3gg0/rx-fft
just like Kraken-win32: https://bitbucket.org/g3gg0/kraken-win32


[EOS] TimerGen Tool

Since last year I helped a little developing Magic Lantern, a Firmware mod for Canon EOS DSLRs.
I reverse engineered some interesting registers and memory structures that make frame rate patching possible.

(yeah, as always I couldn’t resist reverse engineering the next device I bought :) )

Now I’ve coded a little tool that makes it possible to:
a) Calculate the exact timer frequency that generates frame rate
b) generate custom frame rates

The tool is available here.
Here some screenshot.



[GSM] Kraken

currently i am porting Kraken, the fantastic A5/1 cipher cracker to win32/x64.
it seems that i am done with most of the steps.

it starts, cracks the keys, supports ATI cards as the linux version does and is even able to run as a multi-client server application.

i also added support for older cards like the Radeon HD 3870 which will speed up the key search by maybe 10% depending on your HDD setup.

unfortunately its no GPL or even a more free license like MIT or BSD.
so i may not publish my changes. instead i will try to get them added to the original repository.
since i also changed a lot (!) in the internals of kraken, i am not sure if it will get added :)

but we will see….