Can Grbl-LPC set the power via IN and fire via L?

Is there a way to do the usual thing where power is set with a 20+ kHz PWM signal on IN and the laser is fired by pulling L to ground?

Bonus question: Is there a way to add pause (feed hold) and resume (cycle start) buttons?

In case anyone cares, here are the reasons why I’m not interested in the L-only PWM hack:

Setting IN to a fixed voltage and PWM on L does not look like it’s the way to do it. Controllers which support RF and DC tubes (e.g. Ruida RDC6442 G/S) use one pin for RF tubes and two pins for DC tubes. Why would they bother with another pin and a few extra components if this would be completely unnecessary? As far as I can tell, no controller you can find in Chinese or “Western” machines uses only one pin.

That one L PWM frequency works better for cutting and another works better for engraving also suggests that this isn’t quite right. You either lose power or fine-grained control. You don’t have this problem with two pins.

The wiring diagrams and pinouts from the power supply manufacturers also tell you how these two pins are supposed to be used. An L-only alternative isn’t mentioned anywhere. (Please correct me if I’m wrong.)

There doesn’t seem to be any advantage in using this L-only PWM hack. It seems to kind-of work, but not as good as using two pins. It isn’t equivalent or better. Therefore, I have no interest in using it.

wouldn’t this depend on what hardware you are using to control the voltage on IN since most boards do not have a Digital to Analog(D2A) converter to generate a variable voltage and that circuit would have to be fast enough to handle 254DPI at 300mm/s.

Do you have any links to sections of LPS docs which point out other ways to control power level and ON/OFF control differently than a fixed max voltage on IN and PWM on L?

BTW, with LinuxCNC I’m able to switch PWM base frequency on the fly. CAM tools don’t provide this option so the gcode would have to be edited or post processed to do this.

PWM on L and DC voltage on IN is not a hack, it’s the way all K40 Lasers with analog control work from the factory!

This makes absolute sens if you trace the internal logic of the K40 LPS.

I made alot of tests and don’t see ANY advantage of having PWM value and enable saparated in grbl, because grbl in laser mode does PWM 0 when laser is disabled.

By the way: The different frequency response has nothing to do with the used pin on the LPS, it 's a mix of material properties (time to burn) and over/undershoot of the LPS.

1 Like

K40s with analog or digital control panel cannot control the power via software.

With the analog control panel, you can adjust the voltage going to IN.

With the digital control panel, you essentially do the same thing. The frequency of the PWM signal going to IN is so high that it might as well be an analog voltage. (Same deal with Ruida controllers etc. This is how they adjust the power for DC/glass tubes.)

The M2 Nano controller then pulls L to ground when it wants to fire the laser.

When you raster engrave, it draws longer or shorter lines. What you get on L is a 1:1 representation of the pixel data. It’s not PWM. It’s not about adjusting the average power. It either fires for this pixel or it doesn’t.

With Grbl-LPC, IN is set to a fixed value of 5 V (or whatever you want to be the maximum) and then a PWM signal on L is used to fire the laser and its duty cycle is used to adjust the power. L is pulled to ground several times when it draws a single pixel.

Using a single PWM signal to adjust the power and to fire the laser (and to provide a pre-ionizing tickle) is how it’s done with RF/metal tubes. However, I do have a DC/glass tube which has much higher response times. You can’t pulse it like an RF/metal tube.

Of course I also don’t have software which adjusts the frequency to match the resolution in order to get the same amount of pulses for every pixel. Trotec’s JobControl does this kind of thing when you set the PPI to auto, for example.

Anyhow, I got a DC/glass tube and I want to talk to its power supply like a Ruida/Trocen/etc controller would. Or Mini Gerbil, for that matter. I want to do the usual thing and get the usual behavior.

When you tell the power supply to fire, it will try to ramp up the power to the chosen power level as quickly as possible. In the spec sheet, you can see things like >90% of the requested power in X time. Better power supplies may do a better job and ramp up and down a bit quicker.

When you ask for 100% power, but switch it on/off very quickly with a 50% PWM signal, getting more output that 8 mA isn’t really overshooting. You asked for 100%, but it couldn’t pulse that quickly. It’s undershooting in a sluggish manner.

Well, I’m not really interested in this new can of worms. I want the old can of worms I’m familiar with.

There is a major difference between diy firmwares (like smoothieware, marlin, grbl) and commercial machines (like Ruida, Trotec…).

Commercial machines use PPi rastering with fixed laser power for grayscale engraving.
The diy firmwares try to modulate the laser power for each pixel.

But I see, you are not interested in my experience and prefer your theory, so I suggest to go with a commercial controller, and I’m out…

Smoothieware, Grbl_ESP32, and Mini Gerbil’s Grbl fork can/do use two pins.

I’m not interested in these experiments. Using one pin less isn’t a major advantage. There are quite a lot of wires. One wire less doesn’t really affect anything. I would like to do the usual thing with the known/specified/as-designed behavior.

For what it’s worth, I do regret outlining why I’m not interested in using a single pin. I kind of anticipated that I’d get defensive replies, but I also really didn’t want to hear how using one pin works almost as good etc. I wanted to shoot that down. Looks like that didn’t work either. I really only wanted to know if there is a way to make it work like 99% of the other controllers.

Yea, I’ll probably do that.

Thanks for your time. I should have kept this a lot shorter.