I've set up a couple OD grinders with Mach3 latest version .067. One grinder seems to do fine while the other, with identical code, makes "extra" movements. I've attached the part of the script that seems to be the culprit. Any ideas? I've deleted code that follows the problem.

Tom

rem M1053 For PLUNGE GRIND To DIMENSION

Option Explicit

Dim FinishDim As Double

Dim ToGrind As Double

Dim HoldToGrind As Double

Dim Current As Double

Dim Remainder As Double

Dim SparkoutCounter As Integer

Dim RoughToGo As Double

Dim FinishToGo As Double

Dim RoughInc As Double

Dim FinishInc As Double

Dim Sparkouts As Integer

Dim LeftX As Double

Dim RightX As Double

Dim LeftFeedX As Double

Dim RightFeedX As Double

Dim PlungeFeedY As Double

Dim LeftDwell As Double

Dim RightDwell As Double

Dim AmountToGrind As Double

LeftDwell = GetOEMDRO(1110)

RightDwell = GetOEMDRO(1120)

FinishDim = GetOEMDRO(1056)

ToGrind = 0

AmountToGrind = 0

Current = 0

Remainder = 0

SparkoutCounter = 0

RoughToGo = 0

FinishToGo = 0

RoughInc = GetOEMDRO(1052)

FinishInc = GetOEMDRO(1053)

Sparkouts = GetOEMDRO(1054)

LeftX = GetOEMDRO(1060)

RightX = GetOEMDRO(1061)

LeftFeedX = GetOEMDRO(1162)

RightFeedX = GetOEMDRO(1163)

PlungeFeedY = GetOEMDRO(1064)

Current = GetOEMDRO(801)

ToGrind = Current - FinishDim

HoldToGrind = ToGrind * 1000000

ToGrind = HoldToGrind * .000001

AmountToGrind = ToGrind

rem last final Left over

Current = GetOEMDRO(801)

FinishDim = GetOEMDRO(1056)

Remainder = Current - FinishDim

HoldToGrind = Remainder * 1000000

Remainder = HoldToGrind * .000001

If (FinishDim <> Current) Then

Code "M8 M3"

Sleep 2000

rem turn On side travel

If GetUserLed (1101) Then (feed from left)

Code "G90G01 X" & RightX & "F" & LeftFeedX

Code "G04 P" & RightDwell

Code "G90G01 Y" & FinishDim & "F" & PlungeFeedY (*************** after this code the Y axis feeds back to original number, before feed move)

Remainder = 0 (***** it doesn't do it when I run it on a computer in my office)

End If

If GetUserLed (1100) Then (feed from right)

Code "G90G01 X" & LeftX & "F" & RightFeedX

Code "G04 P" & LeftDwell

Code "G90G01 Y" & FinishDim & "F" & PlungeFeedY

Remainder = 0

End If

End If

Code "M9 M5"