Hello Guest it is January 13, 2025, 04:17:02 PM

Author Topic: YAMTCQ (Yet another manual tool change question)  (Read 12020 times)

0 Members and 1 Guest are viewing this topic.

YAMTCQ (Yet another manual tool change question)
« on: January 06, 2024, 05:20:42 PM »
Hello,

I suppose I'll open another thread around tool changing. I can't seem to get my head around how to successfully do this.

I've been using my CNC for over the last year and a half. I'm starting to grow from baby steps to trying to get more advanced. One thing I've been trying to do is have a program where there is a single set up (in CAM and physically) but uses multiple tools.
 
Here is my current process:
1. In my CAM (Fusion 360) I create a "set up" for each tool. I use the post processor to output a program for each tool.
2. I set up the workpiece in the machine.
3. I use the spindle probe to ref x and y according to the ref for the current program.
4. I put in the tool for the first program and then use a height puck on the surface of the stock to zero Z.
5. I run the program from start to finish.
6. Load the new program.
7. I swap in the next tool.
8. I try to keep the x and y reference in each program at the same position. I also try to keep the same Z ref, but that most likely changed so I have to place the height puck back on an appropriate place on the work and take a measurement. This new z height for the workspace has to have been the same when I set it up in CAM. This is a huge hassle because it might be very difficult to get a good height measurement if the surface is really small.
9. Run the program for that tool and hope that I didn't screw up the references for x, y, and z when I made the set ups in CAM and referenced them on the machine.
10. Repeat for each program.

This sucks.

I recently added in a tool setter probe on the work table. From my dumb web developer mind it should be simple to write M6Start and M6End macros to just "shift the Z plane" based on the difference in the measured triggers from the tool setter probe.

Here's a little bit about my machine. It's a Shariff DMC2. The spindle uses an ER-20 collet system. I've traded out the machine's standard probe to have a spindle mounted probe. The machine uses a BL-USBMACH cheap import controller board and a custom made BOB. The BL-USBMACH only has a single input for probes. Basically all my probes are NO. I made a custom Arduino tool to monitor the NC tool setter and invert its output to NC (it's an interesting side project but I digress).

In my head this is how it should work:
1.Use my spindle mounted probe to find the center of the part (or the x,y) ref
2.Use the height puck to find the initial z offset of the workpiece. I don't trust me being able to get the spindle probe in the collet at the same exact height every time.
start the program.
3. At the tool change in the M6Start macro: Go to the tool setter position and measure the probe trigger for z.
4. Move the Z back to the top so I can put the tool in.
5. Manually change tool
6. Click cycle start. Probe using the z tool setter.
7. Compare the difference between the triggers on z
8. Do something to offset the workspace by the difference.
9. Continue with program

I've been able to successfully get the difference. In the Start macro I put the trigger Z position in a user DRO. In the end macro I get the new trigger position.

Here's the question: How can I shift the Z???

I don't think there's a g-code command to offset the workspace when the machine isn't in the current position. I thought I could use G52 to shift the coordinate position. It doesn't appear to be working. I think this is because I use the G52 command in the M6End macro. In my test files I have a G54 command after every Tx M6 command and I think that kills it:

Code: [Select]
(TEST)
(MACHINE)
(  VENDOR SHARIFF DMC)
(  MODEL DMC 2)
(  DESCRIPTION DMC2)
(T1 D=10. CR=0.05 - ZMIN=-1.864 - FACE MILL)
(T8 D=4. CR=0. TAPER=45DEG - ZMIN=-2.264 - CHAMFER MILL)
G90 G94 G91.1 G40 G49 G17
G21
G28 G91 Z0.
G90

(FLAT3)
T1 M6
S19130 M3
G17 G90 G94
G54
G0 X-75.648 Y16.024

...

(2D CONTOUR31 2)
M1
T8 M6
S20000 M3
G17 G90 G94
G54
G0 X-25.591 Y16.1

My other thought was to move the machine back to the correct height and then offset up or down by the difference and then reset the Z workspace then. This is dangerous as I envision a scenario where the new Z 0 position is below the top of the tool setter thus causing a collision.

Is there a way I could do it with VB in the macro? I couldn't find a DRO setting to adjust.

I tried doing this with tool offsets but since I don't track tools. This seemed to do weird things from program to program. Is there a way to reset all tool offsets to 0 at the end of the program?

I've attached my start and end scripts.

Offline TPS

*
  •  2,540 2,540
Re: YAMTCQ (Yet another manual tool change question)
« Reply #1 on: January 08, 2024, 05:18:43 AM »
a simple trick would be to correct Z-Axis Position via OEMDro(802)

-you know the z-axis machinecoord where probe was hit from old tool
-you know the z-axis machinecoord where probe was hit from new tool

so the length differece of tool is z_hit_old - z_hit_new

then you can correct OEMDro(802) with this difference

SetOEMDro(802,GetOEMDro(802)+Diff)
anything is possible, just try to do it.
if you find some mistakes, in my bad bavarian english,they are yours.
Re: YAMTCQ (Yet another manual tool change question)
« Reply #2 on: January 08, 2024, 06:04:35 PM »
I want to say I tried that. When I touch off using the height puck I take the current val of 802 - the current z position to get the top of the workpiece. The formula you mention make sense as it is effectively answering "how to shift the z plane by the difference of the tool length."

I'll modify my M6End script and run through my tests to see if that works. Thanks!