No config files

What is your power source for the laser? Is it that 12v power supply?

At this point I’m not sure how to proceed. The laser that you are using has been reviewed with poor ratings. Ratings are not all that accurate, but this laser has several instances of failure.

I have no experience with grbl on the Arduino MEGA, so that is an unknown for me as well. Sonny has said that there would be limited support for the 2560 as a temporary expansion beyond the capabilities of the 328P.

You have already picked up the PWM move to pin D7, so that is not the issue.

Most likely you don’t have an oscilloscope to test the PWM output from D7.

If you changed the max RPM back to 255 before your last G-code test, then you had good G-code and should have gotten the expected results.

My guess at this point is that you have a defective laser.

PS Don’t know why the forum software labeled this as a reply to Neil

@LarryM Specifications:
Laser Wavelength: 445nm (blue)
Output Power: 2500mW (2.5W)
Driving Mode: External ACC constant current drive
Power Supply Voltage: 12VDC
AC Adaptor Plug: US
AC Adaptor Input Voltage: 100-240V
Lens Material: Optical glass with coating
Light Form: Dot, adjustable-focus
Modulation: TTL
PWM Control: Support
Other Function: Weak light positioning

Are you powering with the 12V?

YES

And what about the little switch?

powered by ac adaptor for 12V

How can a TTL laser work at different power levels? Am I missing something in this thread?

May be a case of bad documentation.

Driving Mode: External ACC constant current drive
Power Supply Voltage: 12VDC
AC Adaptor Plug: US
AC Adaptor Input Voltage: 100-240V
Lens Material: Optical glass with coating
Light Form: Dot, adjustable-focus
Modulation: TTL
PWM Control: Support
Other Function: Weak light positioning

1 Like

Or maybe “PWM Control: Support” just refers to the use of a PWM signal to trigger TTL?:thinking:

Thanks John for joining the thread to help.

@LarryM @NeilFerreri1 @JohnChamplain
Please answer the following questions.

Q1: So in your opinion the laser is working only on TTL not PWM ? My concern is If that is the case then why does it power on with less power as compared to running is straight not thru the mega2560?

Q2: in GRBL 1.1 do i have to define varaible spindle ? if yes which config file is better to define.

Q3: Which value do you think shall #define MINIMUM_SPINDLE_PWM 5 have 5 or greater?

Q4: What will the best test to test to test if PWM is not working at all ?

I am trying the following:
G21
G90
M4 S1; Laser OFF
G0 X10 Y10
M4 S62; Laser On @ Power Level: 62
G1 Y25 F800.0
M4 S1; Laser OFF

G0 X20 Y10
M4 S125; Laser On @ Power Level: 125
G1 Y25 F800.0
M4 S1; Laser OFF

G0 X30 Y10
M4 S255; Laser On @ Power Level: 255
G1 Y25 F800.0
M4 S1; Laser OFF

G21
G90
M4 S1; Laser OFF
G0 X0.000 Y0.000
G4 P0.1

Quote from an Amazon review of the laser:

I turned the Laser off and connected my Oscilloscope to watch the signals. The TTL pulse was clean, no noise. Firing the laser on purpose never functioned. It is a very simple process. I spent hours trying to get the diode to act right.

Q1: No. My opinion is that the laser is not working correctly.
Q2: Grbl 1.1f should have variable spindle defined. If you compile it yourself then you need to make sure that variable spindle is defined in config.h
Q3: just use the default - which I think is disabled
Q4: you would need an oscilloscope

M4 is the wrong command to test PWM - 1.1f made M4 a special case when in laser mode.

M4 S1 is not laser off

1 Like

Thanks.

Modulation: TTL
PWM Control: Support
Other Function: Weak light positioning <<<<<<< ???

I’m guessing that’s the switch I asked about.

@LarryM @JohnChamplain

Which pin and command to use to turn laser on /off only NO PWM ?
Thanks.

Same pin and commands. Use maximum RPM (M3 Smax) as on and S0 or M5 as off.

Thanks larry.
I have requested the seller to refund to replace the laser.
In the meantime, i want to try AudrinoUno board which i was using previously.

Q1:What is your opinion ?

Q2: if yes what vesrion of GRBL and which pins shall I use ?

Q3: Include any other suggestions?

Thanks.

Q1 The arduino code base is much more stable than the 2560 firmware.

Q2 If you are going to pursue laser work use this version of grbl (for testing, if you want to move to 1.1f at a later time you can do so). The PWM pin is D11.

Q3 Not sure at this point.

Do you think it will be better idea to disable Z axis for testing using the code below:
here’s how to do it. You’ll see two lines in the config.h file like so:

#define HOMING_CYCLE_0 (1<<Z_AXIS) // REQUIRED: First move Z to clear workspace.
#define HOMING_CYCLE_1 ((1<<X_AXIS)|(1<<Y_AXIS)) // OPTIONAL: Then move X,Y at the same time.
Change these two lines to look like:

#define HOMING_CYCLE_0 (1<<X_AXIS)
#define HOMING_CYCLE_1 (1<<Y_AXIS)
That’s it! Re-compile and re-flash Grbl via the uploading procedure outlined in the Grbl Wiki.