Conveyor and metal detector application

ASI

Member
Join Date
Nov 2016
Location
Alvin
Posts
3
Hello,
I am new to programming and posting. I have built a conveyor belt with an integrated metal detector. When metal is detected, the belt stops, reverses to dump the product off and then runs forward again. If this cycle happens 3 times in less than 60 seconds, I want to go to an alarm state. I have everything figured out except the logic for determining if 3 events happen in <60 secs. I am using a Schneider TM221 PLC and basic ladder logic for the programming. Can anyone help? Thanks.
 
Hello,
Not familiar with your plc but you could just run a 60 second timer and have a counter for each time the detector goes off or the belt reverses.

Have the timer and counter reset when the 60 seconds is up.

Then you will have a rung of logic that will look something like this:

Timer Timing (or not done)......Counter greater than 2......Output Alarm State.

EDIT...Actually you could leave out the timer timing instuction as it will always be running, since your counter will be reset after the 60 seconds then all you need is the counter greater than 2 and the output for your alarm state on the rung.

BCS
 
Last edited:
Thank you very much, I will try that. As simple as your solution is, I must have been over thinking it!
 
Welcome to the forum!

BCS's solution will work in some cases but not all.

Assuming you start your timer when the first metal is detected...
Assume detection at 0 seconds, 55 seconds, 65 seconds.
You won't have an alarm, because the three occurrences were not within the last 60 seconds, and the timer/counter reset at 60 seconds. But, if you get a third pulse at 70 seconds, you now have three pulses within 25 seconds, but your counter will only be at two, so no alarm.

It sounds simple, but it's one of those ones that when you think about it just a little bit more, gets complicated :)

Here's one idea.

Start with two 60-second timers (let's call them Metal_Timer_1 and Metal_Timer_2). When you start the line or complete your metal dumping, reset both timers.

When you see a metal detected pulse, start Metal_Timer_1. Use the Metal_Timer_1.TT bit in parallel with your metal detected signal; this will make it self-reset when it reaches 60 seconds. If Metal_Timer_1 is already in use from a previous pulse (Metal_Timer_1.TT is true) then start Metal_Timer_2 the same way. If Metal_Timer_1 and Metal_Timer_2 are both in use, and you have a metal detected pulse, then you have your alarm.

The only thing you'll have to watch for is that if you just write all that out sequentially, you'll get an alarm the first time you get a metal pulse - because it will run like this:
Rung 1: Metal Detected. Start Timer 1!
Rung 2: Metal Detected. Timer 1 already running (because we already executed rung 1), so start Timer 2!
Rung 3: Metal Detected. Both timers in use, so Alarm!

The way I would get around this is to have the metal detected input go through a oneshot to an OTL. Let's call the BOOL tag on that OTL "New_Metal_Detection". Then, when you start a timer, unlatch the bit (again, using a oneshot). Use that tag instead of your metal detected input to trigger the timers. So now if Timer 1 is busy, Timer 2 will start, and turn off the New Metal Detection tag, so no alarm. If Timer 1 is not busy, it will start and turn off the tag before Timer 2 gets a chance to look at it.

How does that sound?
 
Thanks for the solution - it does seem to get more complex the more I think about it! I will study your answer and see if I can make it work. Couple of things: would I need to make the timers 30 secs instead 60 so that added together they would be <60? I'm really new and I don't know what a oneshot to an OTL is. And I haven't used tags or words yet, but I will study up and figure it out. Thanks, again!
 
No, the timers should be 60 seconds. Think of it this way.

Each of them is timing how long ago a certain metal detector pulse happened. The accumulated value of the timer shows you how long ago that was. If it was longer than 60 seconds ago, you no longer care about it, so you reset the timer.

So let's say Timer 1 is tracking a pulse that happened 45 seconds ago, while at the same time Timer 2 is tracking a pulse that happened 10 seconds ago. If you get no more pulses in the next 15 seconds, timer 1 resets and frees up to track another pulse, should one occur. But if another pulse does show up in that 15 seconds, you now have three pulses in under 60 seconds so you get an alarm. Does that make sense?

As to your other questions, drop an ONS instruction, an OTL instruction and an OTU instruction onto a rung and press F1 on each of them. The help file will explain them in more detail, but for a quick overview:

OTE: turns the associated tag ON if the rung in condition is TRUE, and turns the associated tag OFF if the rung in condition is FALSE.

OTL (Latch): turns the associated tag ON if the rung in condition is TRUE, and does NOTHING if the rung in condition is FALSE.

OTU (Unlatch): turns the associated tag OFF if the rung in condition is TRUE, and does NOTHING if the rung in condition is FALSE.

If you think about it a little, you should hopefully be able to see why you need to use OTL and OTU, instead of an OTE.

ONS (oneshot): you put this bit in a rung when you want something to only happen once when something happens. Basically, if the rung-in condition goes from false to true, the output of the ONS turns on for ONE SCAN ONLY. To make it's output go true again, the rung in condition must go false, then true again. With that information, you should hopefully be able to work out what I'm getting at above with where I put them.

Good luck!
 

Similar Topics

Good Afternoon , I just came out of a meeting , and the subject came up , about static buildup on a conveyor belt causing a metal detector...
Replies
13
Views
2,741
i'm looking linear metal detecting sensor cross conveyor. anyone have used any type of this sensor? conveyor belt is 10" width.
Replies
9
Views
3,229
Does anyone have sample logic with conveyors that start and stop according to product on the line?
Replies
1
Views
98
Good Afternoon, I’m limited with a skilled maintenance staff to design and build Load Cell , Rollers , etc. for conveyor sections . Do...
Replies
11
Views
659
Hello everyone, I need to create a belt conveyor with an AFM60 encoder on board that detects the position of the glass (too small to be detected...
Replies
5
Views
706
Back
Top Bottom