Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Controlling a Laser with the Raspberry Pi

Lukas
July 06, 2018

Controlling a Laser with the Raspberry Pi

Lukas

July 06, 2018
Tweet

More Decks by Lukas

Other Decks in Technology

Transcript

  1. About Me - Software Engineer @ M3 - 12 years

    in Japan from Germany - Github: https://github.com/lukasjapan - Tech I like - Raspberry Pi - Kotlin/Java - Ruby - ... - Creator of “bt-speaker” - Bluetooth speaker Daemon for Raspberry Pi
  2. Index - Mission - Hardware - Raspberry Pi W Zero

    - Laser & Galvos - Power LEDs - Power supply - GPIO & Homebrew circuits - Software - Demo - Ilda-tools - Demo - TODO
  3. Mission - Control a laser with the Raspberry Pi -

    Draw pictures - Principle can also be applied to laser cutting, laser engraving, ...
  4. Raspberry Pi W Zero - The little brother in the

    Raspberry Pi family - Bluetooth/WLAN - HDMI - MicroUSB - GPIO (General Purpose Input Output)
  5. Laser & Galvos - Principle - Visible light laser -

    “Galvo Scanner” - Movable mirrors - One galvo controls one axis - 2D Projection with 2 signals
  6. Laser & Galvos - The real thing - Red laser

    module from Akihabara - Galvos imported from China - Driver Board included - 2 signal input (-10V ~ +10V) - (I broke the control board in process)
  7. Power Supply - The Chinese Way - No manual! -

    AC Input - 220V? - 110V? - Both? - DC Output - ±12V (-12V, 0V, 12V) - (maybe)
  8. Power Supply - My Way - 2 separate 12V inputs

    - DC Plug - Connect 12V of Input A to Input B - Connected inside module - Do not use same battery! - … if battery has multiple outputs
  9. Power supply - Application +12V | 24V 0V | 12V

    +12V | 0V 5V - Raspberry Pi Power LEDs 3V - Laser Module ±10V Laser Signal 12V-5V DC-DC Converter 3V Regulator ±12V Galvos
  10. GPIO - Generate Signals - General Purpose Input Output -

    0 or 3.3 V Output - 2 Pins with 0~3.3V Output - PWM
  11. GPIO - Sound over GPIO - Raspberry Pi plays audio

    via PWM - lower quality - cheap and dirty - Connecting PWM GPIO to soundcard - only way to output sound when using Pi W Zero - Play audio - interfaced data stream - timing (in kernel) - effectively maps sound samples to 0 ~ 3.3V - 2 channels - no low pass filter (condensators) - which is good for this application
  12. Homebrew Circuit - Raising the signal - galvo signal range

    is 20V - otherwise image is tiny - 0 ~ 3.3V → 2V ~ 22V (±10V) - Signal Shifting + Amplifying - Math/Programming - out = in * 6 + 2 - Circuit - OPAmp → - clamped by power voltage
  13. Homebrew Circuit - Raising the signal - galvo signal range

    is 20V - otherwise image is tiny - 0 ~ 3.3V → 2V ~ 22V (±10V) - Signal Shifting + Amplifying - Math/Programming: y = x * 3 + 12 - Circuit: OPAmp → The messy backside
  14. Homebrew Circuit - LED Controller - Controllable via 3.3 V

    signal - 3 channel RGB - additional 24V output - Parts - Transistors for LEDs - Power MOSFET for 24V output - ...
  15. Demo Setup - SSH Port forwarding - Over my public

    VPN - in Germany - This was the easiest setup - what a modern world we live in :)
  16. Demo Setup - SSH Port forwarding - Over my public

    VPN - in Germany - This was the easiest setup - what a modern world we live in :) 2 m 18652 km (round trip)
  17. Demo 1 - LEDs & Laser module - LED light

    blinking - Switch on Laser
  18. Ilda-tools - Ilda - International Laser Display Association - .ild

    - laser display (video) format - frames - points in each frame - big endian
  19. Ilda-tools - Library to process .ild files - https://github.com/lukasjapan/ilda-tools -

    Command line centric - Made with linux philosophy in mind - Do one thing but do it good - C++ - Work in progress
  20. Demo 3 - ilda-wav - Convert .ild files to .wav

    files - adjust pps - adjust play speed - adjust channels - ...
  21. Demo 4 - svg to ild - convert .svg files

    (vector graphics) to .ild files - used openlase svg2ild.py implementation - soon in ilda-tools
  22. TODO - ilda-tools - Audio to ilda (visualizer) - Video

    (contours) to ilda - OpenCV? - Emulator (GameBoy) to ilda - possible? - Blanking - Buy 2.1 channel external sound card? - Try to separately control over GPIO?