- Posts: 51
- Thank you received: 0
Laser Control using PWM
- Sockheaven
- Topic Author
- Offline
- Senior Member
-
I have very little experience with LinuxCNC so I've been having a hard time trying to figure out the correct configuration in the INI and HAL files. I found another poster doing something very similar:
forum.linuxcnc.org/10-advanced-configura...pwm-output-for-laser
But in this post and others I've found, the jargon and references are going over my head so I was hoping to get some assistance.
A few questions/comments so far:
1. When I scope the spindle pwm signal the signal goes high before the cutting path starts (presumably to get the spindle up to speed) - but in the case of a laser, i don't want the laser pre-firing as it will etch outside of the desired path. What is the appropriate configuration so that this PWM only starts while the cutting path is active?
2. When I scope the spindle pwm signal, it appears on or off - not actually modulating. While looking at the configuration i realized I have no idea what is defining the spindle speed, I see where to define the path motion when generating the gcode from dxf, but i don't see anything for the spindle - where is this normally defined?
Attached are my current INI/HAL files, any assistance or direction would be awesome.
Attachment not found
Attachment not found
Thanks!
Paul
Please Log in to join the conversation.
- tommylight
-
- Away
- Administrator
-
- Posts: 22012
- Thank you received: 4
forum.linuxcnc.org/10-advanced-configura...mosing-a-pic?start=0
Please Log in to join the conversation.
Sockheaven wrote: 1. When I scope the spindle pwm signal the signal goes high before the cutting path starts (presumably to get the spindle up to speed) - but in the case of a laser, i don't want the laser pre-firing as it will etch outside of the desired path. What is the appropriate configuration so that this PWM only starts while the cutting path is active?
Rather than use spindle (M3 / M5) use the G-code analogue outputs (M67):
linuxcnc.org/docs/2.7/html/gcode/m-code.html#mcode:m67
M67 takes effect the instant that the next move command starts.
Please Log in to join the conversation.
- Sockheaven
- Topic Author
- Offline
- Senior Member
-
- Posts: 51
- Thank you received: 0
Is this something I manually edit in the GCODE file? or is is a configuration in DXF2GCODE? or something within the INI/HAL configuration in LinuxCNC?
I haven't strayed too far off the guided path so far, so I'm finding I don't know quite a bit
Please Log in to join the conversation.
Sockheaven wrote: Is this something I manually edit in the GCODE file? or is is a configuration in DXF2GCODE? or something within the INI/HAL configuration in LinuxCNC
Does DXF2GCode output spindle speed and on/off?
If it does, and if it can't be changed then you have a choice of
- Edit by hand
- Set up an input filter linuxcnc.org/docs/2.7/html/config/ini-co...html#_filter_section
- Re-map M3 / S / M5 to be M67 commands: linuxcnc.org/docs/2.7/html/remap/remap.html
There are probably other ways I have not thought of, too.
Please Log in to join the conversation.
- tommylight
-
- Away
- Administrator
-
- Posts: 22012
- Thank you received: 4
That is very good for raster laser engraving. I also have somewhere the gcodetools modified to output that, but it is a bit of work to search through all my SSD's.
Let me know if you need it.
Please Log in to join the conversation.
- Sockheaven
- Topic Author
- Offline
- Senior Member
-
- Posts: 51
- Thank you received: 0
Has anyone considered making a GUI setup tool for the HAL configuration?
If I skip the PWM for now, and simply want to gate the spindle signal(or any signal for that matter) with when the "cut" happens, can someone help with the HAL configuration?
I've seen the single line examples in the documentation mixed and some full HAL files in other posts and I'm seemingly unable to fill in the gaps
Please Log in to join the conversation.
- Sockheaven
- Topic Author
- Offline
- Senior Member
-
- Posts: 51
- Thank you received: 0
Please Log in to join the conversation.
- Sockheaven
- Topic Author
- Offline
- Senior Member
-
- Posts: 51
- Thank you received: 0
Ok, I suspect the duration the laser spends at the start/end is longer due to this primitive method, but its far better than it used to be.
So, stating the obvious, i guess I need to create an additiona pwmgen, attach it to a pin, then the M67 command in a GCODE file will magically turn it on?
Please Log in to join the conversation.
Sockheaven wrote: So, stating the obvious, i guess I need to create an additiona pwmgen, attach it to a pin, then the M67 command in a GCODE file will magically turn it on?
Pretty much.
You could use spindle on/off to enable and disable the pwmgen (there is an enable HAL pin for the pwmgen, but be aware that unless there is a non-zero spindle speed the spindle-on pin does not change state) and then use the M67 output to set the PWM duty cycle. You probably want a fixed PWM frequency.
linuxcnc.org/docs/2.7/html/man/man9/pwmgen.9.html
You might prefer a pwmgen frequency of 0, which enables PDM mode. In fact a very low frequency PDM might give a rather interesting effect with a laser. (As might low-frequency PWM)
Please Log in to join the conversation.
