TTL laser 2W

Please, can anybody help me, how to wire & setup ramps 1.4 (mega2560) + repetier.
TTL laser driver:
https://www.aliexpress.com/item/12V-TTL-1W-2W-3W-445nm-450nm-Laser-Diode-LD-Driver-Power-Supply-Stage-Light-lighing/32684581863.html

I have problem with setting intensity, only On+Off works.
I use pin 11, 
in Configuration.h I set 
#define SUPPORT_LASER 1
#define LASER_PIN 11
#define LASER_ON_HIGH 1
#define LASER_PWM_MAX 255

I try modify Drivers.cpp
void LaserDriver::changeIntensity(uint8_t newIntensity)
{
    if(EVENT_SET_LASER(newIntensity))
    {
        // Default implementation
#if LASER_PIN > -1
//        WRITE(LASER_PIN,(LASER_ON_HIGH ? newIntensity > 199 : newIntensity < 200));
        analogWrite(LASER_PIN, newIntensity);
    }
}


Comments

  • You need to implement EVENT_SET_LASER so that it sets intensity as wanted and returns false. The required logic depends on the solution you choose. Is it a AVR pin with free timer, then you can set the time to intensity, but make sure the period is fast enough. Others have a chip with SPI connected to make it a pwm signal. If you just want to cut with laser controlling speed is enough.
  • thank you, I readed this answer in other thread,
    but implementation of this changes is above my options,
    it's works in grbl, but I want only one board with 1 code inside for cnc, laser & 3d printer...
  • We are working on V2 where PWM becomes a own class and we plan to also add hardware PWM if pins match. But might take a while until we are there. In that case you could just select the hardware pwm class.
  • thank you, good info :)
Sign In or Register to comment.