Hello Guest it is December 02, 2021, 10:50:09 AM

Author Topic: Touch off plate script, something is wrong  (Read 565 times)

0 Members and 1 Guest are viewing this topic.

Offline kak

*
  •  81 81
    • View Profile
Touch off plate script, something is wrong
« on: November 25, 2019, 11:46:51 AM »
Hello
I have been using this script for 8 years ( thanks Greolt :-) ), but had to reinstall everything on a new HDD and now the scipt is not working as it should.
Instead of zeroing Z on top of my table, it's zeroing on top of my PCB.
My PCB is 1.6mm thick.
Is there something wrong with the script?

PlateThickness = GetUserDRO(1151) 'Z-plate thickness DRO

If GetOemLed (825)=0 Then 'Check to see if the probe is already grounded or faulty
DoOEMButton (1010) 'zero the Z axis so the probe move will start from here
Code "G4 P5" ' this delay gives me time to get from computer to hold probe in place
Code "G31Z-40 F60" 'probing move, can set the feed rate here as well as how far to move
While IsMoving() 'wait while it happens
Wend
ZProbePos = GetVar(2002) 'get the axact point the probe was hit
Code "G0 Z" &ZProbePos 'go back to that point, always a very small amount of overrun
While IsMoving ()
Wend
Call SetDro (1.6, PlateThickness) 'set the Z axis DRO to whatever is set as plate thickness
Code "G4 P0.25" 'Pause for Dro to update.
Code "G0 Z10" 'put the Z retract height you want here
Code "(Z axis is now zeroed)" 'puts this message in the status bar
Else
Code "(Z-Plate is grounded, check connection and try again)" 'this goes in the status bar if aplicable
Exit Sub
End If


Offline TPS

*
  •  2,210 2,210
    • View Profile
Re: Touch off plate script, something is wrong
« Reply #1 on: November 30, 2019, 05:40:39 AM »
Code: [Select]
PlateThickness = GetUserDRO(1151) 'Z-plate thickness DRO

If GetOemLed (825)=0 Then 'Check to see if the probe is already grounded or faulty
   DoOEMButton (1010) 'zero the Z axis so the probe move will start from here
   Code "G4 P5" ' this delay gives me time to get from computer to hold probe in place
   Code "G31Z-40 F60" 'probing move, can set the feed rate here as well as how far to move
   While IsMoving() 'wait while it happens
   Wend
   ZProbePos = GetVar(2002) 'get the axact point the probe was hit
   Code "G0 Z" &ZProbePos 'go back to that point, always a very small amount of overrun 
   While IsMoving ()
   Wend
   Call SetDro (1.6, PlateThickness) 'set the Z axis DRO to whatever is set as plate thickness
   Code "G4 P0.25" 'Pause for Dro to update.
   Code "G0 Z10" 'put the Z retract height you want here
   Code "(Z axis is now zeroed)" 'puts this message in the status bar
Else
   Code "(Z-Plate is grounded, check connection and try again)" 'this goes in the status bar if aplicable
Exit Sub
End If

by reading your something look a bit strange

PlateThickness = GetUserDRO(1151) 'Z-plate thickness DRO

is Setting the variable PlateThickness to whatever UserDro(1151) is.

Call SetDro (1.6, PlateThickness) 'set the Z axis DRO to whatever is set as plate thickness

should be the code where the new Z-axis Offset is set.

IHMO it should be

Call SetDro (2, PlateThickness) 'set the Z axis DRO to whatever is set as plate thickness

or if you do not use the variable

Call SetDro (2, 1.6) 'set the Z axis DRO to 1.6mm fix

« Last Edit: November 30, 2019, 05:43:21 AM by TPS »
anything is possible, just try to do it.
if you find some mistakes, in my bad bavarian english,they are yours.

Offline kak

*
  •  81 81
    • View Profile
Re: Touch off plate script, something is wrong
« Reply #2 on: November 30, 2019, 09:31:15 PM »
Thank you very much TPS.
I see.... I have changed  2  to 1.6 myself....I thought it was plate thickness.

4 days later I saw another post, where Greolt and Tweakie have suggested to type 1.6mm (my plate thickness), insted of GetUserDRO(1151), so it´s working now.

I've been trying to understand how it works, so I've downloaded Screen4 and opened the screenset.   I don't think I have UserDRO(1151).
Then I saw Greolts instruction, that I must create myself the UserDRO (1151).
I didn't do that, since it's working now,  but I'm very proud that I managed to create a working LED, right next to "Auto tool zero" button, that shows the Digitize state :-)