How to properly connect LASER and control its power?
- abs32
- Offline
- New Member
-
Less
More
- Posts: 9
- Thank you received: 0
15 Oct 2025 14:41 - 15 Oct 2025 15:10 #336503
by abs32
How to properly connect LASER and control its power? was created by abs32
I read forum.linuxcnc.org/10-advanced-configura...pwm-output-for-laser, read Google + AI. The result is zero.
Let's keep it simple. Let's say my configuration doesn't mention anything about the spindle or the laser.
How exactly should I format the hal file?
The scenario is as follows: there is a laser, controlled by PWM via LPT. It has been proven that the laser itself works. It has been proven that PWM also works (because we control the spindle through it).
The documentation indicates that we must set several mandatory parameters. It would seem that this is sufficient.
linuxcnc.org/docs/2.8/html/man/man9/pwmgen.9.html
forum.linuxcnc.org/media/kunena/attachme...19092/FRANKENLAB.hal
forum.linuxcnc.org/media/kunena/attachme...-mill_2019-07-26.hal
#spindle section
loadrt pwmgen output_type=0
addf pwmgen.make-pulses base-thread #enabled PWM frequency signal generation
addf pwmgen.update servo-thread #enabled control synchronization with the servo cycle
net spindle-pwm <= pwmgen.0.pwm #set the name of the signal controlled by the pwmgen.0.pwm signal
net spindle-pwm => parport.0.pin-14-out #set the LPT port pin to which the signal is transmitted
setp pwmgen.0.dither-pwm true #enabled frequency regulation stepping
setp pwmgen.0.pwm-freq 100.0
setp pwmgen.0.scale 24000
The spindle can be controlled normally with these parameters. If you connect a laser PWM to pin 14 instead, the laser should work somehow, either via M68 or M3S24000.
But the laser does not turn on. Only with the forced activation button on the laser body, and immediately at 100% power.
What am I doing wrong?
Let's keep it simple. Let's say my configuration doesn't mention anything about the spindle or the laser.
How exactly should I format the hal file?
The scenario is as follows: there is a laser, controlled by PWM via LPT. It has been proven that the laser itself works. It has been proven that PWM also works (because we control the spindle through it).
The documentation indicates that we must set several mandatory parameters. It would seem that this is sufficient.
linuxcnc.org/docs/2.8/html/man/man9/pwmgen.9.html
forum.linuxcnc.org/media/kunena/attachme...19092/FRANKENLAB.hal
forum.linuxcnc.org/media/kunena/attachme...-mill_2019-07-26.hal
#spindle section
loadrt pwmgen output_type=0
addf pwmgen.make-pulses base-thread #enabled PWM frequency signal generation
addf pwmgen.update servo-thread #enabled control synchronization with the servo cycle
net spindle-pwm <= pwmgen.0.pwm #set the name of the signal controlled by the pwmgen.0.pwm signal
net spindle-pwm => parport.0.pin-14-out #set the LPT port pin to which the signal is transmitted
setp pwmgen.0.dither-pwm true #enabled frequency regulation stepping
setp pwmgen.0.pwm-freq 100.0
setp pwmgen.0.scale 24000
The spindle can be controlled normally with these parameters. If you connect a laser PWM to pin 14 instead, the laser should work somehow, either via M68 or M3S24000.
But the laser does not turn on. Only with the forced activation button on the laser body, and immediately at 100% power.
What am I doing wrong?
Last edit: 15 Oct 2025 15:10 by abs32.
Please Log in or Create an account to join the conversation.
- tommylight
-
- Away
- Moderator
-
Less
More
- Posts: 20759
- Thank you received: 7066
15 Oct 2025 15:06 #336505
by tommylight
Replied by tommylight on topic How to properly connect LASER and control its power?
This has been already answered and promptly ignored here
forum.linuxcnc.org/10-advanced-configura...aser?start=30#336428
-
How many inputs does it have?
forum.linuxcnc.org/10-advanced-configura...aser?start=30#336428
-
You should have started with this as it clearly shows the wiring is incorrect or there is a signal mismatch, so what does your laser input work with?The spindle can be controlled normally with these parameters. If you connect a laser PWM to pin 14 instead, the laser should work somehow, either via M68 or M3S24000.
But the laser does not turn on. Only with the forced activation button on the laser body, and immediately at 100% power.
How many inputs does it have?
Please Log in or Create an account to join the conversation.
- abs32
- Offline
- New Member
-
Less
More
- Posts: 9
- Thank you received: 0
15 Oct 2025 15:12 #336506
by abs32
Replied by abs32 on topic How to properly connect LASER and control its power?
The laser has 3 inputs. PWM, +12v and ground.
Please Log in or Create an account to join the conversation.
- tommylight
-
- Away
- Moderator
-
Less
More
- Posts: 20759
- Thank you received: 7066
15 Oct 2025 15:29 #336507
by tommylight
Replied by tommylight on topic How to properly connect LASER and control its power?
OK, 5V TTL, so should work as is, but did you wire the GND on BOB to GND on laser?
Please Log in or Create an account to join the conversation.
- abs32
- Offline
- New Member
-
Less
More
- Posts: 9
- Thank you received: 0
15 Oct 2025 15:41 - 15 Oct 2025 15:50 #336508
by abs32
Replied by abs32 on topic How to properly connect LASER and control its power?
Good question. The laser has three inputs:
1. PWM
2. +12V
3. Ground.
Is 3 ground or -12V?
The laser itself operates from the mechanical switch button on the laser. Logically, it needs a separate + and a separate -. I don't see a ground contact.
When attempting to connect pin 3 (ground) of the laser to the ground of the control board (instead of minus 12V), the laser does not flash and the fan does not spin.
1. PWM
2. +12V
3. Ground.
Is 3 ground or -12V?
The laser itself operates from the mechanical switch button on the laser. Logically, it needs a separate + and a separate -. I don't see a ground contact.
When attempting to connect pin 3 (ground) of the laser to the ground of the control board (instead of minus 12V), the laser does not flash and the fan does not spin.
Last edit: 15 Oct 2025 15:50 by abs32.
Please Log in or Create an account to join the conversation.
- abs32
- Offline
- New Member
-
Less
More
- Posts: 9
- Thank you received: 0
15 Oct 2025 16:00 - 15 Oct 2025 16:13 #336509
by abs32
Replied by abs32 on topic How to properly connect LASER and control its power?
Connected the laser mounting screw to the machine and the control board ground contact with a wire. No changes.
I connected a voltmeter directly to the wire at the laser input.
At m30, the voltage is 0.26, and at m3, the voltage is 4.7. The spindle frequency converter is connected here as well and is controlled normally.
The machine controller board indicator also responds appropriately—it turns on and off at m3 or m30.
I connected a voltmeter directly to the wire at the laser input.
At m30, the voltage is 0.26, and at m3, the voltage is 4.7. The spindle frequency converter is connected here as well and is controlled normally.
The machine controller board indicator also responds appropriately—it turns on and off at m3 or m30.
Last edit: 15 Oct 2025 16:13 by abs32.
Please Log in or Create an account to join the conversation.
Time to create page: 0.169 seconds