Help coding tailstock

All things related to the Centroid Acorn CNC Controller

Moderator: cnckeith

Post Reply
Obsidian
Posts: 48
Joined: Tue Dec 03, 2019 10:40 pm
Acorn CNC Controller: Yes
Allin1DC CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: 780473A92571-0930192501
DC3IOB: No
CNC12: Yes
CNC11: No
CPU10 or CPU7: No

Help coding tailstock

Post by Obsidian »

Need help with my TailStock code. I'm using the tailstock in/out button in the vcp to set the tailstock and run a timer that shuts the output off and sets a memory bit. I'm stumped how I should set the closing code for the same button. I have it look for the memory bit set by the end of the open code but not sure how I should go about setting the IF requirements to set the close sequence. I could just use two different buttons in the vcp to do this but I'm trying to keep it to just one. I'm sure there's an easier way :roll:




Code: Select all

                                TailStockStage
;==============================================================================
IF SkinTailStock_M THEN (TailStockOpenPD)
IF (TailStockOpenPD && !SV_PROGRAM_RUNNING && !TailStockActived) || (M32 && SV_PROGRAM_RUNNING)
	THEN SET TailStockActived, SET TailStockLED, SET T28
	IF T28 > 3000 THEN RST TailStockActived, SET MEM360, RST T28

IF MEM360 THEN (TailStockClosedPD)
IF (TailStockClosedPD && !SV_PROGRAM_RUNNING && ??????) || (M32 && SV_PROGRAM_RUNNING)
	THEN SET TailStockDeactivated, SET T28
	IF T28 > 3000 THEN RST TailStockDeactivated, RST TailStockLED, RST MEM360, RST T28
Allin1Chris
Posts: 135
Joined: Wed Jul 31, 2019 12:53 pm
Acorn CNC Controller: Yes
Allin1DC CNC Controller: Yes
Oak CNC controller: Yes
CNC Control System Serial Number: none
DC3IOB: Yes
CNC12: Yes
CNC11: Yes
CPU10 or CPU7: Yes

Re: Help coding tailstock

Post by Allin1Chris »

I am unsure exactly what you are trying to accomplish? Usually there are two ways to do this, A one output system where when energized the tailstock will extend and keep pressure on the part. Turn off the output and the tailstock retracts. Another system is with 2 outputs, Set one output to extend and another output to retract the tailstock (Sometimes these types also have sensors used to turn off the output at determined locations and ect).

If i could have some more information on how your tailstock works i may be able to provide much better help with this.
When requesting support READ THIS POST first. http://centroidcncforum.com/viewtopic.php?f=60&t=1043

Please ALWAYS post a FRESH report. To make a report: https://www.youtube.com/watch?v=Ecvg0VJp1oQ.

(We pride ourselves on providing timely solid technical support but, without good information we may not be able to help and/or reply until such information is posted.)

Centroid PLC Tutorial Videos
Obsidian
Posts: 48
Joined: Tue Dec 03, 2019 10:40 pm
Acorn CNC Controller: Yes
Allin1DC CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: 780473A92571-0930192501
DC3IOB: No
CNC12: Yes
CNC11: No
CPU10 or CPU7: No

Re: Help coding tailstock

Post by Obsidian »

It has two outputs for the hydraulics. One to extend and one to retract the tailstock. What I wanted to do is use one button in the vcp to flipflop the outputs and shut them off with a timer when the button is toggled each time. Ie

vcpbutton- turn output 1 on, wait 3 seconds and turn off
vcpbutton- turn output 2 on , wait 3 seconds and turn off

The solenoid for the hydraulics holds pressure in the last position it was in so Im having the output switch off to keep the coil from staying on constantly.
Last edited by Obsidian on Wed Nov 25, 2020 1:42 pm, edited 1 time in total.
Allin1Chris
Posts: 135
Joined: Wed Jul 31, 2019 12:53 pm
Acorn CNC Controller: Yes
Allin1DC CNC Controller: Yes
Oak CNC controller: Yes
CNC Control System Serial Number: none
DC3IOB: Yes
CNC12: Yes
CNC11: Yes
CPU10 or CPU7: Yes

Re: Help coding tailstock

Post by Allin1Chris »

You can try the following code, this should give you what you want. You may want to remove M32/M33 unless you are planning on creating custom macros as well. I used Aux11LED as the "State" Memory bit, but ofcourse can be changed to an actual memorybit easily.

Code: Select all

TailStockExtend   					IS OUT1
TailStockRetract  					IS OUT2
TailStock_T						IS T33

;==============================================================================
                                TailStockStage
;==============================================================================
IF True THEN TailStock_T = 3000
IF SkinTailStock_M THEN (TailStockPD)

IF (TailStockPD && !SV_PROGRAM_RUNNING && !Aux11LED && !TailStockRetract) || (M32 && SV_PROGRAM_RUNNING)
	THEN SET TailStockExtend, SET Aux11LED, SET TailStock_T
	
IF (TailStockPD && !SV_PROGRAM_RUNNING && Aux11LED && !TailStockExtend) || (M33 && SV_PROGRAM_RUNNING)
	THEN SET TailStockRetract, RST Aux11LED, SET TailStock_T

IF TailStock_T THEN RST TailStockExtend, RST TailStockRetract, RST TailStock_T
When requesting support READ THIS POST first. http://centroidcncforum.com/viewtopic.php?f=60&t=1043

Please ALWAYS post a FRESH report. To make a report: https://www.youtube.com/watch?v=Ecvg0VJp1oQ.

(We pride ourselves on providing timely solid technical support but, without good information we may not be able to help and/or reply until such information is posted.)

Centroid PLC Tutorial Videos
Obsidian
Posts: 48
Joined: Tue Dec 03, 2019 10:40 pm
Acorn CNC Controller: Yes
Allin1DC CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: 780473A92571-0930192501
DC3IOB: No
CNC12: Yes
CNC11: No
CPU10 or CPU7: No

Re: Help coding tailstock

Post by Obsidian »

Thank you Chris!
Post Reply