Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: lightaces on July 14, 2016, 08:38:05 PM

Title: Problem with Fusion 360 produced G-Code (Mach Blue Z-axis probing)
Post by: lightaces on July 14, 2016, 08:38:05 PM
I'm having a couple of problems with G-Code coming out of Fusion 360.  It runs fine - BUT, after the code has run, my MDI no longer works, and the machine won't run the Mach Blue Z-axis zeroing routing correctly - it finds the plate, and then pauses, and then crashes DOWN again!!!!  I've wreaked a couple of end mills this way.  Both the Z probing and the MDI work fine before I run the code from Fusion, but not after.  They also work before or after I run code from CamBam. 

Now, I'm no expert at G-code, but I'm assuming there is some command which is switching off the MDI, and that is somehow effecting the Z probe code as well.  After the Z-probe fails, there is a message about an error in line 19 (I believe - I don't remember the exact details).

Any help would be great!


Gabriel
Title: Re: Problem with Fusion 360 produced G-Code (Mach Blue Z-axis probing)
Post by: lightaces on July 14, 2016, 08:40:26 PM
Oh, here is an example of a piece of G-Code from Fusion 360 which I used today, which caused the problem.



(LOCATING PIN)
(T2  D=0.125 CR=0. - ZMIN=-0.25 - FLAT END MILL)
G90 G94 G91.1 G40 G49 G17
G20
G28 G91 Z0.
G90

(LOCATING)
M5
M9
T2 M6
S20000 M3
G54
M9
G0 X0. Y-9.7649
G43 Z0.6 H2
Z0.2
G98 G81 X0. Y-9.7649 Z-0.25 R0.1408 F11.7
G80
Z0.6

M9
G28 G91 Z0.
G28 X0. Y0.
M30
Title: Re: Problem with Fusion 360 produced G-Code (Mach Blue Z-axis probing)
Post by: dude1 on July 15, 2016, 06:13:23 AM
what height do you have the home / Machine Zero set to and what version of the blue screen is it the one that cost's or the free one.

the free one had a problem that would make it do what you are seeing, also Fusion for some reason I don't know why set's a goats offset you can't find it in the code, in the profile or on the offset page. try putting the cancel codes in to the MDI one at a time and hit enter, G49 so on. I had a fight with the ADSK cam guys over it.

the free blue probing screen will do what you are seeing if the Home / Machine Zero is less than 1 inch 25 mm above work zero. if it's more than 1 inch it wont happen.
it is easy to test just trigger the probe with nothing in the spindle with it less than 1 inch below the machine home if it goes down again when it should go up that is your problem, if it is let me know and I will give you a code that works every time 5 years no problems with it
Title: Re: Problem with Fusion 360 produced G-Code (Mach Blue Z-axis probing)
Post by: lightaces on July 16, 2016, 05:40:34 PM
That code would be great - and since I set it up three or four years ago, if you could remind me where it goes!


Gabriel
Title: Re: Problem with Fusion 360 produced G-Code (Mach Blue Z-axis probing)
Post by: dude1 on July 16, 2016, 05:42:13 PM
I find it and post soon
Title: Re: Problem with Fusion 360 produced G-Code (Mach Blue Z-axis probing)
Post by: lightaces on July 22, 2016, 05:17:58 PM
Any luck finding that code?
Title: Re: Problem with Fusion 360 produced G-Code (Mach Blue Z-axis probing)
Post by: dude1 on July 25, 2016, 05:14:47 PM
here it is my net has been playing up.

just a few things to check before you use it. make sure the OemDRO and OemLED number's are correct and the DoOEMButton is correct I don't know if they are on the version you have, it is one the Mach_Blue_Probing_by_Big-Tex screen set his old one, not the new one.
so use at your own risk.

it's this part off the code that make's it work what is missing from his code I asked him to add it but he did not
RetractStroke = 10 'Set the retract Stroke
RetractFeedRate = 300 'Set the retract FeedRate




Rem Auto Tool Zero Z- Metric Version
DownStroke = -25 'Set the down stroke to find probe
DownFeedRate = 100 'Set the down FeedRate
RetractStroke = 10 'Set the retract Stroke
RetractFeedRate = 300 'Set the retract FeedRate

CurrentFeed = GetOemDRO(818) 'Get the current feedrate to return to later
CurrentAbsInc = GetOemLED(48) 'Get the current G90/G91 state
CurrentGmode = GetOemDRO(819) 'Get the current G0/G1 state
PlateThickness = GetUserDRO(1151) 'Z-plate thickness DRO

If GetOemLed (825)=0 Then 'Check to see if the probe is already grounded or faulty
DoOEMButton (1010) 'zero the Z axis so the probe move will start from here
Code "G4 P2" ' this delay gives me time to get from computer to hold probe in place
Code "G90 G31 Z" &DownStroke &" F" &DownFeedRate 'probing move
While IsMoving() 'wait while it happens
Wend
ZProbePos = GetVar(2002) 'get the axact point the probe was hit
If Abs(ZprobePos) <= Abs(DownStroke)-0.1 Then 'Check if the probe has been found
Code "G0 Z" &ZProbePos 'go back to that point, always a very small amount of overrun
While IsMoving ()
Wend
Call SetDro (2, PlateThickness) 'set the Z axis DRO to whatever is set as plate thickness
Code "G4 P0.25" 'Pause for Dro to update.
Code "G1 Z" &PlateThickness + RetractStroke &" F" &RetractFeedRate 'retract
While IsMoving ()
Wend
Code "(Z axis is now zeroed)" 'puts this message in the status bar   
Else
Code "G0 Z0" 'retract to start pos
While IsMoving ()
Wend
Code "(Z-Plate not found, check connection or stroke and try again)" 'puts this message in the status bar
End If
Else
Code "(Z-Plate is grounded, check connection and try again)" 'this goes in the status bar if aplicable
End If
Code "F" &CurrentFeed 'Returns to prior feed rate
If CurrentAbsInc = 0 Then 'if G91 was in effect before then return to it
Code "G91"
End If
If CurrentGMode = 0 Then 'if G0 was in effect before then return to it
Code "G0"
End If
Exit Sub