Hello Guest it is October 15, 2019, 10:54:31 PM

Author Topic: Mach3 skips to subroutine, crashes Z, ruins part :(  (Read 7217 times)

0 Members and 1 Guest are viewing this topic.

Mach3 skips to subroutine, crashes Z, ruins part :(
« on: December 03, 2008, 11:37:44 AM »
I've got a program spread across two fixtures for making a large waveguide flange. The start point is at G54 X100 Y130 (left hand fixture), and the whole cycle finishes there, returning from a similar position on the right hand (G55) fixture. This normally executes well, using a 3-axis movement to clear the fixtures and a fast return to the start point. I've done about 40 flanges so far, and they're all good, but today Mach3 has run away twice. The first time it drove the cutter up (Y+) without any provocation, shredding the jig and snapping the cutter. Secondly, without any warning, it was returning to the start point when it seemed to hop to a subroutine I'd written for boring a 10mm clearance hole. Again, the cutter broke as Z fed down and stubbed it into the part.

This isn't funny, I've trashed over £60 of carbide cutters and aluminium blanks today and we're going to be in trouble if I can't sort this out. Any clues?
Re: Mach3 skips to subroutine, crashes Z, ruins part :(
« Reply #1 on: December 03, 2008, 05:06:31 PM »
Hi,

I had some quirky happenings when using work offsets with subs (10 work offsets and 4 or 5 subs) & LTOs
If I remember correctly, when I made sure there were no blank lines (i.e just a carriage return) in the Gcode, Mach ran fine.
With the blank lines, I had a few tool crashes.

ATB

Derek.
You can "chop it off" but can't "chop it on"

Offline jimpinder

*
  •  1,233 1,233
  • Wakefield, West Yorks, UK
    • View Profile
Re: Mach3 skips to subroutine, crashes Z, ruins part :(
« Reply #2 on: December 03, 2008, 09:49:08 PM »
I would also steer clear of using G54 in normal use - this is really a default.

Use G55 and G56 etc.

Did you check your offset table after these things had happened.

You seem to be saying, however, that everything has been working just fine for some time, but suddenly a fault has developed. Have you altered anything in the computer recently or altered the run of cables or anything similar.
Not me driving the engine - I'm better looking.
Re: Mach3 skips to subroutine, crashes Z, ruins part :(
« Reply #3 on: December 04, 2008, 04:08:05 AM »
Hi, thanks for the tips so far, I'll check on these.

I didn't check the offset table, but I'll do that today. After the first crash I re-homed the machine and carried on - somebody had stood a part on the keyboard ( !!! ) so i put the spectacular crash down to bad luck and dumbness. The second time I was stood next to it when it halted halfway through a safe move, fed Z down onto the part and stubbed out a brand new 8mm cutter like a freshly finished smoke. I punched the Estop button and halted everything, and the G-code readout on the program run screen was displaying a Z move which is part of a subroutine for boring a 10.2mm hole (feed down, circle, feed down, circle, pullback, rinse-and-repeat). It seems to have jumped there from halfway through a move. Why? This is getting expensive! And it's making me look stupid! I'm not happy! More to the point I've done 40 or so of these parts already with only minor edits for gradually raising feed rates and reducing cycle times. I haven't altered any of the wiring or changed PC settings at all.

I'll investigate and get back on this, thanks again for the suggestions thus far. I'll let you know what I find. The code is pretty beaten-around so there may be blank or orphaned lines in there.

jim - What am I looking for in the offset table? Would its values change for any reason? ta.

more later ... BP
« Last Edit: December 04, 2008, 04:10:17 AM by BluePinnacle »

Offline jimpinder

*
  •  1,233 1,233
  • Wakefield, West Yorks, UK
    • View Profile
Re: Mach3 skips to subroutine, crashes Z, ruins part :(
« Reply #4 on: December 04, 2008, 04:45:40 AM »
The problem is, with offset tables, they change themselves without notice if you are not careful. Before I get cries of "Oh No" let me say that they change because the operator has done something (not literally by themselves)

The particular one that always catches me out (although not recently) is zeroing the DRO's in Program Co-ordinates, after I have zeroed the machine in Machine Co-ordinates.. The thing being, after you have zerod your machine in Machine Co-ordinates NOT to then zero the Part co-ordinates unless the machine is at 0.0.0, otherwise the selected offset is altered to reflect the current offset of the machine.

The machine then seems to work fine for the first cut, but when it then changes to a different offset, the second offset was not in the proper relationship to the first offset (if you get my meaning).

Your problem, however, does not appear to be that - from what you say, the machine is suddenly changing its program. As you know, Mach3 reads ahead, and it appears, correct me if I am wrong, otherwise we are looking in the wrong place, that the machine is gaily returning to base, job done, then Mach3 reads ahead, sees another sub-routine call, and picks the wrong one and starts on that.

I assume you are using mach3 in the normal way, the main program being in the GCode file and Sub-routines being in the Sub Routines file under a seperate name.

I would be tempted to do a little housekeeping on my computer, behaps run a Disk Clean Up and a Defragmenter so that all the  loose ends of files are properly tied up.

I don't know what else to suggest at the moment.

Jim.











Not me driving the engine - I'm better looking.
Re: Mach3 skips to subroutine, crashes Z, ruins part :(
« Reply #5 on: December 04, 2008, 05:27:24 AM »
Hi Jim

Offset tables - Going by what you've said i think we can rule these out. I'd done several parts that day, the usual routine being followed thus:

start computer
reference all axes
jog to approximate start point
fit blanks
load G-code
manually G0 to x100 y130 z10 (nominated start/return point)
run cycle
repeat until hometime

When I started the computer today and did a spindle-off thin-air run, it went to the right places on the fixtures with no surprises, so i can only imagine that my offset tables are robust. I've never zeroed DROs in-flight. Wierdly, it now stops at the end of a subroutine a few steps from the end of the program! arrrgh.

The other possibility you raise is that of reading ahead into a subroutine, I wrote all mine into the same text file. This may be giving it headaches. I'll re-write using seperate text files for subroutines and see if this helps.

There were no orphan spaces in the code btw.

thanks again :)

Offline simpson36

*
  •  1,374 1,374
    • View Profile
Re: Mach3 skips to subroutine, crashes Z, ruins part :(
« Reply #6 on: December 04, 2008, 05:54:26 AM »
Just a couple thoughts:

The thing that has caught me with subroutines is not having a hard carriage return after M99. Mach3's response to this seems unpredictable. Sometimes it will ignore the sub and sometimes it will just stop at the end of the sub.

On the issue of computers in general I have a lot of experience and my advise for any crititcal application is to have the computer running on a UPS. Spikes destroy things immeditately, but power sags, especially if the power company is doing rotating brown outs, can leave the computer running, but with the memory contents changed. I have traced many recurrant spooky problems to this phenonema.

Watch out for other probrams that may be running on a PC, especially if the PC is on a network, or the web. I am running Mach3 on a laptop (temporarily) and the power saver feature kicked in unexpectedly and slowed the CPU down which caused the probram to blow up. If I leave the laptop connected to my network (wireless), Mach runs, but is unreliable.

« Last Edit: December 04, 2008, 05:57:36 AM by simpson36 »
Re: Mach3 skips to subroutine, crashes Z, ruins part :(
« Reply #7 on: December 04, 2008, 06:25:14 AM »
Another possibility... our power is not the best. I did have a sag a week ago which forced a reboot; luckily the chargepump board dropped out and I heard the spindle slam to a stop before I'd spotted the lights go down. Everything stopped dead, just like I'd designed it. :D I'll see if the IT lads have a spare UPS anywhere.

Another thought - USB memory sticks make mine go mad, the steppers bang and groan and won't work worth a sht. It's impossible to do anything. Funny business  ???

Edit again! i checked - the stalling at the end of the sub is down to a missing carriage return. Very peculiar, I'd never have thought to check for that. I'd just gone through and deleted any and all unnecessary spaces. I'll make a point of putting in

(leave this line in, mach3 needs a carriage return above here) at the end of my subroutine file. Cheers for the tip :)
« Last Edit: December 04, 2008, 08:48:22 AM by BluePinnacle »

vmax549

*
Re: Mach3 skips to subroutine, crashes Z, ruins part :(
« Reply #8 on: December 13, 2008, 07:10:01 PM »
Instead of a carrage return Use the % sign as the last line that way you never have to worry about the empty carrage return line.

(;-) TP
Re: Mach3 skips to subroutine, crashes Z, ruins part :(
« Reply #9 on: December 13, 2008, 08:47:38 PM »
Good point - thanks.

It's been ok since then despite wobbly power.

 ???