Page 1 of 1
M3 delay only works first time in gcode
Posted:
Wed Jun 10, 2020 2:09 pm
by Phil1rowe4
Hi,
I'm having an issue where the M3 delay timer only seems to work for the first occurance of M3 in a gcode file. When I change tools and the spindle starts again after the mobile probe, the M3 delay timer doesn't work and I have to press the feed hold until the spindle spins up.
M3 is set to 10000 msec but same thing happens when set to 10 sec also.
I know I could change the post processor but had a look at the post processor code in fusion and dont want to break it! I also dont want to change it for every piece of software I use.
Any ideas?
Re: M3 delay only works first time in gcode
Posted:
Wed Jun 10, 2020 3:26 pm
by cncdrive
There is no delay if the M3 was already on, because then the spindle was already turned on, so no need to delay/dwell.
If you need to get a delay even if the spindle (m3) was not turned off then use the G4Pxx dwell command or switch the spindle off with M5 prior to the M3.
Re: M3 delay only works first time in gcode
Posted:
Wed Jun 10, 2020 10:51 pm
by beefy
Phil,
what you are saying is a little confusing.
The first thing you need to tell is if the generated gcode is correct. I say this because you are talking about altering the post processor that generates the gcode. That implies you think the generated gcode is wrong.
So which one is it ? Is the gcode correct and there's an issue in UCCNC, or is UCCNC not doing what you expect because the generated gcode is wrong. Cncdrive can't fix wrong gcode.
If you decide the gcode is wrong then perhaps ask on the Fusion forum about how to modify the post. Just do a backup of the original post first.
Re: M3 delay only works first time in gcode
Posted:
Thu Jun 11, 2020 1:59 pm
by Phil1rowe4
My apologies for the confusion.
The sequence of events is that the gcode file starts, does a T1M6 command followed by a S20000 M3 command. The delay timer in UCCNC works fine.
The gcode then runs until it gets to a new section where it has a T2M6 command followed by a S20000 M3 command. At this point, after the tool change, the M3 delay timer doesn't work.
What I have found is that there isn't an M5 command at the end of the previous section. I'm not sure when the spindle is being turned off for the tool change but it does stop somehow. I cant see an M5 command within the M6 macro?
Re: M3 delay only works first time in gcode
Posted:
Thu Jun 11, 2020 2:12 pm
by Phil1rowe4
My apologies Beefy.
The delay timer can either be triggered by a setting in UCCNC or a G4Pxx command produced by the post processor. As I use different programs with different post processors I wanted to use the UCCNC setting so that it applied to any M3 command in any gcode file.
What appears to be happening is that an M5 command is not occurring in the gcode file before the tool change which would then trigger the next M3 delay timer.
I can only assume that an S0 command is happening somewhere to stop the spindle without tecnically turning it off.
Re: M3 delay only works first time in gcode
Posted:
Thu Jun 11, 2020 3:07 pm
by Phil1rowe4
I just found the exec.Stop() line in the M6 macro which I assume is also stopping the spindle. I'll add an exec.Stopspin() to turn off the spindle properly.
Re: M3 delay only works first time in gcode
Posted:
Thu Jun 11, 2020 3:40 pm
by cncdrive
You can also add a exec.code("M5");
In macros you can execute any g-code commands with the exec.code function.