PDA

View Full Version : Automatic probe calibration script


xcalibur
12-07-2007, 10:03 AM
Hi,
:confused:
I'd like to make an automatic script that will calibrate automaticaly all probes and tips positions used in a program. I uses a MCR20 probe changer with 6 modules.
Find attached the program i wrote but it doesn't work very well.
It open the probe calibration window and select only the tip position used in the program to calibrate but then, it ask me if i want to calibrate all the probe positions (when i use the command 'qualify2').
There is a mistake or something i don't understand !!

Is there anyone who could help me?

Thanks

Goodluck
12-07-2007, 11:11 AM
I'm not sure what you've done (I can't view your doc) and I don't know what version you are using but I think what you want to do is:

Insert -> Calibrate -> Autocalibrate Probe

You can then use parameter sets to calibrate only the probe angles used in the program. Have a look at this code. Maybe it will help.

PART NAME : gfdgdfg
REV NUMBER :
SER NUMBER :
STATS COUNT : 1

STARTUP =ALIGNMENT/START,RECALL:, LIST= YES
ALIGNMENT/END
MODE/MANUAL
CHECK/ 0.1,1
TOUCHSPEED/ 1
C2 =COMMENT/YESNO,NO,Do you want to calibrate tips?
IF/C2.INPUT=="YES"
LOADPROBE/4X20X30
TIP/T1A0B0, SHANKIJK=0, 0, 1, ANGLE=0
AUTOCALIBRATE/PROBE, PARAMETER_SET=806-106 4X20X30, QUALTOOL_MOVED=YES,
SHOW_SUMMARY=YES, OVERWRITE_RESULTSFILE=YES
BEGIN AUTOCALIBRATE RESULTS FOR PROBE 4X20X30 USING SET 806-106 4X20X30
Probe file=4X20X30 Date=12/18/2006 Time=8:56:50 AM
Top Sphere CENT X 11.0435 Y 24.2910 Z -9.7849 D 0.7500
T1A0B0 THEO X 0.0000 Y 0.0000 Z 7.5402 D 0.1575
T1A0B0 MEAS X -0.0047 Y -0.0411 Z 7.5633 D 0.1564 StdDev 0.0001
T1A90B0 THEO X 0.0000 Y 6.1622 Z 1.3780 D 0.1575
T1A90B0 MEAS X -0.0367 Y 6.1517 Z 1.3891 D 0.1565 StdDev 0.0001
T1A90B-90 THEO X 6.1622 Y 0.0000 Z 1.3780 D 0.1575
T1A90B-90 MEAS X 6.1855 Y 0.0027 Z 1.3905 D 0.1566 StdDev 0.0001
T1A90B90 THEO X -6.1622 Y 0.0000 Z 1.3780 D 0.1575
T1A90B90 MEAS X -6.1837 Y -0.0697 Z 1.3822 D 0.1565 StdDev 0.0001
END AUTOCALIBRATE RESULTS FOR PROBE 4X20X30 USING SET 806-106 4X20X30
LOADPROBE/2X20X40
TIP/T1A0B0, SHANKIJK=0, 0, 1, ANGLE=0
AUTOCALIBRATE/PROBE, PARAMETER_SET=806-106 2X20X40, QUALTOOL_MOVED=NO,
SHOW_SUMMARY=YES, OVERWRITE_RESULTSFILE=YES
BEGIN AUTOCALIBRATE RESULTS FOR PROBE 2X20X40 USING SET 806-106 2X20X40
Probe file=2X20X40 Date=12/18/2006 Time=9:00:05 AM
T1A0B0 THEO X 0.0000 Y 0.0000 Z 7.9339 D 0.0787
T1A0B0 MEAS X -0.0190 Y -0.0275 Z 7.9728 D 0.0777 StdDev 0.0001
T1A90B-90 THEO X 6.5559 Y 0.0000 Z 1.3780 D 0.0787
T1A90B-90 MEAS X 6.5951 Y 0.0186 Z 1.3769 D 0.0779 StdDev 0.0001
T1A90B0 THEO X 0.0000 Y 6.5559 Z 1.3780 D 0.0787
T1A90B0 MEAS X -0.0525 Y 6.5612 Z 1.3753 D 0.0777 StdDev 0.0001
T1A90B90 THEO X -6.5559 Y 0.0000 Z 1.3780 D 0.0787
T1A90B90 MEAS X -6.5932 Y -0.0857 Z 1.3679 D 0.0776 StdDev 0.0001
END AUTOCALIBRATE RESULTS FOR PROBE 2X20X40 USING SET 806-106 2X20X40
C11 =COMMENT/YESNO,NO,Please review the calibration results in the edit window.
,Are the standard deviation values acceptable?
IF/C11.INPUT=="NO"
COMMENT/OPER,NO,Please re-start the program and run the calibration again.
PROGRAM/END
END_IF/
END_IF/

Jan d.
12-07-2007, 12:06 PM
Great idea for a Script! If you get this to work there is no need for a calibration program at all. No need to worry about adding and subtracting probes or tips. I also have these programs that sometimes get extra tips, or then I delete a bunch, and forget to update the cal program. This would take care of that.

Did the zz= actuprb.qualify2 work? In other words, can you get it to work for just 1 probe and tip? Or does this command never work? I would start with a simple program that just calibrates 1 probe/tip. The try to do 2 tips, then 2 probes 2 tips and work you way into whatever you have right now.

Oh, and another tip: create a PC-DMIS program that calibrates 2 probes and 2 tips. Make sure it runs clean. The export it to a VBasic file. Then look at the code that got generated. That may provide a clue as to what you are doing wrong.

Hope this helps. Please post when you have it all done. Seems like a very useful piece of code to me!


Jan.

xcalibur
12-11-2007, 10:42 AM
Yes Jan d.,
You said all the interest it give to write such a script.

The zz= actuprb.qualify2 works but the problem is that it doesn't take in account the selected tips positions made before in the script. It ask if I want to calibrate all the positions.

I have also tried to use the actuprb.qualify command wich take in account the selected tips positions but if i haven't calibrate one probe just before to run the script, it doesn't work.
I think there's something missing in the script but what???

I'm using PCDMIS V3.7 MR3

For those who don't see the attached file, see the script lines just after:

' Routine de calibration automatique de tous les palpeurs utilisés dans un programme
'
Sub main
' ces variables sont pour acceder à l'application PC-DMIS
Dim Application As Object
Dim part As Object
Dim cmds As Object
Dim cmd As Object
Dim prb As Object
'
'
' these variables are used To manipulate
' the return value from GetToggleString
Dim togglestring As String
Dim togglecount As Integer
' probes variables And tool variable
Dim actuprb As Object
Dim actutip As Object
Dim posactu As Object
Dim actusettings As Object
Dim actutool As Object
Dim actusphere As Object
'
Dim palpactuel, posactuel As String
Dim s As String
Dim i,palpdeb As Integer
Dim tt,newpalpeur,zz As Boolean
'
' Get the application variable And make sure it is valid
Set Application = CreateObject("PCDLRN.Application")
If Application is Nothing Then
msgbox "Impossible de trouver l'application PCDMIS --> fin de la procédure."
End
End If
'
' Get the part variable And make sure it is valid
Dim programs As Object
'
Set programs = Application.PartPrograms
Set part = Application.ActivePartProgram
'
partname = part.fullname
If part is Nothing Then
msgbox "Impossible de trouver un programme actif --> fin de la procédure."
End
End If
' Get the cmds variable And make sure it is valid
Set cmds = part.Commands
If cmds is Nothing Then
msgbox "Impossible de trouver les commandes du programme --> fin de la procédure."
End
End If
'
'
Dim palpeur (6) As String
Dim positions(6) As String
Dim ii,jj,nbpalp As Integer
'
For jj=1 To 6
palpeur (jj)=" "
Next
'
'************************************************* ************************************************** **
' Loop over all the commands To find used probes
' pour trouver tous les palpeurs utilisés
For Each cmd In cmds
'
If cmd.Type=61 Then '61 est commande charg palpeur / load probe command
togglestring=cmd.gettext(file_name,0)
newpalpeur=True
For jj=1 To 6
If palpeur(jj)=togglestring Then
newpalpeur=False
End If
Next jj
'
If newpalpeur=True Then
ii=ii+1
palpeur(ii)=togglestring
End If
End If
'
Next cmd
'
'************************************************* ************************************************** **
'
nbpalp=ii
'
Dim numligne%
Dim txt$
numligne=1
'
'************************************************* ************************************************** **
' Loop over all the commands To find all tip positions
' pour trouver toutes les positions palpeurs utilisées
For Each cmd In cmds
'
If cmd.Type=61 Then '61 est commande charg palpeur / load probe command

palpactuel=cmd.gettext(file_name,0)
For jj=1 To nbpalp
If palpeur(jj)=palpactuel Then
ii=jj
End If
Next jj

End If

If cmd.Type=60 Then '60 est commande contact... / 60= Select tip command
posactuel=cmd.gettext(id,0)
'
txt$=positions(ii)
txt$=txt$ & posactuel & ";"
positions(ii)= txt$
'
End If
numligne=numligne+1
Next cmd
'
'************************************************* ************************************************** **
'

'************************************************* ************************
' Calibration de tous les palpeurs détectés précédemment
' Calibrate all probes And positions detected before
'************************************************* ************************
'
Dim nomoutil$
Set prb= part.probes
Set actutool=part.tools
Set actusphere=actutool.item(1)
togglestring=palpeur(1)
txt$=positions(1)
Set actuprb=prb.item(togglestring)
Set actutip=actuprb.tips
Set actusettings=actuprb.qualificationsettings
tt= actusettings.settool(actusphere)

'zz= actuprb.qualify2 (actusettings)
'
For ii=1 To nbpalp
'
'actusettings.toolmoved=1
togglestring=palpeur(ii)
txt$=positions(ii)
Set actuprb=prb.item(togglestring)
Set actutip=actuprb.tips
For jj=1 To actutip.count
Set posactu=actutip.item (jj)
nomoutil$= posactu.id
If instr(1,positions(ii),nomoutil$) Then
posactu.selected=True
Else
posactu.selected=False
End If
Next
'
msgbox togglestring & " " & txt$
'
tt= actuprb.qualify2 (actusettings)
Next
'
msgbox "Qualification terminée !!"
End
'
End Sub

Goodluck
05-23-2008, 09:31 AM
I know it's spam. I just found the title of the post funny.

I am appreciated for this pretty article. thanks.

It is obvious that English is not their first language. What they typed is the opposite of what they meant. I found that humorous.

BTW, speaking of spam, wouldn't it suck if your name was actually Charles Soludo but you weren't that guy?

bw_bob
05-23-2008, 11:25 AM
Don't get sucked in, that is SPAM, SPAM, SPAM, SPAM, SPAM, SPAM, SPAM, SPAM, SPAM, SPAM, SPAM, SPAM, SPAM, SPAM, SPAM, SPAM, SPAM, SPAM, SPAM, SPAM, SPAM, SPAM, SPAM, SPAM, SPAM, SPAM, SPAM, SPAM, SPAM, SPAM, SPAM, SPAM, SPAM, SPAM, SPAM, SPAM, SPAM, SPAM, SPAM, SPAM

It is a new twist from the spammers, they post in existing threads instead of starting new ones. I have been reporting this for 3 days, all to no avail.



tattletail......