Building a laser galvo scanner from scratch using stepper motors

Many laser scanning systems for material processing today are based on galvanometer-actuated mirror systems and utilize fiber lasers for efficient and fast engraving on metals. However, galvanometers (and fiber lasers) are expensive and complicated to drive.

This projects goal is to create a similar system using stepper motors, which are very simple to use, and a cheap laser diode (= 650nm) to simulate the fiber laser beam. It also acts as a prototype for an engraver using this kinematic but with a high power diode laser.

A quick note: Scanning in this context does not refer to the digitalization of a physical 3D-Object. It refers instead to the process of engraving by moving the laser spot line by line.

A very detailled Prototype Report for this system can be found at my GitHub-Page. This report is written like a scientific paper and should give a lot more insight into the design details of the project.

Optomechanics

The general mechanics of the scanner could not be simpler: Two stepper motors with attached mirrors (I used 20mm CO2-Laser mirrors because I had them laying around), two endswitches and the 3D-printed base to hold it all together. The optics, in general, are pretty simple as well: The laser diode itself is seated in a brass housing contained in an aluminium block acting as a heatsink. The brass housing also contains a collimator lens so that the beam is parallel (=collimated). The beam exits the housing and gets deflected by the mirrors. Of course, the machine must know exactly how much the mirrors need to be turned for a specific position on the target plane (XY-coordinates are given by G-Code commands). Luckily, I was able to find a paper describing the mathematical model of this exact kinematic (Link).

Kinematics model given by Meng et al.

Kinematics model given by Meng et al.

From this paper I was able to rearrange some formulas to know the direct relation of XY-movement and necessary mirror rotation (See my Prototype report for more details).

Electronics

Schematics of the system

Schematics of the system

The electronics of the scanner are relatively simple as well. At the heart of the system lies a Teensy 4.0 chosen due to its incredibly high clockspeed of 600MHz and above (a normal Arduino Uno only has 16MHz!). It controls the motor via two SilentStepStick TMC2209 stepper motor drivers, reads the endstops for the mirrors and controls the laser diode (7mW 650nm ADL65075TA4) using a transistor. For controlling the current of the laser diode, a cheap universal laser driver is chosen. The whole package is fed 12V input voltage with a LM317 supplying 5V for the Teensy Board. The power of the laser diode can be adjusted by turning a potentiometer.

The software

General Structure of the Code.

General Structure of the Code.

I wont go too much into detail of the code since this is the most boring part for most people, but the general structure of the software can be seen in the figure above. By the way, all of the code can be found on the GitHub-Page of the project. The basic instructions are stored as G-Code (e.g. G0 X10 Y10) in a .txt file. These commands are transmitted line by line to the Teensy by a Python via USB. The Firmware interprets the lines and rotates the mirrors accordingly. This can be done at very high speeds (due to the high clock frequency of the Teensy), resulting in a smooth movement of the laser dot.

Results

Finished machine and lasercut housing for the electronics

Finished machine and lasercut housing for the electronics

The following video shows the system in action:

This test is done at various speeds, from 3000 to 20000 steps/s (distance 200mm). As you can see, the higher the speed, the smoother the projection looks. However above ~ 15k steps/s mechanical vibrations and motor limits are quite noticable.

All in all, the system behaves surprisingly well considering what it is made of. I also did some quite extensive accuracy tests, see chapter 4.2 of the Prototype report, but they are generally of little concern in this application.

I hope you enjoyed reading this short summary of the project! I really enjoyed working out all of the little details of the machine and really suggest reading the Prototype Report linked above. It does go into detail quite a bit more than this article! The successor of this prototype, a 5W “galvo” laser engraver using this kinematic approach actually is already functional. Hopefully I’ll have found the time to write an article about it by the time you are reading this!

So, as always, thanks for reading and have a good day!

Previous
Previous

Continuos wave diode pumped ruby laser

Next
Next

Simple full wave rectification using a homemade PCB