DT02 Tool Touchoff Sensor - SUCCESS

All things related to the Centroid Acorn CNC Controller

Moderator: cnckeith

cncman172
Posts: 254
Joined: Thu Nov 02, 2017 4:07 pm
Acorn CNC Controller: Yes
Allin1DC CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: 985DAD429EE9-0926170118
DC3IOB: No
CNC11: No
CPU10 or CPU7: No
Location: Westerville, Ohio

Re: DT02 Tool Touchoff Sensor - SUCCESS

Post by cncman172 »

SUCCESS !!!!

For those of you who would like to modify the PLC script to build in a check for the DT02 touchoff tool here is how you do it.

BEFORE YOU START backup these files in a safe directory.

acorn_mill_plc.src
plcmsg.txt



First you need to create a new message to display in CNC12. You do this by opening the file plcmsg.txt with Notepad+ or Notepad. Now there are various kinds of messages if you read the PLC programming manual. Messages in the 9000 range are Faults, those in the 8000 range are Errors, and those in the 5000 range are Warning. For the DT02 touch off sensor we want a warning message. I added message #74, and you add 5074 to indicate it is a warning and message 74, followed by the message you want to see on the screen. Here is the line of code added to plcmsg.txt

74 5074 WARNING: PRESS_DT02_TOUCHOFF_SENSOR_TO_INITIALIZE

Now you can save that file and use Notepad+ to open acorn_mill_plc.src which is located in the C:\cncm directory. We are going to make several changes in the PLC file.

First we need to create a constant definition for the message, the next available one was message 74 so I added the following line in the Constant Definition section.

;------------------------------------------------------------------------------
; CONSTANT DEFINITIONS
;------------------------------------------------------------------------------

DT02_TOUCHOFF_WARNING IS 18946;(2+256*74)

Now we need to create a Stage in the PLC program. Stages are sections of the PLC program and they get executed from the top of the program to the bottom of the program. I need to add a new stage call DT2WakeUpStage, so first we have to add that name to the Stage Definition section. The next available one was STG11 so you can see I added that line.

;------------------------------------------------------------------------------
; Stage Definitions
;------------------------------------------------------------------------------
WatchDogStage IS STG1
InitialStage IS STG2
JogPanelStage IS STG3
MainStage IS STG4
AxesEnableStage IS STG5
StandardSpindleStage IS STG6
G540SpindleStage IS STG7
SpindleBrakeStage IS STG8
MPGStage IS STG9
ShuttleStage IS STG10
DT2WakeUpStage IS STG11


Now before we actually create the stage we need to modify the InitialStage and have it SET the new DT2WakeUpStage, it comes right after PLCBus, make sure you have the common at the end of that line.

;==============================================================================
InitialStage
;==============================================================================
IF SV_MACHINE_PARAMETER_822 > 0 THEN SET HomeAllStage
IF 1==1 THEN SET True,
SET OnAtPowerUp_M,
SET AxesEnableStage,
SET MainStage,
SET JogPanelStage,
SET LoadParametersStage,
SET MPGStage,
SET PLCBus_Oe_M,
SET DT2WakeUpStage,
RST DriveComFltIn_M,
RST DriveComFltOut_M,
RST PLCFault_M,
CycloneStatus_T = 300,


Now we have to create the new stage call DT2WakeUpStage and add this to the PLC program. I added this new stage right after the AxisEnableStage, but that is not critical.

;=============================================================================
DT2WakeUpStage
;=============================================================================

;When the DT02 Touchoff probe is first turned on it needs to have the sensor pressed to walk before use

IF Tooltouchofftriggered THEN InfoMsg_W = DT02_TOUCHOFF_WARNING

; this should print a warning on the screen to tell the user to press the DT02


Now you need to save the acorn_mill_plc.src file. The next step is to compile the new PLC program.

First you want to go to window globe in the bottom left hand corner of the screen and click it and a white box will open. Just type in cmd this will open a DOS prompt in a new window. You now need to get to the C:/cncm directory. Use CD .. a couple times to get back to C: Then cd cncm
Now if you type dir you will see all the files.

you compile the new PLC program using the mpucomp.exe program which is the compiler.

type the following: mpucomp acorn_mill_plc.src mpu.plc

This will start the compiler and if you did not make any typing errors the program will compile successfully.

Now when you start CNC12 it will notify you that the PLC program has changed and you need to power down the Acorn board. Go ahead and power it down and exit CNC12. After you power it back up and see the heartbeat light blinking go ahead and start CNC12. Probably most of you power the DT02 base unit with the Acorn 24V supply, so when you turn on acorn the base unit is powered. The RF touchoff sensor has not yet initialized the base unit. Now when you turn on CNC12 without touching the DT02 you will get the message on the CNC12 screen. Press the touchoff sensor with your finger and you will not see the message anymore until you power the Acorn up the next time.

This was a real learning experience for me but hopefully others will find this useful.


Russ


cbb1962
Posts: 349
Joined: Wed Jan 03, 2018 10:04 pm
Acorn CNC Controller: Yes
Allin1DC CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: 38D2695C8301-0122180576
DC3IOB: No
CNC11: No
CPU10 or CPU7: No
Location: NW Arkansas

Re: DT02 Tool Touchoff Sensor - SUCCESS

Post by cbb1962 »

Great job Russ!

I hope that this is something that they add to the wizard as a checkbox to auto-magically make these changes.

Clint
Clint in NW Arkansas

The more I learn, the more I realize I don't know...


cncman172
Posts: 254
Joined: Thu Nov 02, 2017 4:07 pm
Acorn CNC Controller: Yes
Allin1DC CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: 985DAD429EE9-0926170118
DC3IOB: No
CNC11: No
CPU10 or CPU7: No
Location: Westerville, Ohio

Re: DT02 Tool Touchoff Sensor - SUCCESS

Post by cncman172 »

Clint,
Actually not that difficult, give it a try. Read some of the pic programmin guide.

Russ


cbb1962
Posts: 349
Joined: Wed Jan 03, 2018 10:04 pm
Acorn CNC Controller: Yes
Allin1DC CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: 38D2695C8301-0122180576
DC3IOB: No
CNC11: No
CPU10 or CPU7: No
Location: NW Arkansas

Re: DT02 Tool Touchoff Sensor - SUCCESS

Post by cbb1962 »

Russ,

Your instructions are clear. I will be making your changes and the changes to activate the Aux keys in the coming days.

I would like it to be in the wizard so that your changes don't have to be manually added when versions change. I'm pretty sure that when V4.14 comes you will have to do this again.

Thanks again for your work.

Clint
Clint in NW Arkansas

The more I learn, the more I realize I don't know...


cncman172
Posts: 254
Joined: Thu Nov 02, 2017 4:07 pm
Acorn CNC Controller: Yes
Allin1DC CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: 985DAD429EE9-0926170118
DC3IOB: No
CNC11: No
CPU10 or CPU7: No
Location: Westerville, Ohio

Re: DT02 Tool Touchoff Sensor - SUCCESS

Post by cncman172 »

You are correct but it will be a cut and paste operation. The wizard modifies the source file depending on your selections. The Centroid team will not support all these third party pieces of equipment but they have added the capability in the pic scripts to add new things.

Russ


Dan M
Posts: 506
Joined: Tue Aug 28, 2018 3:47 pm
Acorn CNC Controller: Yes
Allin1DC CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: C8df84dfbdd5-0809181120
DC3IOB: No
CNC12: Yes
CNC11: Yes
CPU10 or CPU7: No
Contact:

Re: DT02 Tool Touchoff Sensor - SUCCESS

Post by Dan M »

Thank you for the instructions, I'm going to add it since I still forget sometimes to tap the toolsetter. You guys are very smart on this forum. I'm glad I bought the controller with the helpful smart user base. It's pretty amazing how much customization can be done as well as how willing other users are to help out.

Thankgoodness for all you guys on here that know a lot about coding and like to share your knowledge. I'm still lost with writing anything, thankfully I can follow directions and cut and paste lol.

Thanks again Russ and all the other guys who take the time to help us out.


cbb1962
Posts: 349
Joined: Wed Jan 03, 2018 10:04 pm
Acorn CNC Controller: Yes
Allin1DC CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: 38D2695C8301-0122180576
DC3IOB: No
CNC11: No
CPU10 or CPU7: No
Location: NW Arkansas

Re: DT02 Tool Touchoff Sensor - SUCCESS

Post by cbb1962 »

Russ,

I was watching this video: https://www.youtube.com/watch?v=KruaNaeEA50 to allow the use of Aux9 and Aux10 in V4.12.
CNCKeith edits C:\cncm\WizardResources\Template\acorn_universal_template.src and re-runs the wizard to compile the PLC program.

Shouldn't the changes you made occur in the acorn_universal_template.src? Then, if you have to run the wizard to make a change, your fix will stay fixed.
Clint in NW Arkansas

The more I learn, the more I realize I don't know...


cncman172
Posts: 254
Joined: Thu Nov 02, 2017 4:07 pm
Acorn CNC Controller: Yes
Allin1DC CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: 985DAD429EE9-0926170118
DC3IOB: No
CNC11: No
CPU10 or CPU7: No
Location: Westerville, Ohio

Re: DT02 Tool Touchoff Sensor - SUCCESS

Post by cncman172 »

cbb1962

You are absolutely correct, if you just run the wizard and tell it to write to the controller it will run the compiler for you. If you compile it the old fashion way it will also say fixed. You are changing the PLC source code so each time the wizard is run it compiles the source if you tell it to write to the controller. That is also easier than getting into a dos window and typing in the compiler command. LOL

However, when you are first developing code it works better to do this manually so you see all the errors generated when the compiler runs. This this code works that should not be an issue. If you want to change the message printed on screen slightly, which I plan on making it a little shorter, you only change the message in the plcmsg.txt

74 5074 WARNING: PRESS_DT02_TOUCHOFF_SENSOR_TO_INITIALIZE

something like this

74 5074 WARNING: PRESS_DT02_TOUCHOFF_SENSOR_TO_WAKE


Russ


cbb1962
Posts: 349
Joined: Wed Jan 03, 2018 10:04 pm
Acorn CNC Controller: Yes
Allin1DC CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: 38D2695C8301-0122180576
DC3IOB: No
CNC11: No
CPU10 or CPU7: No
Location: NW Arkansas

Re: DT02 Tool Touchoff Sensor - SUCCESS

Post by cbb1962 »

Russ,
Mine fails to compile. I've double checked everything twice. It appears that it doesn't know what to do with "Tooltouchofftriggered" it isn't defined anywhere that I found.

Clint
Clint in NW Arkansas

The more I learn, the more I realize I don't know...


cncman172
Posts: 254
Joined: Thu Nov 02, 2017 4:07 pm
Acorn CNC Controller: Yes
Allin1DC CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: 985DAD429EE9-0926170118
DC3IOB: No
CNC11: No
CPU10 or CPU7: No
Location: Westerville, Ohio

Re: DT02 Tool Touchoff Sensor - SUCCESS

Post by cncman172 »

cbb1962,
How did you compile the code? Did you use the Wizard or do this manually. If you do it manually it will show you the error. I can even post my two files and then you will need to go into the wizard and adjust you inputs, outputs, etc.

;------------------------------------------------------------------------------
; INPUT DEFINITIONS
; Closed = 1 (green) Open = 0 (red)
;------------------------------------------------------------------------------
FirstAxisHomeOk IS INP1 ;&*;
SecondAxisHomeOk IS INP2 ;&*;
ThirdAxisHomeOk IS INP3 ;&*;
ToolTouchOffTriggered IS INP4 ;&*;

If you did not use your wizard to assign the ToolTouchoffTrigger to an input port that is probably your problem. When assigned you can look in the acorn_mill_plc.src and find the section for inputs listed above.

Russ


Post Reply