Hello Guest it is December 07, 2024, 12:07:51 PM

Author Topic: Mach 3 on Tormach laser is not proceeding past M3  (Read 14841 times)

0 Members and 1 Guest are viewing this topic.

Mach 3 on Tormach laser is not proceeding past M3
« on: February 06, 2022, 04:21:41 PM »
I have a Mach 3 driven Tormach machine that I converted to a laser a while back and recently I wanted to see if I could cut down on the dwell time that is built into the spindle on time and off time.  I'm using a 5 volt signal to the laser which comes from the spindle at full rpms.  I have physically removed the spindle and simply use the wires J1-1 and J1-2 on the PCNC Control board to get that signal.  The VFD is not even connected.  It worked fine, but someone online had noticed how slow the laser was.  The titanium part I was cutting in a video had lots of short cuts with stops and starts between them.  The stops and starts all seem to have delays built in.  I decided to investigate and try to reduce that non-productive time.

It seems that I must have had an old .XML file that I used as a backup that I renamed to be the actual working file, and now I can't get it to work properly.  Somehow I screwed up on my files while trying different parameters and my Tormach is in a permanent dwell while it tries to get "up to speed".  I can press the cycle start button again to get past it, but it seems that I must have messed up some settings that were allowing it to work.  Some of my other .XML trials were worse, most not responding to an M3 at all.  I think it has to do with pulleys and ramp up speeds and such.  If the spindle was actually there, going from 0 to 5140 rpm would take some time.  I can't seem to get a combination of parameters to get it to work again.

My original thought was to use the M7 (mist coolant on) command to turn it on, but I use M8 (coolant on) for argon, and I believe they are actually the same relay.  I don't know if there might be some other work around with an M code, or if I just need to be saddled with the 1/2 second delay from the spindle-on signal.  Right now, the 1/2 second delay would look pretty good compared to not getting past the M3 dwell at all!  (The additional dwell numbers that are shown in the setup screen are all at zero.)

Any insight on what to try would be appreciated.
Bruce Boone
Boone Titanium Rings

Offline Tweakie.CNC

*
  • *
  •  9,265 9,265
  • Super Kitty
Re: Mach 3 on Tormach laser is not proceeding past M3
« Reply #1 on: February 06, 2022, 04:55:30 PM »
Because of the delays associated with the M3/M5 commands and the high speed requirements for laser switching operations, many years back, Artsoft introduced the M11Px/M10Px command set for use with Mach3 and M62Px/M63Px for use with Mach4. Whilst not all motion controllers support these commands there are alternative methods that can be used to overcome the M3/M5 delays.

It is overlong but this thread may be of interest to you;    https://www.machsupport.com/forum/index.php?topic=12444.msg265104#msg265104

Tweakie.
PEACE
Re: Mach 3 on Tormach laser is not proceeding past M3
« Reply #2 on: February 06, 2022, 06:09:10 PM »
It sounds like it would be the best thing to do, but it's a bit over my head.  Is it something that is simply added to the spindle control board?  Mine has no power.  I assume that's because I took off the S1 and S2 wires years back.  There are no power at any of the terminals at all.

In the case of the laser, I don't need a spindle command anymore.  Would there be a way to have an M3 command simply activate a relay, or is that getting too far into the onboard logic?  I have several hundred programs written with the M3 already in them.  They could be changed to the M11 if necessary, but I'm still not quite getting how that all will work. 

I just cut some needed parts, but I had to click on the cycle start button at every pierce to keep it going.  I would definitely settle for just having it close to what I had while a faster long-term solution is in the works.  Obviously not an ideal way to run the laser.
« Last Edit: February 06, 2022, 06:11:58 PM by btboone »
Bruce Boone
Boone Titanium Rings
Re: Mach 3 on Tormach laser is not proceeding past M3
« Reply #3 on: February 06, 2022, 06:38:35 PM »
On my laser, the power is controlled by the laser itself in its own control software, so it just needs a 5 volt on/off signal.
Bruce Boone
Boone Titanium Rings
Re: Mach 3 on Tormach laser is not proceeding past M3
« Reply #4 on: February 07, 2022, 01:15:32 PM »
I was working on the M11/10 theory but never got that to work just due to the inputs not being properly addressed and turned on.  My thought was to do some user created M codes, maybe M103 and M105 to replace M3 and M5, then I noticed that M3 and M5 were actually defined in the macro subdirectory.  M3 had a dwell built in so the "spindle" took about 5 seconds to get up to speed.  I was able to dial that math formula in so that it took just long enough for the laser to pierce the material and go.  I had to remove my separate dwell I have in my programs for the pierce as it would hang up on that, but it does now work!  ;D
« Last Edit: February 07, 2022, 01:31:10 PM by btboone »
Bruce Boone
Boone Titanium Rings
Re: Mach 3 on Tormach laser is not proceeding past M3
« Reply #5 on: February 07, 2022, 01:28:55 PM »
Another question for the hackers in the group; is there an easy way to batch edit all my laser files to get rid of my G4 P350 or G4 P450 or whatever the dwell in microseconds is?  I can go into each and every file and find and replace them with a blank space, but I assume people that write code have a tool that will do that to all the files in a specific subdirectory at once.
Bruce Boone
Boone Titanium Rings

Offline TPS

*
  •  2,536 2,536
Re: Mach 3 on Tormach laser is not proceeding past M3
« Reply #6 on: February 11, 2022, 12:03:07 PM »
smoe years ago i did something simular for G43 should be easy to modify this

Code: [Select]
' ---------------------------------------------------------------------------------
' TPS 02/2018
' macro to open GCode file and comment out all G43
' ---------------------------------------------------------------------------------
Sub Main()
On Error GoTo errhandler

'get the source file
Dim Filename As String
Dim Dialog1

    Set Dialog1 = CreateObject("MSComDlg.CommonDialog")
    Dialog1.MaxFileSize = 256
    Dialog1.Filter = "GCode Files (*.tap)|*.tap"
    Dialog1.FilterIndex = 1
    Dialog1.DialogTitle = "select GCode file"
    Dialog1.InitDir = GetUserLabel(200)
    Dialog1.CancelError = True
    'get the last selection
    Dialog1.FileName = ""
    save = false
    If save = true Then
        Dialog1.DefaultExt = def
        Dialog1.Flags = &H800 + &H4
        discard = Dialog1.ShowSave()
    Else
        Dialog1.Flags = &H1000 + &H4 + &H800
        discard = Dialog1.ShowOpen()
    End If

FileName = Dialog1.FileName
If Len(FileName) = 0 Then
message "no source file selected"
Exit Sub
End If
'store last selection
SetUserLabel(200,CurDir)

'find the last "\" in filename
For i = 1 To Len(FileName)
If Mid(FileName,i,1) = "\" Then
last = i
End If
Next i

'extract filename
myfilename = Mid(FileName,last+1,Len(FileName)-last)

'get the destination folder
Dim destfile As String

    Dialog1.DialogTitle = "select destination folder and filename"
    'get the last selection
    Dialog1.FileName = GetUserLabel(201) + "\" + myfilename
    Dialog1.InitDir = GetUserLabel(201)

    save = true
    If save = true Then
        Dialog1.DefaultExt = def
        Dialog1.Flags = &H800 + &H4
        discard = Dialog1.ShowSave()
    Else
        Dialog1.Flags = &H1000 + &H4 + &H800
        discard = Dialog1.ShowOpen()
    End If

destfile = Dialog1.FileName

If Len(destfile) = 0 Then
message "no destination file selected"
  Exit Sub
End If
  'store last selection
SetUserLabel(201,CurDir)

'open input file
FNumInput    = FreeFile 'Determine next file number.
Open FileName For Input As FNumInput

'open output file
FNumOutput = FreeFile 'Determine next file number.
Open "C:\Mach3\GCode\import.txt" For Output As FNumOutput

actions = 0
'go through To whole file
Do While Not EOF(FNumInput)
Line Input #FNumInput, FileData ' Read a line of data.
If ((InStr(FileData,"G43") <> 0) And (Left(FileData,1) <> "(")) Then
Print #FNumOutput, "( " + FileData + " )"
actions = actions + 1
Else
Print #FNumOutput, FileData
End If
Loop


Close ' Close all open files.
message CStr(actions) + " G43 have been found"
DoOEMButton(169) 'close Mach3 files just in case
SourceFile = "C:\Mach3\GCode\import.txt"

FileCopy SourceFile, destfile ' Copy source to target.
Kill SourceFile
LoadFile( destfile)
Exit Sub
errhandler:
message "user cancel"
End Sub



anything is possible, just try to do it.
if you find some mistakes, in my bad bavarian english,they are yours.