Machsupport Forum
Mach Discussion => Mach4 General Discussion => Topic started by: Cartierusm 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 %
-
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?
-
Ah sorry I generated this from a saved file, so I have to manually go in and change it to K1 normally.
-
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.
-
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
-
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.
-
The G32 is a single line thread. So you will have to code the lead in and lead out yourself.
-
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.
-
Hi,
don't know the answer for you but:
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
-
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?
-
Hi,
what sort of servos?
Old style brushed servos with DC drives don't have a 'following error window' but detect large deviation between commanded position and
actual position by measuring armature current. If the deviation is large then the servo will attempt to accelerate quickly ( high current) to the
correct position.
AC Step/Direction servos have a commanded input position and compare that to the actual position as indicated by the encoder. Ideally they would be
the same but they aren't. The servo position and therefore the encoder position will always lag a little.
I have an Allen Bradley servo for a spindle motor. It has an 8000 count per rev encoder. I have it programmed with a following error window of 20
counts, ie 0.9 degrees. If it gets more than 0.9 degrees from where it should be then it will fault, signal Mach, and if I wish it, have Mach stop.
I could make the error window smaller but then I would have to use less aggressive moves so that the servo can keep up or it would fault all the time.
Alternately I could make the error window wider and therefore drive the servo harder with a greater difference between commanded position and
actual position but with the wider tolerance or window still not fault.
Understanding how following error is handled is an important part of understanding your machine.
Craig
-
I'm using new DMM. Also I remember when the servos have stalled, I forget the problem, that the servo would fault and I'd have to reset it on the driver.
-
Hi,
I suspect DMMs have a very similar set up to the Allen Bradley drive. There will be a programmable register for following error, or whatever DMM
call it.
I suspect also that you can program what the fault signal includes. The Allen Bradley has alarms for over voltage, over current, over heat, following error.
They can be combined into one fault line or over several lines. Such line would be hooked to Mach and then you program Mach how to handle them.
There is also an alarm reset, if memory serves its a distinct input on the Allen Bradley but with many drives it a pulse Mach applies to the fault line
that resets the drive.
Time to look at the manual.
Does DMM have servo setup software that you install as an application on your PC? If it does you might use the software scope to observe your servo while
doing a Gcode job and detect a loss of position. It would give you valuable insight as to how servos work and following errors.
Craig
-
Yes it has setup software. Great advise thanks. I'll see if I can monitor while it's running.