Change spindle with laser and problem with PWM
03 Apr 2024 11:23 #297498
by sonik
Change spindle with laser and problem with PWM was created by sonik
Hi everyone,
this is my first post here. Not really new to linuxcnc i built my first router in 2016. Now i bought a small laser and i have the problem that the laser is always full on as soon as i start the machine. I never worked with spindlespeed inside linuxcnc, but with an external vfd drive manually.
I did configure the pwm on parallel port pin 1 with stepconf as this is how my breakoutboard works. I assume that the problem is my hal or ini file, Probaby something is missing but i couldn't find out.
Linuxcnc is generating a pwm out at 10V stable, my driver board for the laser turns to green as soon as i hook up the pwm source, so pwm is basically working expect it seems to be always at 100%. I run a testfile created with lightburn and the laser never turns off.
I use a cheap chinese mach3 Breakoutboard, the one with the blue relay and a laser LT-80-W.
I am happy for any hint pointing in the right direction.
THANKS
this is my first post here. Not really new to linuxcnc i built my first router in 2016. Now i bought a small laser and i have the problem that the laser is always full on as soon as i start the machine. I never worked with spindlespeed inside linuxcnc, but with an external vfd drive manually.
I did configure the pwm on parallel port pin 1 with stepconf as this is how my breakoutboard works. I assume that the problem is my hal or ini file, Probaby something is missing but i couldn't find out.
Linuxcnc is generating a pwm out at 10V stable, my driver board for the laser turns to green as soon as i hook up the pwm source, so pwm is basically working expect it seems to be always at 100%. I run a testfile created with lightburn and the laser never turns off.
I use a cheap chinese mach3 Breakoutboard, the one with the blue relay and a laser LT-80-W.
I am happy for any hint pointing in the right direction.
THANKS
The following user(s) said Thank You: Trondwell
Please Log in or Create an account to join the conversation.
- tommylight
- Away
- Moderator
Less
More
- Posts: 19196
- Thank you received: 6434
03 Apr 2024 19:17 #297524
by tommylight
Replied by tommylight on topic Change spindle with laser and problem with PWM
Laser requires having values besides switching on and off, so if scaled properly that would be
M3 S0 for laser off
M3 S100 for laser at full power
That should be done in post-processing in CAM software, and it works OK for Vector drawings.
For raster drawings, using spindle output is not OK as it stops motion to change speed, but using M67 works nicely. M67 works also for vector, so it would be best to use this.
forum.linuxcnc.org/10-advanced-configura...posing-a-pic?start=0
forum.linuxcnc.org/show-your-stuff/46752...ver-etcher-scratcher
Configs attached on both topics, use the ones on the last link as they also have provisions for stopping the laser/pwm when pressing ESC or stopping program execution.
M3 S0 for laser off
M3 S100 for laser at full power
That should be done in post-processing in CAM software, and it works OK for Vector drawings.
For raster drawings, using spindle output is not OK as it stops motion to change speed, but using M67 works nicely. M67 works also for vector, so it would be best to use this.
forum.linuxcnc.org/10-advanced-configura...posing-a-pic?start=0
forum.linuxcnc.org/show-your-stuff/46752...ver-etcher-scratcher
Configs attached on both topics, use the ones on the last link as they also have provisions for stopping the laser/pwm when pressing ESC or stopping program execution.
Please Log in or Create an account to join the conversation.
10 Apr 2024 14:36 #297931
by sonik
Replied by sonik on topic Change spindle with laser and problem with PWM
Thanks for the answer but this didn't help me.
First of all, the gcode which lightburn generates is using M67. I then read thatNoteM67 will not function unless the appropriate motion.analog-out-nn pins are connected in your HAL file to outputs.
I don't have that in my hal-file generated by stepconf. So i probably need to connect that to some pins or signals or whatever and put it into the custom-hal. I just have no clue how to do that.
I tried adding this :
net analogout motion.analog-out-00 => pwmgen.0.value
net laserpwm pwmgen.0.pwm => parport.0.pin-01-out
but then linuxcnc is complaining about :
./custom.hal:3: Pin 'pwmgen.0.value' was already linked to signal 'spindle-cmd-rpm'
I attach my latest hal and ini files.
First of all, the gcode which lightburn generates is using M67. I then read thatNoteM67 will not function unless the appropriate motion.analog-out-nn pins are connected in your HAL file to outputs.
I don't have that in my hal-file generated by stepconf. So i probably need to connect that to some pins or signals or whatever and put it into the custom-hal. I just have no clue how to do that.
I tried adding this :
net analogout motion.analog-out-00 => pwmgen.0.value
net laserpwm pwmgen.0.pwm => parport.0.pin-01-out
but then linuxcnc is complaining about :
./custom.hal:3: Pin 'pwmgen.0.value' was already linked to signal 'spindle-cmd-rpm'
I attach my latest hal and ini files.
Please Log in or Create an account to join the conversation.
10 Apr 2024 14:57 #297934
by PCW
Replied by PCW on topic Change spindle with laser and problem with PWM
If you want the PWM to be controlled by the M67 value
you would delete (or just comment-out) this line:
net spindle-cmd-rpm => pwmgen.0.value
you would delete (or just comment-out) this line:
net spindle-cmd-rpm => pwmgen.0.value
Please Log in or Create an account to join the conversation.
- tommylight
- Away
- Moderator
Less
More
- Posts: 19196
- Thank you received: 6434
10 Apr 2024 15:43 #297939
by tommylight
You are on the right path, see PCW above and i would delete everything regarding the spindle and just adding the PWM parts from the files you got on the links above.
Also do copy the stuff about disabling the laser on stop, esc and pause.
Replied by tommylight on topic Change spindle with laser and problem with PWM
Stating it did not help and then using hal entries from the files you found there, is not polite.Thanks for the answer but this didn't help me.
First of all, the gcode which lightburn generates is using M67. I then read thatNoteM67 will not function unless the appropriate motion.analog-out-nn pins are connected in your HAL file to outputs.
I don't have that in my hal-file generated by stepconf. So i probably need to connect that to some pins or signals or whatever and put it into the custom-hal. I just have no clue how to do that.
I tried adding this :
net analogout motion.analog-out-00 => pwmgen.0.value
net laserpwm pwmgen.0.pwm => parport.0.pin-01-out
but then linuxcnc is complaining about :
./custom.hal:3: Pin 'pwmgen.0.value' was already linked to signal 'spindle-cmd-rpm'
I attach my latest hal and ini files.
You are on the right path, see PCW above and i would delete everything regarding the spindle and just adding the PWM parts from the files you got on the links above.
Also do copy the stuff about disabling the laser on stop, esc and pause.
Please Log in or Create an account to join the conversation.
11 Apr 2024 09:00 #297993
by sonik
Replied by sonik on topic Change spindle with laser and problem with PWM
Sorry, didn't want to be not polite. It's just that the entries didn't work in my case, probably because of all that spindle-stuff still in my hal. So you and PCW pointed me in the right direction (i hope) . I will try later on and let you know...
The following user(s) said Thank You: tommylight
Please Log in or Create an account to join the conversation.
11 Apr 2024 16:47 #298009
by sonik
Replied by sonik on topic Change spindle with laser and problem with PWM
So i am getting a bit further, not quite there yet, but...
after commenting out all that spindle stuff, the main lines are:
setp pwmgen.0.pwm-freq 1000.0
setp pwmgen.0.scale 100.0
setp pwmgen.0.offset 0.0
setp pwmgen.0.dither-pwm true
net analogout motion.analog-out-00 => pwmgen.0.value
net laserpwm pwmgen.0.pwm => parport.0.pin-01-out
But my laser still outputs 100%. So i opened some hal-meters:
pwmgen.0.value is showing correct values (0.2 for a 20%pwm)
parport.0.pin-01-out : FALSE
laserpwm : FALSE
motion.analog-out-00 showing correct values
I also tried loadrt pwmgen output_type=0 or 1, no difference.
Any ideas ?
after commenting out all that spindle stuff, the main lines are:
setp pwmgen.0.pwm-freq 1000.0
setp pwmgen.0.scale 100.0
setp pwmgen.0.offset 0.0
setp pwmgen.0.dither-pwm true
net analogout motion.analog-out-00 => pwmgen.0.value
net laserpwm pwmgen.0.pwm => parport.0.pin-01-out
But my laser still outputs 100%. So i opened some hal-meters:
pwmgen.0.value is showing correct values (0.2 for a 20%pwm)
parport.0.pin-01-out : FALSE
laserpwm : FALSE
motion.analog-out-00 showing correct values
I also tried loadrt pwmgen output_type=0 or 1, no difference.
Any ideas ?
Please Log in or Create an account to join the conversation.
11 Apr 2024 17:17 #298011
by PCW
Replied by PCW on topic Change spindle with laser and problem with PWM
Electrical/wiring issues?
I would measure the voltage at parallel port P1
and see if it changes with the PWM value
I would measure the voltage at parallel port P1
and see if it changes with the PWM value
Please Log in or Create an account to join the conversation.
11 Apr 2024 18:47 #298020
by sonik
Replied by sonik on topic Change spindle with laser and problem with PWM
Actually my chinese bob has a led for showing the pwm-stream. It's green. When i inverse parport pin 01, the led is off. I checked all my connections from the bob to the laser, they are okay. But i will measure at the head while running a programm, maybe my bob is broke ?
Please Log in or Create an account to join the conversation.
15 Apr 2024 14:51 - 15 Apr 2024 14:54 #298288
by sonik
Replied by sonik on topic Change spindle with laser and problem with PWM
I measured my parallel port:
I started a test pattern for lasercut, halmeter is showing correct values on motion.analog-out-00
I measured on pin 1 about 0.1V stable, not moving
while x and y step ins are jumping between 0 and 3V4
So either my pin 1 doesn't work or (what i suppose) my pwm is still not connected to pin 1.
My hal is 3 posts above.
I started a test pattern for lasercut, halmeter is showing correct values on motion.analog-out-00
I measured on pin 1 about 0.1V stable, not moving
while x and y step ins are jumping between 0 and 3V4
So either my pin 1 doesn't work or (what i suppose) my pwm is still not connected to pin 1.
My hal is 3 posts above.
Last edit: 15 Apr 2024 14:54 by sonik.
Please Log in or Create an account to join the conversation.
Moderators: snowgoer540
Time to create page: 0.154 seconds