Sign in to follow this  
Followers 0
osmirnov

High Speed Machinery

17 posts in this topic

Hi ALL! I need to put together 9 bit AB 845G-F3G8HC0360R Absolute Encoder and AB 1746-ITV16 Fast Speed Input Card. I was asked to create a Die Protection System on a punch press. Meantime the press is using Omron Crank Positioner which has only 8 relays. First of all I need to get to know the actual position of the Crank Shaft from 0-360 Degree. I'm looking for a sample of RSLogix 500 converting program from Gray Code into Binary. Thanks a lot for any help!!!

Share this post


Link to post
Share on other sites
Check for the GCD instruction (Micrologix 1200 and 1500 processors according to the instruction help but setting to a micrologix 1100 it seems to accept it).

Share this post


Link to post
Share on other sites
Thanks But GCD instruction is not avaiable for SLC 5/04 processor so I have to do it in my PLC code.

Share this post


Link to post
Share on other sites
This assumes input on slot 1 and output to N7:0 - adjust as necessary Zero N7:0 before you start the conversion to ensure that the upper bits are off. 1st rung - XIC I:1.0/8 OTE N7:0/8 2nd rung - BST XIC I:1.0/7 XIO N7:0/8 NXB XIO I:1.0/7 XIC N7:0/8 BND OTE N7:0/7 The subsequent rungs (3 - 9) will be like rung 2 - the addresses are all shifted down 1 bit. In general, the MSB is preserved. Each following input bit is XORed with the previous CONVERTED bit. So it has to be a sequential process like this, a total of 9 rungs. There's no simple math trick to do this. But - since you mention a 9 bit encoder and 0-360 degrees (actually 0-359 degrees) then the result of the above conversion IS NOT 0 - 359. The encoder is probably an "Excess 76" type. You must take the final result (N7:0), subtract 76 from it, then save that value. If you are curious as to why this is - it is a subject for a whole other thread. Edited by b_carlton

Share this post


Link to post
Share on other sites
Thanks a lot! I think I got. Another question. How can I set 0 in the encoder or I have manually turn the encoder untill it muches the position of the crank?

Share this post


Link to post
Share on other sites
Your last line - I take it you mean "matches" - is the preferred method. Otherwise you could create an offset in your ladder. Then after the previous conversion add: BST ADD N7:0 N7:1 N7:2 NXB GRT N7:2 359 SUB N7:2 359 N7:2 NXB LES N7:2 0 ADD N7:2 359 N7:2 BND The offset value is in N7:1, the shifted encoder reading ends up in N7:2 Edit - I've modified the code for offsets both plus and minus. Edited by b_carlton

Share this post


Link to post
Share on other sites
Thanks again and again! It's all clear now. Done.

Share this post


Link to post
Share on other sites
osmirnov I always used a TBD sensor to verify position accuracy. The following is not what you asked about. They are just some of the gotchyus. What happens if the encoder fails mid-stroke? What are you going to have for safety? Please don't say (1) SLC 5/04. What type of press? How many SPM? Will you be using a multi turn system? One part that was often overlooked in OEM controls is what happens when the 2 part Clutch / Brake system is not timed correctly? At QDS the counterbalance pulls the ram/ side up when it should be going down or at QSU the ram falls when it should be raising? Bernie what is the 76

Share this post


Link to post
Share on other sites
Hi Jak, Thanks for your reply. I know exactly what you saying, but I’m not building a PRESS CONTROL with a dual channel safety system, brake compensation… All I need to build is just a programmable Die Protection System and wire to the Stop of the press. This is an old 135T press, there's only a Motor ON/OFF PB, speed adjust, lube fault and Omron Crank Positioner which is used for the Die Protection. We received a Die from our customer with a lot of sensors on it. Why SLC 5/04? Because, I already have it on the shelf. All I need is an absolute encoder and Fast Input card.

Share this post


Link to post
Share on other sites
Once a person gets the idea of Gray Code encoders under their belt they tend to think that any Gray Code encoder must have a count of a power of 2. But any even value can be setup in Gray Code. Let's take 360 (as in degrees). We take the next higher power of 2 number which is 512. This is 9 bits. If you were to have a chart of all the codes for a 512 step Gray Code encoder you'll notice the neat symetry if you don't count the MSB. What we do is use the middle 360 codes. You'll notice that the 2 endpoints (180 each way from the middle) differ only by the MSB so you can wrap from one to the other, still preserving the feature of Gray Codes in only one bit changing. Using the middle 360 codes you'll notice that '0' is actually at number 76 (256 'half of 512' - 180 'half of 360'). All the numbers are shifted up by 76. Therefore, when the 9 bit Gray Code is converted we merely subtract 76 to get the 0-359 representation of the degree.

Share this post


Link to post
Share on other sites
Is that correct?

Share this post


Link to post
Share on other sites
The instruction is correct, though the raw converted result from the 9 bit Gray Code encoder should never be less than 76. it might be better to use a seperate N register for each of Raw Gray Code (actually that's the input word itself), the converted encoder reading and the reading minus 76. This will help to troubleshoot any problems. Aftyer that you can apply the offset (if you use a software offset) as discussed a few posts back. Just in case this is getting confusing let's review: Input bits (Gray Code) -> conversion logic -> Converted value Converted Value -> minus 76 -> Encoder value (0 - 359) Encoder Value -> plus/minus offset (if used) -> Offset Encoder reading

Share this post


Link to post
Share on other sites
Thanks a lot, it's all clear to me.

Share this post


Link to post
Share on other sites
Another question. At our plant we use NPN sensors for Die Protection. From time to time we get Dies from out customers with PNP sensors. Then I have two choices: 1. I can install a relay to convert NPN signal from a sensor into PNP. 2. To replace a PNP sensor with NPN. Is there any thing, any device which I can install between a sensor signal and input card so it will automatically convert PNP signal into NPN and if it’s a NPN signal just let it go thru. I can do it with two relays per sensor but they are not reliable. And the biggest problem- operator has to remember to select on the PanelView PNP or NPN sensor. I hope I’m not asking to much.

Share this post


Link to post
Share on other sites
How about using one of these Turck connectors when you need PNP/NPN conversion and substituting compatible inline straight-through connectors when you don't need the conversion.

Share this post


Link to post
Share on other sites
This converter can help but not to solve the problem. I need to install something so an operator can plug any type of sensor without thinking.

Share this post


Link to post
Share on other sites
Pressroom Electronics makes a die protection module for around 2 grand. Will operate on a press that runs over 200 SPM. Comes with resolver and can be set up with quite a few inputs. Hard deal to beat.

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