Hello Guest it is April 23, 2024, 10:49:34 AM

Author Topic: Question on 4 Axis Toolpath?  (Read 7225 times)

0 Members and 1 Guest are viewing this topic.

Offline Mauri

*
  •  328 328
    • View Profile
Question on 4 Axis Toolpath?
« on: January 22, 2017, 04:55:55 PM »
Hi,
For the last 18 months plus, the Mach 4 program has been unable to produce any 4 axis Toolpath that has any resemblance to the actual object, see pics below Venus Bust.
Is there anyone going to fix the issue? ???
Can anyone advise that Mach 4 program can actual cut a 4 Axis Toolpath?
Regards,
Mauri.

Offline smav

*
  •  55 55
    • View Profile
Re: Question on 4 Axis Toolpath?
« Reply #1 on: April 07, 2018, 12:36:03 PM »
Has anyone got any input on this issue. I have seen this issue asked in a few other posts but no real replies that I have found. mach 3 does not have this issue and I generally use mach 3 to check code that I have created but not run before just to make sure nothing is missing or out of range. :o
Re: Question on 4 Axis Toolpath?
« Reply #2 on: April 08, 2018, 01:54:41 AM »
Hi,
I have had it working for a while. I use Industrial version but tried this as a test now in the Mach4 hobby Demo.

First create a Toggle button on your screenset.
In the 'Down Script' enter...

Code: [Select]
--A rot on----------------------
local inst = mc.mcGetInstance()
mc.mcToolPathSetARotationAxis(inst, 0)

In the 'Up Script' enter...
Code: [Select]
--A rot off----------------------
local inst = mc.mcGetInstance()
mc.mcToolPathSetARotationAxis(inst, -1)

Secondly create a DRO and name it 'droRadius'.
In the 'On Modify Script' for the dro enter...

Code: [Select]
local inst = mc.mcGetInstance();
local getVal = scr.GetProperty('droRadius', 'Value');
local getValAsNumber = tonumber(getVal);
getValAsNumber = getValAsNumber / 2;    --convert to radius (dro is entered as diameter)
getValAsNumber = 0 - getValAsNumber;    --make negative for Z offset
mc.mcToolPathSetAAxisPosition(inst, 0.000, 0.000, getValAsNumber);

Load your Venus head in, enable rotations with your toggle button and enter diameter of the model and hit regen.
If weird stuff happens in a 2D job toolpath remember to toggle rotations OFF and regen your toolpath.
Also if your scale is wrong make sure your A Axis Machine Coords are at Zero.

Good Luck!
D+C
« Last Edit: April 08, 2018, 01:57:20 AM by Dazed+Confused »

Offline smav

*
  •  55 55
    • View Profile
Re: Question on 4 Axis Toolpath?
« Reply #3 on: April 08, 2018, 02:28:52 PM »
Thanks for the reply. I am going to try that a little later when I get some time at the machine again. I think what you have will resolve my problem as it appears that mach 4 right out of the box does not really recognize a 4th axis toolpath and this will add that ability to the toolpath window. A few days ago I generated some gcode in which I forgot to set my machine preference up as a 4 axis machine and left it on a 3 axis preference. I generated the code and when I loaded it in to mach 4 the tool path came up and looked exactly like the toolpath I generated in my cam/cad program that generates the gcode. The image in the toolpath window was 3d and represented the cylindrical shaped object I was working on  and I thought wow that's the first time I  have ever saw it actually recreate the object accurately. I then noticed in my gcode window that there was no A axis present only xyz. Once I regenerated the code set to a 4 axis machine and included the a axis movements the picture in the toolpath window looked like it always has in the past with what appears to be an object that looks nothing like what I am cutting but once finished the object does come out as designed.
I will post again after I have added the script to the screen file and let you know if worked for me.
Thanks for taking the time to reply and post that.....  
« Last Edit: April 08, 2018, 02:31:00 PM by smav »

Offline Mauri

*
  •  328 328
    • View Profile
Re: Question on 4 Axis Toolpath?
« Reply #4 on: April 08, 2018, 04:05:22 PM »
Dazed+Confused,
That looks like a great solution for my 3 year problem. ;D
I will try it when I later.
Maybe this should be coded in Mach4 Screen sets for all users on the next official release to make Mach4 display 4 axis correctly when choosing 4 Axis G-Code.
Nest question, what about 5 axis users, does this work for them as well?
Will they have to make up another button for the 5th Axis.
Thanks,
Regards,
Mauri.

Offline smav

*
  •  55 55
    • View Profile
Re: Question on 4 Axis Toolpath?
« Reply #5 on: April 08, 2018, 09:24:38 PM »
I made those edits and it does actually give a 3d view of the object in the tool path window.  I have not actually cut anything now so i don't know if that DRO value is intended to scale anything or what the purpose is exactly. Does the diameter you enter in to the DRO actually have any effect on anything?
Thanks again for the help on that....

Offline smav

*
  •  55 55
    • View Profile
Re: Question on 4 Axis Toolpath?
« Reply #6 on: April 08, 2018, 09:33:13 PM »
I attached an example of a chess pawn. the 2d is the view I had prior to adding the dro and button. the other is the view when turned on and diameter is entered. The 2d view is a very closely represents what the half shape looks like and the 3d somewhat tapers the end where in the 2d it is kind of rounded and is actually how the object cuts and looks. Is that normal or is there something I need to work on do to get it to be closer to what the part actually looks like after cutting it?

UPDATE: After I posted I see it now. The 3d picture is actually like a mirror or inverted view. After i posted I actually saw the out line of the pawn in the top and bottom of the view, kind of like you are seeing two pawns side by side and tool path is the space between them, if that makes sense.
« Last Edit: April 08, 2018, 09:35:33 PM by smav »

Offline smav

*
  •  55 55
    • View Profile
Re: Question on 4 Axis Toolpath?
« Reply #7 on: April 08, 2018, 11:15:31 PM »
Ok got it to generate the picture of the tool path correctly. I set all machine coordinates and work coordinates all to zero and the picture of the pawn shows up correctly in the tool path.
Thank you D+F for sharing that information and I hope my added comments will help anyone else who is wanting to the same and comes across the same little issues I did.
Thanks again D+F
Re: Question on 4 Axis Toolpath?
« Reply #8 on: April 09, 2018, 02:48:19 AM »
@Mauri
I only built a 4axis machine so have not idea about 5 axis stuff.....yet :)

@smav
Yes it is the inversion problem that made me figure out what 'mc.mcToolPathSetAAxisPosition' does.
As long as your machine coordinates are at zero it should work fine, this is probably a bug?
I was to lazy to come up with any lua code to fix it automagically.

Glad to have helped
D+C

Offline Mauri

*
  •  328 328
    • View Profile
Re: Question on 4 Axis Toolpath?
« Reply #9 on: April 09, 2018, 07:30:52 AM »
Dazed+Confused,
Just a question, what Diameter do you set, the Stock to be cut or the Maximum Diameter of the Model.
If it is the Maximum Diameter of the Model then the only way to ascertain that correctly would be wih the CAM Model, as in my Z Axis (being the Radius) is not the Tip of the Tool but higher by the Radius of the Tool Tip.
Also with 4 Axis Simultaneous the Z Axis would move off center.
Does this ToolPath Regen to display the Correct shape of the Model affect the G-Code being sent to the Controller?
Regards.Mauri.