LPC1769 QEI rpm measurement

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

LPC1769 QEI rpm measurement

499 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Shoaib on Tue Aug 05 12:58:59 MST 2014
Hi everyone,

I was trying to implement a basic code for rpm measurement but came across a couple of problems.

1)  I am connecting a DC motor to the power supply and measuring the rpm values in my code. The rpm values are reducing for higher supply voltages. If the power supply is 10 V the rpm value is around 180 and for 15V it reduces to 90.
2) Moreover the measured rpm is alternating between two values. For example for 10V supply i receive 180 and 220 as the rpm values.

Thanks!

Original Attachment has been moved to: New%20Text%20Document_0.txt.zip

Original Attachment has been moved to: New%20Text%20Document_0.txt.zip

Original Attachment has been moved to: New%20Text%20Document_0.txt.zip

Original Attachment has been moved to: New%20Text%20Document_0.txt.zip

Original Attachment has been moved to: New%20Text%20Document_0.txt.zip

Original Attachment has been moved to: New%20Text%20Document_0.txt.zip

Labels (1)
0 Kudos
2 Replies

413 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Shoaib on Wed Aug 06 07:39:27 MST 2014
Thanks a lot starblue! It worked when i changed the order of the multiplication.
Great find!
0 Kudos

413 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by starblue on Wed Aug 06 00:42:22 MST 2014
Probably your computation is overflowing.  (120000000/8) * n * 60 is n time 900 million, so for n >= 5 it overflows a 32 bit unsigned int.
0 Kudos