Hello Guest it is April 19, 2024, 08:20:05 AM

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - JohnHaine

251
General Mach Discussion / Re: ESS Disconnects my Internet?
« on: June 19, 2022, 03:28:24 AM »
How are they connected?

252
Another data point.  I just for the first time tried Mach3 threading using the standard wizard on my lathe and the UC100 motion controller.  Not actually cutting metal but just checking it behaved as expected - it did!  So as expected the UC100 does support Mach3 threading using a single index pulse.

253
Right, so I have done a couple of experiments on my mill using the tool height setter and a square-ended rod in the chuck as a probe.  The setter is basically a spring-loaded button at a known height of 38.84mm, which is grounded via the rod on contact.  I used my tool height setting macro initially, then also a straight G31 move.  Both of these verified that G31 operates and writes the XYZ PROGRAM coordinates to a specified file.  In the case of my macro two readings are written, for the fast and slow probe moves, they are very slightly different on Z but of course X and Y are the same.

So I suggest you try the following.

a)   Type M40 into the MDI text box and return - when a file dialogue appears type a suitable filename.txt into the appropriate box and save it somewhere you can find it quickly.
b)   Position the probe just above (say 1mm) the surface to be probed and take a note of the displayed X and Y coords (and Z if you like).  Suppose the Z value is Z0.
c)   Type G31 (Z0 - 2) F5 into the MDI box and press return.  The probe should start moving slowly down until it contacts the surface then stop.
d)   Type M41 into the text box to close the file you just created and wrote to.
e)   Now from Windows navigate to where you saved the file and open it - it should have one line with the X, Y, and Z coords in it corresponding to the values shown on the system DROs.

I had no problems whatever getting this to work and I conclude that probing is working as documented.  It is conceivable that whilst your Ethernet controller does support probing, for some reason it doesn't support the protocol to write the values into the file.  Probing motion is a function of the controller since very tight coupling is needed between the motion control and sensing the probe trigger, how the coord values get written to the file is a Mach3 function.  I have a Win10 Dell mini Inspiron PC with USB connection to a UC100 motion controller.

254
I suggest that you try a very simple single Z probing move at one  XY point, after first opening a data file, then close it, then look to see what is written.  I know that probing itself works, though I haven't tried writing to a file.  Searching on Autoleveller there seem to be several threads on problems with it and solutions.

Writing a G31 command is not going to be easy - what you don't see is that behind the scenes there is a very tight loop to stop the axis moving very quickly when the probe trips.   You would have to use a G1 command to move the probe and find a way to stop the move in response to a hardware input before it completes, or move it in very tiny increments, testing the probe state after each one.  Anything you write in CB will be rather slow anyway.


255
I would have thought M40 is quite independent.  After a probe move the trip coords are just held in the specified parameter registers and it's up to the following code to read them and store in a file.  But I have never used it so can't confirm.  If you are having Autoleveller problems I suggest you raise them with the originator.

256
Doh!  Sorry I've been a bit thick here.  All the probing routines I have used have been MACROS, not .nc files.  That is, they are written in Cypress Basic (CB) (equivalent of Visual Basic).  The "while ismoving() / wend" construct is a CB command.  A probing macro would then include a phrase such as:

Code "G90 G31 Z #1 F" & ProbeFeed1 'Fast probing move
While IsMoving () 'Wait until task has been completed
Wend

Notice that the Code command causes the CB interpreter to issue a G code command to Mach.  In this case it's a G31 in absolute mode (G90) to a level set in variable #1 and at a rate determined by ProbeFeed1.  This comes from a tool height macro which is below.  I guess you are trying to do auto levelling of some sort?  I notice that your code has a lot of XY moves written in-line, if you write it as a macro you can use a couple of for-next loops (or whatever CB calls them) which makes everything much easier.  There are also autolevelling macros around - see for example https://www.autoleveller.co.uk/.

'Tool Height Setting Macro - JLH v1.1 - 4 March 2013
'This version has a 2-phase approach, fast for speed & slow for precision.
CurrentAbsInc = GetOemLED (48) 'Copy current G90/G91 state
CurrentGMode = GetOemDRO (819) 'Copy current G0/G1 state
CurrentFeed = GetOemDRO (818) 'Copy current feedrate
Contact = 0 'Clear the contact flag
PlateThickness = 38.84 'Touch Plate thickness is set here
ProbeFeed1 = 50 'Fast probing feedrate is set here
ProbeFeed2 = 5 'Slow probing feedrate is set here
SetVar (1, -5) 'Maximum probing distance is set here
SetVar (2, 50) 'Retract height is set here
Code "M5" 'Ensures spindle is not running
Code "G21" 'Ensure metric units are used
Zs = GetOemDRO (61) 'Copy current Z-Scale DRO
Call SetOemDRO (61,1) 'Set Z-Scale DRO to 1
DoOemButton (1010) 'Zero Z-Axis DRO
Code "(Setting Tool Zero)" 'Message for status bar
While IsMoving () 'Wait until task has been completed
Wend
If GetOemLED (825) = 0 Then 'Check to see if touch plate is not already grounded
Code "G90 G31 Z #1 F" & ProbeFeed1 'Fast probing move
While IsMoving () 'Wait until task has been completed
Wend
If GetOemLED (825) = True Then 'Check to see if probe has touched plate
Contact = 1 'Set the contact flag
End If
DoOemButton (1003) 'Clear a possible feed-hold condition
ProbePos = GetVar (2002) 'Exact point probe touched
ProbePos = ProbePos + 1 'Displace probe position upwards by 1mm
Code "G0 Z" & ProbePos 'Lifts probe 1 above fast feed endpoint
While IsMoving () 'Wait until task has been completed
Wend
Code "G90 G31 Z #1 F" & ProbeFeed2 'Slow probing move
While IsMoving () 'Wait until task has been completed
Wend
If GetOemLED (825) = True Then 'Check to see if probe has touched plate
Contact = 1 'Set the contact flag
End If
ProbePos = GetVar (2002) 'Exact point probe touched
Code "G0 Z" & ProbePos 'Lifts probe to exact touch position
While IsMoving () 'Wait until task has been completed
Wend
Call SetDRO (2,PlateThickness) 'Set Z-Axis DRO to Touch Plate thickness
Code "G0 Z #2" 'Retract off Touch Plate to the set height
While IsMoving () 'Wait until task has been completed
Wend
Code "(Z-Axis is now Referenced.)" 'Message for status bar
Code "F" & CurrentFeed 'Restore feedrate to original setting
If Contact = 0 Then 'Probe reached max travel without touching
Code "(ERROR - Probe did not touch.)" 'Message for status bar
Response = MsgBox ("ERROR - Probe did not touch.",37,"Auto Tool Zero")
End If
Else
Code "(ERROR - Touch Plate is grounded.)" 'Message for status bar
Response = MsgBox ("ERROR - Touch Plate is grounded - Check connection.",16,"Auto Tool Zero")
End If
Call SetOemDRO (61,Zs) 'Restore Z-Scale DRO to original setting
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 
     

257
The statement

While IsMoving()       
   Wend

just halts the macro execution while the G31 move is happening.  Once the move is finished and the coords are written to the parameter registers execution can continue.  All the probe routines that I have seen use this construct.  Maybe you aren't giving the system time to finish probing?  Also see this thread:

https://www.machsupport.com/forum/index.php?topic=25414.0


258
Um, as I read your code (and use a search box in edit), I don't see ANY G31 commands?  You need something like this after each XY move:
G31 Z-5 F50
while ismoving wend (waits until the move has stopped)
(then commands to move up to just clear, followed by a repeat G31/while/wend at a slow rate)
Then you read the probed height from the #2002 variable and write it to where you want it
Then lift the probe clear and move to the next XY point.


259
Please post your code.

260
By the way there is a very good support forum for CNCDrive (who make the UC100) here:

http://www.forum.cncdrive.com/index.php