Sign in to follow this  
Followers 0
noxcuses

Encoder Issue

3 posts in this topic

I was working on a project Friday and had something happen that I can't get off my mind (hate when that happens because I think about it all weekend). I'm adding a PLC to an older shaft driven machine to trigger some outputs based on shaft position. I decided on a CompactLogix L23E PLC and a 10-bit single turn absolute grey code encoder. I've done this same type of setup many times in the past with good results. After wiring the encoder into the IQ16F input card, I get 0-1024 as expected when the encoder is rotated. To trigger outputs I use a LIM instruction with a High/Low value going to the output. What is puzzling me is that when I rotated the encoder, the output would flicker when it wasn't supposed to. The output flickers when the encoder reaches 256, 512, and 768. If the LIM instruction was set to Low=550 High=700, the output flickers on at 256, 512, and 768 even though it is outside the LIM range. I can turn the encoder very slow and see the count go up correctly, but the output will still flicker on at those intervals? I've checked the wiring and the Grey code conversion logic and it seems to be correct??? I know this is one of those things that hard to figure out without seeing.. Hope someone has an idea??? Edited by noxcuses

Share this post


Link to post
Share on other sites
Make sure you're copying the 10 bits of data from the Input module tag to a holding tag before executing the Gray code conversion logic. The Copy Synchronous command was created specifically for this sort of application. The Logix platform I/O updates asynchronously to the ladder logic scan, and Gray code conversion logic is notorious for delivering the incorrect value if the source data is updated in the middle of the ladder routine. I'm not saying this is necessarily the issue you're seeing, but I've seen it several times with Logix applications and Gray code.

Share this post


Link to post
Share on other sites
I checked my logic first thing today and noticed I didn't have a Synchronous Copy.. Changed it and problem went away. It's funny how little things like that can sometimes bite you.. Thanks Ken you hit a bullseye on this one!!!!!! Edited by noxcuses

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
Sign in to follow this  
Followers 0