Page 3 of 8

Re: PLC Program For Emco PC Turn 55 (using original turret board and motor)

Posted: Thu Apr 12, 2018 2:31 pm
by DICKEYBIRD
Threedj16 wrote: Thu Apr 12, 2018 11:47 am This one's first op will be with the turret, and I'm not stopping till I git R dun! LOL.
Admirable! I guess I've lost so many little battles with this stuff over the years I tend to mumble parts of the Serenity Prayer & move on to git'n 'er dun the easy way! ;)

Re: PLC Program For Emco PC Turn 55 (using original turret board and motor)

Posted: Thu Apr 12, 2018 3:34 pm
by Threedj16
DICKEYBIRD wrote: Thu Apr 12, 2018 2:31 pm
Threedj16 wrote: Thu Apr 12, 2018 11:47 am This one's first op will be with the turret, and I'm not stopping till I git R dun! LOL.
Admirable! I guess I've lost so many little battles with this stuff over the years I tend to mumble parts of the Serenity Prayer & move on to git'n 'er dun the easy way! ;)
I've still got a little stubborn ole goat left in me. If it's possible to do, I'm not one to give up on something I want.

Finally found the PLC manual today. Saw reference to one in the lathe manual, but couldn't find it. This is the stuff that makes it hard. I've seen others state the same thing. To folks that know all the menu clicks to find items, I'm sure it's easy. But tech bulletins in one place, lathe operator manual in another, searching forum for turret information and my last find I've been looking for, an actual PLC manual. Now I at least feel like I've got the right ammo to get on target.

We'll see I guess.

Re: PLC Program For Emco PC Turn 55 (using original turret board and motor)

Posted: Fri Apr 20, 2018 12:57 pm
by Threedj16
Updated my original post with the current output that it is tied to and also the fact that when the turret reverses onto the pawl, it actually transitions the current tool switch, back off. So going forward, it will trigger the current tool switch once at the current tool position and then again for each tool position it passes.

Re: PLC Program For Emco PC Turn 55 (using original turret board and motor)

Posted: Sun Apr 22, 2018 4:10 am
by Threedj16
Wow, many, many hours of looking at source code, think I've about gone blind. But after finally getting the Aux10 to toggle work light on/off, decided to move on to homing the turret. That is now working. Once I call for a homing sequence, it sets the X, then x zero pulse marker (hall effect sensor on the ball screw pulley), sets the turret and then sets the Z and Z zero pulse marker. I need to add move Z out far enough from the spindle before the homing, just thought it of, so I'll add it later. So then started working on Aux11 moving one tool position. Moving isn't an issue, but getting it past the current tool position switch transition and on to the actual next tool is giving me fits. Oh well, stayed up way to late playing with this as it is. Maybe something will hit me tomorrow(er..today) on how to accomplish that, even if it's just a simple timer or something.

Lastly, can anyone tell me how you manually toggle outputs or inputs on the LED display screen? Also how you can invert them on that screen? Can't seem to find that in the operator manual.

Re: PLC Program For Emco PC Turn 55 (using original turret board and motor)

Posted: Sun Apr 22, 2018 6:21 pm
by Threedj16
Well, at one point I have homing working fine and using Aux11 to advance 1 tool forward (but it only worked once). Continuing to tweak the code without saving the one working was a product of me going mad from looking at it so many hours. Strange, the homing was working fine, then all of a sudden, it started triggering too soon and didn't let the turret get far enough ahead to lock on the correct pawl. So it backed up on the previous tool pawl. Ended up adding a timer to try and solve that, and just can't get it worked out.

I also used a timer to get around the tool forward having to trigger the current position before moving the next position. But now I've managed to get it out of wack. I think it's a lot of do with not separating them in a good way. I need to figure out how to stop one from affecting the other. But hey, got really close to Aux 11 tool advance, tool call to ATC almost there and the homing of the turret position. Just completely brain dead now from all those hours spend on it.

I will say the PLC detective is absolutely invaluable doing this. Saving a list of variables makes using it great too. Only thing I wish it had was a search type feature when adding variable to watch. Takes a few to set it all up initially, which is why saving that list is a must.



Thanks

Re: PLC Program For Emco PC Turn 55 (using original turret board and motor)

Posted: Wed Apr 25, 2018 8:45 pm
by Threedj16
Sweet. It's back homing properly now and the tool is advancing 1 tool per press of Aux 11. Had trouble getting it to advance off tool 1, solved it, but it is still missing that count. So after tool 2, it counts normally and still resets on tool 1. Just too sleepy to figure out that last little bit. But I'm pretty happy that I've managed to get this much working. Also, it still is not holding the value stored during the program shutdown to remember when started back up. Thought I had that covered in a system variable, but not quite. Anyway, stepping a little closer to success, even though my code is definitely not very efficient. Get it working first was my thoughts, streamline and error handling later.

Re: PLC Program For Emco PC Turn 55 (using original turret board and motor)

Posted: Thu Apr 26, 2018 6:39 am
by martyscncgarage
Threedj16 wrote: Wed Apr 25, 2018 8:45 pm Sweet. It's back homing properly now and the tool is advancing 1 tool per press of Aux 11. Had trouble getting it to advance off tool 1, solved it, but it is still missing that count. So after tool 2, it counts normally and still resets on tool 1. Just too sleepy to figure out that last little bit. But I'm pretty happy that I've managed to get this much working. Also, it still is not holding the value stored during the program shutdown to remember when started back up. Thought I had that covered in a system variable, but not quite. Anyway, stepping a little closer to success, even though my code is definitely not very efficient. Get it working first was my thoughts, streamline and error handling later.

Anyway, report file if anyone is interested.

report_C8FD19F23AFF-0213180659_2018-04-25_20-29-19.zip
I wish you luck and you conquer that PLC. Getting that turret working is icing on the cake.
Marty

Re: PLC Program For Emco PC Turn 55 (using original turret board and motor)

Posted: Thu Apr 26, 2018 2:29 pm
by Threedj16
martyscncgarage wrote: Thu Apr 26, 2018 6:39 am
Threedj16 wrote: Wed Apr 25, 2018 8:45 pm Sweet. It's back homing properly now and the tool is advancing 1 tool per press of Aux 11. Had trouble getting it to advance off tool 1, solved it, but it is still missing that count. So after tool 2, it counts normally and still resets on tool 1. Just too sleepy to figure out that last little bit. But I'm pretty happy that I've managed to get this much working. Also, it still is not holding the value stored during the program shutdown to remember when started back up. Thought I had that covered in a system variable, but not quite. Anyway, stepping a little closer to success, even though my code is definitely not very efficient. Get it working first was my thoughts, streamline and error handling later.

Anyway, report file if anyone is interested.

report_C8FD19F23AFF-0213180659_2018-04-25_20-29-19.zip
I wish you luck and you conquer that PLC. Getting that turret working is icing on the cake.
Marty
I like my icing....LOL. Devils in the details.....

Re: PLC Program For Emco PC Turn 55 (using original turret board and motor)

Posted: Tue May 01, 2018 8:03 pm
by Threedj16
Ok, finally got the homing working along with Aux11 jogging one tool forward and the count is all correct (tool 1 reset proper, each tool aux11 push increments by 1, rollover back to 1 after 6...all good). Now I am trying to work on the M6 call for a tool change. Using a midi or the ATC call, the code executes, but the following issues have me stuck. Not sure why the counter works just fine for the Aux11 change, but not for the ATC call. I have to use the timer in order for the tool to come off the pawl, pass the current tool position (which trips the input), then the timer runs out and it will count the next input trip which will be the next tool. That works, but when I do the same thing for the ATC call, it just increments many times per switch pulse. Tried using a oneshot, didn't work. I'm still a little confused on the protocol for oneshot variables, set, reset. But still it seems to me that the line should only count once.

These are my three issues:
1) This never occurs - IF 1==1 THEN CurrentTurretPosition_W = SV_PLC_CAROUSEL_POSITION
2) This occurred once or twice - IF 1==1 THEN RequestedTurretPosition_W = SV_TOOL_NUMBER
3) This counts really fast the entire time it's true. I tried a oneshot, same deal - If ToolTurretPosBit1 && T21 Then CurrentTurretPosition_W = CurrentTurretPosition_W + 1

Yeah, I'm in for a tech support call (I hope) this Friday. And I'll use the software they come up with. This is more about understanding it for myself. I've managed to get several things working based on reading and looking at other code posted here.



;------------------------------------------------------------------------------
; AtcIncrementalStage
;------------------------------------------------------------------------------
;
;_________________________________________________________________________________________
;Information for this stage from appropriate sections above:
;ToolTurretSyncBit IS INP5 ;&*;
;ToolTurretPosBit1 IS INP6 ;&*;
;RotateToolTurret IS OUT2 ;&*;
;M6 IS SV_M94_M95_4 ; (Turret Tool Requested)
;M18 IS SV_M94_M95_18; Home turret
;M19 IS SV_M94_M95_19; Next Turret Position
;CurrentTurretPosition_W IS W22
;RequestedTurretPosition_W IS W23
;ToolCounterPD Is PD39
;TurretHomePD IS PD40
;TurretSettleTimer IS T21
;ToolTurretOffCurrentToolTimer IS T23
;ToolTurretOffPastSyncBitTimer IS T24
; TurretSettleTimer = 2500,
; ToolTurretOffCurrentToolTimer = 2500,
; ToolTurretOffPastSyncBitTimer = 750,
;________________________________________________________________________________________
;
;
;
;Set CurrentTurretPosition_W to current tool number via SV_ATC_CAROUSEL_POSITION
;IF 1==1 THEN CurrentTurretPosition_W = SV_PLC_CAROUSEL_POSITION
;
;
;Homes turret to position 1 via the CNCT.hom file, then sets the CurrentTurretPosition_W to 1
IF M18 && CurrentTurretPosition_W != 1 THEN SET RotateToolTurret
If ToolTurretSyncBit && CurrentTurretPosition_W != 1 Then Set T24
If T24 Then RST RotateToolTurret, RST T24, CurrentTurretPosition_W = 1, RST M18
;
;
;Move Turret Forward One Tool With Aux11
IF DoAux11Key THEN SET T23, SET RotateToolTurret
If ToolTurretPosBit1 && T23 Then RST RotateToolTurret, CurrentTurretPosition_W = CurrentTurretPosition_W + 1, RST T23
;
;
;Rollover CurrentTurretPosition_W base on number of tools set in Parameter 161
IF CurrentTurretPosition_W > SV_MACHINE_PARAMETER_161 THEN CurrentTurretPosition_W = 1 ;Rollover after 6 counts back to 1
;
;
;Send tool number down to PLC
IF 1==1 THEN RequestedTurretPosition_W = SV_TOOL_NUMBER
;
;
;Perform Tool Change is the current tool is not the requested tool
IF M6 && RequestedTurretPosition_W != CurrentTurretPosition_W Then SET T21, SET RotateToolTurret
If ToolTurretPosBit1 && T21 Then CurrentTurretPosition_W = CurrentTurretPosition_W + 1
IF M6 && (RequestedTurretPosition_W == CurrentTurretPosition_W) THEN RST RotateToolTurret, SET ToolChangeComplete_M, RST T23, RST M6
;
;
;Note control stores the last known location of tool turret on shutdown so you can use SV_ATC_CAROUSEL_POSITION to initialize the turret
;position on power up. No need for home switch if the turret doesn't move while powered off
IF 1==1 THEN SV_PLC_CAROUSEL_POSITION = CurrentTurretPosition_W

Re: PLC Program For Emco PC Turn 55 (using original turret board and motor)

Posted: Thu May 03, 2018 2:55 am
by Threedj16
Finally, M6 working and counting properly. Only issue now is I can only fire if off one time. Still no joy on the SV_PLC_CAROUSEL_POSITION storing the position after a shutdown.



;------------------------------------------------------------------------------
; AtcIncrementalStage
;------------------------------------------------------------------------------
;
;_________________________________________________________________________________________
;Information for this stage from appropriate sections above:
;ToolTurretSyncBit IS INP5 ;&*;
;ToolTurretPosBit1 IS INP6 ;&*;
;RotateToolTurret IS OUT2 ;&*;
;M6 IS SV_M94_M95_4 ; (Turret Tool Requested)
;M18 IS SV_M94_M95_18; Home turret
;M19 IS SV_M94_M95_19; Next Turret Position
;CurrentTurretPosition_W IS W22
;RequestedTurretPosition_W IS W23
;ToolChangeComplete_M IS MEM9
;ToolCounterPD Is PD39
;TurretHomePD IS PD40
;TurretSettleTimer IS T21
;ToolTurretOffCurrentToolTimer IS T23
;ToolTurretOffPastSyncBitTimer IS T24
; TurretSettleTimer = 2500,
;ToolTurretOffCurrentToolTimer = 2500,
;ToolTurretOffPastSyncBitTimer = 750,
;________________________________________________________________________________________
;
;
;
;Set CurrentTurretPosition_W to current tool number via SV_ATC_CAROUSEL_POSITION
;
IF 1==1 THEN CurrentTurretPosition_W = SV_PLC_CAROUSEL_POSITION
;
;
;Homes turret to position 1 via the CNCT.hom file, then sets the CurrentTurretPosition_W to 1
;
IF M18 && CurrentTurretPosition_W != 1 && !(ToolTurretPosBit1) THEN SET RotateToolTurret
If ToolTurretSyncBit && CurrentTurretPosition_W != 1 Then Set T24
If T24 Then RST RotateToolTurret, RST T24, CurrentTurretPosition_W = 1
;
;
;Move Turret Forward One Tool With Aux11
;
IF DoAux11Key THEN SET T23, SET RotateToolTurret
If ToolTurretPosBit1 && T23 Then RST RotateToolTurret, CurrentTurretPosition_W = CurrentTurretPosition_W + 1, RST T23
;
;
;Rollover CurrentTurretPosition_W base on number of tools set in Parameter 161
;
IF CurrentTurretPosition_W > SV_MACHINE_PARAMETER_161 THEN CurrentTurretPosition_W = 1 ;Rollover after 6 counts back to 1
;
;
;Send tool number down to PLC
;
IF 1==1 THEN RequestedTurretPosition_W = SV_TOOL_NUMBER
;
;
;Perform Tool Change is the current tool is not the requested tool
;
IF M6 && RequestedTurretPosition_W != CurrentTurretPosition_W Then SET T21, SET RotateToolTurret
If ToolTurretPosBit1 && T21 Then (ToolCounterPD)
If ToolCounterPD && RotateToolTurret Then CurrentTurretPosition_W = CurrentTurretPosition_W + 1
IF T21 && (RequestedTurretPosition_W == CurrentTurretPosition_W) THEN RST RotateToolTurret, SET ToolChangeComplete_M, RST T21
;
;
;Note control stores the last known location of tool turret on shutdown so you can use SV_ATC_CAROUSEL_POSITION to initialize the turret
;position on power up. No need for home switch if the turret doesn't move while powered off
;
IF 1==1 THEN SV_PLC_CAROUSEL_POSITION = CurrentTurretPosition_W