Hello Guest it is March 28, 2024, 05:22:17 PM

Author Topic: Mach4 g54 work cordinates trouble help please  (Read 1928 times)

0 Members and 1 Guest are viewing this topic.

Mach4 g54 work cordinates trouble help please
« on: November 07, 2021, 12:19:36 AM »
so when I load my machine the first run is fine after that the night mare begins. ive been ucing Mach3 for over 10 years now and I have to go to mach4 but what im seeing is when I load material and the zero my cordinates along with my tool touchoff . the first run works good and then when i put in a new piece and then go thru the same process evetually I lose the correct Z. thought i was loosing steps and ythats wasnt it.
then eventually I figured out the g54 was automatically saving the work cordinates wrong, right for it wrong for me lol.
so I have a 3 axis rotary machine the rotary is the A axis  the linear axis is X and the Z axis the spindle. and I used the ceter of the material for my zero, but i zreo using a touchoff plate and compensate on the touch off tool. the problem is. if I home in place or home with proximity switch the offset for zwill be a - number. and im not very smart or I would have figured this out months ago. I have mach 3 on a bunch of the machines and mach3 doesnt care I always home in place and have never homed any of those machines and they work flawless run them 24-7. how do I get mach4 to work the same or what is the work around?  Im sure there is an easy solution if more info is needed let me know please.

I assume it works the first time because the machine and computer are a fresh boot up sp there is no data in the table offsets

thanks in advance JD
Jamie Doeren
Renegade carving Co LLC
Re: Mach4 g54 work cordinates trouble help please
« Reply #1 on: November 07, 2021, 01:12:09 AM »
so what I did was changed the G54 in the code to G55 and it still logs everything but isnt adding the offset to the work. before it was adding the machine and work together. I  think.
Jamie Doeren
Renegade carving Co LLC
Re: Mach4 g54 work cordinates trouble help please
« Reply #2 on: November 07, 2021, 02:58:21 AM »
ok I lied it didnt work . I atached some photos , you can see the third time i ran it the 3d file is inverted/reversed. at that point i have to rehome all axis and then try to clear machine cordinates again. its a real pain
Jamie Doeren
Renegade carving Co LLC

Offline Graham Waterworth

*
  • *
  •  2,668 2,668
  • Yorkshire Dales, England
    • View Profile
Re: Mach4 g54 work cordinates trouble help please
« Reply #3 on: November 08, 2021, 05:48:53 PM »
Have you got a spurious G52 or a G10 in the code that is close to the end of the file?

Are you allowing the file to complete or stopping it mid run?

Or

Is the Z axis hitting the end stop at the end of the program by a few thou?


Offset will only work if you have a G43 Hnn in the program


Can you post the file so I can see what happens here.

« Last Edit: November 08, 2021, 05:57:15 PM by Graham Waterworth »
Without engineers the world stops
Re: Mach4 g54 work cordinates trouble help please
« Reply #4 on: November 08, 2021, 11:32:13 PM »
( Generated by SprutCAM )
( DATE: 11/7/2021 )
( TIME: 6:17:04 PM )

(Tool) (1) (Diametr)(0.875) (.875) (Operation) (Rotary Roughing 875)

N10 G90 G64 G50 G54 G80 G17 G40 G49
N20 G20 (Inch)
(Rotary Roughing 875)
N30 M998
N40 T1 G43 H1 M6
(.875)
N50 S18000 M3
N60 G0 G93 X-44.7375 Z5.9214 A-144.152
N70 G1 Z4.1714 A-144.151 F114.29
N80 Z4.1731 A-140.4 F732.2
N90 Z4.1685 A-137.702 F1018.07
N100 Z4.1732 A-135.005 F1018.42
N110 Z4.1685 A-132.302 F1016.16


N280340 Z3.4484 A1378.8 F615.67
N280350 Z3.4488 A1384.198 F615.58
N280360 Z3.4491 A1389.6 F615.06
N280370 Z3.4491 A1395.002 F615.02
N280380 Z3.4491 A1400.4 F615.48
N280390 Z3.4488 A1405.798 F615.52
N280400 Z3.4484 A1411.2 F615.11
N280410 Z3.4478 A1416.602 F615.21
N280420 Z3.446 A1421.342 F701.37
N280430 Z5.196 F200
N280440 M5
N280450 M998
N280460 M30
%



here are the start of the code and the end of the code and it does look like there is a G43 in there if you want all the code I can send it to you.
Im not a machinest by any way shape or form so thanks for your help. I know mach3 runs this code no issues mach 4 is whatr im having problems with .
Jamie Doeren
Renegade carving Co LLC

Offline thosj

*
  •  532 532
    • View Profile
Re: Mach4 g54 work cordinates trouble help please
« Reply #5 on: November 09, 2021, 06:26:25 PM »
I think Mach4 is more "strict" with Gcode that Mach3 was so if you have a program that ran fine under Mach3 there may be something in there that is "wrong."

Three questions from a guy who doesn't know for sure!!

What's the G50 in line 10? If the answer is "I don't know.", remove it and try.

What is M998?

I've never personally seen the G43 stuff in the same line as an M6. I've always used one line, T1 M6, to change the tool, then a line like G43 H1 Z1. or something. Not sure if they can all be on one line like that.

Just some suggestions really, I don't know:)

Tom

--
Tom

Offline Graham Waterworth

*
  • *
  •  2,668 2,668
  • Yorkshire Dales, England
    • View Profile
Re: Mach4 g54 work cordinates trouble help please
« Reply #6 on: November 09, 2021, 09:53:12 PM »
I think we need to see the M6Start.m1s and M998.m1s macros to see what they are doing.

« Last Edit: November 09, 2021, 09:55:41 PM by Graham Waterworth »
Without engineers the world stops
Re: Mach4 g54 work cordinates trouble help please
« Reply #7 on: November 27, 2021, 02:51:48 AM »
Ive had to go to california for some work and im back and working on this problem again. i will post the m6 script later.
what im wondering is since the zero for the z is the center of my rotay as thats my a axis. and im doing the hight touch off from the head stock and added the diference from the center to the touch plate offset. could that be why im getting a negative instead of a postive in the g54 Z? it homes up to the top. I removed the m998 as it is for tormach specific m code. if I home my machine in place and and zero to the center of the a axis then load my material the roughing pass works great and sometimes but not always the finishing pass will work but alot of the time I actually have to restart my computer and start over.

and what im talking about with the z axis is i set it at 4.3118 and if I look at the table offset the z will be -4.3118 so when cycle start and it hits the g54 it changes the z to zero and well obviously that doesnt work. shouldnt the G54 stay at 0 like G54 X0 A0 Z0 ? 
Jamie Doeren
Renegade carving Co LLC

Offline thosj

*
  •  532 532
    • View Profile
Re: Mach4 g54 work cordinates trouble help please
« Reply #8 on: November 27, 2021, 08:25:14 AM »
G54, and really ALL G54-G59, is the distance from machine coordinate zero to work position zero. So if you set G54 Z0 to some number, say your 4.3118, they MDI in G0 G54 Z0, the machine moves there. Clicking the Machine Coordinates button will alternately show 0 and 4.3118.

Homing in place I don't do and don't know how it really works. Having limit switches eliminates that, machine coordinate zero is always the same place.

The really odd thing here is one tool runs fine and the next "sometimes" does not. Are both roughing and finishing passes using the same tool?

Another thing, in a "normal" situation, with Z homing at the "top", all the way UP, and Z direction set right, G54 would be a negative value.

Tom
--
Tom
Re: Mach4 g54 work cordinates trouble help please
« Reply #9 on: November 27, 2021, 07:27:01 PM »
I do understand what your saying, and I tryed homing with my switches and in place and cant seem to get the same results everytime.
this is my m6 script Im using. i want to thanks to you guys that are trying to haelp as this is so confusing for me. my other machines run mach3 are running smooth and making the switch is super frustrating.

function m6()

   local inst = mc.mcGetInstance()
   local selectedTool = mc.mcToolGetSelected(inst)
   selectedTool = math.tointeger(selectedTool)
   local currentTool = mc.mcToolGetCurrent(inst)
   currentTool = math.tointeger(currentTool)
   
   if selectedTool == currentTool then
      mc.mcCntlSetLastError(inst, "Current tool == Selected tool so there is nothing to do")
   else
      --Remove this line if you would not like the Z axis to move
      --mc.mcCntlGcodeExecute(inst, "G90 G53 G0 Z0.0");--Move the Z axis all the way up
      mc.mcCntlSetLastError(inst, "Change to tool " .. tostring(selectedTool) .. " and press start to continue") --Message at beginning of tool change
      mc.mcCntlToolChangeManual(inst, true) --This will pause the tool change here and wait for a press of cycle start to continue
      mc.mcCntlSetLastError(inst, "Current tool == " .. tostring(selectedTool) .. "   Previous Tool == " .. tostring(currentTool)) --Message that shows after Cycle Start
      mc.mcToolSetCurrent(inst, selectedTool)
   end
end

if (mc.mcInEditor() == 1) then
   m6()
end
Jamie Doeren
Renegade carving Co LLC