Hello Guest it is April 19, 2024, 04:30:36 AM

Author Topic: Demo G code stops when spindle running  (Read 3874 times)

0 Members and 1 Guest are viewing this topic.

Demo G code stops when spindle running
« on: February 08, 2015, 07:29:45 PM »
Hello folks,

This is my first post so I hope I have the correct area.

I have a 3-axis gantry router setup with a nice spindle.  I am using Dynomotions's KFLOP motion controller board and everything is working fine.  That said, I am attempting to cut my first piece using Mach3 demo and demo code that I found in this forum.  I have tried both the 'smiley face' and the 'heart' for those of you who are familiar with them.  They are both less than 500 lines of code.  When I run them without using the spindle (no 'S' set) they work fine.  All the axes move and the movement appears reasonable.  However, when I either turn on the spindle with a manual command, or insert an 'S' command in the code, the spindle will turn on and then the axes seem to start moving but only go a few thousands of an inch before stopping.  The G code stops processing and the machine just sits there until I stop the cycle.  Does anyone have an idea of what I am doing incorrectly?  I have inserted a G20, M3, M5, and S command along with a 10 second delay command to let the spindle wind up (bold text in code).  The code is as follows:

(Created 7:48:52 AM 5/1/2011 from Smiley face.dxf)
(Post = Mikes Mach3 Router)
(Tool 8 = .250 Vee bit)
N0001 G90 G20
N0002 S5000 M3 G4 P10
N0003 G00 X0.1250 Y0.0000 Z0.5000
N0004 G00 X0.1250 Y0.0000 Z0.5000
N0005 G01 X0.1250 Y0.0000 Z-0.0500 F10.00
N0006 G03 X0.1250 Y0.0000 I-0.1250 J0.0000 F40.00
N0007 G00 X0.1250 Y0.0000 Z0.5000
N0008 G00 X1.8215 Y4.2445 Z0.5000
N0009 G01 X1.8215 Y4.2445 Z-0.0500 F10.00
N0010 G03 X1.8215 Y4.2445 I-0.1250 J0.0000 F40.00
N0011 G00 X1.8215 Y4.2445 Z0.5000
N0012 G00 X2.2583 Y5.1186 Z0.5000
N0013 G01 X2.2583 Y5.1186 Z-0.0500 F10.00
N0014 G01 X2.2583 Y5.9313 Z-0.0500 F40.00
N0015 G00 X2.2583 Y5.9313 Z0.5000
N0016 G00 X3.0000 Y6.0244 Z0.5000
N0017 G01 X3.0000 Y6.0244 Z-0.0500 F10.00
N0018 G01 X3.0000 Y5.1186 Z-0.0500 F40.00
N0019 G00 X3.0000 Y5.1186 Z0.5000
N0020 G00 X3.7417 Y5.1186 Z0.5000
N0021 G01 X3.7417 Y5.1186 Z-0.0500 F10.00
N0022 G01 X3.7417 Y5.9313 Z-0.0500 F40.00
N0023 G00 X3.7417 Y5.9313 Z0.5000
N0024 G00 X4.4835 Y5.1186 Z0.5000
N0025 G01 X4.4835 Y5.1186 Z-0.0500 F10.00
N0026 G01 X4.4835 Y5.6320 Z-0.0500 F40.00
N0027 G00 X4.4835 Y5.6320 Z0.5000
N0028 G00 X4.7885 Y4.2445 Z0.5000
N0029 G01 X4.7885 Y4.2445 Z-0.0500 F10.00
N0030 G03 X4.7885 Y4.2445 I-0.1250 J0.0000 F40.00
N0031 G00 X4.7885 Y4.2445 Z0.5000
N0032 G00 X1.5165 Y1.8003 Z0.5000
N0033 G01 X1.5165 Y1.8003 Z-0.0500 F10.00
N0034 G03 X4.4835 Y1.8003 I1.4835 J0.8852 F40.00
N0035 G02 X1.5165 Y1.8003 I-1.4835 J1.2241
N0036 G00 X1.5165 Y1.8003 Z0.5000
N0037 G00 X2.4130 Y2.6855 Z0.5000
N0038 G01 X2.4130 Y2.6855 Z-0.0500 F10.00
N0039 G01 X3.5870 Y2.6855 Z-0.0500 F40.00
N0040 G01 X3.0000 Y3.7022 Z-0.0500
N0041 G01 X2.4130 Y2.6855 Z-0.0500
N0042 G00 X2.4130 Y2.6855 Z0.5000
N0043 G00 X2.0165 Y4.3945 Z0.5000
N0044 G01 X2.0165 Y4.3945 Z-0.0500 F10.00
N0045 G03 X2.0165 Y4.3945 I-0.5000 J0.0000 F40.00
N0046 G00 X2.0165 Y4.3945 Z0.5000
N0047 G00 X4.9835 Y4.3945 Z0.5000
N0048 G01 X4.9835 Y4.3945 Z-0.0500 F10.00
N0049 G03 X4.9835 Y4.3945 I-0.5000 J0.0000 F40.00
N0050 G00 X4.9835 Y4.3945 Z0.5000
N0051 G00 X6.0000 Y3.0244 Z0.5000
N0052 G01 X6.0000 Y3.0244 Z-0.0500 F10.00
N0053 G03 X6.0000 Y3.0244 I-3.0000 J0.0000 F40.00
N0054 G00 X6.0000 Y3.0244 Z0.5000
N0055 G00 X1.5165 Y5.1186 Z0.5000
N0056 G01 X1.5165 Y5.1186 Z-0.0500 F10.00
N0057 G01 X1.5165 Y5.6320 Z-0.0500 F40.00
N0058 G00 X1.5165 Y5.6320 Z0.5000
N0059 G00 X0.8518 Y5.1186 Z0.5000
N0060 G01 X0.8518 Y5.1186 Z-0.0500 F10.00
N0061 G01 X5.1482 Y5.1186 Z-0.0500 F40.00
N0062 G00 X5.1482 Y5.1186 Z0.5000
N0063 M5
N0064 M30

Lines 2 and 63 were blank when I loaded the code.  I assume that this was to allow someone to insert their own spindle commands if necessary.  I am brand new to this so I have probably made an error somewhere.  Please feel free to correct me if you are able to do so.  Ultimately, I plan to purchase a license for Mach3.  However, I will not do so until I have proven to myself that it will work for me.

Cheers,
Jeff

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: Demo G code stops when spindle running
« Reply #1 on: February 08, 2015, 09:11:55 PM »
I would start the spindle with this It starts the spindle at a speed of 5000. THEN there is a 10 sec delay (if you have mach3 set to sec not msec) before motion will begin.

M3 S5000
G4 P10

(;-) TP
Re: Demo G code stops when spindle running
« Reply #2 on: February 09, 2015, 09:03:47 PM »
Hi BR549,

Thanks for the input.  I did what you suggested, to no avail.  I have tried this in Mach3 and in KMotionCNC.  As soon as the spindle starts up, the axes stop moving.  I saw something about Safe-Z in Mach3, so I tried running the code again with Safe-Z enabled and disabled.  Same result.  I'd like to know how I could 'debug' what is happening to determine where this failure is occurring.  Is that possible in Mach3?

I am open to other suggestions, of course.  BTW, I have tried other code from the same source.  Could it be that the code is somehow the problem?  I am just learning G code, but I haven't seen anything that I wouldn't expect or didn't understand when I looked it up.  I am stumped again.

Thanks to the folks who have tried to help so far.  Much appreciated.

Cheers,
Jeff

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: Demo G code stops when spindle running
« Reply #3 on: February 09, 2015, 09:29:11 PM »
You need to talk to TOM at dynomotion. IF it did the same thing runninh his software then it is a Dynomotion problem not a mach3 problem.

(;-) TP
Re: Demo G code stops when spindle running
« Reply #4 on: February 10, 2015, 02:53:28 PM »
Hi TP,

I think it is actually me that is the problem.  I did some further diagnostics last night and noticed that my digital I/O signals into, and out of, the KFLOP motion control board were fluctuating when the spindle was running.  This was causing the KFLOP to see limit switch activation when there was none.  That, of course, would stop the axes from moving as that is how I have things configured.  However, Mach3 doesn't seem to know this, so I may have to write some C code that will pass such messages from KFLOP to Mach3.  In the meantime, it looks this I have some serious RF interference that is likely the result of a ground loop.  So, me and my multi-meter have a great deal of work to do!

I'll update this post when I find the problem and fix it, just in case there are others following this thread who would like to know the resolution.  When I find one, that is.

Thanks for the support!

Cheers,
Jeff