Close

The next hurdle

A project log for Laser Projector

Laser projector with 3 lasers (RGB) incident on an x-cube(dichroic) with galvanomirror

shoaib-mustafaShoaib Mustafa 09/16/2024 at 15:210 Comments

I've been experimenting with the setup trying to make the galvo movement as smooth as possible and for this i've been successful in implementing a triangle wave generator on the DAC with DMA, i've gotten the results and compared with the interrupt based output which was limited to 300 Hz, with DMA however i've tested the wave output to 200KHz, This creates many different opportunities for me. First i can rest assured that the microcontroller is not being the bottleneck and concurrent processing in the stm32 while the SCAN mechanism is running. 

I've discovered that the DMA has callbacks which i can use such as half-complete or full-complete. This allows us to change the one half of the array while the other half is being output. this way we can keep the lookup table updated. but i don't think we will need this as we just need a constant scanning mechanism. 

I've also gotten a bit better in the stm32cubeide, now i can use the debugging features such as live variables and use the debugger better. I also understand that an easy way to look for available functions is to look in the header file and use that. not everything is defined in reference manual or data sheet. 

I faced a problem while generating the triangle wave with DMA on the DAC; the wave had some weird peaks showing 

I tried to fix it by doing several things such as adding a bypass capacitor, low pass filter but it couldn't be fixed. in addition to the wrong waveform, the frequency it was showing was also wrong, almost triple of the calculated frequency. I then fixed it by changing the word size of the DMA from word to half word. this fixed the issue. 

I've also gotten hold of some better lasers which i've connected the power supply to by directly connecting to it's + and - also i'm working on developing a holder for the laser. before we use kinematic mirror mounts which allowed to make minute adjustment in x and y direction. but since this new laser is larger we can't fit it in there. 

The laser looks heavy stuff but it's just a slightly better laser than the usual pointer. I wouldn't be surprised if the same diode is used here as well. 

Right now I'm looking into somehow triggering the 2nd dac used for Y axis steering when the X axis DAC triangle wave is completed by using the complete callback. 

Discussions