Timing help

newbeetoplc

Member
Join Date
Jan 2016
Location
IN
Posts
12
I need help with some timing logic. I have a conveyor system. At the beginning of the conveyor (the load end) I have a laser sensor. This sensor dose a few things in my logic. What I need help with is, when a part is place on the conveyor and it triggers the laser switch, I need a process to happen to that part at a later point in time down the conveyor system. It would be simple if it was just that one part I had to worry about but each time a part is placed on the conveyor I need the same process to happen to that part and not interfere with the parts that are already heading to the process. Dose that make sense? The conveyor moves at 8.5fpm and the point I need the process to happen to the part is ruffly 15 seconds down the conveyor. I cant use a another sensor because the environment down the conveyor is to harsh (wind, heat, flying debris, water).
 
Hi and Welcome to the Forum,
I haven't done any Conveyor applications before but I will give you some ideas.
How many boxes will you have on the Conveyor at any given time?
My initial thoughts are: Use FIFO (First In First Out) logic to track the box as it is on the conveyor (search the Forum for FIFO). Then you could use a timer per box. You would start the timer and LOAD into the FIFO stack when the box breaks the beam. When the timer is done do the "Process" and UNLOAD from the FIFO Stack.

Using timers may not be the best way to do this if you need the box to be in a certain position to perform your "process". You may want to use a shaft encoder that is mounted on the conveyor. It will give you pulses every time it completes a revolution. So many revolutions per trip of conveyor = pulses per conveyor trip. If you divide the length of the conveyor belt by the pulses per trip you will get pulses per inch/foot/mm of your conveyor belt. If you start counting when the beam is broken you will know exactly where that box is at any time during its travel. That will make the process much more accurate.

If you have any more questions post back.
 
Suppose that you have an array named TimeControl. Your are going to use it as a FIFO. Let's see this pseudocode:

Code:
If part_is_detected then
  Push actual time in TimeControl
End If

If TimeControl is not empty then
  x = actual time - first element of TimeControl 
  If x >= expected time then
    Execute special_task
    Pop first element from TimeControl
  End If
End If
Maybe you'd have to use an oneshot in the first part of the code to be sure that actual time is pushed once per detected object.

To be clear:

Pop: unloads the value from position 0 (first position) and the remain data in the FIFO shifts down one position.
Push: the data in the FIFO is shifted up one position and the new value is loaded to position 0.
 
If you are using MicroLogix or RSLogix 500 by Rockwell I would suggest using the BSL (Bit Shift Left) instruction to store the entry of the product. For toggling the BSL, use an encoder or prox. switch to make pulses driven by the conveyor to measure the distance to the discharge point.
See Bullzi's post#2 for greater description about the encoder part.
 
Last edited:
Bullzi and nhatsen,

First, thank you both for the welcome and responding. Please let me fill you in on a few more details. First, I'm an electrician with a lot of years troubleshooting PLCs and a few intro to PLC classes but zero actual real world programming experience. I work for the Veterans Affair and this project is a large Hobart conveyor dishwasher. It has never been that good but for the past year this machine has been a big problem. We've had techs come out and replaced so many of the ic boards and everything else and it continuous to be a problem. Over $20,000.00 in the last two months. It would be to the governments best value to just get a new one but with contracting in the gov sometimes that can take a year or so. I know the process of the machine very well so I decided to install a small Do-more PLC from Automation Direct. Everything is very simple except this one part. With that being said, everything that is needed to run is there. It doesn't have an encoder or a prox reader for a tooth count. Their are no limit switches inside the system. It only has one laser switch at the load end, a few temp sensors, and some float switches for inputs. Once the tank levels are full and the temps are right, everything is time based. I know about arrays from some MS Visual Basics and Java coding but I don't have a clue about using arrays in the Do-more Designer (Programming Software) that came with the PLC and tech support will be closed till Tuesday. I'm hoping the workers don't have to wait that long. It seems that a few timers and some latching could achieve what I'm wanting I just haven't got it yet.
 
snip....
I know the process of the machine very well so I decided to install a small Do-more PLC from Automation Direct.
Please post the exact model numbers Do-more plc and any modules numbers plus the version of software you are using. That way others can download the free software and help you develop the program code.
 
Last edited:
CPU: H2-DMI
Rack: D2-06B-1
Input: D2-32ND3-2
Output: D2-12TR
RTD: F2-04RTD

Software: Do-more Designer V 1.4.3
Thanks
 
It seems from your description that the ware is placed in separate trays that then move through the washer. If this is the case I think a timer based approach would work for you. The timer could take the place of a hardware encoder and generate a pulse at a programmed interval to drive a shift register. Assuming that the tracking is needed to turn on/off water jets and such at certain points in the process, the suggested basic bit shift would work here.

A lot depends on, a; how accurate the timing needs to be. That is, is +-2 in. good enough or is +- .25 in. required?, and b; how often, if at all, the conveyor may stop and start while the trays are in transit. If either of these two are an issue I would lean to a sensor physically related to conveyor movement.
 
I would take a look at what Garry posted. It looks like it would work for you. If you just change up the encoder to a timer like his demo shows you should be able to make work.
 
Hopefully I'm not repeating other peoples replies but here goes.

A 15 second timer after a part is detected would be easy enough. Once the Time on delay is finished the next process begins. Often a bit is set that the next process has begun and the timer is reset. If there are additional parts delivered during that time everything will become difficult. Ideally right before the next process there would be some sort of part detection. Examples that would work in that environment would include ultrasonic sensors or mechanical devices that are connected to limit switches or proximity switches. However there are times when there is not much we can do. A solution inside the control could be done in several ways. If the conveyor is always running and the parts arrive on a fairly consistent schedule you can make the system like an indexing system. Create a bit array of 5 bits (for instance) make a timer that shifts the bits every three seconds. If during that period the sensor detects a part a 1 is written into the first bit. After the timer is timed out the bit shift occurs. 00001 becomes 00010. If another part appears this becomes 00011 then 00110 after the shift.

Now let us say that you have 10 part types and your sensor can detect which is which (for instance the sensor is doing height detection). Instead of a bit array now you will use an integer array. When the timer times out a copy command or a move command (depending on the PLC) is used to shift data down. So when the first part is detected let us say it measures as part 8. 8 in placed into the first integer. When the timer times out the array is copied and the 8 is transferred to the second integer. No matter which method is used the moment the update is done and if the final position in the array is non-zero the process starts.
 
Awesome! Thank you everyone. The SR with a timer works great. I tried using like 30 timers. The struggle is real. The good news is, I've learned more in the past two days then all my time. Again, Thank you.
 
Awesome! Thank you everyone. The SR with a timer works great. I tried using like 30 timers. The struggle is real. The good news is, I've learned more in the past two days then all my time. Again, Thank you.
Please zip and post your program so that we can all see a working example, thanks.
 
Give me a few days. I still need to clean up the program and set up the HMI. Would love the feedback tho. I know I have a lot of redundancy. Thanks again
 

Similar Topics

Hi there, I am accustomed to working with Logix 500 but have a program modification I need to do on a CompactLogix.... I created a timer...no...
Replies
7
Views
2,442
Hello All! I am currently working on a project and I have hit a snag. I am programming an s7-1200 and trying to use the TON timer to run a...
Replies
6
Views
4,486
Hello, curious if anyone can offer me a little assistance with a project. I'd appreciate it. I'm getting all caught up in my timers and sequences...
Replies
5
Views
2,033
I am a newbee who could sure use some help... I am using RSLogix 500 and a Micrologix 1400. Can someone help me with some simple ladder logic...
Replies
8
Views
3,656
i need to design the PLC ladder diagram for 4-ways traffic light control. the timing for the lights are: R= red light for 30 seconds...
Replies
4
Views
7,133
Back
Top Bottom