UCCNC manual tool change
Hi,
I'm trying to figure out how manual tool change works with UCCNC (version 8 with SC2/600). I have configured the M6 to stop and wait for cycle start. I'm using Estlcam for the CAM process and got M6 in the g-code. When it hits M6 it stops properly and waits for cycle start, i.e. so far all as expected.
Now I wonder how to do the tool change, where I need to move Z up, and how to adjust the different tool length. I got the tool length sensor working to generally measure the zero point. I was thinking about storing the current Z pos and then do some reference measuring with the current tool to somehow calculate with a measure on the new tool the difference. But I don't see how to keep the current Z-position nor how I get to the difference. But maybe it's a completely wrong approach or I just miss the point.
I also started writing a macro which actually would be ok but it seems I can't just stop in the middle of the macro to manually move the tool anywhere (because any message box dialog disable control of the main window) to measure the current tool length, then halt and change the tool, then measure this one, calculate the z offset and move back to the stored x,y location with a new Z position. I already wrote a macro to measure and set z-zero with M31 that works fine. But that would probably only work when the tool sensor is in a well know fixed location. I expect no problems with the program itself but I don't understand the coordinate system fully yet. I use GetX/Y/Z/machpos methods to remember the current location. Then I stop the spindle and show a message box to change the tool. Before I'd have to move z up to get some space for chaning the tool. But here I don't see how do I move up e.g. to the maximum valid Z as I seem to get only coordinates relative to the zero position of the work piece but as I don't know how high it is I have not idea how far to move up. Isn't it possible to get the absolute coordinates relative to the machine's zero point? Or am I missing already any existing macro for this?
Thanks for any help.
Best,
Chris
In the macros there is two forms of asking the coordinates, one gives you the current position relative to zeroed location, other gives you the current coordinates in the machine space:
See the UCCNCDocumentationMacro_capability_detailed.htm file:
Function: double Get[XYZABC]machpos(void) Description: The function returns the actual machine position of an axis, this is the abosulte position excluding any offsets. Example: double Xmachposvariable = exec.GetXmachpos(); Notes: [XYZABC] means a character of X, Y, Z, A, B or C Function: double Get[XYZABC]pos(void) Description: The function returns the actual position of an axis including the selected offset and the tool offset. Example: double Xposvariable = exec.GetXpos(); Notes: [XYZABC] means a character of X, Y, Z, A, B or C
Also in the Gcode there is several ways to move the head, i.e. if you add G53 to move command then it moves to absolute machine coordinates instead of zeroed coordinates.
This is explained in the page 43 on the UCCNC_usersmanual.pdf found in the same directory. If you use following command
exec.Code("G00 G53 Z"+ parkZ);
where the parkZ is the height you want to move in absolute machine coordinates the head will move up to that location. You might want to add check that it will never move down, i.e. write the code like this:
if (exec.GetZmachpos() < parkZ) { exec.Code("G00 G53 Z"+ parkZ); // Move Z up first to park Z position while(exec.IsMoving()){} exec.Wait(200); }
In this case it will only move head if it moves up. It will not move the head at all, if your parkZ is lower than what the current head position is.
You might also want to check that softlimits of when doing those operations. To get softlimits you can use following code:
double XMin = exec.mainform.UCsetup.UCset.Axis[0].UC100axis.SoftLimitN; double XMax = exec.mainform.UCsetup.UCset.Axis[0].UC100axis.SoftLimitP; double YMin = exec.mainform.UCsetup.UCset.Axis[1].UC100axis.SoftLimitN; double YMax = exec.mainform.UCsetup.UCset.Axis[1].UC100axis.SoftLimitP;
This would allow you to move the head closer to you before starting to do work, but only if it is not too close to the edge already.
I was planning to do the tool change macros myself too, but I have not had time to do it yet, and it I remember right it was hard to get the UCCNC to both run the M6 macro and pause operations. Perhaps the M6 macro can press the cyclestop button to pause the g-code run to allow the tool to be changed, and or something.
Stepcraft 2 840 Kickstarter make anything package
HF500, 3D print, Drag Knife, etc
UCCNC + UC100, V-Carve
I think it's easier to avoid changing your tools while inside a routine.
Just save the toolpaths that use a single tool in one file and toolpaths that use another tool in other file.
Stepcraft 2 840
Kress 800 FME
UCCNC + UC100
V-Carve + QCad
I had trouble with that on wincnc as exporting different paths from the same setup as different jobs made the seconds assume different zeros.
In other previous experiences with different machines with no automatic tool changer I done it like that and it was ok.
Fusion360CAM and Winpcnc was not good.
I'm trying the same technique with Unccnc right now.
any trick to take into account?
thanks in advance.
- 44 Foren
- 7,390 Themen
- 63.3 K Beiträge
- 6 Online
- 26.5 K Mitglieder