HSC not reporting fast enough

phuz

Member
Join Date
Jun 2008
Location
Mohnton, PA
Posts
1,044
I am using a HSC in a ControlLogix system (L72S) in order to trigger a vision system for bad items on a tray.

I reset the count at the beginning of each tray and then each of the 10 triggers is based on position of the tray.

Position 1 > 200 for Trigger 1
Position 2 > 500 for Trigger 2
Position 3 > 800 for Trigger 3
Position 4 > 1100 for Trigger 4
...You get the idea.

What is happening is a double trigger for 3 and 4 and it appears to happen because the value coming from the counters PresentValue[0] is already greater than both Position 3 and 4 by the time it comes to that rung, so I get both. My entire controller scan time is around 2ms. I dropped the RPI on the HSC card to 2ms. It hasn't helped. Any advice on how I can capture this or get a quicker update from the HSC?

From what I can physically see in Logix5000, the count jumps from 780 to 1300 while I am monitoring Counterx.PresentValue[0].

The HSC is currently set for Counter. Would it make a difference if I switch to Encoder X1?
 
Is it the Continuous Task you are evaluating the logic related to the HSC counters values within?
Since the Logix class CPU logic scan is asynchronous to the I/O updates rates, you might want to implement the HSC related logic within a Periodic Task.
2ms RPI for the HSC module connection is a bit excessive; if you need Motion quality timing then you should implement a motion application.
Set the Periodic Task frequency at the HSC RPI value.
 
That almost doesn't make sense. If I make a 5ms periodic then it would be slower than the current total scan time of 2ms. I would think it's already going pretty fast. No?
 
I don't know why you are trying to read the counter into the ladder program. the data received would be dependent on the scan time of the program. the scan time can vary depending on the ladder execution time.

The HSC has 4 programmable outputs that are designed to do what you are looking for. although I don't know how to get 10 separated outputs on 1 counter but you could try to reset the counter partway through the tray.
If the trigger points are equally spaced you could set the counter up as a rollover counter at the 4 th trigger and start the count over. or something similar.
you could use 3 counters connected to the 1 encoder that would give you 12 outputs.
The counter processor is completely independent of the ladder processor and can count at a 50mhz rate. you may also want to check to be sure that you are not getting noise on the counter input the counter will read the noise pulse as a count
 
That almost doesn't make sense. If I make a 5ms periodic then it would be slower than the current total scan time of 2ms. I would think it's already going pretty fast. No?

I have stated "...Set the Periodic Task frequency at the HSC RPI value..."; this means: scan your HSC logic synchronized to the counter's update rate...

If you want a 2ms HSC RPI then use a 2ms Periodic Task.

If you want a 5ms HSC RPI then use a 5ms Periodic Task.
 
Just from what I saw, you may have to take the value from the counter and run it through some logic to see if it is between the values of 800 and 1100.

800 > 500
1100 > 800
> 1100

seems like you may be double triggering because you have multiple conditions true at the same time.

Just one more simple thing to throw out there, make sure your coupling on your encoder isn't slipping. That can cause this kind of issue too. I don't know if this is a new machine or one you are servicing, but I had been called due to a "PLC" issue and when looking at the counter, noticed some gaps in the rise of the increment. When we checked the encoder the coupling was loose, 30 seconds to tighten it up and it solved the problem.
 
Ethernet/IP is neither real-time nor deterministic, so 2ms may be wishful thinking on the RPI. I'm not sure how off the timing it has to be to generate an error or if an error is even generated until a certain number of packets are late or lost.

Cameras take varying amounts of times to process images, if your camera is slow, it may be taking too long to trigger so quickly.
 
I did the periodic and RPI at 5ms. No difference. Still getting double triggers. I guess the logic just can't scan fast enough for the encoder values and I will have to get creative using the HSC outputs themselves.

The double triggering is not a result of faulty logic.

Thanks for the input, guys.

Ethernet/IP is neither real-time nor deterministic, so 2ms may be wishful thinking on the RPI. I'm not sure how off the timing it has to be to generate an error or if an error is even generated until a certain number of packets are late or lost.

Cameras take varying amounts of times to process images, if your camera is slow, it may be taking too long to trigger so quickly.

Actually the camera is not the problem here. It functions fine. Even other Ethernet/IP, when I initiate a trigger, it fires instantly. Out of my 10 triggers, I am only getting one double. The rest are OK and as the camera shows, they are spot on. I was quite impressed with the Keyence system.
 
We have some of those keyence optical scanner cameras at work for barcode readers and they are, simply put, amazing. They also have a pretty nice line of photo electric sensors. They are pricey, but you get what you pay for.
 
How do you figure? There are 4 outputs with 2 value ranges per output?
That appears to be 8 triggers.

I think he was saying you *can* have 15 triggers (I wonder if it wouldn't actually be 16) but I don't think he was saying you *needed* 15 triggers.
 
And again I ask, how do you figure?

4 x 2 = 8 (not 16)

What am I missing here? :D

I think what he is saying that the equipment would allow you to have up to 15 or 16, not that your application needs 16. I think he was talking about bit packing a 16 bit integer for the output.

I haven't used your equipment, so I may be misunderstanding what *he* was saying, but I certainly understand that you only need 8.
 

Similar Topics

Hello. Has anyone ran into an issue with HSC on 2080-LC20. It run a cut off press and every so often after resetting to 0 it does not count...
Replies
0
Views
63
Hey Everyone, After reading a lot on this forum and elsewhere I see not many are fond of the 1794-VHSC module. I can see to a degree as I was...
Replies
3
Views
154
Hi everyone, this is my first time trying to setup encoder counts and track the traveled distance and speed i am using L27ERM QBFC1B processor...
Replies
12
Views
385
Good day, I have a micro 850 with a 2080-MOT-HSC that is being fed by two flowmeters, Schneider Electric using IMT31's as converters. They are...
Replies
6
Views
458
I'm trying to set up a ring counter - one that transitions from 3599 to 0 (and 0 to 3599 in the reverse direction). My counter insists on...
Replies
2
Views
359
Back
Top Bottom