hexagon logo

Programming to allow for a choice between 2 different Auto Calibrate commands

This is relatively simple code, but new users might find it helpful. I was recently asked if I could help automate a company’s probe calibration routine and write a program that would run one of 2 Auto Calibrate routines: one for “yes, the cal sphere has moved,” and “no, the cal sphere has not moved.”

First question: Do you want to calibrate the probe?

Second question: Has the calibration sphere moved?

STARTUP    =ALIGNMENT/START,RECALL:USE_PART_SETUP,LIST=YES
            ALIGNMENT/END
            MODE/DCC
            FORMAT/TEXT,OPTIONS, ,HEADINGS,SYMBOLS, ;NOM,TOL,MEAS,DEV,OUTTOL, ,
            LOADPROBE/3X20MM
            TIP/T1A0B0, SHANKIJK=0, 0, 1, ANGLE=0
C2         =COMMENT/YESNO,NO,FULL SCREEN=YES,AUTO-CONTINUE=NO,
            Do you want to calibrate?
            IF/C2.INPUT=="YES"
C1           =COMMENT/YESNO,NO,FULL SCREEN=YES,AUTO-CONTINUE=NO,
              Has the cal sphere moved?
              IF/C1.INPUT=="YES"
                COMMENT/OPER,NO,FULL SCREEN=YES,AUTO-CONTINUE=NO,
                Take a manual hit to locate cal sphere
                AUTOCALIBRATE/PROBE, PARAMETER_SET=ALL-TIPS-WITH-DEFAULTS, QUALTOOL_MOVED=YES_MANUAL,
                              SHOW_SUMMARY=NO, OVERWRITE_RESULTSFILE=NO
              END_IF/
              ELSE_IF/C1.INPUT=="NO"
                AUTOCALIBRATE/PROBE, PARAMETER_SET=ALL-TIPS-WITH-DEFAULTS, QUALTOOL_MOVED=NO,
                              SHOW_SUMMARY=NO, OVERWRITE_RESULTSFILE=NO
              END_ELSEIF/
            END_IF/
            COMMENT/OPER,NO,FULL SCREEN=YES,AUTO-CONTINUE=NO,
            PRESS "OK" TO BEGIN CMM PROGRAM
            MODE/DCC
  • In hindsight, the initial comment of "Would you like to calibrate?" is answered as YES when the individual runs the program, therefore is redundant.
    However, if this is placed at the beginning of each and every program, it MIGHT come in hand.,. although this in and of itself could be considered a "complete" autocalibration program, and doesn't need to be inserted into any programs; merely run as "the calibration program", then run whatever programs you need to.

    Good call on posting the code, however since this is, as stated above, more or less for new users, some explanation as to what you're doing would be helpful.
    Maybe an explanation on why your autocalibration program uses ALL_TIPS_WITH_DEFAULTS as opposed to a custom parameter set, or why you would NOT want to say yes it moved.

    In my opinion (and I do consider this an opinion), if you're calibrating, regardless of if the sphere actually physically moved or not, the first probe should ALWAYS answer "Yes, the sphere has moved", to designate that tip as the "Master" (because answering YES tells PC-DMIS that the probe is the master).
    Then, theoretically, every probe after that could answer NO, but still DCC the calibration, and you'd only need to take 1 manual point every time and walk away (setup-dependent, of course)

    provided a good explanation somewhere on the forum on why it's not necessarily a good idea to "truly" calibrate the master, hence why I believe you should always answer YES for calibration at least once. Something along the lines of, you want the master to be theoretically perfect, to reduce the amount of errors and such and such.
  • I have this type of Auto Calibration built into the PC-DMIS program template for Non-Probe Rack probes. A Forum or Comments control this Auto Calibration depending on the Template settings.
    Within the Auto Calibration Group I also, have an Input Comment to choose from a list of probes to recalibrate. A comment to display the last time calibration was complete. Print Commands and Basic scripts to Save the Auto Calibration report and automatically open the report when using Inspect. For the Master probes can be forced to be calibrated using the Auto Calibration within this Auto Calibration Group. I do have a separate Mater Probe Calibration Program that can be executed within Inspect that will automatically open the probe results file.
    There are right ways to do this and wrong ways to do this with PC-DMIS and this should not be the case with this software.
  • For this particular customer, I was focused more on the use of the IF/END_IF and ELSE_IF/END_ELSEIF commands to allow their operators to choose one of two options. I also added the option to not run any probe calibration at all, at their request.

    I posted this code in Tips & Tricks only to provide an example of how to program to either run “THIS” or “THAT.” So, for that reason, I wasn’t overly concerned with the details of the actual calibration – I just inserted the Auto Calibration command where I needed it.

    Having said all that, I agree with all the comments made on the BIG topic of probe calibration. The new Level 2 curriculum has expanded this topic greatly and addresses the use of a Master Probe when employing multiple Auto Calibration commands. The page from the training manual is shown below .



    I usually expand on the curriculum in this area when I teach Level 2 and show how you can use the PROBEDATA command with a variable (and a bunch of other code) to flag a failed calibration. I made a tutorial video on this a few years ago. You can watch it here if you’re interested: https://blog.cmmxyz.com/blog/displaying-autocalibration-results


  • Thank you Trevor for your post. The tutorial videos that cmmxyz have provided have been very helpful over the years.
  • Hey, no problem and thanks for the feedback! By the way, how does one graduate from being a "Junior Member" on this forum?? That title is really starting to hurt my ego! Hahaha Disappointed
  • +1 +1 +1 I've learned a lot of really good stuff from cmmxyz's videos. It's pretty much all practical stuff that can be used every day.
  • A Lot of Posting and Replying. I wouldn't worry about it. It's Just a number and Title.
  • Hey Trevor, I have a quick question, my program starts with this code for my initial probe," TIP/T1A0B0, SHANKIJK=0, 0, 1, ANGLE=-90", your sample program shows the ANGLE=0 DEG, is there something wrong with the probe setup?
    I have not watched your tutorial video yet but will today.
  • To be honest, I've never actually paid attention to that bit of code. If your probe is built, defined and calibrated correctly, then the code should show the angle it needs to show. I did a quick search and couldn't find a description for that field. I'll keep digging now that you've got me curious.

    Are you having issues with running your program or are you just wondering why yours looks different than mine?
  • The code just looked different, I am having no trouble with prob cal results or measurements. Thanks for the great videos!