Programming Question: One pushbutton, two contactors

GhostG90

Member
Join Date
Jun 2015
Location
Leuven
Posts
3
Hello!

First time using this site, I hope It's okay if I ask programming related questions here.

I have a problem with a project I'm making in PCWorx. I'm using the ladder method to program.

What I need to do is have a garage door move up and down, this is done with one pushbutton as input S1 , and two contactors K1(down) and K2(up) as output.

the garage door starts in rest, so it is not moving, then the user presses the pushbutton(S1) and the garage door moves down(K1), press (S1) again, and the garage door stops moving, press once more (S1) and the garage door changes direction and goes up(K2).

I've tried and tried and searched the web and asked friends for advice, and I just cannot get it working like that. I can't figure out how to program it so it could work like that, I'm not even 100% sure if it's possible. I might have to settle with another method if it's not possible.

Anyone have an idea of how I could solve this or point me in a direction where I might find an answer ? or is this simply not possible ?

Thanks!
 
Push Button -> One Shot -> Add 1 to a register.
When the counter = 1 -> Door closes (K1)
When the counter = 2 -> Door stops
When the counter = 3 -> Door opens (K2)

Add some logic to insure that the register counts 1-2-3 and then back to 1 again.

Good Luck

Yosi
 
Push Button -> One Shot -> Add 1 to a register.
When the counter = 1 -> Door closes (K1)
When the counter = 2 -> Door stops
When the counter = 3 -> Door opens (K2)

Add some logic to insure that the register counts 1-2-3 and then back to 1 again.

Good Luck

Yosi

This will work fine, but if you want the door to stop moving if the button is pressed when the door is in motion no matter which direction it is moving, then you would need to move a 2 to the register again after step 3. (or add a step 4)

Or you could do something like this attachment. (You really don't need the one shots I put in so if your controller does not have a ONS instruction then no worries)
 
Last edited:
Hello Again,

After taking a look at my last attachment again....I snapped back to reality and realized that unless you are "VERY QUICK" pushing your S1 button then the PLC scan time is going to catch you, which means my last attachment actually will not work.

I revised the logic a bit and this time it will work. (You will need 1 ONE SHOT instruction for this though.)

See attachment below.

BCS
 
Last edited:
Use two flip flops.

The push button toggles the first flip flop. When the bit is set the door moves.

The door in motion bit toggles another flip flop. This one controls the direction. When the bit=1 the door is closing. When the bit=0 the door is opening.

Note, this example uses a generic oneshot.



First one-shot: PB_OSR is true for one scan only
BUTTON SB1 PB_OSR
---] [-----]\[-----------( )

BUTTON SB1
---] [-------------------( )


Door Run flip flop: Toggles state each time button is pushed
PB_OSR RUN_DOOR RUN_DOOR
---] [-----]\[------+------( )
|
PB_OSR RUN_DOOR |
---]\[-----] [------+


Second one-shot: RUN_OSR is true for one scan only
each time the door starts
RUN_DOOR SB2 RUN_OSR
---] [-------]\[-----------( )

RUN_DOOR SB2
---] [---------------------( )

Door direction flip flop: Toggles state each time door starts
1=close door
0=open door
RUN_OSR DOOR_DIR DOOR_DIR
---] [-----]\[------+------( )
|
RUN_OSR DOOR_DIR |
---]\[-----] [------+

Close the door when RUN_DOOR and DOOR_DIR
RUN_DOOR DOOR_DIR CLOSE_DOOR
---] [-------] [----------( )


Open the door when RUN_DOOR and not DOOR_DIR
RUN_DOOR DOOR_DIR OPEN_DOOR
---] [-------]\[----------( )


 
Last edited:
Thanks!

yup I worked something out similar, with two flip flops.

And it works now! :) Now to figure out how to insert some other things, but I think I'll be able to find those myself :)

Thanks again for all the help!!
 
You went another route so you did not find the additional booby trap in my logic.

I had added limit switches that stop the doors advance when in the full up or down position.

You did not specify these but it would only make since that you would need them.
However the way I had orentented them in the logic, they don't work right.
When the button is pressed the scan time will be so fast that you would be unable to get your finger off the button before the contractors would unlatch themselves and the door would never move off the end of travel limit switches.

To fix this I had to take the end of travel limit switch instructions and put them on a separate rung from the Push Button (S1) and include a ONS (one shot) instruction before unlatching the contactors.

Screen shots where getting kind of small so I have attached the logic in 2 shots.
Rungs 0-2 are the same no change.
Rungs 3 & 4 shot now reflects a workable solution for the end of travel limit switches.

I know you took a different route, but I just wanted to correct the problem with my previous post for good measure.

BCS
 

Similar Topics

I'm been deciphering a program for a press here. I've gotten most of it deciphered using the manual to understand the instructions (first mitsu...
Replies
11
Views
343
Hello. Was just curious, if it is possible to load an image from an SD card on to a Compactlogix PLC that came straight out of the box brand new...
Replies
4
Views
562
Hi All, Looking for advice on programming MicroLogix 1400 with RSLogix500. Basically, I have a client who requested I make a "simple" program...
Replies
19
Views
3,237
How do you code it to when you push a button attached to X001, it turns on Y001. Then, the next time you push the button attached to X001 it...
Replies
4
Views
1,631
I am just finishing up my project, which was my first experience with PLCs. I thank everyone that has helped me work through the RIO and analog...
Replies
11
Views
2,982
Back
Top Bottom