Logic Help

I have a series of 12 silos. All of the silos are filled by a cart that makes a simple limit switch to tell it which silo it's over. It runs foward and reverse, increasing and decreasing the position index. If I had a bad limit switch, it would increase the position by two. I need this to alarm if it misses a switch and I'm not sure how to write it. Basically, if I am traveling foward/reverse and my position increases/decreases by more that one, then energize a bit. How do I write it to determine a moving position index that moves more than one position? Thanks for the help
 
Is the cart going at a fixed speed so that you can tell if it's taken twice as long to reach the next silo?
Are the limit switches all ON and the cart turns them OFF. That way if two switches are OFF at the same time you know that one of them is broken?
Is there any other detection of the cart (i.e. a retro-reflective sensor across the track to say the cart is here... then if the limit switch doesn't come on/off before the retro reflective goes off (i.e. cart has gone) then you can trigger a fault) ?
 
Basically, you need to "remember" the last limit switch that was tripped. I'd use an integer, and put a different "position index" or "silo number" into it each time a limit is tripped.

Then, you make logic that checks for conditions like:
Was at position 1, going foward, any switch but position 2 tripped (3-12).
Was at position 2, going foward, any switch but position 3 tripped (1, 4-12).
...
Was at position 12, going reverse, any switch but position 11 tripped (1-10).
Was at position 11, going reverse, any switch but position 10 tripped (1-9, 12).
...

Update the "position index" after you check for the alarm conditions.

You may feel that checking for all the other limit switches is overkill, but if any of them are acting up, it's going to be a problem.

Another way to go about this is to make a more robust "position index". Use an integer to track the cart even when it is not on a limit switch.

5 before silo 1 (was @ silo 1 going rev and silo 1 LS not tripped)
10 at silo 1 (silo 1 LS tripped)
15 between silo 1 & 2 (was @ silo 1 going fwd and silo 1 LS not tripped or was @ silo 2 going rev and silo 2 LS not tripped)
20 at silo 2
25 between silo 2 & 3
...
120 at silo 12
125 past silo 12

If your current position is ever more than 5 from your "last position", you skipped a switch.
 
It all depends on WHAT is in the silos and WHO fills the cart!

And of course how well you convey to your instructor these answers.
 
Is the cart going at a fixed speed so that you can tell if it's taken twice as long to reach the next silo?
Are the limit switches all ON and the cart turns them OFF. That way if two switches are OFF at the same time you know that one of them is broken?

Yes the cart is going at a fixed position. Yes the limits are all ON (NC) and the cart does open them. I need to do this to basically test and check the limits. We run 4 different materials into the silos. Being wired NC, if one opens, or stops working, the program and falsely belive the cart is over the wrong silo. This can be very bad if the wrong material is dumped into the wrong silo. This would help test the limits if it is travelling and the position index increases,decreases more than one. there is a position integer. when the first limit is made, it movs a 1 into cart.pos. the second, a 2 and so forth. I'm just not sure how to measure the index jumping a number
 
You may feel that checking for all the other limit switches is overkill, but if any of them are acting up, it's going to be a problem.
You are exactly right. It did happen the other day. 10tons of Limestone was dumped into a coal silo before it was caught. I never realized they are all wired NC. A blown fuse, nick in a wire, loose wire, will all appear to be a "open" making the system believe it is over the correct silo. I'm trying to protect this from happening. I'm not 100% sure it was a limit problem, but I do see a problem in the future. Limits fail!
 
It all depends on WHAT is in the silos and WHO fills the cart!
See this previous thread for an explanation and history of this project.

http://www.plctalk.net/qanda/showthread.php?t=68881

I never realized they are all wired NC.
That could be a real headache. Is this a good time to change the limit switch contacts to NO?

One common method is to move your 12 limit switch bits to a single "Alarm" word, then check the decimal value of that word. If you must keep the switches NC, then with 12 switches there are 12 possible values for a 12-bit number when only 1 of the switches is OPEN:
1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048
If the value of your Alarm word is not one of these decimal values, then you have more than 2 switches open at the same time. You can check the values one at a time in parallel comparison branch rungs, or use twelve AND statements. If the result is not TRUE, then you have an error, and should do more checking to find the bad switch (look for an OPEN switch that is not the current cart location).
 
With the cart not located at a silo (in between travel), then the value of the new Alarm word should = 0. If it is not 0, then one or more switches are stuck open.
 
I did something similar for a 5 level lift a while back using prox sensors that were NC (all I could get at the time). If they are going directly into a PLC the contact sense doesn't make all that much difference.
I wrote fault logic the tested to be sure no two switches were ever made at the same time and also that any switch that was made was exactly one position away from the prior switch. It's a bunch of ladder logic for 12 positions but it's well worth doing.
That machine has had some switch failures (forklift damage) but has never failed to report the fault.
 
If they are going directly into a PLC the contact sense doesn't make all that much difference.
No, the contact polarity doesn't make much difference unless you need to be concerned with the fail-safe condition and whether a broken circuit in the wires could be interpreted by the PLC as an open contact leading to a dangerous situation. Traditionally, things that could be dangerous if a wire or switch breaks are made to stop on NO, so that the switch has to close or enable the circuit to cause something to operate. That way a broken wire causes the same action as a Stop switch.

In Hooter's silo carts, a broken or disconnected or loose limit switch wire could cause a cart dump, not dangerous unless your boss kicks your @$$ out the door.
 
If it is that important that the position be correct - Product in wrong hoppers etc.
then it is time to assess the actual budget cost of the process.
seriously look at an absolue distance measurement device.
eg, Encoder, laser etc.
i am sure that this can be payed for - 10 ton of Lime in Coal
you could keep using the swithces - a measurement system will be better
 
Heard of a dairy farm with underground tanks - one molasses and one bunker. Normally filled from one truck with two trailers. Driver got it backward = molasses in bunker and bunker in molasses.

Dan Bentler
 
No, the contact polarity doesn't make much difference unless you need to be concerned with the fail-safe condition and whether a broken circuit in the wires could be interpreted by the PLC as an open contact leading to a dangerous situation. Traditionally, things that could be dangerous if a wire or switch breaks are made to stop on NO, so that the switch has to close or enable the circuit to cause something to operate. That way a broken wire causes the same action as a Stop switch.

In Hooter's silo carts, a broken or disconnected or loose limit switch wire could cause a cart dump, not dangerous unless your boss kicks your @$$ out the door.
I agree with that up to a point, but the NO contact also has a failure mode which is of course a shorted wire. In either case the fault check is that you should never have more than one input active (whether open or closed) at the same time.
 
Sequence checks and balances. In any operation like this i will built in additional checking. For instance it is impossible to have the cart over two silos , if the condition is true STOP everything and Alarm. Let say i am at Silo 1 moving towards Silo 2 and it dont reach Silo 2 in x amount of time Alarm.

Another condition is when there is abnormal stoppage of the cart. When this happens for some reason how would the operator get the cart back into position to resume normal operation.

The Software knows the cart may only index by one so if there is a switch faulty you can detect this. You expect the Cart to be at 4 but now it has reached 5 and missed 4 Alarm.

Remember to have the check in for multiple proximity sensors being activated as not to have a false value in the variable.

Lastly what is the total distance of travel for the Cart?

In the past we have used Laser Transmitters for similar applications but there are various methods of doing this.

Be sure to have the facility of creeping to a silo either in manual. I have in the past had functions that automatically creeps to a position to get it back in sequence if there was a stop between silos.

I agree with Lancie the state of the switch is irrelevant in this case.

In terms of writing the code for the next station check.

If Current Index = 3 And moving Forward then i would have a variable expected to be 4. If <> 4 Alarm
If Current Index = 3 And Moving Reverse then i would have a variable expected to be 2. If <> 2 Alarm

Do this check on When the Index Variable changes
 

Similar Topics

Hi Experts, I am working on the LogixPro 4-Floor Elevator Simulator. I am trying to build the motor logic without using Latch (OTL) and Unlatch...
13
Replies
522
Views
Hi All, I'm currently studying PLC at college and not doing so great. We use TIA Portal V15. I'm trying to set up the ladder logic for this...
22
Replies
1,242
Views
I'm fairly new with this. (My first post on here). Wondering if someone can help me solve this. The bottom branch of line 24 i added and line 25...
9
Replies
459
Views
Hi all, I'm new to the PLC/Automation space - my background is in IT. My team is shifting to OT focus and supporting our equipment so I am...
35
Replies
1,775
Views
Hey Everyone, this is my first post here. Im having an issue with brainstorming a way to make this work without having to install different...
13
Replies
865
Views
Top