Hey Guys,
I'm pretty new to this, so please bare with me.
I've got a custom built CNC, using Smooth stepper ESS, and Mach 4. I did my Design and CAM in Fusion 360. Today was the first day I got it up and running, and I wanted to find out if there are a few things that I could do to streamline the setup of a G-Code file, and perhaps shed some light on an issue I'm having.
I've attached my G-Code, but the below changes won't reflect in the code.
First, I'm new to G-Code, so I did a lot of research to do these small adds. First, since I'm zeroing the work area, and I found that if you're not exactly where you zeroed the work area the machine will run with some amount of offset that you started at. So, what I did was added a "G0 Z3" to ensure that where ever the X and Y axis take me, the spindle won't collide with hold downs. I also added a 10 second pause "G4 P10000" to give me a little mind reset for what's to come. Next comes the spindle command "s20000 M3" and I added a 4 second pause to allow for the spindle to get to speed "G4 P4000." The rest runs as is until I get to the end. This all runs great, with no issues
Problem #1
About 7/8 of the way through the G-Code I run into an issue. I think it's around line 301 in the attached file. For some reason, when I have my soft limits enabled (They're set to .5 inches on X and Y and 14+ and 12+ inches respectably) I get an "Error: X Axis commanded over softmin." I've tried moving the workpiece and work area to the center of the machine with no luck, so that's a mystery to me. I'll run the G-Code without softlimits and it runs fine. If someone has insight into this, I'm all ears.
Problem #2
Line 325 in my attached G-Code when we get to the G28 commands, some weird thing happens. Instead of returning to the work area starting point X0y0, the G-code is sending it to the Machine coordinates, thus tripping my limit switches... Does anyone have an explanation why that is?
My solutions: Remove line 325 - 327, and after G90 I insert "G0 Z3" to raise the spindle to clear any fastners, and then on the next line I add "G0 X0 y0" to return to the work area coordinates I started at, and then followed on the next line: "S0 M5" to shut down the spindle.
Am I reading all this wrong? Do I have something else set up wrong where this isn't working as it's intended? To get this far it took me a better part of the day, but it's definitely something I can repeat fairly quickly with other G-Code. I would rather this just be done in the CAM software though....
Attached you will find "A3_Test_G_Code" which is the original from the CAM software. "Revised A3_Test_G_Code" will be the version I revised that does what I want it to.