AB HSCE Counter Linear Overflow Setup - Help!

OneShot

Member
Join Date
Sep 2011
Location
Illinois
Posts
13
I've been coming to this forum for several years finding answers to PLC questions I've had, however I now have a question of my own I can't seem to figure out. Hoping you guys can help me out. Here's what I'm working with, SLC 5/05 with an HSCE card. I've got an AGV that travels back and forth across the floor in a strait line between several production lines, loads finished product off the lines, then brings them all back to a common main line which finishes them and sends them out to the warehouse. I am retrofitting it with a magnetic ring encoder attached to a wheel on the bottom which rides along the ground to get the position. I've got the encoder hooked up to my HSCE card and counting, kind of... That's where I need a little help programming, as I haven't had to program one of these cards before. My issue is my encoder counts 1950 pulses per every 18 inches, however I need it to travel about 80 feet, which would be 960 inches, which is 104,000 pulses. The HSCE card will only count to 32,767. I need to figure out some way to overflow my HSCE count into maybe a Floating Point to accumulate my counts so I can travel the whole line accurately.
What I've currently tried was setting the counter type to Ring Counter with the rollover count set to 29,250, however when the count hits 29,250 it just resets the count and starts over. I also tried setting the counter type to Linear Counter with the Reset Value set to 29,250, then when it runs up to that value it 0's out the count and latches the Overflow/Underflow bit as well as the Critical Error bit then I can't figure out how to unlatch them and get it back to counting again. What I'm trying to do I wouldn't think should be too tricky to setup, I just can't figure it out, and hoping one of you guys has seen this before and can help me out. Another kicker is it travels both ways, so I need to add to my main value as the AGV moves forward, then subtract the value as it moves back to the main line. Thanks in advance!! :)
 
Okay, actually, a float might work here, but you need to handle the counter differently.

First, let the counter just count, make sure it is bidirectional, and leave the rollover at default (32767 IIRC). That way, it will go from 0 to 32767, then to -32768 and back to 0 (going forward).

Now, put in a rung, that is scanned every scan, and what you want is like in the picture.

N9:0 is the raw value in from the HSCE module
N9:1 is the last scan raw value
N9:2 is the difference between scans

F8:0 is the total accumulated count
F8:1 is your actual current position in inches
F8:2 is the counts to inches calibration.

Note that if the platform supported it, a long integer (4 byte) would be better to use for F8:0, but you will not run out of mantissa bits in this application, so the float is okay.

Oh, while I'm at it, you can preset any particular position simply by writing the desired value to F8:0, or set home (zero) by clearing it.

CTR_Delta.jpg
 
Thanks!
But I still don't understand how I would accumulate a count above 32,767 in my total distance traveled. I understand I can use a floating point for a bigger integer value, but when my HSCE count gets to 32767 it will fault out. I was thinking maybe there was a way so when it hit 32767 it would set an "overflow" bit then reset the count to 0 and then continue the count over again. So when the "overflow" bit latched I would add a 1 into a counter and then just multiply 32767 by that accumulated value, move that into a floating point, and that would be my total accumulated distance. Then on the contrary when the count counted backwards to 0 it would latch an "underflow" bit which would just subtract 1 from the total counter. The thing is, I can't figure out how to get that sort overflow/underflow bits, and when I have the counter type set to linear instead of ring, as soon as it hits either extreme it just faults the HSCE card out with bit I:e/10 and I:e/13. I know which way the AGV is traveling, so if the overflow and underflow bit come on on either extreme I can just use that bit to add or subtract my rollover count value depending on the direction it is traveling. Hopefully this isn't confusing. Thanks! :)
 
Can this be modified for a ring counter. I have a print register that has a 100ppr encoder mounted on the motor. Through the gearbox it give 50,000 pulses for 1 rotation of the cylinder. I wan to piggyback the encoder to give readout on the operator panel. I could change to 50ppr to stay in range with the 1746 HSCE but the OEM has it scaled through their little readout on the section. I used the z pulse to give me 500 pules for one cylinder revolution but would like more resolution.

hope some one still looks at this I know its an older post
 

Similar Topics

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
362
I have used the 1746 HSCE several times and always move the last position count back to M0:e.34 on a power up with a first pass bit. I have...
Replies
1
Views
1,417
I have a 502 processor 1747 -- L524 with four K. memory in a seven slot rack.. I'm trying to configure a 1746 HSCE high-speed counter module...
Replies
12
Views
13,264
Hello, Problem:The accumlator value in the counter card freezes when my encoder wheel spins beyond 4.5K Hz. Ofcourse the rate would be 0 at that...
Replies
5
Views
2,291
I had a 1746-HSCE go suspected bad. have to swap the card in the morning. Other than dip switch settings is there any configuration to do?
Replies
1
Views
1,028
Back
Top Bottom