From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW Interface for Arduino Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Display speed DC Motor from an encoder with aruino

I want to display speed motor(rounds per min) from an encoder. Help. I can't do it  

0 Kudos
Message 1 of 6
(3,952 Views)

You will need to get the following data first:

  • Encoder pulses per revolution (X)
  • Gear Ratio (Direct Drive is 1) (Is RPM for Encoder or wheel rotation?)
  • Max Acquisition speed for either 2 (A & B) or 3 (A, B & Z) inputs
  • Divide Max Acquisition Speed by 4 as each pulse has 4 edges (2A & 2B) that need to be captured with only one edge moving per sample (Z changes are not subject to the same restrictions of A/B changes).  Otherwise it will skip pulses or think it is rotating in the other direction at times reducing/increasing pulse count.  Normal Rotation states are [(A-B-) > (A+B-) > (A+B+) > (A-B+)] then repeat or follow in the inverse order for the other direction.

That will help determine how many pulses can be sampled per second.  Take that number and divide by the number of encoder pulses/revolution.  Now multiply by 60 to get Max RPM available by your system.  As long as you rotate slower than that Max RPM number, you should be able to monitor your RPM. 

Help the Community (and future reviewers) by marking posts as follows:
If it helped - KUDOS
If it answers the issue - SOLUTION
0 Kudos
Message 2 of 6
(3,923 Views)

Can you show me your idea by picture??

I dont understand your idea.

My encoder has 500 Pulses per revolution and it has 3 wire : GND, VCC, Pulse.

Thank so much.

0 Kudos
Message 3 of 6
(3,920 Views)

Are you sure that those are your encoder connections?  There are other 3-wire encoders that use A,B, and Ground in the center.  Pull-ups for proper functionality would be required for these encoders. See the Arduino Forum link here for more information on Arduino and 3 wire encoders.

Arduino forum

Help the Community (and future reviewers) by marking posts as follows:
If it helped - KUDOS
If it answers the issue - SOLUTION
0 Kudos
Message 4 of 6
(3,902 Views)

Yes I know. but i think 1 wire enough to caculate speed of motor encoder. I dont known how to caculate by labview.. I used to do it with MCU.!!

0 Kudos
Message 5 of 6
(3,860 Views)

As long as no pulses are missed and no jitter (back & forth motion) occurs, then the speed is determined as:

  1. <Revolutions/minute> = (Rev/min) = { [ Number of total pulses / (Pulses/Revolution) ] occurring each minute }
  2. <Meters/second> = Dependent on Encoder Mounting
  • Direct Drive ==> { [ (Rev/min) * (Wheel Circumference in meters ] * [ min / (60 seconds] }
  • Geared Drive ==> { (Direct Drive) * [Gear Ratio (Wheel / Encoder) ] }

 

Help the Community (and future reviewers) by marking posts as follows:
If it helped - KUDOS
If it answers the issue - SOLUTION
0 Kudos
Message 6 of 6
(3,857 Views)