slaw_dawg

1756-HSC using material sensor Z channel

10 posts in this topic

Greetings,

I have been banging my head for a while now trying to figure out how to get this 1756-HSC card to do what I assumed it would do. I am hoping somebody else out there with more experience has accomplished what I am trying to do either with logic or the hsc card configuration and can help shed some light on a solution.

Configuration: I am using a high speed (10us response) sensor wired to the Z channel input. A & B channels are wired to their respective channels on the card. The card sees all channels as it should. Encoder resolution is 1024 ppr.

Configuration is in encoder 4x mode, rollover is 32768, preset it 0, scalar is 0.

high speed sensor is set to dark operate supplying the output from the sensor when the light beam is broken by product.

The problem: I am trying to accumulate the counts only while z channel is high (the sensor sees product). I want to take the accumulated value in stored value, multiply by ppi, and and divide it by product width to get a piece count.

Accumulated counts would be reset to 0, when a downstream prox goes high

However, I cannot for the life of me figure out how to configure the channel in the HSC module properties to achieve this effect (accumulated counts while z channel is high). I am not sure this is even possible using the 4 storage modes in the HSC configuration.

I would do this in logic, but i am pretty sure it would be too inaccurate due to scan times and product speed.

Any ideas are much appreciated!

Share this post


Link to post
Share on other sites

The Z channel is only used for the registration signal on the encoder that is turned on once per rotation. You can't use it any other way. You'll have to wire the enabling input to the PLC and use it to turn on/off the channel enable bit that is part of the tag structure for the HSC card.

Share this post


Link to post
Share on other sites

JRoss, 

 

Thanks for your reply, unfortunately there is no channel enable bit in the tag structure.

I tried using the reset counter bit, but the results are still too inconsistent. 

Share this post


Link to post
Share on other sites

Ah, I was thinking the CompactLogix version, and you're using the ControlLogix version. What is inconsistent about using the reset bit? Can you post your code?

Share this post


Link to post
Share on other sites

Sure thing, give me a few minutes to clean and comment the logic up. Thanks again for your help

Share this post


Link to post
Share on other sites

Sorry for the delay in getting this, I had something come up that needed my attention. Attached is a PDF of the routine.

bar_counter.pdf

What is inconsistent is the number of counts I am seeing. I understand that there will be a little variance but it should be very close each time it counts a new layer.

 

Sketch.png

Edited by slaw_dawg
added analysis screenshot

Share this post


Link to post
Share on other sites

Your PDF doesn't show the calculation for Bars_Current_Layer_Int. This implies that the connection is over an RIO network. I wonder if the update rates versus the scan times (asynchronous to each other) may be giving a lot of the inconsistency.

Edited by b_carlton

Share this post


Link to post
Share on other sites

Bars_Current_Layer_Int is simply a DINT tag, I am only moving the Real into the DINT tag to round the value, it is only possible to have a whole number of bars

Scan time on the program is 2ms.

RPI on the is hsc card is 2ms and the en2f is 1ms

Share this post


Link to post
Share on other sites

OK, so now that I'm looking at the manual for that card, I see what you're talking about. Here's what I think should work. In the counter configuration, set the storage mode to Store and Reset, Wait and Start. Then check the box for "Invert Z Value". This should reset the present value when no product present (sensor low, so Z is high), allow it to accumulate when product is present (sensor high, so Z is low), and store the present value (product length) when the product clears the sensor (sensor low, so Z is high).

 

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now