Shift Register Not Tracking

Hershfam

Member
Join Date
Mar 2024
Location
USA
Posts
8
I am attempting to reject a bottle If the label fails. The rejection works fine at normal line speed but at low speed the rejector fires (air fired by solenoid) early and misses the product. It is shifted using an encoder which is why I’m confused on why the line speed change messed it up. I’m sure it’s something simple I’m over looking but please help. I’m using a cognex camera system to get the fail signal to the PLC. Logix5000
 

Attachments

  • IMG_9985.png
    IMG_9985.png
    28.9 KB · Views: 27
Last edited:
I thought the encoder pulse rate (and thus the shift rate) for the different speeds would make up and cover the speed change
 
It may be that the pulse is not in-loine with the actual central reject position, remember that even though your pulses i.e. shift register is fast, the reject air shot will take a little time to actuate, at the fast line speed the bit position has been set to probably 3 or 4 bits from the centre of what would be the reject, so at a fast speed the bit -x is true but by the time thew PLC reacts & the air shot is enabled the actual position is correct I can only suggest the following adjust the bit looked at later on slow speeds do some sort of calculation for a delay time based on speed & so on
Did one likle thios many years ago at full speed it was bit 200, at 3/4 speed it was bit 210 & so on, this worked sort of but what I did ion the end is put a delay timer on the reject & depending on the conveyor speed I set the timer value for example from 0 to 100% the delay would be 110ms to 10ms i.e. reverse in reality I had 0 speed was 100 - speed in % so in effect the timer was 100ms to 0ms on speed value of 0-100 it was close enough to time the reject enough you would need to determoine the delay range you need my timers although programmed in ms the timers were clocked in 10ms intervals
 
Your timer solution is an idea I had and was thinking about. I think I’m going to try and set up a program today with the timers and get the different belt speeds set up. Thank you!
 
yes but on some PLC's a value of 0 will not trigger the timer at all you will need to try it, one suggestion is to change the shift bit a little earlier, have a minimum time value of say 10ms that way if your timers do not trigger on 0 time value (I have seen that on one plc cannot remember the make). most PLC timers are 100ms timebase but many types have high speed timers.
 
I thought the encoder pulse rate (and thus the shift rate) for the different speeds would make up and cover the speed change
Assuming the encoder is driven from the same motor that drives the bottles, each pulse from the encoder represents a distance traveled by the bottles. I doubt there is anything inherent in the encoder or the encoder counting device in the PLC that compensates for speed. I expect you will have to provide the compensation.
Assuming your reject triggering strategy is to fire the solenoid X encoder counts after the bottle passes a fixed point, as the speed increases, the encoder count at which your trigger the reject device will need to decrease.
 
Hmm okay. I’m new to this side of things I’ve normally just more used PLC’s to trouble shoot and fix stuff. The encoder is on the motor that’s driving the belt. I thought for the bottles to travel say 5 ft is half a rotation and 10 pulses (completely made up numbers) no matter what 10 pulses would mean the same distance traveled and the only thing that would change is how fast those 10 pulses happen
 
Hmm okay. I’m new to this side of things I’ve normally just more used PLC’s to trouble shoot and fix stuff. The encoder is on the motor that’s driving the belt. I thought for the bottles to travel say 5 ft is half a rotation and 10 pulses (completely made up numbers) no matter what 10 pulses would mean the same distance traveled and the only thing that would change is how fast those 10 pulses happen
That's true...but...the mechanism that rejects the bottle (is it a cylinder or a puff of air or what?) has a time delay built into it that probably doesn't change with machine speed. IOW, if you tell it to reject at time 0, the bottle will be rejected at some point in the future 0 + N ms. You have to synchronize the reject actuator timing to the bottle movement.

What I've done in the past to tune stuff like this is to use a timer instruction to monitor how long it takes for the cylinder (or whatever) to complete its move once I tell it to start. That lets me back into how far ahead to send the signal.

Basically, let's say you're making the decision to reject the bottle at encoder position A. There's a time delay before you tell the reject to fire of say X ms. It takes the bottle Y ms to travel from encoder position A to the reject position (encoder position B). The 2 time delays have to intersect if you're going to reject the correct bottle. If the line is running more slowly, then the time from encoder position A to position B is longer, so your time delay of Xms also has to change to keep it in sync.
 
That's exactly what happens. Each encoder count represents the same distance traveled regardless of speed. But the reject mechanism doesn't deploy instantaneously. The time from when the PLC tells the solenoid to fire until the puff of air hits the bottle is always the same number of milliseconds regardless of the line speed. But the distance the bottle travels during that deployment time is greater at faster speed.
When you're trying to shoot a moving duck you have to aim at a point in front of the duck so your shot and the duck arrive at the same place at the same time. When you're trying to shoot a woodcock you aim a bit further ahead, because the woodcock flies faster than the duck. That's assuming both birds fly in a straight line, which, in the case of the woodcock, isn't a safe assumption.
 
Last edited:
I thought the encoder pulse rate (and thus the shift rate) for the different speeds would make up and cover the speed change
[Update: of course my long-winded explanation is much later than others, so read those first as you might grok the problem quicker]

General statement: essentially all computer programs, and certainly all useful PLC programs, model some real-world process; the primary design choices for a computer model are the levels of fidelity between the model and the real-world processes that are modeled. We care about the pass-fail status of a label, and that is a binary state so it is easy to model with high fidelity; we don't care about the color of the operator's socks, so we don't model it at all.

Read carefully what @Steve Bailey and @parky have written.

When the bottle label is detected by the camera, it is at an inotial fixed position, let's call it P0. It will then take a non-zero amount of time to evaluate the label and pass a failure signal to the PLC, let's call that non-zero time tdetect. On the scan cycle when that failure signal is received, the bottle is downstream of the fixed of P0 by a distance Ddetect = S * tdetect, where S is the speed of the conveyor. If S is variable, then Ddetect is variable. In addition, when the PLC detects the failure bit is downstream i.e. at the reject station, it will take another non-zero amount of time from that moment for are to push the rejector to the point where it reaches the bottle, let's call that second non-zero time treject, and the distance the bottle travels in that time Dreject = S * treject.

I mention all this because the shift register is a model used to determine when a bottle with a bad label detected at upstream position P0 will be at the rejector when the reject has extended to the line of bottles. If the shift register's discrete movement is tied to the conveyor distance, e.g. to teeth on a sprocket being detected by a prox sensor, then once that fail-bit is in the register it will model the relative movement of the bottle. The question though is, where is the bottle on the conveyor during the PLC scan cycle when the fail-bit is received?

In slower conveyors, we assume that the variability in the sum of those distances, Ddetect + Dreject, will be small enough that it does not affect the fidelity of the model and the rejector will hit the right bottle. For a high speed conveyor, however, that sum of distances make a huge difference.

If you were a quarterback throwing a pass, you would lead a professional wide end by a lot more than you would lead me with my bad hip, even if we were both 10yd downfield at the time you released the pass; the time it takes the ball to travel those 10yd is analogous to the sum of the tdetect + treject times.

In the time it took me to write this, others have suggested various approaches e.g. adding a timer to model tdetect + treject. Another approach would be to vary where the code writes the initial detect fail-bit, or looks for the downstream reject fail-bit. Either way, the solution is going to need an empirical approach, because it is essentially adding a fudge factor.
 
That's exactly what happens. Each encoder count represents the same distance traveled regardless of speed. But the reject mechanism doesn't deploy instantaneously. The time from when the PLC tells the solenoid to fire until the puff of air hits the bottle is always the same number of milliseconds regardless of the line speed. But the distance the bottle travels during that deployment time is greater at faster speed.
When you're trying to shoot a moving duck you have to aim at a point in front of the duck so your shot and the duck arrive at the same place at the same time. When you're trying to shoot a woodcock you aim a bit further ahead, because the woodcock flies faster than the duck. That's assuming both birds fly in a straight line, which, in the case of the woodcock, is n't a safe assumption.
Do I look like a duck ;)?
 
yes but on some PLC's a value of 0 will not trigger the timer at all you will need to try it, one suggestion is to change the shift bit a little earlier, have a minimum time value of say 10ms that way if your timers do not trigger on 0 time value (I have seen that on one plc cannot remember the make). most PLC timers are 100ms timebase but many types have high speed timers.
Siemens Step 7 IEC type (SFB block) timers (TON, TOF,TP / t#0s) on 3xx and / 4xx PLCs.
Pretty sure that Siemens TIA portal works with 0ms time values.
 
I am attempting to reject a bottle If the label fails. The rejection works fine at normal line speed but at low speed the rejector fires (air fired by solenoid) early and misses the product. It is shifted using an encoder which is why I’m confused on why the line speed change messed it up. I’m sure it’s something simple I’m over looking but please help. I’m using a cognex camera system to get the fail signal to the PLC. Logix5000
Wow thank you all for all the info! I got some studying to do clearly. I appreciate all the well though out solutions and the amazing metaphors lol
 

Similar Topics

Hey guys, I have to work on a project using AB plc. I have 12 indeed conveyors from which boxes are enter into the main conveyor. The main...
Replies
4
Views
1,954
Hi guys, I am pretty new when it comes to programming. I am working with CX-Programmer and I am having a problem where I have a sensor on my...
Replies
6
Views
692
Hi all, i have a very slow indexing machine where we are looking to make everything as bulletproof as possible, money is not much of a factor...
Replies
12
Views
3,068
Good morning (EST), I am trying to implement the code below in on an S7-1200. It's barely half a dozen instructions, but I am stuck; I have not...
Replies
26
Views
5,694
Hi everyone I am completely new to using shift registers and am a bit stuck, my shift register works as should, it is for an overhead conveyor...
Replies
55
Views
15,629
Back
Top Bottom