New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Laser ON/OFF (M3/M5) dont work? #23

Closed
Ch3fk0ch88 opened this Issue Mar 25, 2017 · 19 comments

Comments

Projects
None yet
5 participants
@Ch3fk0ch88
Copy link

Ch3fk0ch88 commented Mar 25, 2017

Hi, i trie to engrave something like this:
unbenannt
But the result looks like this:
file_000
I testet the command m3 and m5 and the laser goes on and off.

@arkypita

This comment has been minimized.

Copy link
Owner

arkypita commented Mar 26, 2017

In order to use all of LaserGRBL feature, your engraver must supports laser power modulation through gcode "S command".

LaserGRBL use "S command" to reproduce pure black or white image as well as greyscale image.
"S command" control power modulation: the ability of arduino to generate a PWM signal that control the instant power of laser by switching it very fast through its driver "TTL" pin (M3/M5 could not switch laser so fast). I.e. S0 mean laser power = 0%, S255 mean laser power 100%, and S128 mean laser power 50% etc...

Indeed, to engrave an image composed only by the colors black and white would suffice the M3 and M5 commands, but to take full advantage of laser potential, the PWM modulation is really important.

@arkypita

This comment has been minimized.

Copy link
Owner

arkypita commented Mar 26, 2017

Please look at those link to read about power modulation and how to activate in your board.
http://blog.protoneer.co.nz/grbls-pwm-functionality-how-to-control-a-laser-or-variable-speed-spindle/
https://github.com/gnea/grbl/wiki/Connecting-Grbl#grbls-pins (PWM use pin 11)

How to modify driver to support laser power modulation:
https://forum.arduino.cc/index.php?topic=192733.0
https://forum.allaboutcircuits.com/threads/ttl-modulated-driver-for-laser.31275/
http://forums.reprap.org/read.php?133,703931

In addition version 1.1 grbl has added an important new feature for those who use the laser, which is precisely the "laser mode". To read anything more informed about it here:
https://github.com/gnea/grbl/wiki/Grbl-v1.1-Laser-Mode#laser-mode-overview

If you follow my instructions and you will activate the laser power modulation you will find a tool much more useful than what you have now.

Best regards

@Ch3fk0ch88

This comment has been minimized.

Copy link
Author

Ch3fk0ch88 commented Mar 26, 2017

Hi,
thanks.
at the moment i only can turn the laser on and off (have to reasearch on which way i can add a pwm inkl so DDL)

@arkypita

This comment has been minimized.

Copy link
Owner

arkypita commented Mar 26, 2017

Maybe I could add a config switch for who does not have PWM ability that replace all S command with M3/M5 command based on threshold. I added it on dev roadmap.

@Ch3fk0ch88

This comment has been minimized.

Copy link
Author

Ch3fk0ch88 commented Mar 26, 2017

Ok, thanks.

@arkypita arkypita referenced this issue Mar 26, 2017

Closed

Development Roadmap #10

15 of 22 tasks complete
@Ch3fk0ch88

This comment has been minimized.

Copy link
Author

Ch3fk0ch88 commented Mar 26, 2017

So,
i tried to use an PWM like this:
laser_driver
I normally use the 3055 on D12 to turn the laser on and off.

When i laser something it looks like it works (a bit).
But:

  1. I dont get the full power
  2. I cant enable the laser, only when it "draw something" it goes on. I cant turn it on manually to focus the laser for example.

(Just for Info)

@arkypita

This comment has been minimized.

Copy link
Owner

arkypita commented Mar 27, 2017

N° 1
You can not get full power even if you connect the control pin to fixed +5V?
S255 must produce a PWM modulation of 100% time +5V out of pin 11, so it is equivalent to a +5V when you issue a S255 command.

I suppose you don't have an oscilloscope to test signal on D11 but you could try to do some diagnoses with a led+resistor on D11
You can also do some measure with a multimeter on transistor Vce to see if you loose some power on transistor.

Also remove 10uF capacitor near Laser Diode. PWM control need to be fast in on/off operation, and capacitor add charging/discharging times when transistor open/close to ground.

P.s. i usually prefer MOSFET as switch when i design PWM circuit, but transistor could be ok too.

N° 2
gnea/grbl#72
#19

@Ch3fk0ch88

This comment has been minimized.

Copy link
Author

Ch3fk0ch88 commented Mar 27, 2017

Hi, no i dont have a oscilloscope.
When i connect the E3055 to D12 and disable #define VARIABLE_SPINDLE than i get full power.

I anyway want to test a MOSFET or a 555 timer as next step, greetings.

@arkypita

This comment has been minimized.

Copy link
Owner

arkypita commented Apr 2, 2017

Hi! Any news? Did you get it working with full power?

@Ch3fk0ch88

This comment has been minimized.

Copy link
Author

Ch3fk0ch88 commented Apr 2, 2017

Hi,
I have not ordered the things yet.
I wait to make a bigger order cause of the shipping costs (shipping is more expensive than the part itself^^)

@arkypita

This comment has been minimized.

Copy link
Owner

arkypita commented Apr 3, 2017

I know, it's a common problem.

By the way I don't know if LM317 could be easly used in a TTL circuit.
http://laserpointerforums.com/f67/pwm-ttl-controlled-driver-56027.html

Maybe it's easier to buy a ready laser driver with ttl like this one: http://www.ebay.co.uk/itm/12V-TTL-200mW-To-2W-445nm-450nm-Laser-Diode-LD-Power-Supply-Driver-Board-/322453276000?hash=item4b13b68560:g:a2UAAOSwhQhYyCzg

@arkypita

This comment has been minimized.

Copy link
Owner

arkypita commented Apr 3, 2017

In these days I made a version that allows to use LaserGRBL on machines that do not have the PWM control. I have not had a chance to test it properly, but if you want to try it and tell me if it works you can download it from here: https://github.com/arkypita/LaserGRBL/releases/tag/v2.5.1-pre

@Ch3fk0ch88

This comment has been minimized.

Copy link
Author

Ch3fk0ch88 commented Apr 3, 2017

I will test it net weekend.

Greetings.

@Ch3fk0ch88

This comment has been minimized.

Copy link
Author

Ch3fk0ch88 commented Apr 7, 2017

Hi,
i testet the Version.
But why i can only use Vectoring and this 1bit thing when i disable the PWM Support?
With this i 1 Bit it all time looks a but broken.
logo
unbenannt
file_000
( a bit to slow -.- ^^)

Greetings.

@arkypita

This comment has been minimized.

Copy link
Owner

arkypita commented Apr 7, 2017

The function called "Line To Line line tracing" is used to produce grayscale images modulating power, so it cannot be used for hardware setup without power modulation. So I have removed the option for PWM-less hardware.

1 bit dithering try to reproduce eye grayscales effect by creating a black points map. The dithering alghoritm could add some artifacts when white pixels are not "pure white".

http://lasergrbl.com/usage/raster-image-import/dithering-tool/
http://codegolf.stackexchange.com/questions/26554/dither-a-grayscale-image

But... your image is not a grayscale! Is a pure black logo. The best result for pure black logos is obtained with vectorization + filling. Try this combination, result will be OK!

@arkypita arkypita closed this Apr 18, 2017

@joncarns

This comment has been minimized.

Copy link

joncarns commented Oct 13, 2018

I have a similar issue, I have been able to connect. I can move the steppers however laser stays on from start to finish. if its plugged in the computer it is on regardless of having lasergrbl started or not. ive adjusted $32=1. unchecked the pwm box. didnt have this issue until i uploaded grbl v1.1.hex but i had no connectivity before that. ive ran the laser with t2laser however subscription issues rendered my computer without a hardware number. ive tried S0 m5

@StuartB4

This comment has been minimized.

Copy link

StuartB4 commented Oct 13, 2018

Hi joncarns.
What setup do you have?
Which laser, laser driver, Arduino Type etc,
Do you have any pics of the wiring / connections of the machine.

@ricardomagagnin

This comment has been minimized.

Copy link

ricardomagagnin commented Dec 22, 2018

Hi All,,
I have the same problem.
When I set M3 S255 the laser is turned on but without power..
I need to send M3 S2500 to have a powerful laser.
but, for me looks something is wrong because PWM should be from 0 to 255 only
It is very hard to control the power, any one has an idea?

@StuartB4

This comment has been minimized.

Copy link

StuartB4 commented Dec 23, 2018

You could try changing the PWM Frequency settings in the cpu_map.h file in Arduino Libraries.

untitled3

First make a copy of the original cpu_map.h file and put it somewhere safe, in case it needs to be replaced.

Open cpu_map.h with a text editor and find the section I have highlighted in the image below.
If the line numbers are different to the ones in my image it does'nt matter, just find the same highlighted section. This is the section you need:

// Prescaled, 8-bit Fast PWM mode.
#define SPINDLE_TCCRA_INIT_MASK ((1<<WGM20) | (1<<WGM21)) // Configures fast PWM mode.
// #define SPINDLE_TCCRB_INIT_MASK (1<<CS20) // Disable prescaler -> 62.5kHz
//#define SPINDLE_TCCRB_INIT_MASK (1<<CS21) // 1/8 prescaler -> 7.8kHz (Used in v0.9)
// #define SPINDLE_TCCRB_INIT_MASK ((1<<CS21) | (1<<CS20)) // 1/32 prescaler -> 1.96kHz
#define SPINDLE_TCCRB_INIT_MASK (1<<CS22) // 1/64 prescaler -> 0.98kHz (J-tech laser)

Change line 141 (4th line down in that section) by REMOVING // from the begining of the line to uncomment it.

Change line 143 (6th line down in that section) by ADDING // to comment it out.

It should then look like the image below.

Click File menu in your text editor and select Save so it overwrites the original in the library.
Recompile GRBL and re-upload to the Arduino for the changes to work.

untitled2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment