Laser Tutorial Question

Ok so some progress… Flash it to pin 42. Now I have on and off at least. I do not however have variable voltage. It turns on at 51% - 100% it is off at 0% - 50%. Always sitting at approximately 4.5v it does not go above that voltage.

I completed all the steps I outlined. The laser burns but it seems to be stuck at max power I guess if 42 is 4.5 volts. Is the mega board toast? Surprisingly enough after hitting it with the 12v polarity reversed the driver still seems to function normally.

Can you zip up and post your marlin folder? I’ll take a look after work. If the laser responds then your connections are good.strange that you’re not getting pwm output, just digital on and off.

I still think you should troubleshoot by flashing a simple sketch that does analogwrite to pin 42 with a value of 127 and then check to see if you read about 2.5 volts on the pin. If you do then your firmware configuration is the issue, otherwise you have a damaged mega board.

My bad:( I think I gave you some bad info.I just reviewed the mega pin mapping and ramps schematic and it looks like pin 42 isn’t PWM capable which explains why you’re only getting digital highs and lows out of it. The A5 pin on that aux2 block should be able to generate the pwm output that you need.

ok so change 42 to A5 in the pins_ramps_13 file?

Yup. That should work but you’re the guinea pig here. Definitely won’t hurt to try it.

No problem. I trust you. :slight_smile:

Info I can find suggest that, that pin is PWM capable so hopefully this works as planned… Exciting lol

I understand that this is full a full diy laser component…
But if I would buy a 2W laser with ttl support and driver from a cheap Chinese store, I assume I can still follow the steps for the Arduino control?

I just have my MPCNC built and doing my first testruns with a pen, so I am sourcing my toolset now.

@Michael Hensen
Yeah, a cheap Chinese laser should work as long as it supports the 0-5V TTL control signal. In that case you can just follow the instructions for re-mapping the pin. Some drivers, like the Jtech Photonics , support 12V control signals and can be connected to the D9 fan output on the Ramps board directly without re-mapping to a different pin.

Changed Fan_pin to A5 and now I get the error

temperature.cpp: In function ‘void tp_init()’:
temperature.cpp:894: error: ‘DIOA5_DDR’ was not declared in this scope
temperature.cpp:894: error: ‘DIOA5_PIN’ was not declared in this scope

any ideas?

could it be pin 59? looking a pin diagram show pin a5 d59… I am just guessing here…

RAMPS-AUX2600.png

I’m not at my pc right now but I’m guessing you need to leave off the A in A5 as just use 5bucks itself. A5 is ok in an arduino sketch but in this case it looks like it’s being passed to a function that expects an integer value.

I will go and try 5 and 59 right now

It accepted it with 5 but i get no voltage at all on that pin

Ok so it was 59… But it was the same as pin 42. No PWM only on or off.

It’s possible that the mega board got damaged from the reverse polarity connection then.Might not be worth all the troubleshooting to save $10.

Would my 5v regulator on the mega cause this? I assume yes. The regulator chip looks like it let the magic smoke out. Looks like there is a tiny burn hole in it. Had to see in the pic but can kinda see it.

Ok so… my replacement Mega came in WOOT!!! Plugged it all in TTL 5v works great on pin 44. Then I check movement… None of my steppers move other then homing on X axis. Nothing, not even homing on Y or Z… F#%#%#$%# resistor is attached to T0. So I connect up my old mega. X,Y and Z move but the end stops are dead, it just grinds away when it hits the end stops. Upon some closer inspection of the ramps board I see a bunch of brown spots in the red mask… Must have fried my ramps too.

I just do not understand how I could have such different operation from 2 different mega boards like that. They are both flashed with the exact same firmware. So new ramps board ordered arriving tomorrow. This better F#$%! work. LOL

Not moving other hitting the home button means it thinks the endstops are triggered. Meaning you set the firmware wrong or wired your endstops wrong.

If you flash my firmware with no endstops plugged it it should move fine, if not your board is shorted near the endstop pins.

Grinding away, when homing, means the endstops are plugged in the wrong way, max instead of min.

I highly suggest unplugging your endstops and using my firmware, if you are using the laser edit my firmware.

I flashed the new mega with the exact same version of your firmware that was working perfectly prior to my mega blowing up… No wiring has changed everything was plugged back in the exact same way.

I use the no graphic lcd version of your firmware. I have a second folder with the edits done for the laser. Everything was working 100% until I plugged the laser driver power in backwards as leo mentioned earlier.

Its really weird how the 2 mega boards are behaving differently although the firmware is identical.

Will see what happens when the new ramps arrives tomorrow. Start back from square 1… I just hope it didnt damage this new mega board too.