Laser Galvo Control Via Microcontroller’s DAC

Mirror galvanometers (‘galvos’ for short) are the worky bits in a laser projector; they are capable of twisting a mirror extremely quickly and accurately. With two of them, a laser beam may be steered in X and Y to form patterns. [bdring] had purchased some laser galvos and decided to roll his own control system with the goal of driving the galvos with the DAC (digital to analog) output of a microcontroller. After that, all that was needed to make it draw some shapes was a laser and a 3D printed fixture to hold everything in the right alignment.

The galvos came with drivers to take care of the low-level interfacing, and [bdring]’s job was to make an interface to translate the 0 V – 5 V output range of his microcontroller’s DAC into the 10 V differential range the driver expects. He succeeded, and a brief video of some test patterns is embedded below.

We have seen drawing shapes with lasers go in some really creative and interesting directions. For example, this amazing mechanical laser projector draws shapes using only 3D printed cams and gears, and this one draws on a glow-in-the-dark surface with a UV laser for a ghostly take on things.

33 thoughts on “Laser Galvo Control Via Microcontroller’s DAC

  1. Can these be used with higher powered CO2 lasers? I’ve not seen much written about the internals of a 30-50W laser, but I guess they must use mirrors and/or a lens as the tube has to remain static?

    1. I guess with the right mirror you could. If you really should is another question.
      AFAIK the “consumer” level laser cutters (around the 50W-100W types) have a static laser tube and deflect the laser beam through a series of mirrors until it is deflected down onto the work pice. Basically one mirror per axis fixed onto the axis itself.

      1. This is correct. They have fixed mirrors on moving gantries. The mirrors and lenses end up being maintenance parts since they eventually get covered in soot and soak up too much heat and crack.

    2. You could. But the diameter of CO2 beams is rather large and you’d therefore have to pass it through a really expensive scan lens. Better option is to use an XY carriage and fixed mirrors together with a simple focus lens.

    3. That would be awesome, but focus might be an issue. Afaik those lasers usually get focused at the business end of the CNC, is this correct? This would need move the lens between the laser and mirrors, thus it would swing the focal point around in an arc. Might be troublesome if you’re trying to position the cut on a flat surface.

    4. In addition to the reasons others mentioned, scanning a laser with galvos results in a cut that’s not perpendicular to the work surface as the angle from the galvos increases.

      If you were only interested in surface etching, very thin materials, or SLA then this wouldn’t be an issue.

    5. Yes. I work for a company that builds laser systems with galvos and we have systems that push over 150w of CO2 through galvos for via drilling. Of course the galvos and drivers cost $21000 a pair from Cambridge and you still have not bought a scan lens.

  2. What is new here? I created a laser light show with a pair of pen motors from an old analog chart recorder and a HeNe laser back in the 80’s. The control was a pair of 8 it DAC’s that were driven from the expansion port of my C64. Back in the day it was quite the contraption. The laser alone was damn near $200.

    1. And I’ve done something very similar using mirrors fixed to speaker cones. So what’s your beef, that this isn’t a hack? It’s just as much a hack as a kiddie keyboard. Didn’t see you complaining there.

      1. Ditto on the speaker cones!
        I used those tiny nylon hobby glue in hinges to stabilize each to swing about a single axis and drove them with some piano wire glued to the voice coils.
        Powered it with a stereo amplifier using L-R audio output from a PC for X-Y, although it was far cooler to just play music with the bass/treble split between the two.
        My first HeNe laser… in 1991.

        1. The speaker-cones trick is great. We made the hinge with broken matchsticks one night at my hackspace. Very low res, but still pleasing visuals for audio.

          There is nothing “new” about running laser galvos with a DAC. A lot of the secret sauce of (closed-source) professional software is in how they do the motion control to offset the non-linearities / inertia of the galvos and mirrors.

          [Bart Dring] is a master of mechanical motion control, and he shares his work. He’s writing firmware to work with cheap import galvos. This is a project that you’re going to want to follow if you’re interested in DIY laser shows.

          1. I too was playing with a HeNe laser tube back around 1985. I was in my early 20’s at that time. An ex-boss of mine acquired a set of galvanometers and gave them to me. A co-worker mechanical engineer, Roger, designed and fashioned a 1-off aluminum support bracket complete with mounting holes and hardware for the galvos as well as an aligned “cradle” for the HeNe tube. Not to mention he fashioned some surface-reflective mirror holders that mounted on the galvo shafts. He even made sure that EVERYTHING was in perfect alignment for me.

            I designed a nice 2 channel galvo driver circuit for it using some bipolar transistors driven by op-amps and a simple 4 channel “audio mixer” (2 channels per (X or Y) channel).

            At the time, I was designing hardware for my Apple //e and used two 8-bit DACs that drove the galvo driver. A friend was very much into math and designed a program (in BASIC) to pump put quite a few shapes and mapped them to X-Y coordinates. I wrote a 6502 assembly language program to scan the X-Y shape data out to the DACs (BASIC was too slow!). I still have the programs (BASIC and 6502 ASM) and shape data for it. I used a frequency generator and an external audio mixer to mix in some music to the shape data and frequency generators output. Nice effects… Very mesmerizing…

            Although the galvos had feedback coils, I never did design them into the circuit to achieve any kind of accuracy. The highest scanning frequency seemed to be about 80 Hz and there was a mechanical-mass resonant frequency as well.

            It all worked like a charm though and I recall many hallucinogenic evenings with a few friends working with the “laser show” and music by The Grateful Dead. It was really fascinating to use smoke effects with the laser to create true 3D images like “holographic tunnels” and spirals. When the movie ALIENS came out and they showed the blue laser scanning the retrieved life-boat at the beginning of the movie, my friends and I exclaimed “Hey! We’re already doing that!”

            This article reminds me of that project, which I still have in storage, and still works as of the last time it was powered up. I did break it out for birthday parties in the garage for my daughters when they were younger. It worked well with the disco lights and smoke machine.

            And … I also had some of those nylon micro-hinges that were used for RC planes and did try them with speaker cones. They worked “okay” but after having and using the galvos, I was a little spoiled.

            If I were to resurrect the laser show, I would use a microcontroller and two PWM channels for the analog output. All the shape data would fit in FLASH memory and a simple keyboard and display could be used.

            Thanks for the inspiration of allowing me to reminisce about my “laser show” days. We had a lot of good, clean fun!

            Peace and blessings.

        2. I used the speaker cone method as well with my HeNe laser back in the 80’s. I’ve still got that tube lying around somewhere..

          Having access to galvos, mircos and fast a/d converters at the time would have been magic.

          1. Any significantly advanced technology is imperceivable from magic (:
            I very slowly drilled a hole right through a large speeker a while back.
            Through the magnet, through the armature, and through the dome in the center of the cone.
            Then carefully glued a tiny glass lens over the hole in the dome. Perfect for focusing.
            I used four speakers around it in a box to pull around a second lens for targeting.
            I put too much current through it and it caught on fire. But it was fun whilst it lasted.

    1. Look up LASER MAME. There’s been two or three attempts to build contraptions for playing all the old vector arcade games with the MAME emulator and a LASER, but nobody bothered to actually finish the fine tuning or get galvos fast enough to do the more complex games without ending up with rounded off corners and other distortions.

      What could possibly work is using four LASERs and four galvo pairs to divide the display into quarters. But that would take even more tinkering with the vector game display code in MAME.

      Or how about making the LASER display device emulate an actual vector CRT to connect to original arcade hardware?

  3. Funny how this shows up as I’m starting to build an ILDA compatible laser projector. Bought a cheap ($100) “460mW” chinese unit that used servos, with separate mirror sets per color to start off with (mainly for the lasers and case). Then added on some half-decent galvos with powersupply, control electronics, ILDA interface. My hope is to get a couple more beam combiners and add another matching blue laser, end up with two RGB units in the same case. Where this gets into nightmare land is filing for FDA variances so I can use this in an outdoor laser show for Christmas.

  4. Using some interrupts and an Arduino due I made a simple crossover between 3d printer hardware and galvos a few years back.
    https://www.flickr.com/photos/andrewsharmon/16280336675/in/dateposted-public/

    I also did some SVG to Galvo via audio (then streamed over bluetooth to some hacked portable headphones)

    https://www.flickr.com/photos/andrewsharmon/24995268211/in/dateposted-public/
    https://www.flickr.com/photos/andrewsharmon/25062265076/in/dateposted-public/

    1. this looks brilliant. i’m interested in doing something similar using the tiniest components, to control a laser displayed image and be able to move it along xy axis. the purpose of it is do display the image on a HUD about 30cm away from the laser, the xy controls would position the image exactly where i want it. I know zilch about electronics, but would really appreciate it if you could let me know what components would be required to build something like this.

    2. Hi Andrew, I’m trying to do something similar, send a SVG file via Processing to a galvo laser, using a ESP32 to drive a two-channel DAC. You obviously got your system to work, so I was wondering if you published or shared your work somewhere? I’d love to learn from your project and help mine. Thanks in advance.

  5. Hi,
    I´d like to create a line with a galvo system to clean some parts with a laser source.
    I´m looking some component which could generate for me a differential analog output +/-10V, 16bits resolution, which I could control by a plc, it means just receive a ON/OFF signal from PLC and generate the analog signal for me. Have you guys seen something like this?

    1. @Gustavo
      There are lots of integrated circuit options and systems
      you could exploit to do exactly what you want but, not quite
      trivial for the home hobbyist. Its more an engineering challenge
      and from perspective routine for a graduate. The first step
      being clarifying the terms of reference and scope of work…

      ie.
      – Differential to mean two wires not ground referenced ?
      – Meaning have to be isolated from source & destination ?
      – Output swing + or – under digital control to 10v either way ?
      – PLC can turn output on or off or also set the 16 bit output +-10v ?
      – Then does that mean the 16 bit preset or also under PLC control
      – If static value represented in 16 bits what is the source, how set ?
      – What sort rate of change of output, an example duty cycle range ?
      – Guessing mains operated or would it need be battery ?

      Thats just a start but, in principle fairly straightforward depending
      on any incongruenices with the overall systems approach…

      I suggest looking at application notes from various DAC suppliers
      as this can be achieved without much drama, prob hire a tech or
      uni student locally, good luck :-)

  6. Wow! ~ 1980, a pair of 1 khz open loop galvos (scanners) w/scan amps were $1000. A 5 watt argon laser was $10,000. It required 30 gal/min of water cooling and 30 amps @ 408 Volts via 3 phase transformer. RYGB krypton lasers cost more, with 1/5 the output. Quadrature waveform generators were initially custom built unstable analog, then digital (as line drawings became possible). Total system cost was ~$40,000, including 3 phase power cables, connectors, cooling hoses, pump, filter, etc.
    Just learned about the Teensy, an amazing small micro controller capable of generating 16 bit digital 2 channel waveforms, and realized that it might be perfect for this application. So, with today’s inexpensive galvos and laser diodes, I’m on a mission to relive the past.
    Thanks for the pointers.

Leave a Reply to OstracusCancel reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.