Hello Guest it is May 12, 2021, 08:19:00 PM

Author Topic: Lathe Problems with Mach Motion Wizards, Is this Gcode Good?  (Read 1766 times)

0 Members and 1 Guest are viewing this topic.

Lathe Problems with Mach Motion Wizards, Is this Gcode Good?
« on: April 05, 2018, 11:06:51 PM »
So I made a different post months ago about all the errors I get when posting from Mach Motion Wizards. I think one of the creators tried to help, but wasn't getting the same errors as I was. Not sure if it's a software or computer hardware problem. I'm running all the latest Mach 4 and associated drivers. Anywho, I was making some parts the other day and noticed when i was threading the lathe carriage was jerking when it was going back to home position, move violently than normal. Then when I changed out parts and ran the same program for threading the tool was now off, by maybe 1/16", in the X axis. So I tried lots of things, re-tuned the servos for slower speed in Mach Config. That didn't work. So then i thought maybe I'm losing steps, but it' servos and if it loses position I imagine it would fault and give me an error. So I ran the program without the threading cycle and everything was dead nuts perfect. Then I ran the threading and that's where the position was off.

Here is my Gcode, does anyone see anything wrong with it?

What I ended up doing was run the threading cycle, rehome the machine, put a new part in and thread, rehome, etc... that worked, but everytime it finished a threading cycle it was off.

N0000 (Machine type - MachMotion Lathe Canned Cycles)
N0005 (Filename: C:\Mach4Hobby\GcodeFiles\Temporary - Copy.tap)
N0010 (Generated on 04/05/18 at 19:57:00)

N0015 %
N0020 G00 G40 G18 G54 G64 G80 G90.1 G99 G20 (Safe Start Block)
N0025 %

N0030 (Starting Gcode for Threading Cycle: ThreadingCycle-0)
N0035 G50 S4100 (Spindle Speed Cap)

N0040 %
N0045 G00 G40 G18 G54 G64 G80 G90.1 G99 G20 (Safe Start Block)
N0050 %

N0055 T0808 (Tool Change)
N0060 G99 (Feed per Revolution)
N0065 G97 S400 (Constant Speed)
N0070 M04 (Spindle Reverse)
N0075 M08 (Flood)
N0080 G00 X0.5750 Z0.1600  (Rapid move to Clearance Height)
N0085 G76 P040060 Q0.01 R0.005 K0
N0090 G76 X0.2965 Z-0.5 R0 P0.0785 Q0.01 F0.0625
N0095 G80
N0100 G00 X0.5750 Z0.1600  (Rapid move to Clearance Height)
N0105 (End Gcode for Threading Cycle: ThreadingCycle-0)

N0110 %
N0115 (Custom Footer Block)
N0120 G00G53X-0.25Z-0.25
N0125 %

N0130 %
N0135 M09
N0140 M05
N0145 M30
N0150 %
N0155 (End Gcode file)
N0160 %
Re: Lathe Problems with Mach Motion Wizards, Is this Gcode Good?
« Reply #1 on: April 06, 2018, 10:22:14 AM »
I'm surprised that the threading code ran at all.  the N0085 G76 contains a k value of zero which is not valid.  Are you running hobby or industrial?
Re: Lathe Problems with Mach Motion Wizards, Is this Gcode Good?
« Reply #2 on: April 06, 2018, 11:47:31 AM »
Ah sorry I generated this from a saved file, so I have to manually go in and change it to K1 normally.
Re: Lathe Problems with Mach Motion Wizards, Is this Gcode Good?
« Reply #3 on: April 09, 2018, 08:27:57 AM »
It's strange.  When I used the Mach Motion Wizard to try threading, it didn't work correctly either; I never figured out what it was.  Curiously enough, however, it did mess with my servos.  My motion controller gave an error before the threading move saying that it was not going to run properly.  Max Following Error Exceeded.   

We use G32.  My Dad wrote a program that generates G Code based on variable to do threading.  It works just fine, so we've never noticed an issue with G76 until I tried the Mach Motion Cycles.
Chad Byrd
Re: Lathe Problems with Mach Motion Wizards, Is this Gcode Good?
« Reply #4 on: April 09, 2018, 11:08:05 AM »
While manual editing of the output works you can eliminate this by selecting the in-feed option every time.  While the GUI shows something as being selected, like 'Flank In-Feed, Constant Depth', it will always output a k=0 value unless you re-select an option each time.

Just one of many flaws in the turn cycles wizard.

I think this may be time to open a ticket with NFS to determine if it Mach or motion control related.  sorry I can't help more.

TIA

RT
Re: Lathe Problems with Mach Motion Wizards, Is this Gcode Good?
« Reply #5 on: April 09, 2018, 12:12:15 PM »
Rhuttle, I've done that per the other thread suggestion, but selecting a type of feed works except for the first one. I've selected others and gone back to the first one and it doesn't come out at K1, just K0. I appreciate the help though.

@Cbyrdtopper, I'll try that, G32.

I wonder why this code would change the X axis offset, I mean I don't see anything in there that does, but it sure does and like I said above I assume that the servos would fault out if they were losing position.

I'm building a new CNC Plasma and have to go back to Mach 3 and just now learned i can use Mach 3 on Win 10 with a Pokeys57CNC. I mean I'm not sure if I could have used my PLC for my tool changer with Mach 3, but if I could I wouldn't have switched. OK I probably would have, but would have changed back. I've been using Mach 3 for like 15 years. NEVER had one problem. Seriously, running a CNC Bridgeport, CNC Router I built and a cnc Lathe I built.
Re: Lathe Problems with Mach Motion Wizards, Is this Gcode Good?
« Reply #6 on: April 09, 2018, 01:47:32 PM »
The G32 is a single line thread.  So you will have to code the lead in and lead out yourself. 
Chad Byrd
Re: Lathe Problems with Mach Motion Wizards, Is this Gcode Good?
« Reply #7 on: July 31, 2018, 11:02:11 PM »
Time to revisit this problem. Still having positional error with threading. It seems as when the tool is done cutting and moves back to it's starting position (X0 Z0) before going to it's home position (G53 X-.25 Z-.25) it's losing steps or jerking or something. You can hear it. But if I re-home the machine and bring that tool back to where it should be then it's good. So this means the belts are tight, the pulleys on the servos are not slipping and the servos are not losing steps. I say this, correct me if I'm wrong, but if the servos lose steps I'm assuming the machine would halt or give me an error. Also the belts and pulley are not it because when I start the machine up and home the machine I turn just the servos off and back on so they can home to their optical index. IF they were slipping that would be off as well when I tried to cut with a known diameter piece of stock.

BTW this only happens when threading. I run 20-30 pieces of stainless parts all the time (just turning no threading), last week in fact, and everything was dead nuts. I even tried tuning my servos to 40ipm instead of 80 and it still does it. It also does it if I change the final rapid moves in each block of code from G00 to G01, because that's where it's happening.

Any suggestions? I didn't try the single line threading as mentioned above yet.
Re: Lathe Problems with Mach Motion Wizards, Is this Gcode Good?
« Reply #8 on: July 31, 2018, 11:22:34 PM »
Hi,
don't know the answer for you but:

Quote
I say this, correct me if I'm wrong, but if the servos lose steps I'm assuming the machine would halt or give me an error
Yes I would expect the servo drive to signal a 'following error'. That depends on how, or even if, you have programmed
a 'following error window'. Are your servo drives wired so that if they detect a fault, following error for instance, that
Mach would see it and stop?

Craig
My wife left with my best friend...
     and I miss him!
Re: Lathe Problems with Mach Motion Wizards, Is this Gcode Good?
« Reply #9 on: August 01, 2018, 10:28:25 AM »
Joe, I never programmed anything in mach for the servos. I assumed that the Pokeys board or mach had that built in. When I was first tuning the motors I would get Motion Overflow errors that would make mach fault. So I assumed that any servo fault would stop mach.

How do I check or program that in?