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

Controlling a Laser with the Raspberry Pi

E9a8393b5ad337ea9103d50169aa6d32?s=47 Lukas
July 06, 2018

Controlling a Laser with the Raspberry Pi

E9a8393b5ad337ea9103d50169aa6d32?s=128

Lukas

July 06, 2018
Tweet

Transcript

  1. Controlling a Laser with the Raspberry Pi M3 Techtalk #96

    2018/7/6 M3 Inc., Lukas Prasuhn
  2. 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
  3. Index - Mission - Hardware - Raspberry Pi W Zero

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

    Draw pictures - Principle can also be applied to laser cutting, laser engraving, ...
  5. Hardware

  6. Raspberry Pi W Zero - The little brother in the

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

    “Galvo Scanner” - Movable mirrors - One galvo controls one axis - 2D Projection with 2 signals
  8. 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)
  9. Power LEDs - Max 3W - Red - Green -

    Blue
  10. Power Supply - The Chinese Way - No manual! -

    AC Input - 220V? - 110V? - Both? - DC Output - ±12V (-12V, 0V, 12V) - (maybe)
  11. 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
  12. 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
  13. GPIO - Generate Signals - General Purpose Input Output -

    0 or 3.3 V Output - 2 Pins with 0~3.3V Output - PWM
  14. 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
  15. 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
  16. 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
  17. 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 - ...
  18. Software

  19. Demo Setup - SSH Port forwarding - Over my public

    VPN - in Germany - This was the easiest setup - what a modern world we live in :)
  20. 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)
  21. Demo 1 - LEDs & Laser module - LED light

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

    - laser display (video) format - frames - points in each frame - big endian
  23. 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
  24. Ilda-tools - Alternative: Openlase - https://github.com/marcan/openlase - Jack (sound daemon)

    centric - partly closed source - Python / C, C++
  25. Demo 2 - ilda-player - Play .ild files on computer

    - FLTK
  26. Demo 3 - ilda-wav - Convert .ild files to .wav

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

    (vector graphics) to .ild files - used openlase svg2ild.py implementation - soon in ilda-tools
  28. 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?