Dynomotion

Group: DynoMotion Message: 14682 From: jackgiz@ymail.com Date: 5/6/2017
Subject: Z calibration program

Hi Tom,

I wrote a program to calibrate my Z axis off of a limit switch and it kinda works.  There's an InputBox where you enter the material thickness and the machine moves over the limit switch, comes down, trips the limit switch, does the math,Plugs that into the Z DRO and the Z is calibrated.  The program is attached.


I've got a couple of problems.  


1.  Everytime the program runs the InputBox remembers the last material thickness that was entered.  After running the program a few times I end up with a drop down full of material thicknesses.  How do I zero out that register so it comes up blank without cycling power on my Kflop?


2.  There are 2 buttons at the bottom of the InputBox, Cancel and Set.  What variable do they pass so that I can add an If statement to Cancel out of the program if necessary?


3.  My limit switch triggers at 1.927" above the work surface.  Using the value from the InputBox I subtract it from the 1.927 to get the distance from the current location to the top of the material using the follow statement.


DoPCFloat(PC_COMM_SET_Z,1.927-value);


Unfortunately the machine ends up at a height that is approximately .227" too high.  Even if I remove the value variable and only use the 1.927 my Z zero is still too high.  Is there some kind of limitation with this command where it maxs out at 1.7"?


Jack


  @@attachment@@
Group: DynoMotion Message: 14683 From: Tom Kerekes Date: 5/6/2017
Subject: Re: Z calibration program [1 Attachment]

Hi Jack,

See below:


On 5/6/2017 7:08 PM, jackgiz@... [DynoMotion] wrote:
 

Hi Tom,

I wrote a program to calibrate my Z axis off of a limit switch and it kinda works.  There's an InputBox where you enter the material thickness and the machine moves over the limit switch, comes down, trips the limit switch, does the math,Plugs that into the Z DRO and the Z is calibrated.  The program is attached.


I've got a couple of problems.  


1.  Everytime the program runs the InputBox remembers the last material thickness that was entered.  After running the program a few times I end up with a drop down full of material thicknesses.  How do I zero out that register so it comes up blank without cycling power on my Kflop?

Is that really a problem?  It remembers the last 10 unique values typed in for you. 


2.  There are 2 buttons at the bottom of the InputBox, Cancel and Set.  What variable do they pass so that I can add an If statement to Cancel out of the program if necessary?

The returned value you save in "Answer" will be 0 if the Operator pushed "set" and 1 of the Operator pushed Cancel


3.  My limit switch triggers at 1.927" above the work surface.  Using the value from the InputBox I subtract it from the 1.927 to get the distance from the current location to the top of the material using the follow statement.


DoPCFloat(PC_COMM_SET_Z,1.927-value);


Unfortunately the machine ends up at a height that is approximately .227" too high.  Even if I remove the value variable and only use the 1.927 my Z zero is still too high.  Is there some kind of limitation with this command where it maxs out at 1.7"?

  I don't really understand what you are saying or trying to do.  But I see your code moves the axis after setting the DRO to machine coordinate -2000 counts.  Are you considering this.

HTH
Regards
TK


Jack



Group: DynoMotion Message: 14689 From: Jack Date: 5/7/2017
Subject: Re: Z calibration program

Thanks for your help Tom,

 

Issue 1 – More of a nice to do vs a requirement.  I can live with the way it works.

 

Issue 2 – Answer == 1 to cancel worked perfectly.

 

Issue 3 – Seems like I have more of an ability to measure correctly issue then a program issue.  When I got the switch height correct everything worked fine.

 

Thanks again for your help.  You’ll make a C programmer out of me yet.

 

Jack

 

From: DynoMotion@yahoogroups.com [mailto:DynoMotion@yahoogroups.com]
Sent: Saturday, May 06, 2017 11:47 PM
To: DynoMotion@yahoogroups.com
Subject: Re: [DynoMotion] Z calibration program

 

 

Hi Jack,

See below:

 

On 5/6/2017 7:08 PM, jackgiz@... [DynoMotion] wrote:

 

Hi Tom,

I wrote a program to calibrate my Z axis off of a limit switch and it kinda works.  There's an InputBox where you enter the material thickness and the machine moves over the limit switch, comes down, trips the limit switch, does the math,Plugs that into the Z DRO and the Z is calibrated.  The program is attached.

 

I've got a couple of problems.  

 

1.  Everytime the program runs the InputBox remembers the last material thickness that was entered.  After running the program a few times I end up with a drop down full of material thicknesses.  How do I zero out that register so it comes up blank without cycling power on my Kflop?

Is that really a problem?  It remembers the last 10 unique values typed in for you. 

 

2.  There are 2 buttons at the bottom of the InputBox, Cancel and Set.  What variable do they pass so that I can add an If statement to Cancel out of the program if necessary?

The returned value you save in "Answer" will be 0 if the Operator pushed "set" and 1 of the Operator pushed Cancel

 

3.  My limit switch triggers at 1.927" above the work surface.  Using the value from the InputBox I subtract it from the 1.927 to get the distance from the current location to the top of the material using the follow statement.

 

DoPCFloat(PC_COMM_SET_Z,1.927-value);

 

Unfortunately the machine ends up at a height that is approximately .227" too high.  Even if I remove the value variable and only use the 1.927 my Z zero is still too high.  Is there some kind of limitation with this command where it maxs out at 1.7"?

  I don't really understand what you are saying or trying to do.  But I see your code moves the axis after setting the DRO to machine coordinate -2000 counts.  Are you considering this.

HTH
Regards
TK


 

Jack