Изменения документа Настройка омического датчика
Редактировал(а) writer 2024/12/25 13:12
Сводка
Подробности
- M150.pm
-
- Author
-
... ... @@ -1,0 +1,1 @@ 1 +XWiki.Knetyaga - Размер
-
... ... @@ -1,0 +1,1 @@ 1 +995 bytes - Содержимое
-
... ... @@ -1,0 +1,37 @@ 1 +require("Common") 2 + 3 +function M150() 4 + if Is_THC_Mode() then 5 + PushCurrentDistanceMode() 6 + PushCurrentMotionMode() 7 + if not IsProbingPinConfigured() then 8 + DisplayMessage(GetMessage(Messages.ProbeNotConfigured)) 9 + Stop() 10 + return 11 + end 12 + if not IsSpecificProbingPinConfigured(2) then 13 + DisplayMessage(GetMessage(Messages.SecondProbeNotConfigured)) 14 + Stop() 15 + return 16 + end 17 + if (PinGetState(Inputs.Probing) or PinGetState(Inputs.Probing2)) then 18 + DisplayMessage(GetMessage(Messages.ProbeActive)) 19 + Stop() 20 + return 21 + end 22 + 23 + GotoSafeZ() 24 + 25 + local max_probe = -1000 26 + local ProbeFeed = GetProbeFeed() 27 + ExecuteMDI("G90 G38.2 P1 Z"..max_probe.." F"..ProbeFeed) 28 + local pos_z1 = AxisGetMachinePos(Axis.Z) 29 + ExecuteMDI("G90 G38.2 P2 Z"..max_probe.." F"..ProbeFeed) 30 + local pos_z2 = AxisGetMachinePos(Axis.Z) 31 + --- 32 + local dz = pos_z1 - pos_z2 33 + SetOmichSensorDelta(dz) 34 + GotoSafeZ() 35 + DisplayMessage("Расчет завершен, dz = "..dz) 36 + end 37 +end