how to program motor control relay

zamka

Member
Join Date
Mar 2011
Location
Texsa
Posts
2
Hi,
my project is to program the motor in a grage door using control relay. The thing is that I'm using only one button to make it goes up and then if I press the same button, the door should stop and when I press it for the third time, the control relay should be energized and the door should go down.

I'm using I:1 for the push button, O:0 for the motor and O:1 for the control relay. could any one post me a logixpro program that can do this.

thank you,
 
Hello all,
First, I am not a student. Because of the nature of business, PLCs are part of my work.
I've responded to this post because it intrigues me. I have never seen this scenario in my everyday work.
I think i have a solution. But I think its, clumsy and could be cleaned up. The problem is I can't figure out how to upload a .rss file.
 
Create a 'zip' file from the RSS file and upload that.

If the program is short you can use one of the free PDF 'printer' programs to 'print' the ladder then upload the resulting PDF.
 
I looked at your attached file. I saw no provisions for stopping the door by pushing the same button a second time. The OP (Zamka) had that as a condition to be met.
There are some additional items that need to be fixed to make a functional program that were never stated. These include but not limited to dealing with length of travel, jams, and obstructions in the path of the door.
An optional feature most residential doors have is a timed overhead light to allow time to get inside at night. Of course it should have a separate pushbutton to override the automatic timer for manual control.
 
Last edited:
I looked at your attached file. I saw no provisions for stopping the door by pushing the same button a second time. The OP (Zamka) had that as a condition to be met.

Actually it does, if the PB is pushed a second time the value of the counter's .ACC will equal 2. The first output will turn off the second output will remain off ( counter value not yet a value of 3).
 
Thank you all for your input.
I have never tried to use a single pb to control 3 functions. My solution works(currently running on a small Micrologix.) The code just seems clumsy and a bit of overkill.
I am brand new to the forum. Thank you Mickey for your time and patience, and showing me where to find instructions on uploading files.
 
Actually it does, if the PB is pushed a second time the value of the counter's .ACC will equal 2. The first output will turn off the second output will remain off ( counter value not yet a value of 3).
Mickey,
You are absolutely right, I missed that.
 
Thank you all for your input.
I have never tried to use a single pb to control 3 functions. My solution works(currently running on a small Micrologix.) The code just seems clumsy and a bit of overkill.
I would not call it clumsy at all. You might want to consider
what happens when the door reached it's full open or closed position. In your program the outputs will stay on. Usually there would be a limit switch to turn off the outputs when the door reaches its full open or closed position. Something to consider.

Also documentation and lots of it always helps for future troubleshooting and understanding of the program. ( Rung comments/descriptions). Good habit to get into now.
 
Mickey,
I realize there are a lot of real world considerations to be taken into acct.
Great call on the documentation. I am a maint. tech by trade. I have learned the value of a well documented program. A couple of times I have had to build symbols and descriptions from scratch.

All I was doing with this post was a bit of self educating. Everything I know about Plcs is self taught or learned from leaning over the shoulder of an outside source.
The original poster (zamka) asked a question, I didn't have the answer to. I made it work, I just figured there was a better way. So I put it before the great circle of knowledge on here.
 
I would not call it clumsy at all. You might want to consider
what happens when the door reached it's full open or closed position. In your program the outputs will stay on. Usually there would be a limit switch to turn off the outputs when the door reaches its full open or closed position. Something to consider.
quote]


Thanx for all of you. Yeah the program works fine with me except when the door reached it's full open or closed positions. When it is fully opened, the Acc=1 so when i press the button again the acc will =2 and will do nothing. which means i have to double press the button each time its reach fully opend or closed position. When its fully closed, the acc=3 and again needs duoble press.

I'm thinking that if i can rest the acc. using the Limit Switiches then the problem would be solved but i'm new to this program and I tried to do it but it didn't work the way i did it. Any suggestions?

Picture1.jpg
 
I have a couple of suggestions....

1. You don't need the -[OSR]- on most PLCs, Counters are usually triggered by the rung's false to true transition, and will not count on every scan if the rung is held true.

2. Using a counter for your different "states" is a perfectly valid approach, but your thoughts about resetting it on various conditions is flawed.

The counter is following what the real-world is doing, defining the "states" that the procedure can be in at any one time... e.g. 0=Closed, 1=Opening, 2=Open, 3=Closing, 4=Closed, so reset to 0.

Your only provision for advancing the count to the next state is the pushbutton, and you need to make provision for the feedbacks from the door open and closed limits to also advance the counter, but only on certain count values. That will cure your need to press the button twice to get the counter to the correct state values. You need to add EQU rungs for each state that the procedure can be in.

3. The reset you have programmed using the "First Pass" bit S:1/15 is also going to cause problems. It should move the counter to 0 or 2 depending on where the door actually is, or what it was doing before the power went off. Imagine the door is open, and you reset the counter, you will have to press the button 3 times to get it to close again.

4. Think about a more complex procedure, and consider that your EQU rungs are just defining how to make the procedure advance to the next state, i.e. what is this state waiting for.

Then consider separating the outputs away from the procedure, and driving them independantly. Sometimes you will want outputs to be on over a range of states. You can use LIM instructions to do this.

Separating the Procedural Control from the Equipment Control in this manner is good programming practice, as the procedure doesn't need to know how to open/close the door, it just needs to make it happen, and respond to feedbacks from the devices controlled.

I would even advocate that your "procedure" should check that what it is commanding is actually happening, and I would typically program this procedure as follows....

Procedure Control...
0 = Wait Pushbutton pressed.
1 = Start Motor Forward Direction (Open Door)
Wait Motor Running Forward feedback
2 = Wait Door Open L.S. OR Pushbutton pressed
3 = Stop Motor
Wait motor running feedback off
4 = Wait Pushbutton pressed.
5 = Start Motor Reverse Direction (Close Door)
Wait Motor Running Reverse feedback
6 = Wait Door Closed L.S. OR Pushbutton pressed
7 = Stop Motor
Wait motor running feedback off
8 = Go To 0

Equipment Control...
1-2 : Run Motor Forward
5-6 : Run Motor Reverse

On steps 1,3,5,7, if there are no motor feedback signals available, just advance the procedure anyway.


HTH
 

Similar Topics

Hi, Please help me with this PLC interview question. The logic conditions are if any 1 sensor turns on, motor1 turns on and other motors off...
Replies
12
Views
5,674
I've started writing a program and its a sequence of steps that it will go through. The sequence commands seemed a little complex to me so I opted...
Replies
7
Views
8,755
Hello, i need to build a generic structure for any motor control application. I need to know which are the most common and important elements to...
Replies
7
Views
9,567
Hello i have poblem whit program, i need use 4 ouputs to control motor step left and right, I create program in GX iec developer but his need 8...
Replies
0
Views
2,154
Hi! Can any one help me out on this? I am new to this thing, and I am trying to make a positioning system that has a lead screw whit a 5mm...
Replies
2
Views
2,489
Back
Top Bottom