Help with zeroing script

All things related to the Centroid Acorn CNC Controller

Moderator: cnckeith

Post Reply
Toaster
Posts: 199
Joined: Mon Oct 29, 2018 5:25 pm
Acorn CNC Controller: Yes
Allin1DC CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: none
DC3IOB: No
CNC11: No
CPU10 or CPU7: No

Help with zeroing script

Post by Toaster »

Hey all, I've created a reasonably simple script that will allow someone to zero to the top of the material with a zero plate. The script works just as I want to... Essentially what it does is allow you to put a touch plate on top of your material and zero there. When the zeroing is done, it sets your WCS1 Z height to the height of your material. Pretty simple.

The question I have is how do I get the script to work with the current WCS, not the first WCS? I see that in the parameters you can figure out what i the active WCS, but I'm not sure how to turn that into setting the Z height for the active WCS. Right now I have it hardcoded for WCS1.

Does anyone know a simple strategy for getting this script to work with whatever the active WCS is, not just WCS1?

I've attached the code and here's a little video of the script working: https://photos.app.goo.gl/bG5fSFNQHF472eNYA
measure to top of part with plate.cnc
(1.37 KiB) Downloaded 103 times
Centroid_Tech
Posts: 286
Joined: Thu Mar 18, 2010 2:24 pm

Re: Help with zeroing script

Post by Centroid_Tech »

That is because you are setting the Z coordinate for WCS #1. Instead of using #2701, use #2700 as that is the Z axis value for the active WCS that the CNC software is in.

I also have some minor corrections for your macro. You have #100=-#153 with a comment stating that this is the input number of the touch probe. That is incorrect as #153 is not the system variable for any of the inputs. It's just another system variable but that is stored in non-volatile RAM so that when you power the system off, that value doesn't get reset to 0. The system variable for the inputs are in the #50000 series. Luckily, it doesn't make a difference in your macro as you are never using #100 in your logic anywhere.

You are using #103 and #104 in your M225 callout but those variables are not assigned to any value at the beginning of the macro which means that they default to 0.

You don't need the M0 after the M225 as the #103 and #104 are set to 0 and when that timer is set to 0, the message will be displayed until the operator presses Cycle Start.
When requesting support, please ALWAYS post a current report. Find out how to take a report from your Acorn, CNC11 or CNC10 system here: https://www.youtube.com/watch?v=Ecvg0VJp1oQ.

If your question is PLC, Macro or program related, please also post a copy of the program or macro as well.

Without the above information we may not be able to help and/or reply until the required information is posted..
Toaster
Posts: 199
Joined: Mon Oct 29, 2018 5:25 pm
Acorn CNC Controller: Yes
Allin1DC CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: none
DC3IOB: No
CNC11: No
CPU10 or CPU7: No

Re: Help with zeroing script

Post by Toaster »

Thanks!! I'll go and give that a try and report back.
Toaster
Posts: 199
Joined: Mon Oct 29, 2018 5:25 pm
Acorn CNC Controller: Yes
Allin1DC CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: none
DC3IOB: No
CNC11: No
CPU10 or CPU7: No

Re: Help with zeroing script

Post by Toaster »

Here's the result:

https://youtu.be/nW_7iHxc0QM
Post Reply