Alternating output

Dustin, I will print a PDF file and post it for you. Be right back.

Here it is. Page 35 is the start of the subject Rungs 199 - 123 and Output O:8/5 Table Turn CCW.

I think Rung 122 is the problem. I:1/13 is already ON so unlatches O:8/5 before the motor can run CCW. I think the CW fix will have to be done on RUng 127 before the CCW fix can be made to work.

I don't think a counter or any other type of alternator is needed here. The logic only needs to be restored to the original and maybe cleaned up a little.

I recieved this machine in our plant and it was missing some parts and some code.
How did you manage to get only part of the code? Usually it is all or none. Was there any old hard-copy print-outs in the bottom of the cabinet?
 
Last edited:
daba,
You are of course correct. This can be easily solved by adding an XIO of the first scan bit in series with the XIO of B3:0/2 in the above code. This will keep the one-shot from being triggered on first scan and turning on the output. After the first scan, the hold status bit would be on, so no power-up One-Shot Rising. It would require a false-true transition.

That being said, I still prefer the counter method.


Cheers,
Dustin

Dustin, you dug a hole, then cleverly got out of it, :ROFLMAO:. Not many would comprehend the why's and wherefore's....

Which of course is why I also prefer the counter accumulator bit 0 method for toggles. There is no need for any user-created logic to ensure the correct state is maintained.
 
Dustin, I will print a PDF file and post it for you. Be right back.

Here it is. Page 35 is the start of the subject Rungs 199 - 123 and Output O:8/5 Table Turn CCW.

I think Rung 122 is the problem. I:1/13 is already ON so unlatches O:8/5 before the motor can run CCW. I think the CW fix will have to be done on RUng 127 before the CCW fix can be made to work.

I don't think a counter or any other type of alternator is needed here. The logic only needs to be restored to the original and maybe cleaned up a little.

How did you manage to get only part of the code? Usually it is all or none. Was there any old hard-copy print-outs in the bottom of the cabinet?

Thanks Lancie.

I agree, what is wrong with the CW output O:08/04? It seems the "Dead Rung" tag is a homemade AFI, am I right? Are you trying to toggle between CW and CCW run when a certain condition is met? I can't see from the code what the trigger for the output (or for the toggle you are attempting) is supposed to be. You mentioned something about an "auto-mode" but I'm not seeing that. Only the XIO of I:9/0 for the manual mode.

If you are wanting to toggle between CCW and CW in auto mode, then you can use a counter, but ditch the OTL and OTU of the output itself. Figure out what your trigger bit is, then every time that bit/input goes high, increment the counter (if in auto-mode). Then in the rung for O:8/4 add an XIC C5:2.ACC/0 and an XIO C5:2.ACC/0 in the rung for O:8/5.
Then what-ever input switch, prox etc is supposed to turn off the motor should also turn-off the trigger condition. Then the next time the trigger goes high, it will increment the counter, which will change the state of C5:2.ACC/0 and the motor will turn the other way.

Another side-note: If O:8/4 and O:8/5 are indeed the opposing coils on a reversing contactor, then you should program in some interlocks, i.e. XIO O:8/4 in series with OTE O:8/5 and vice versa. There should of course also be hard-wired and mechanical interlocks between the two as well.
 
Dustin, you dug a hole, then cleverly got out of it, :ROFLMAO:.

Thanks, daba. Some folks I know would say I've made a career of it :D
I will say that a large chunk of what I know I learned by being too curious and stubborn not to dig that hole, and then having to claw my way back out.
 
Explanation of operation

Ok here is the sequence:
R112 pipe comes out of tester and goes onto a lift table that rotates. I:1/15 and B3:2/0
R113 Table up O:0/8 comes on.
R114 not sure why it is there except to advance the code?
R115 is table at the top I:1/11 and B3:2/2
R116 is a timer for CW limit I:1/13. “Not sure why this is here?” Also note that CCW Limit is not used and needs to be removed.
R117 another extra line of code to advance the process?
R118 is table turn to the counter. The pipe that comes out of the tester needs to flipped every other pipe. So one time O:0/8 goes up and down the next time it goes up it needs to make a 180deg turn. There is one sensor I:1/13 on the table. There is a flag at each end of the table. So if it rotates 180 the sensor will come back on. The sensor I:1/13 is always on until it turns and when it comes back on after turning it needs to stop the motor and the table goes back down.
R118 I added the CTU C5:1 but the accum kept getting higher.
R119 I added this EQU to turn on the motor O:8/5
R120 was an old line that I had to latch a bit. I forgot to take it out.
R121and 121 was my attempt to get the motor to make on turn and stop when it saw I:1/13 again.
R122 was to stop the motor
R123 was to reset the motor turn counter.
Thanks again for all the help
 
Your logic is dying to be completely rewritten using a state engine charted on paper first, with all the transitions clearly defined, mutually exclusive state decision logic, and output instructions driven by the device states in which the need to be eniergized. This makes it easy to re-use sensors and combinations of sensors to advance a sequence. You may frequently program timer to limit the minimum or maximum duration of a step. It is a quick and easy way to generate reliable sequences, a basic example can be had here:

http://www.plctalk.net/qanda/showthread.php?t=52654&highlight=state+engine
 
Your logic is dying to be completely rewritten using a state engine charted on paper first, with all the transitions clearly defined, mutually exclusive state decision logic, and output instructions driven by the device states in which the need to be eniergized. This makes it easy to re-use sensors and combinations of sensors to advance a sequence. You may frequently program timer to limit the minimum or maximum duration of a step. It is a quick and easy way to generate reliable sequences, a basic example can be had here:

http://www.plctalk.net/qanda/showthread.php?t=52654&highlight=state+engine
 
One more thought: The motor only turns one way now and that is the CCW [direction]. All CW code will be removed.
It seems that you really do need a lot of help with the logic part of your operation.

1. If the motor is to only turn one dirction (CCW) NOW, then your logic does NOT need a method to make it alternate between CCW and CW. It only needs reliable triggers to START and STOP at the correct times. In the old program, there were CW and CCW limit switches that served those Start and Stop functions. Now you are planning to remove those. What will take the place of those reliable, efficient devices?

2. It seems that your logic is living in two worlds: the real-world situation with feedback limit switches that are the eyes, ears, and fingers of a PLC program, as opposed to your imagined theoretical world where a motor will just KNOW when to start and stop without anything except a start trigger and a timer. You need to reconcile these two worlds. I always vote heavily for using real-world inputs to make my PLC logic as smart as possible (it knows what is going on and doesn't have to ASSUME anything or guess at when certain events happen. Eliminating limit switches is never a smart idea. You need to add more input switches, sensors, and photoswitches, not less.

3. Your logic is trying to use latched relays to control a motor. This is inefficient, and unnecessary. If your motor has an overload device, it cannot be latched hard-on anyway. Some provision has to be made to allow the motor contactor to drop out on a current overload. If you have to do that, then you might as well use the old traditional reliable method for motor starting. I realize that method is no longer taught in many PLC courses (because the instructors never worked as electricians with motor starters) but it still is the best method and does not require latching on a motor (with no reliable way to always get it unltached).
R117 another extra line of code to advance the process?
4. No, I doubt if these internal output relays were put in on a whim. These unknown bits were probably Step or Mode Relays. They monitored the progress of the operation and could be used to trigger the next step. Try this: Start with the first unknown internal bit and label it "Step 1", then go to the next and label it Step 2. Often this results in seeing what the relay is actually doing, and then you can label it "Step X: Move the doo-dad to Position X".
R116 is a timer for CW limit I:1/13. “Not sure why this is here?” Also note that CCW Limit is not used and needs to be removed.
If you remove I:1/13, then just WHAT will be the signal or trigger to turn your Motor in the CCW direction? You must have SOMETHING - you cannot use magic, intuition, or whims. You need some real-world feedback from the process. Using a timer to control a motor usually does not work too well, unless the motor is geared down and the object is moving very slowly.
 
Last edited:
R118 is table turn to the counter. The pipe that comes out of the tester needs to flipped every other pipe. So one time O:0/8 goes up and down the next time it goes up it needs to make a 180deg turn. There is one sensor I:1/13 on the table. There is a flag at each end of the table. So if it rotates 180 the sensor will come back on. The sensor I:1/13 is always on until it turns and when it comes back on after turning it needs to stop the motor and the table goes back down.
Which one of the "B3" bits is the signal that the pipe is out of the tester and "ready" (for what?), either to be rotated or not? This is the bit that should be used to trigger a bit in your logic that alternates between ON and OFF every other time.
 
Yes i agree the program needs alot of work because when it was in the other facility they used a CW/CCW setup. We do not need that anymore. The line is schedule to startup on Friday and this rotation issue is the only thing keeping it from working.
What if i put in a another sensor on the other side so it flips between sensors? Or what if i just put a timer on the motor and make it spin for the acquired time?
 
Here is a modification for Rungs 118 to 121 to rotate the Turntable Counter-Clockwise every other time that Rung 118 goes TRUE. Note that the timer T4:19 is used to only START the CCW rotation, but the I:1/13 Limit Switch is used to STOP the CCW rotation. That should be all you need to rotate the table every other time.

You now need to figure out all the rungs where the new bit B3/40 on Rung 121 needs to be used (to signal that the CCW Rotation (if needed) is finished). I see that there are still a bunch of "CW" rotation rungs that will need modifying or deleting or making inoperable.
 
Last edited:
I now see that Timer T4:19 was already used on Rung 004. I changed the Table-Turning Start Timer on Rung 119 to the unused T4:53.
 
Last edited:
Wow thanks for helping me get this thing straight. My laptop that i use for my RS Logix just blew up. So now i can't even work on the machine. ARGHHHHH!!!!!! If it ain't one thing it's another!!!!
I will let you know the outcome once i get my laptop repaired ;(
 

Similar Topics

Hi All, I am a rookie at ladder programming a Micrologix 1200, and would like to know how to alternate an output from energizing every time from a...
Replies
31
Views
12,485
Today I was making an online edit to a 5/40 Series E Rev K.2 with about 14% free memory. I was removing one branch in a large rung. Accept...
Replies
4
Views
3,180
I have 2 pumps not alternating at a lift station. When im at the panel and use the test switches to initiate the pumps,it alternates in the PLC...
Replies
22
Views
5,855
Hello I have been thinking in some way to operate 3 pumps in the same way (I have schneider modicon m340 PLC): -the pumps feed a tank. - As...
Replies
3
Views
1,897
Hi Everyone, trying to get an alternating output to work. Read through the forums on flip flop, toggle, etc. Found this site...
Replies
5
Views
4,245
Back
Top Bottom