Help with Mach3 and 4th axis machining

Home Model Engine Machinist Forum

Help Support Home Model Engine Machinist Forum:

Carbuilder

Well-Known Member
Joined
Feb 2, 2015
Messages
90
Reaction score
62
Location
Bolton, ON, Canada
Not sure what section this should go in, but I'll start here. I'll try and keep this brief, but probably won't be able to. ;)

So, here is what is going on. I'm going to machine the camshaft for my Little Demon engine using my small CNC mill with the rotary axis. I have DeskProto software. It will handle the 4th axis, but not being super expensive top-of-the-line software, it does't handle multiple axis movement while using the rotary axis. So it can rotate the part while moving the cutter up and down (Z-axis), or can rotate the cutter while moving the part axially (X-axis). Both ways should be suitable for producing a cam. It can't move the X, Y, and Z while rotating.

So I did some test pieces in aluminum and found I was getting a real mess. Lex, at DeskProto, is very good at helping and we have gone back and forth for over a week to try and sort this out, with no resolution. One issue is that Lex does not use Mach3 so can't say if I have settings wrong. To help things along, I did a quick model of the cam with only 1 lobe as a test piece. The software lets you specify machining around the A-axis (so rotating while moving the cutter up and down to produce a cam lobe) or you can specify cutting along the X-axis; this would be what is sometimes referred to as indexed cutting. Make a cut along the length of the part, turn it a degree or 2 and repeat.

When I specify cutting along the X-axis, I get a good part. This is 1/2" diameter material, machined in advance to around 1/4" to chuck in the mill. It is machined with a 1/8" flat end mill and seemed to be indexing about 2 degrees for each cut. A perfectly acceptable cam lobe:

Screen Shot 2022-02-02 at 12.26.40 PM.png

But before I did this, I was specifying machining around the A-axis and got this. This was with the same 1/8" flat end mill. The machining is decent (a little strange in one area), but the cam lobe is almost round. It is the one on the right.

Screen Shot 2022-02-02 at 1.15.53 PM.png

In both cases it did rough machining and then finish machining, both with the same cutter. Since it is just 1 cam lobe it was only about 5 minutes to machine.

Now while the machining along the X-axis is producing a good part and I can use that to do the camshaft, I would really like to sort out why I can't use machining around the A-axis. I have checked my settings in Mach3, primarily in General Configuration not having any boxes checked in the rotational section, and having Angular Properties checked. This was specified by Lex for DeskProto.

I passed the file onto Lex and he ran it on his machine and got a decent cam shape. But as I said, he is not using Mach3.

I can see from the 2 G-code files that they are both machining to about the same depth, but it seems that the one with around A-axis machining is carrying that depth too far around....but not on Lex's machine. Very strange.

If anyone has seen anything like this before or can offer suggestions it would be great. I know it is asking a lot, but if anyone is willing to try machining one with the "around A-axis" code that would be fantastic. You should get a cam lobe with around .070" lift. The starting point is a piece with 1/2" diameter, machined down to .25-.3" beside the lobe. The lobe is .155" wide and the 0,0,0 point is the top of the part, left side of the lobe, centred on Y-axis as shown:

Screen Shot 2022-02-02 at 1.15.23 PM.png

Thank you very much in advance (for those I haven't lost by now),

Rick
 

Attachments

  • Cam around A-axis with .125 flat mill copy.txt
    133.5 KB · Views: 80
  • single lobe cam X-axis machining v2 copy.txt
    16.1 KB · Views: 81
Last edited:

Carbuilder

Well-Known Member
Joined
Feb 2, 2015
Messages
90
Reaction score
62
Location
Bolton, ON, Canada
Oh, I've machined spark plug pieces with round areas and hex areas and they come out fine with machining along the X-axis, so my machine is indexing angles properly.

Screen Shot 2022-02-02 at 1.41.33 PM.png
 

Eccentric

Well-Known Member
HMEM Supporting Member
Joined
Dec 29, 2020
Messages
312
Reaction score
699
Location
Southern California
I do not see the Y axis in your G-code. When I perform this operation I offset the end mill a fixed distance in the Y direction so I do not machine on the bottom of the end mill, but the side. I also have had better luck with a ball nose end mill, but the flat end mill should work OK.

Do you have any g-code simulation software that shows the path produced by the G-code?
 

Eccentric

Well-Known Member
HMEM Supporting Member
Joined
Dec 29, 2020
Messages
312
Reaction score
699
Location
Southern California
You can try this code to cut a cam lobe with the A-axis rotating. This is for LinuxCNC so it might take a little editing at the beginning. this should tell you if your machine is OK with the A- axis. the key here is that we are using G93 (inverse time mode), you are as well, that is good.
 

Attachments

  • cam lobe test code.txt
    199.9 KB · Views: 79

Carbuilder

Well-Known Member
Joined
Feb 2, 2015
Messages
90
Reaction score
62
Location
Bolton, ON, Canada
I suppose the Y-axis does not show anything since it is not moving that from the initial setup. I can see using the side of the end mill, but then you need many passes to smooth out the machining. I was doing that initially with a ball nose cutter (but using the bottom of it along the centreline of the part), but then realized that I might as well use a flat end mill for something like this and get a "flatter" machined surface without so many passes.

The only G-code simulator I have is the one that comes with DeskProto and that shows the same simulation for both ways of machining, which you would expect in the finished part. It does show the different machining passes for "along X-axis" and "around A-axis", but the end result is pretty much the same. That is why I think it must be something in my Mach3 setup, but don't know what.

Rick
 

Carbuilder

Well-Known Member
Joined
Feb 2, 2015
Messages
90
Reaction score
62
Location
Bolton, ON, Canada
Thank you very much for the help. You are giving me a little too much credit in understanding G-code!

I'll try that file. Is the Z=0 at the top of the blank and at the centreline? And what diameter blank do I start with? Sorry if I should know this from the code, but I'm learning slowly.
 

Carbuilder

Well-Known Member
Joined
Feb 2, 2015
Messages
90
Reaction score
62
Location
Bolton, ON, Canada
You sure Z=0 is the centre of the stock? I did a pass in the air and it was plunging down to near the stock centre (sorry about spelling centre the Canadian way, but my autocorrect keeps doing that). I see Z0.0424 in many places. Isn't that very close to the centre of the stock? I guess I don't understand this. On my other programs when I set Z=0 at the top of the material, the cuts are all Z negative. On your program the cuts are all Z positive, so it makes sense that Z=0 is the stock centre, but it is very close to the centre. What is the min diameter of this cam lobe?

I did find that when I started it, the Z kept going all the way up and hitting the limit switch. I think the G28 was doing that? Never seemed to matter for anything else I've done, but looking into it, it seemed to be trying to machine zero that axis and couldn't do it. I reset the machine 0, but had to do that every time before staring the program. Would that have anything to do with my issues?
 

Carbuilder

Well-Known Member
Joined
Feb 2, 2015
Messages
90
Reaction score
62
Location
Bolton, ON, Canada
I rebooted the machine and zeroed the axes. When running, it first puts the spindle all the way to the top of the travel, then all the way back down again. Not a big deal, but is that what G28 does, and if so, is it required?

I took a few pictures of the machining (but in the air behind the piece of stock). Where I stopped it you can see that it would pretty much machine away all the material.

Screen Shot 2022-02-03 at 3.15.20 PM.png

Screen Shot 2022-02-03 at 3.15.40 PM.png
 

solarenergyadventures

Active Member
Joined
Sep 20, 2012
Messages
34
Reaction score
15
You sure Z=0 is the centre of the stock? I did a pass in the air and it was plunging down to near the stock centre (sorry about spelling centre the Canadian way, but my autocorrect keeps doing that). I see Z0.0424 in many places. Isn't that very close to the centre of the stock? I guess I don't understand this. On my other programs when I set Z=0 at the top of the material, the cuts are all Z negative. On your program the cuts are all Z positive, so it makes sense that Z=0 is the stock centre, but it is very close to the centre. What is the min diameter of this cam lobe?

I did find that when I started it, the Z kept going all the way up and hitting the limit switch. I think the G28 was doing that? Never seemed to matter for anything else I've done, but looking into it, it seemed to be trying to machine zero that axis and couldn't do it. I reset the machine 0, but had to do that every time before staring the program. Would that have anything to do with my issues?
You can take out G28 without any problems. G28 rapids all axis to their home position which I find can be kind of dangerous if you are unsure of what path the machine will take to accomplish this. Personally, I never use G28 for this reason. I like to use G00 Z4.000, or G01 Z4.000 F10 (if you are squeamish about rapids) without any X or Y moves to get the cutter up and away from anything it can hit as my last line before M5 (stop spindle) M9 (all coolant off) and finally M30 (end program and rewind)
If you are running stepper motor based machine like a Tormach, you never want to hit a limit switch because it powers off the stepper motor drivers. This loses your setup in XYZ, and then you have to find your zeros again. It doesn't change much, but it doesen't have to in order to mess up a part. I hope this helps. Cheers!
 

Carbuilder

Well-Known Member
Joined
Feb 2, 2015
Messages
90
Reaction score
62
Location
Bolton, ON, Canada
Makes sense. And for the other concern of mine with the cutter being too deep, I think the cutter moves away from the stock and cuts with the side of it, so it will be a .0125 deep cut on the side of the cutter. I'll give it another try in the air and see what it is doing, and if it looks OK, I'll cut metal.
 

Eccentric

Well-Known Member
HMEM Supporting Member
Joined
Dec 29, 2020
Messages
312
Reaction score
699
Location
Southern California
One piece of important information is that my tool path is for a 1/4" ball end mill. And you are correct, the reason it cuts almost down to the center of the work piece is that it is offset in the Y direction using the side of the tool, not the bottom.

And I agree you can remove the G28.
 

Carbuilder

Well-Known Member
Joined
Feb 2, 2015
Messages
90
Reaction score
62
Location
Bolton, ON, Canada
I read it as .125 ball end mill while I suppose that meant the radius? Anyways, that explains why the cam lobe did not have a complete nose on it, since I was using a 1/8" ball end mill. But other than that, it did have a very nice finish with no steps, and it is a lobe shape, unlike what I am getting with my "around A-axis" machining.

Screen Shot 2022-02-03 at 7.23.07 PM.png

I did have to stop it at this line since it was going to run forever to get back to A=0.

Screen Shot 2022-02-03 at 7.23.28 PM.png

So does this tell me that my machine is OK? It must be something in the mach3 setup that is messing up the around A-axis machining with my original file, but I can't see what. I've read up on all the things to check in the configuration screens and they seem to be correct.
 

awake

Well-Known Member
HMEM Supporting Member
Joined
Sep 4, 2019
Messages
1,786
Reaction score
761
Location
North Carolina
If you are running stepper motor based machine like a Tormach, you never want to hit a limit switch because it powers off the stepper motor drivers. This loses your setup in XYZ, and then you have to find your zeros again. It doesn't change much, but it doesen't have to in order to mess up a part. I hope this helps. Cheers!

Worth noting that while this may be true of the Tormach (can't speak to that), the presence of steppers and limit switches does not automatically mean the steppers are powered down when hitting a limit switch. That is a matter of the hardware and software design - not an inherent requirement of stepper motors.
 

L98fiero

Well-Known Member
HMEM Supporting Member
Joined
Oct 18, 2013
Messages
356
Reaction score
138
Location
Keswick, Ontario
You sure Z=0 is the centre of the stock? I did a pass in the air and it was plunging down to near the stock centre (sorry about spelling centre the Canadian way, but my autocorrect keeps doing that). I see Z0.0424 in many places. Isn't that very close to the centre of the stock? I guess I don't understand this. On my other programs when I set Z=0 at the top of the material, the cuts are all Z negative. On your program the cuts are all Z positive, so it makes sense that Z=0 is the stock centre, but it is very close to the centre. What is the min diameter of this cam lobe?

I did find that when I started it, the Z kept going all the way up and hitting the limit switch. I think the G28 was doing that? Never seemed to matter for anything else I've done, but looking into it, it seemed to be trying to machine zero that axis and couldn't do it. I reset the machine 0, but had to do that every time before staring the program. Would that have anything to do with my issues?
G28 by definition is to send the machine to home position through an intermediate point. When you use G0; G91 G28 X0 Y0 Z0 the machine would just rapid to home, If you used G0; G91 G28 X0 Y0 Z2. it would move Z2. before going to home. You can also use G28 in absolute mode. In my programs, on a VMC, I typically rapid to Z axis home first, i.e., G0; G91 G28 Z0
 

Carbuilder

Well-Known Member
Joined
Feb 2, 2015
Messages
90
Reaction score
62
Location
Bolton, ON, Canada
Even the code that works well, cutting along the X-axis, doesn't have any Y in it. The software doesn't move in the Y axis direction when using the 4th axis, just keeps it at 0 the whole time, so I suppose it just assumes Y=0 if there is no reference to it?
 

Carbuilder

Well-Known Member
Joined
Feb 2, 2015
Messages
90
Reaction score
62
Location
Bolton, ON, Canada
I'm still playing around with this now and then, trying to figure out what the issue is. I did a simple single lobe cam test piece this morning, and took a video of it and the screen in the same view so I could see the machining and code real-time. I can't see anything wrong with the G-code. The nose of the cam is around A=0 to 20 degrees and at no point does it lower Z to take a deep cut at that area of the lobe (from the G-code anyways). But at one point the rotation stops completely but the code is still moving through the lines. It is hard to see the exact point but looks like about a 2 second delay where the code goes through about 10 lines that should be rotating the 4th axis. Maybe it puts things out of whack (technical term) from there on. The rough machining before that point looks OK, but the nose of the cam is machined off after.

Any ideas on what would cause this? And generally only on this code, other uses of the 4th axis seem OK......really strange.

This is that portion of the code with my notes.

Screen Shot 2022-02-07 at 7.54.59 PM.png

Rick
 

Carbuilder

Well-Known Member
Joined
Feb 2, 2015
Messages
90
Reaction score
62
Location
Bolton, ON, Canada
Just watched my video again after something occurred to me to check. During the pause in movement, where the code is still advancing, the A-axis readout on the screen is changing. So the code seems correct and the DRO is indicating continuous movement of the 4th axis, but it isn't actually turning. So some sort of hardware issue? Must be.
 

Scott_M

Well-Known Member
Joined
Apr 13, 2013
Messages
362
Reaction score
167
Location
Medina, Ohio USA
If the code is running and the part is not moving/rotating, then you are either losing steps or the stepper is slipping in its coupling. Does the part/chuck return to the proper position at the end of the code? ie A0, or is it off? If a stepper is missing steps you can usually hear it, a cogging sound. I would check the coupling first. Take it off and see if the shaft is scared up. Just tightening it more won't tell us if it was slipping.
Can you post that code, I will see what it looks like in NCPlot ( back plotter )

Scott
 

Latest posts

Top