It is currently Tue Oct 17, 2017 11:34 pm

 

Zero to work height issues and my macro solution.

Mach 3 CNC from Artsoft questions or tips can be posted to this forum.
User avatar
AdrianH
Posts: 42
Joined: Tue Dec 27, 2016 1:08 pm
Location: Blackburn England
Contact:

Zero to work height issues and my macro solution.

Postby AdrianH » Fri Jun 16, 2017 4:08 pm

I am not sure if this will help anyone or, if the issue I had is only particular to me, but here goes.

On occasion, my switch used on the G31 probe would stick, either due to crud that had managed to get in there or something had jammed in there keeping the torch raised slightly, basically meaning the digitise input was active before I zero'ed for a cut.

When this happened Mach3 would sort of hang for a while, then output a message to say Probe ignored, but then the axis would actually move at a very slow rate and the DRO's go at a different rate. It meant that I would need to hit stop, remove the obstruction and then try and reset the position back up on the table as it was prior to the zero heigh macro.

Anyway, not knowing why Mach3 did as it did, I have changed my macro M800.m1s to the one below, It will check for active probe before doing the zero action, if Active it does an "M1" to stop everything and sticks a message in the status window, but at least it does not then go on to move the axis around, giving me the chance to remove the obstruction, back step a line and try again.


Code: Select all

' Adrian Hodgson M800.m1s
' Update 15/06/17 revised 16/06/17
APH = 2.50         ' Define Above Pierce Height
HA = -3.6         ' Define the Height Adjustment

If GetOemLed(825) Then      ' The probe LED is already on
   Code "M1"            ' Code out the M1 to stop the machine if set to allow
   Message "Probe input error!"   ' notify
Else                  ' probe not set
   Message ""            ' clear message
   Code("G31 Z-30.0 F600")      ' probe surface
   While (IsMoving())         ' Wait for movement to complete
   Sleep(100)            ' Sleep, so other threads can run while we wait
   Wend               ' Wait end
   ZprobePos = GetVar(2002)    ' get contact point
   Code("G0 Z " &ZprobePos)    ' return to point to remove overshoot
   While (IsMoving())         ' Wait For movement To complete
   Sleep(100)            ' Sleep, so other threads can run While we wait
   Wend               ' Wait end
   Call SetOEMDRO(802, HA)    ' Set Z DRO = 0.00
   Code("G1 Z "& APH &" F600")   ' go to just above pierce height
   While (IsMoving())         ' Wait for movement to complete
   Sleep(100)            ' Sleep, so other threads can run while we wait
   Wend               ' Wait end                 
End If               ' End


If it helps anyone, I have managed a bit, if not, nothing lost!

Adrian

tcaudle
Posts: 756
Joined: Tue Feb 28, 2012 6:47 pm
Contact:

Re: Zero to work height issues and my macro solution.

Postby tcaudle » Fri Jun 16, 2017 4:19 pm

This si a Macro we have been including for MACH profiles for several years:

M900

'code to stop a touch off if the Ohmic is stuck on
if IsActive(8) then
Response = MsgBox ("Touch - Off sensor jammed. Clear and hit RUN to continue ", 4 , "Clear Z Jam")
code "M00"
end if

You then do an M900 call in the OnReference Function in SheetCAM so when it starts a reference it first checks the input and stops until you clear it. Simple and elegant.

tcaudle
Posts: 756
Joined: Tue Feb 28, 2012 6:47 pm
Contact:

Re: Zero to work height issues and my macro solution.

Postby tcaudle » Fri Jun 16, 2017 4:20 pm

Works with any input used for touch off but it may need to be renumbered

User avatar
AdrianH
Posts: 42
Joined: Tue Dec 27, 2016 1:08 pm
Location: Blackburn England
Contact:

Re: Zero to work height issues and my macro solution.

Postby AdrianH » Fri Jun 16, 2017 4:53 pm

OK, so you include this with your CandCNC gear, sorry I did not know. Mine is all home made so I am learning to resolve issues as I go along.

I looked at the IsActive() but could not find anything that defined the probe input pin (Port 1 Pin 11) when reading though the macro reference manual, have I missed it? where is the defs?

Also just reading through the Sheetcam resource Post.html I have, there is no function listed I can see called OnReference. So I am assuming you have been at this for a few years and have gained a lot of knowledge including writing your own functions. It will probably take me some time to catch up if ever.

Can I ask if Mach3 moving the axis if 'Ohmic' is stuck is a known thing, or just on mine?

Adrian

User avatar
AdrianH
Posts: 42
Joined: Tue Dec 27, 2016 1:08 pm
Location: Blackburn England
Contact:

Re: Zero to work height issues and my macro solution.

Postby AdrianH » Fri Jun 16, 2017 6:21 pm

Hello tcaudle, or anyone!
I am reading more resources and trying to learn. I found this on the web
http://www.machsupport.com/Mach3Wiki/in ... gnal_Names

Are you using these numbers for Ohmic, in effect using what would be using ZHome for Ohmic and possibly using the DIGITIZE 22 as a back-up on a switch?

Just trying to understand where the 8 came from.

Adrian

tcaudle
Posts: 756
Joined: Tue Feb 28, 2012 6:47 pm
Contact:

Re: Zero to work height issues and my macro solution.

Postby tcaudle » Sat Jun 17, 2017 3:44 pm

Open the MACH WIKI and look at how you can call things like DRO's, Buttons and test the state of inputs and outputs. the number is a shorthand parameter and the cross list is in the WIKI. Each outputs and input FUNCTION (like Z home ) has a number. Which physical input you assign to it is up to the input mappings

http://www.machsupport.com/Mach3Wiki/index.php?title=VB_Constants_for_Signal_Names

The input being tested is Z home (Probe input is mapped to both Probe and Z home). Z home mapped to the same input as Probe.

User avatar
AdrianH
Posts: 42
Joined: Tue Dec 27, 2016 1:08 pm
Location: Blackburn England
Contact:

Re: Zero to work height issues and my macro solution.

Postby AdrianH » Sat Jun 17, 2017 6:08 pm

OK thanks that is the document I found last night later on in the evening. Just needed to confirm.

It gives me a bit more information to play with and use in the future.
Your table users must be pleased with your knowledge.
Have fun
Adrian

tcaudle
Posts: 756
Joined: Tue Feb 28, 2012 6:47 pm
Contact:

Re: Zero to work height issues and my macro solution.

Postby tcaudle » Sun Jun 18, 2017 2:18 pm

45+ years of Electronics and Electronic Design
25+ years Computer and Software Applications /Programming
35 + years CNC and power electronics
15+ years with DIY and Entry Level CNC
15 + years CNC Plasma and THC design
15+ years Windows/MACH back to Master 5 on WIN98
9 years with SheetCAM and LUA Post language
2+ years with LINUX and LINUXCNC

If you do things long enough and often enough you start to learn things! :D


Return to “Mach3 CNC”

Who is online

Users browsing this forum: No registered users and 1 guest