I had a macropump a while back that looked at True spindle and Requested spindle speeds over a 5 second or so period and if it was out by a certain % it would fault Mach. Problem I had was it worked fine as long as ModBUS was not enabled but just wouldnt work if it was, because I needed Modbus it was no use to me and Brian never fixed the problem as far as I know.
Not sure if I still have it but if you think it would be of use I can do some searching of the old hard drives I have here.
Hood
Hood I would like to get that from you if you don't mind. As of now i just have it wait a few seconds before driving the axises allowing time for spin up of the spindle. I would love to have mach notice true spindle speed vs the commanded speed and if its out by a set % then it will estop. I am not using ModBUS.
Thanks,
Wes
Give this a go and see if it works for you
Sub Main()
If (GetLed(13)) Then
Call SetOemDro (1100,0)
Exit Sub
End If
CodeSpeed = GetOemDro (817) 'Requested speed
TrueSpeed = GetOemDro (39) 'Speed of Spindle
Count = GetUserDro (1100) 'Get the count
If (Count<4) Then
Call SetVar (70+Count,TrueSpeed)
Count = Count+1
Call SetOemDro (1100,Count)
Else
Call SetOemDro(1100,0)
Avg=((GetVar(70)+GetVar(71)+GetVar(72)+GetVar(73))/4) 'Average Speed
Low=CodeSpeed*.9 'Fault Speed (10% less than commanded)
Call SetOemDro(1113,Avg)
Call SetOemDro(1114,Low)
If Avg<Low Then
Call DoOemButton(1003)
MsgBox ("Spindle Fault")
End If
End If
End Sub