Micrologix 1400 Encoder equation

Christoph

Member
Join Date
Sep 2003
Location
Indiana
Posts
345
Hey All!

Using the HSC:0 for an unwind. Not high speed or anything.
50 PPR at fastest 800 FPM.using this math
pulse count per second / 50 the ppr * 60 for seconds = rpm
When I look at the data and do the math by hand it is right on
But letting it do the math in a cpt block it is really off.
Any Ideas?
 
Hey All!

Using the HSC:0 for an unwind. Not high speed or anything.
50 PPR at fastest 800 FPM.using this math
pulse count per second / 50 the ppr * 60 for seconds = rpm
When I look at the data and do the math by hand it is right on
But letting it do the math in a cpt block it is really off.
Any Ideas?


Give examples of the numbers that are off.



Is the [pulse count per second i.e. Hz] a 16-bit unsigned INT or a 32-bit LONG?


Try putting the Hz value in a float and go from there.


Try reversing the /50 and the *60, or use parens to enforce the intended order of operations, or just multiply by 1.2 (= (1/50) * 60)
 
The pulse count was a Long and I changed it to an Integer, no affect.
I already use parenthesis in the equation (Hz|50)*60=
I have found this processor does not seem to like just a digital value in an equation
but would rather have a data type with the value entered in the data table
I will try your suggestions in a little while.
 
Can you give an example e.g.
At an a measured or controlled 90RPM, the HSC measures a rate of 75 pulses per second i.e. ppr=75Hz, but the compute instruction that evaluates (ppr/50)*60 gives an answer of 62.5RPM.
Also, can you attach your code (.RSS in a .ZIP) to a post?
 
If staying in integer format then executing the multiplication before the division will help avoid loss of precision. (PPR * 60)/50


Just ensure that PPR*60 does not produce an out of range (over 32767) result.
 
If staying in integer format then executing the multiplication before the division will help avoid loss of precision. (PPR * 60)/50


Just ensure that PPR*60 does not produce an out of range (over 32767) result.




Of course.


Were the "really off" results always a multiple of 60?
 

Similar Topics

Hello everybody.. I am new as programmer. I got a project in which i have to control some mechanical cams. I have micrologix 1400 1766-L32BXB and...
Replies
1
Views
2,687
Hi All, Need some help regarding MicroLogix 1400 HSC, Can I use Omron Encoder : E6B2-CWZ6C 600P/R... I badly need help.. Thank you very...
Replies
12
Views
4,331
I have a machine I am upgrading and would like to use an encoder to keep track of machine position. My problem is I had already ordered a A/C...
Replies
6
Views
6,610
Hey guys! Been awhile since I visited. Been out of it for a bit. Good to be logged in again. I have a MicroLogix 1400 Series A PLC with a...
Replies
0
Views
3,273
I'm using a SLC typed write from the ControlLogix5572 to the MicroLogix 1400, with path: 2, (MicroLogix IP). The ControlLogix equipment has a...
Replies
0
Views
57
Back
Top Bottom