Forum Rule: Always post complete source code & details to reproduce any issue!
Page 2 of 2 FirstFirst 1 2
Results 26 to 42 of 42

Thread: Teensy Laser Control

  1. #26
    Junior Member
    Join Date
    Nov 2021
    Posts
    11
    No need to buy a differential board when they are so simple to build

    Click image for larger version. 

Name:	Galvo driver.jpg 
Views:	24 
Size:	25.4 KB 
ID:	27631

  2. #27
    Member
    Join Date
    Dec 2021
    Location
    No. 1s Business, USA
    Posts
    60
    Quote Originally Posted by Dmax View Post
    No need to buy a differential board when they are so simple to build
    Cool! Thanks for sharing that schematic, Dmax.
    I noticed that the jpg is named 'galvo driver'. Is this not a circuit that connects to the differential inputs of a galvo driver card, rather than the actual driver card?
    This is where your investments into electronics knowledge really pays off. Unfortunately, now $420 later, I've already purchased 3 DIY unipolar correction amp boards, plus 3 differential ILDA compliant amps.
    But, unless I'm mistaken, I could add the inverting amp to the unidirectional correction amps to make them compatible with the galvo drivers' differential inputs, right? That would eliminate the need for a show card inside the projector. Basically, my Teensy waveform generator module would replace that functionality. That's my intention for the differential amp boards, anyway. Nice to know that I have both options.
    I'm always very pleased to meet fellow laser enthusiasts/laserists, Dmax. I see that you are also a member of the PL forum. Perhaps our conversation would be more beneficial to those folks than here. JS
    Regarding my problem with the T3.x audio shields not being DC coupled, with the help of another person on a different thread, I've learned of a work around soultion by summing the outputs of slower I2C DC coupled quad DACs with the T3.x quad audio shields, prior to sending the signals to ILDA.
    Looks like my laser system will be up and running by next week, but only using an Akai MIDI controller, until the custom desk is finished.
    How cool is that?

  3. #28
    Junior Member
    Join Date
    Nov 2021
    Posts
    11
    " Is this not a circuit that connects to the differential inputs of a Galvo driver card" Yes that is correct, I named the jpg file Galvo driver because I have a quite a few other files that are driving other parts of my laser system and they are all at the preamp stage. Yes you could add the inverting amp to your unidirectional correction amps. "a member of the PL forum" Probably I sign up to forums and then forget I'm a member lol... I'm looking at using the Microchip DACs as I already have a few in my parts bin. if I remember right the MCP4802 and a MCP4822 both are dual channel the 02 being 8 bit and the 22 12 bit they have an SPI Interface so with some simple 74 logic I should be able to have 2x 02 DACs plus a 22 giving me all the channels I need. I hope to make a start on the board this weekend but I've been trying to find the time for the last 3 or 4 weeks lol...

  4. #29
    Member
    Join Date
    Dec 2021
    Location
    No. 1s Business, USA
    Posts
    60
    Dmax,
    Except for the non-DC coupling issue, the T3.x audio shields and the Teensyduino audio library are working very well for me. I'm pushing out 4 pairs of X/Y waveforms, 2 pairs of RGB waveforms, 4 premix LFOs for all, and final master LFOs on all 5 output channels. All of those waveform/mixer/LFO variables consume 126 MIDI controls levels. All of that is already happening, just within the T3.6 & I2S audio shields.
    I only need to add an Adafruit MCP4728 I2C audio DAC to sum in the DC & LFO outputs with what I already have. The T3.6 has 2 more DC coupled GPIO DAC outputs to complete the picture. But, those are only 0-3 VDC and have inherent offsets to overcome, as well. On the other hand, simply bump that voltage up to 5 VDC and use the DC offset for R & G color, perhaps? Perhaps not.
    TheHermit

  5. #30
    Member
    Join Date
    Dec 2021
    Location
    No. 1s Business, USA
    Posts
    60
    PROJECT UPDATE:
    I see some folks have followed this thread, of which has mostly been my novice conversations with some very helpful folks. My primary challenge has been regarding several failed attempts to overcome the capacitors (AC couplings) on the line outputs of the audio shields.
    Suffice it to say that I blew 2 audio shields + 1 T3.6 by attempting to replace those output caps with wire bridges. Then, after being coached through creating an alt I2C bus, I was able to add a quad I2C DAC to provide DC & LFO functionality. But, when I attempted to sum those signals with the quad I2S shields, I killed another T3.6 + 2 audio shields. Only one last set remained.
    SUCCESS!!
    After staring hopelessly at the audio shield's schematic (for the hundredth time), I noticed that the headphone outputs had no capacitors. So, I tried those instead and Voila'! The only problem was myself.
    The T3.6, with 2 GPIO DAC outputs + 2 audio shields (headphone outputs only) and the audio design tool are the perfect combination for a DIY laser controller. Shout out to "our pal, Dave" for his great YT Teensy Synth tutorial series, which guided me through the development of this laser synth.
    That's the great news! The bad news is that, after a late night's session of putting something together to record on video for everyone here, my T3.6 was dead this morning. The prototype stack of boards were separated by a piece of foam. It looks like the foam got hot, sagged, and allowed the T3.6 to touch the +/- 5VDC supply.
    BUT IT WORKED until it didn't. I witnessed the proof of concept, even if no one else had the pleasure. Nevertheless, I'm only more encouraged to press forward (aka, 'a gluten for punishment'?).
    Since the T3.6 isn't currently available, I've stocked up on a pair of T4.1's + 4 audio shields + a PT8211 I2S stereo DAC, hopefully to substitute for the T3.6's 2 GPIO DAC outputs that are no longer available on the T4.1.
    I assume that I can move the I2C (from T4.x SCL/SDA to SCL1/SDA1) by enabling Wire1, but what about DIN, WS, MCLK1. BCLK1, & LRCLK1? Can the existing audio library be modified to accommodate the multiplexing of 6 output DACs from a single I2S DIN?
    Any advice or guidance is most appreciated. Meanwhile, I'll be up to my ears in docs and all over this forum.

  6. #31
    Member
    Join Date
    Dec 2021
    Location
    No. 1s Business, USA
    Posts
    60
    Quote Originally Posted by Frank B View Post
    I2S_quad and PT8211_2 would work. But that needs all pins (ok, without input) from the 2nd I2S (AKA "SAI") port.
    However I have no idea if removing the capacitors from the shields is ok.
    Hello Frank,
    As it happens, the headphone outputs are already DC coupled, but I had to destroy 3 audio shields + 3 T3.6's
    to learn that lesson the hard way. IOW, I've run out of T3.6's and after ordering 3 PCBs the SMD parts for the CS42448 ae out of stock.
    But, I have a few T4.1's + 4 rev D audio shields and a PT8211 I2S DAC kit.
    It appears that MCLK isn't used, plus CLK & WS pins can be shared between the SGTL5000 and PT8211. So, I could physically stack the PT8211 on top of the 2 SGT5000 shields, as long as I cut the header pin#7, which is DIN already being used by SGTL5000-1.
    Shouldn't I be able to simply run a jumper from the PT8211's DIN pin #7 to the unused T4.1's pin #9, then change the DIN pin assignment within one of the audio libraries, such as output i2s hex.h, output pt8211 2.h, or output i2s.h?
    I saw an old 2016 post by tly, saying that there is such a file named, 'i2s.h', but that doesn't exist within my current audio library.
    Q2: I see that the pt8211 'normally' generates its own MCLK, but the SGTL5000 doc states that all I2S devices must be running in slave mode. Is that a deal breaker for their coexistence?
    Thank you for your assistance, Frank
    BR

  7. #32
    Member
    Join Date
    Dec 2021
    Location
    No. 1s Business, USA
    Posts
    60

    Project Update: 6 channel audio on T4

    Hi Folks,
    Just thought I'd share some 'How to's" instead of asking "How do?"
    To summarize in a nutshell, I'm using a T4.1 to develop a polyphonic laser synthesizer, which requires at least 5 DC coupled audio signals to create the laser imagery.
    So, the initial challenge was acquiring DC coupled audio signals in order to provide DC ofset positions for the beams, as well as DC levels to control RGB color mixing. The second was achieving 6 channels of synthesized waveforms.
    DC coupling is readily available from the headphone jacks on the SGTL5000 I2S stereo audio shields. But, the line outputs have a decoupling capacitor on each channel. So, that was my 1st ahah! moment to learn.
    The PT8211 I2S audio kit can be modified to provide DC coupled audio by simply replacing the output capacitors with wire jumpers while soldering the components together. The documentation for assembling the PT8211 kit is here;
    https://www.pjrc.com/store/pt8211_kit.html

    6 audio channels can be achieved by modifying and stacking 2 * SGTL5000 I2S audio shields + 1 * I2S PT8211 audio shield. There are T3.x and T4.x versions of both audio shields, so buyer beware while ordering.
    The modifications rquired for the T4.x I2S SGTL5000 audio shields to produce quad channel outputs are well documented here:
    https://forum.pjrc.com/threads/61123...l=1#post241517
    However, I discovered a gotcha while attempting to add the PT8211 shield for channels 5 & 6. The online PJRC Audio Design Tool lists 2 different PT8211 audio output devices, 'pt8211' and 'pt8211_2'.
    The T4 PCB in the kit has breakout pins that correspond to the pt8211 device, which has an I2S conflict with the SGTL5000 quad stack. But, the Audio Design Tool indicates that the pt8211_2 device uses T4.x pins 2, 3, & 4 for DIN, FS, & BK respectively. Therefore, those inputs to the pt8211 breakout PCB need to be moved from pins 7, 20, & 21. Since I was stacking the pt8211 on top of the other shields, I was able to easily clip the header pin #s 7, 20, & 21 prior to soldering them to the PT8211. That left empty holes on those inputs to solder jumper wires to reroute those inputs to T4 pins 2,3,& 4.
    These are the pics showing the modified stack of audio shields:

    Click image for larger version. 

Name:	Hex_Chan_Stack.jpg 
Views:	6 
Size:	81.8 KB 
ID:	28125

    Click image for larger version. 

Name:	pt8211_mods.jpg 
Views:	4 
Size:	71.5 KB 
ID:	28124

    This is the laser projector that they live in:
    Click image for larger version. 

Name:	3Watt_RGB_OPT_40kpps_T4_Projector.jpg 
Views:	9 
Size:	97.9 KB 
ID:	28126

    This is the custom T4.1 MIDI laser control desk layout, which is the next phase of this project.
    Click image for larger version. 

Name:	Hermit_MIDI_Controller.jpg 
Views:	7 
Size:	123.4 KB 
ID:	28127

    22" 10 point multitouch screen,
    8 * 600 ppr optical rotary encoders, w/8 * 16 RGB neopixel rings.
    8 * RGB backlit rotary encoders w/detents,
    32 * RGB backlit preset buttons,
    2 * 7" multipage Nextion Intelligent HMI touchscreens (2D gains, instead of mechanical faders),
    8 * bank/function buttons to modify the controls' functionality,
    Nanuk road case.
    Pure Data connects the MIDI controller, T4 waveform synth module, Cakewalk's DAW, and provides additional touchscreen GUI controls and visual feedback for each of the 20 oscillators, envelopes, mixers, etc.
    IOW, I'll probably be up to my ears with coding issues for the next 6 months. But, it's a labor of love, full of anticipation to see it all in action.
    I'm very grateful for the help from Paul, Frank, and others on this thread who have held my hand to get this far. TBH, I wish I could delete some of my groping around blindly, as well as some misinformation due to my misunderstandings. Perhaps there should be a Teensy Dummies group for that purpose. ;-)
    I think I can see a glimmer of light at the end of the tunnel, but can't tell whether it is an oncoming train.
    BR

  8. #33
    Junior Member
    Join Date
    Nov 2021
    Posts
    11
    I will be very interested to see how this works. you really need your system to update the galvo and rgb DACs at the same time for the best results , will you optimize the X/Y signals before you send them to the galvo DACS ? here is a picture of what I have so far, I'm using a Pixelblaze sensor expansion board to run a FFT spectrum on an audio signal and output the level of 32 frequency bands to one of the serial ports on teensy that way the teensy just needs to read those values saving a load I've still got a shit load of programming to do before its anywhere near ready... I'm going to use laserboy to optimize/convert DXF files that I will make in 3ds Max as I know that software like the back of my hand.. I will let you know how I get on as well as keep an eye on your project ..
    all the best

    Click image for larger version. 

Name:	Teensy_LC.jpg 
Views:	6 
Size:	195.7 KB 
ID:	28131

    Click image for larger version. 

Name:	Laser_01.jpg 
Views:	4 
Size:	118.6 KB 
ID:	28132
    Last edited by Dmax; 04-19-2022 at 07:10 PM.

  9. #34
    Member
    Join Date
    Dec 2021
    Location
    No. 1s Business, USA
    Posts
    60
    Quote Originally Posted by Dmax View Post
    I will be very interested to see how this works. you really need your system to update the galvo and rgb DACs at the same time for the best results , will you optimize the X/Y signals before you send them to the galvo DACS ?
    Thank you for your interest and advice. Yes, I'm using a modified ILDA conversion amp card w/differential outputs, from PLF HankLoydRight's ESP32 ILDA DAC, w/o the original ESP32 and DACs. But, initial tests have produced a low scan angle with an offset that the card's trim pots won't overcome.
    The small scan angle and offset is due to having only 0-3.3 V p-p coming from the Teensy's audio DACs.
    I also have Laserboy's mono signal output ILDA conversion amps, but haven't tried them, yet in preference for ILDA differential standards.
    I'm hoping to increase the gains of the ILDA amps and offset ranges of the cards with a few resistance mods. but, I'm no EE and am open to your suggestions.
    Currently constructing and assembling all of the previously pictured hardware.
    Once I get it all tweaked into something playable, I'll put together a (Welcome to the Machine , cliché I know, but what could be more appropriate for the return of an old retired laserist) project demo video to share.
    Are you interested inn this project as a professional or a hobbyist?

  10. #35
    Junior Member
    Join Date
    Nov 2021
    Posts
    11
    Like you I used to work with Lasers bloody great beasts that needed 3 phase power and water cooling most of them where made by spectra physics and used a krypton and argon gas mix, I always wanted my own but for practical and money reasons I never got anything bigger than a 5 mW He-Ne tube, so with the Diodes being so cheap now I decided to finally build a laser projector. its just for my own person use as I'm not in the laser game anymore.

    edit... "The small scan angle and offset is due to having only 0-3.3 V p-p coming from the Teensy's audio DACs." simply place an op-amp in line between the teensy and the amp boards input that should fix your gain problem.
    Last edited by Dmax; 04-19-2022 at 08:41 PM.

  11. #36
    Member
    Join Date
    Dec 2021
    Location
    No. 1s Business, USA
    Posts
    60
    OMG! Tell me about it! $50K Spectra Physics 165 or 172 ion gas monsters to tour with. (Only CoRads did mixed gas during my time.) Uninsurable blown glass tubes inside blown glass water jackets. Must blow all the water out before loading them into the truck headed to Norway to avoid breakage from ice. Coffin sized projectors mounted onto 10' high scaffolding or hanging from the upstage truss, above the drummer. 30 amp 3 phase power distribution to each laser.
    Custom designed, wire wrapped analog/digital control desks, designed by eccentric gurus. Detailed safety variance applications, including all beam paths, exposure calculations, and pre-show inspections by local authorities (who knew nothing about lasers).
    You were better off avoiding all of that. Yes, now the technology is much more accessible, affordable, and home friendly.
    Yes, we're obviously paddling together in the same boat.
    Welcome aboard!

    re: op amp buffer. Yes, I've already used a TL074 op amp from laserboy's kit to test a 2x gain summing amp on a previous test (which blew my audio shield, but probably not the cause). The only difference between that circuit and my ILDA conversion card is the value of the feedback resistors.
    Here's the schematic of the ILDA conversion circuit:
    Schematic_Audio to ILDA.pdf
    Last edited by TheHermit; 04-19-2022 at 10:50 PM.

  12. #37
    Member
    Join Date
    Dec 2021
    Location
    No. 1s Business, USA
    Posts
    60
    Second attempt to upload schematic:
    Try, try, again...

    Click image for larger version. 

Name:	Schematic_Audio to ILDA.jpg 
Views:	16 
Size:	93.9 KB 
ID:	28139
    Got it. JPG images are displayed. PDFs aren't.😎

  13. #38
    Junior Member
    Join Date
    Nov 2021
    Posts
    11
    Well I've been up most of the night unable to sleep for some unknown reason ?? ....

    ok my amp is much more simple, its more or less the same differential amp I posted at the top of this page.Click image for larger version. 

Name:	differential amp.jpg 
Views:	5 
Size:	146.2 KB 
ID:	28279 I will add some voltage protection before I get the PCB printed if I ever get it that far as it may just end up in a box as it is lol, I have most of the main code running now so I'm able to do tests now. I have a pixelblaze sensor board taking care of the FFT so the Teensy is free to do everything else its really simple to use, I can generate patterns on the fly but to do anything other than mathematical based roulette curves I'm going to need to be able to read ILDA files, right now I'm using Laserboy to convert the ILDA files to .WAV then I'm reading those, although I have to convert those files from 6 channel to two channel as I've yet to convert the C function I found online that only read one channel to six, I've got it reading two channels just to test the idea so it should only be a matter of adding a few more lines of code in the function, but the problem I do have right now is reading a large file as the function writes to a buffer and then reads out from that buffer which is no good if the file it a few Mbyte in size as it just causes the Teensy to crash I'm really not a programmer at all and I'm learning C++ as I go along or should I say stumbling along as I go lol, I will post up in these forums if I cant work it out so maybe someone will help out
    anyway chat soon

  14. #39
    Member
    Join Date
    Dec 2021
    Location
    No. 1s Business, USA
    Posts
    60
    Dmax,
    This looks like a great start to something ;-) So, you're using the pixelblaze sensor to digitize ILDA imagery converted to .wav, inputting that into the Teensy, then using this differential amp circuit to generate X/Y vector images on an oscope?
    If that's where you are, then I've trimmed back my Arduino sketch to 4 quadrature waveform generators, feeding X & Y mixers. That would provide you with the ability to generate your own vector imagery by modifying the frequencies, gains, etc. This is basically a 5 channel expansion of Notes & Volts YT channel's tutorial. The Teensy audio design tool setup is as follows:
    Click image for larger version. 

Name:	Basic_XYRGB_QOSCs.jpg 
Views:	3 
Size:	95.3 KB 
ID:	28280
    The corresponding sketch is attached. Perhaps it can save you some time in reinventing the wheel.
    ��
    Attached Files Attached Files

  15. #40
    Junior Member
    Join Date
    Nov 2021
    Posts
    11
    "So, you're using the pixelblaze sensor to digitize ILDA imagery converted to .wav" No the Pixelblaze is only used for the FFT algorithm its running, the Teensy will do everything else .. forgive me if you already know this but your sketch wont generate an optimized signal so when running at high speed it will cause problems when it comes to stopping the Galvos at a given point also a change of direction will also produce some ringing and over shoot. the Galvos have a mass that needs to be taken into account so you really need to optimize the signal before feeding it into the amps, You can think of the galvos as a set of low pass filters that will have peaks in their resonance at certain frequency's and that can play havoc with the frequency response. none of this will really matter if all you want to do is to display lisajous type patterns but anything other than that and you really should look into something else to generate the signals. also this is me being a little anal so please forgive me but your sketch will not generate true vector imagery because its output will be linear, vector imagery is generated point to point so its more on the generating coordinates by using a geometry base system and as such is a better choice for what we are trying to do here. of cause I could be wrong in my presumptuous bollocks that Ive just posted and you are adding something to optimize your signal which could by default also make it a more vector based system anyway whatever path your taking all that really matter is you get something working and you enjoy doing it.
    chat soon dude

    My system uses the SPI bus so those audio sketches wont work with it but thanks anyway oh and make sure you don't overdrive your galvos with that sketch because they can easily be permanently damaged by to high a frequency as well as to high a voltage..

  16. #41
    Member
    Join Date
    Dec 2021
    Location
    No. 1s Business, USA
    Posts
    60
    Dmax,
    Thanks for your feedback. Yes, I came from the days of GS124 open loop scanners and understand the inertial challenges of resonance peaks and the need for precise damping and feed back in those old scan amps. Of course, most of today's galvos come with pretuned, closed loop driver boards (w/o documentation specifying which trimpot does what.
    Admittedly, I'm new to today's galvos and just realized that I only wasted $ on no-name 40kpps galvos, but I'm pretty impressed with the DT-40's. I've presumed that the DT-40's would take whatever waveforms that I throw at them up to ~800Hz sine. The low budget 3watt RGB diode modules wouldn't hold alignment, either. My most recent projector is a 3 watt W3000 RGB OPT laser module. Much better build quality, color balance, and power.
    Anyway, I yes I'm more interested in harmonic waveforms, instead of computer generated line graphics. But, I still want 3 axis rotation, similar to Neon Captain's Radiator's functionality. At the moment, I happy to play with complex cycloids in synch with some psychil tunes. I was thinking about adding custom 'waveforms' to the audio library for vector generated graphics.
    Different strokes for different folks, but both methodologies use the same hardware. Except I'm also using usbMIDI for controlling waveform generators. Perhaps that functionality could also apply to what you're doing, with regards to selecting image presets, size, symmetry, position, color, etc. Having a DAW to automate all of those manipulations is very handy and easy to record and edit, especially while tied to the sound track(s). Looks like you're using a touchscreen, as well. I still need to learn Nextion's editor to set up multiple pages and communicate with encoder/button banks via I2C for the new desk.
    Speaking of being in synch, I've checked out your pixelblaze sensor board. Is it able to break out the audio spectrum into discrete values that could be used to amplitude modulate specific waveforms or to trigger events? That sounds like something I've been considering for some time.

  17. #42
    Junior Member
    Join Date
    Nov 2021
    Posts
    11
    cool and yes the pixelblaze sensor board is a great little board I'm not going to worry about midi control at all right now as its not something I need with this project I want the unit to be totally self contained I also ready have laser show that I can run on a laptop but the whole point of this project is that I don't have to carry around a computer. I want to be able to just plug it in and it will just run..

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •