09-09-2015 08:53 PM
I took the codes for Quadrature Encoder from the GPIC reference guide (LabView 2014) and put it to test. I wasn't able to get correct results. It appears to me that the position measurement might be correct but the speed (RPM) measurement is way off. It read ~87rpm for a machine running at ~1200rpm. I have posted screen shots of the codes. I would appreciate it if someone could take a look and help me figure out the problem.
I put 100000 for clock divider and got dt = 200000 ticks (as expected). I then took the position counter value from the "quadrature encoder dX method" subVI and multiplied it with 60 / ( (CPR*4) * (2e6*25e-9) ) = 0.12 (CPR = 2500). Due to the data type the factor becomes 0.1199951171875.
I can provide more information on the codes if needed...
09-10-2015 11:49 AM
The way in which quadrature encoder vendors specify counts per revolution (CPR) is often inconsistent. Some specify the equivalent resolution achieved after decoding, which is 4X the number of counts per revolution of an individual phase, i.e. phase A, phase B. Others specify the number of counts per revolution of each individual phase.
My guess is that in your case they are specifying the latter, so the equivalent CPR value for the scaling factors of the quadrature decoder IP is 2,500*4 = 10,000 CPR.
Based on that, let's calculate the velocity scaling factor, which is (1/dT)*(1/(CPR*4))*(60)).
Encoder dT [ticks] = 200,000
That means, for every velocity update, 200,000 FPGA clock ticks at 40 MHz have occured. Therefore,
dT = 200,000 / 40e6 = 0.005 s
So, the velocity scaling factor is the following,
Velocity Scaling = (1/dT)*(1/(CPR*4))*(60)) = (1/0.005)*(1/(10,000*4))*(60)) = 0.3
Based on the ratio to the scaling factor you had, you would get a velocity measurement of 1305 RPM (0.3/0.02*87) based on this new scaling factor.
Let us know if that does the trick.
10-20-2015 09:19 AM
BMac,
Actually 1.2 instead of 0.12 did the trick for me.
But I ran into some RPM resolution issue with the dX method and I've decided to go with the dT method. This has solved my problem.
Thanks for your feedback.