Page 1 of 2

WCS zero X and Y macro

Posted: Thu Dec 31, 2020 4:22 pm
by routebot
I'm running CNC12 4.5

After homing my router, I would like to push a button on my wireless controller or the VCP and move it to a programed location. Then automatically zero X and Y WCS.

Probably simple but not sure how to make it happen.

Re: WCS zero X and Y macro

Posted: Thu Dec 31, 2020 5:34 pm
by Sword
Numerous ways to make it happen, fully automated with a macro assigned to one of the MPG or VCP buttons that asks you for input, or sort of partially automated by setting up your various WCS locations G54-G59 and then switch to whatever one you want with Alt-1, Alt-2, etc. and hitting the GOTO WCS XY0 button. You can look at some of those macros in an editor and create your own custom macro using them as templates.

There are also the 'Return' locations that can be used, G28, G30, G30 P3 and P4.

Re: WCS zero X and Y macro

Posted: Thu Dec 31, 2020 5:50 pm
by routebot
How do I write G code to move the router to X2.00 Y3.00 Z4.00 then automatically set that location to WCS to X0.00 Y 0.00 Z4.00?

I will assign it to a MPG button that I will push after the homing operation. This will set my WCS 0's when using a jig.

Re: WCS zero X and Y macro

Posted: Thu Dec 31, 2020 6:11 pm
by cncsnw
Assuming you mean for the first move to be relative to machine zero, and not to the previously-set part zero:

Code: Select all

G53 X2 Y3 Z4
G92 X0 Y0 Z4

Re: WCS zero X and Y macro

Posted: Thu Dec 31, 2020 6:36 pm
by routebot
Yes, I will home the router first then run the macro. Sounds like this will work.

Thanks!

Re: WCS zero X and Y macro

Posted: Thu Dec 31, 2020 6:54 pm
by ShawnM
routebot wrote: Thu Dec 31, 2020 6:36 pm Yes, I will home the router first then run the macro. Sounds like this will work.

Thanks!
If you are always going to do this after you home the machine you can simply add the code posted by cncsnw to the home script and it'll be automatic every time the machine homes. Then if you press the "reset home" on the VCP it'll do the same thing.

Re: WCS zero X and Y macro

Posted: Thu Dec 31, 2020 8:33 pm
by cncsnw
You do know that CNC12 saves your WCS locations indefinitely, right?

If you set WCS (part) zero at X2Y3Z4 from machine home, then that is where it will be every day when you start up, until you change it.

The only reason to do what you are describing, is if you always want part zero to be that far from home, but you don't trust yourself or other operators not to have changed it to someplace else in the course of the day's work.

Re: WCS zero X and Y macro

Posted: Fri Jan 01, 2021 2:56 pm
by routebot
I did not know that CNC12 keeps the last zero location. Good to know!

However, what I'm doing is just for a jig that mounts to the spoil board. It's not used everyday. So having a button to locate the router zero at the jig is perfect. I will run the code you posted as I think that is exactly what I needed.

Re: WCS zero X and Y macro

Posted: Sat Jan 02, 2021 9:07 am
by Nigelo
Unless I am missing something and you have used all available WCS depending on your licensing, why not allocate one (e.g. WCS6) just for the jig. Then you are ready to go as and when required but still retaining the flexibility of the other WCS settings for other work. Advantage is no programing required

Re: WCS zero X and Y macro

Posted: Thu Jan 07, 2021 12:52 pm
by routebot
Nigelo wrote: Sat Jan 02, 2021 9:07 am Unless I am missing something and you have used all available WCS depending on your licensing, why not allocate one (e.g. WCS6) just for the jig. Then you are ready to go as and when required but still retaining the flexibility of the other WCS settings for other work. Advantage is no programing required
I need to look into this. If I can save a WCS that would be perfect. CNC12 is new to me and I have a lot to learn!!