Sign in to follow this  
Followers 0
vrbasgrad

INCREMENTAL ENCODER/MICROLOGIC 1500

13 posts in this topic

Hello, Can somebody please give me an tip or quick file on how to convert incremental encoder value 0 to 1000 to SPEED per minute using MIcrologix 1500? Thank You All

Share this post


Link to post
Share on other sites
Get the instruction set reference manual from literature.rockwellautomation.com for a Micrologix 1500, then follow along. You need to interface the encoder to one of the high speed encoder inputs. There are several different drivers and/or wiring styles for encoders so you'll have to figure out which one to use for your particular encoder. Second, you need to periodically read the pulse count. So you need to create an STI file. See chapter 18 on page 272 for how to set up an STI. Essentially, you will pick a time base such as once per second to go read the pulse counts. Remember that the longer you wait, the higher the resolution and the lower the RPM you can actually measure. At the same time waiting longer also makes the system less responsive. The alternative is to trigger on every pulse count and measure the time difference but since this is not the normal way to do this, I'll leave it as an exercise to figure out how to use an event input interrupt to accomplish this. Third, you need to set up the high speed counter. Chapter 5 contains the details on doing this. You can either operate in quadrature mode where you can count in either direction (forward or backwards), or in one direction only. Note that there are several enables and the "set parameters" bits, all of which need to be set up correctly to get the high speed counter to run. So what happens once you have everything set up is that periodically, the STI ladder fires. The STI ladder reads the accumulator (.ACC). The accumulator divided by the time base (in minutes) equals the RPM. Finally, clear the accumulator using the RAC (reset accumulated value) instruction before exitting the STI. For instance, let's say that you have the STI set up to fire once per second. Then the .ACC value will be in counts per second. Multiply by 60 to get counts per minute. However, since you want revolutions per minute and you said the encoder has 1000 pulses per revolution, divide by 1000. So to get to RPM from the pulse count, calculate pulse count * (60/1000) = pulse count * 0.06 for RPM. If you can help it, it is probably a wise move to stay within a 15 bit integer value so the maximum pulse count shouldn't be over 32,767 (for calculation convenience). So given that there are 1000 pulses per revolution and a maximum potential RPM of let's say 1800 RPM, you can calculate that you would have 1800 x 1000 = 1,800,000 pulses per minute, or divide by 60 to get 30,000 pulses per second. So if you set the STI up for one reading per second, there won't be an overflow and the reading will be accurate to within 1800 / 30,000 = 0.06 RPM. By triggering it 10 times per second (every 100 ms), the pulse maximum drops to 3,000 and the accuracy is still within 0.6 RPM.

Share this post


Link to post
Share on other sites
Were the answers here not helpful enough?

Share this post


Link to post
Share on other sites
This sound very optimistic but I am very confused unfortunately!What would it take for you to make some example of this procedure?I just need something to start with I will probably pick up the paste after. Thank you in advance

Share this post


Link to post
Share on other sites
At some point you will ahve to show that you are at least trying the steps shown. Starting from the top of the explenation what have you tried? What is the first thing that you couldn't do or that didn't turn out as you expected? If you try the steps one at a time and give feedback then you will get more help.

Share this post


Link to post
Share on other sites
I don't remember asking you for a help!!!If you don't want to help don't COMMENT on it.

Share this post


Link to post
Share on other sites
I'm sorry my comment was taken that way. I was just trying to say that I think people need information on where in the process you are stuck so they can give more specific help. The outline of the process you noted is good but more detailed help will depend on more specific feedback on which level in this development you ahve achieved. I have used encoders with the high speed counter of the 1500. It just might be best to say something on the order of - "I have the encoder connected and am seeing counts in the high speed counter but am not sure on the next step" or whereever you are.

Share this post


Link to post
Share on other sites
My Apologizes, I am building packaging machines and this is my fourth one and they all have incremental encoder from 0-1000 and flag on I:0/2 that sits on main shaft to reset encoder back to 0. Encoder is used to determent glue length , stitch control, feed position.Everything is hooked up and encoder is working fine. Costumer asked me to add read out on HMI to say Boxes per minutes and I am not really sure how to convert encoder pulses to box per minute. I no, it is probably not that hard but I am very limited on time rite now.Machine has to ship in 2 days and I am still having mechanical issues and that is the reason way I am asking for help otherwise I will probably sit and solve this problem myself but I don't have time. If you can help I will appreciate a lot? Thank you in Advance

Share this post


Link to post
Share on other sites
Ah - now that's excellent information. The case counter on our machine is formed by a timer (1/100 second timebase, preset 6000). The enable is the NC of a oneshot which occurs once per case. On the immediately previous rung I use the following logic: If oneshot AND Timer.ACC > 0 then divide 6000 by timer accumulator. Output is cases per minute updated each case (use a float as the destination of the divide to see decimal portion of the divide also). The test for Timer.ACC greater than 0 is to prevent a divide by zero. If the flow of cases is fairly regular then this is a good indication. Else you may wish to average. Here's the code for three rungs. You'll have to adjust for any items which are already used. XIC I:0.0/2 ONS B3:0/0 OTE B3:0/1 XIC B3:0/1 GRT T4:0.ACC 0 DIV 6000.0 T4:0.ACC F8:0 XIO B3:0/1 TON T4:0 0.01 6000 0 Edited by b_carlton

Share this post


Link to post
Share on other sites
Thank you very much.Everything is working just fine.And I apologize again for my comments before I guess I am bit stress out. If you ever come to Canada you got a self a beer. THX Sasha

Share this post


Link to post
Share on other sites
I was glad to be of assistance. I too get a bit out of sorts when the pressure mounts. No problem.

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