Sign in to follow this  
Followers 0
Harrison

RPM Calculations on a MircoLogix 1100

15 posts in this topic

I need some help with some programing to calculate the RPM of an object to use in a PID control. I am using a MicroLogix 1100 PLC in this project. The setup for the rpm detection is a single reflector and detector wired into one of the high speed inputs of the controller. I need to calculate the RPM that the cylinder is turning at and the use that data to go into a PID to control the speed of the a motor. The motor is controlled by a 0-10 VDC analog output to a speed controller. I am unsure as to how to quickly calculate the current rpm so that is gives me useful data for the PID. Any suggestions or ideas would be greatly appreciated.

Share this post


Link to post
Share on other sites
The range will be anywhere between 50 to 100 rpm. We will be running several different speeds on the machine and the size of the cylinder will change slightly between products. Edited by Harrison

Share this post


Link to post
Share on other sites
I would not use the High Speed Counter for this, but rather use the Discrete Input Interrupt and the free-running clock of the controller. The DII (you can set up four of them, I think) triggers a specific ladder logic subroutine. Each time that input goes from false to true, have the routine that the DII triggers calculate the difference between the S:4 clock's current value and its previous value. That will tell you the number of 10-microsecond 'ticks' between inputs. From that value, you can calculate revolutions per minute. This is all from memory... you will need to verify exactly what time interval is represented by a single count in the free-running clock on a MicroLogix 1100.

Share this post


Link to post
Share on other sites
Where is the reflector/detector mounted? It sounds like you'll only get one pulse per revolution, which translates to 1-2 pulses per second. This is pretty slow, which is why using an interrupt and free-running clock makes sense.

Share this post


Link to post
Share on other sites
I looked at the instruction help and found an IID and an IIE for input interrupts but is said that the instructions only worked in the SLC 5 controllers. Would it work to trigger a move off the input and then compare it to the previous move and calculate the time-passed between the two? Or would the time it takes to execute the instructions skew the results?

Share this post


Link to post
Share on other sites
This would be controlled through the EII Function File (on the left hand side). Go to the help file for information.

Share this post


Link to post
Share on other sites
I was able to find the EII and the help file for it. I have to say the help file was almost useless. It said what each part was but not how to use them. Do you know of anywhere i can find program examples and more information on how to properly use the EII function file? I haven't used this part of the PLC before. Edited by Harrison

Share this post


Link to post
Share on other sites
Page 272 of http://literature.rockwellautomation.com/idc/groups/literature/documents/rm/1763-rm001_-en-p.pdf

Share this post


Link to post
Share on other sites
Thank you. None of the manuals i had downloaded had this information in it.

Share this post


Link to post
Share on other sites
Usually device specific AB/RA literature manuals come in two "flavors", The User Manual and the Reference Manual. User Manuals address the installation, setup and troubleshooting while the Reference Manuals explain in detail the actual functionality of the devices.

Share this post


Link to post
Share on other sites
Dear Harrison, I am attaching a speed measuring routing for low speeds. I use the method of measuring the time it takes to perform a single revolution so you have to activate a digital input every revolution. I use this routine to display a packing machine speed which goes from 12 to 120 cycles per minute. It is probably not as fast and accurate as you may wish but it works really fine for me. Anyway, it gives you a good idea of how to proceed and you may make it better or simply use a different approach. Hope this helps Bye chantecler (I apologize for my as-a-second-language English) P.S.: I utilize a ML 1200 instead of a ML 1100 because my emulator does not support the last one. LSM.RSS Edited by chantecler

Share this post


Link to post
Share on other sites
Thank you dmargineau for the link to the manual and information about the different types of manuals. And thank you chantecler for the sample program code. Between the two sources of information I have been able to write the program that is needed for the machine.

Share this post


Link to post
Share on other sites
You will all be happy to know that Harrison wrote a really well designed program and I gave him an A. edit - j/k. I know Harrison and had to rib him. Edited by TConnolly
1 person likes this

Share this post


Link to post
Share on other sites

So, I'm dredging up this thread to ask a follow on question.  I'm a newbie on the PLC front so is using S:4 clock the same as using a millisecond timer to determining the time per pulse, only more accurate?

 

Thanks

 

Mike

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