Thumbnail

Wheel Encoder Counter

Compatible with firmware that counts wheel rotation for left and right wheels with wheel encoder.

+ How To Add This Control To Your Project (Click to Expand)
  1. Make sure you have the latest version of ARC installed.
  2. Select the Get button in this page to download the archive file.
  3. Double click the downloaded archive file to execute installer.
  4. The installer will add this control to ARC.
  5. Load ARC and press the Project -> Add Control button from the menu.
  6. Choose the Navigation category tab.
  7. Press the Wheel Encoder Counter icon to add the control to your project.

Manual

This control is compatible with firmware that counts wheel rotation for left and right wheels. You can see how this plugin was created by watching my live hack event here: https://synthiam.com/HackEvent/Dj-s-5th-Live-Hack-Session-17578



The Wheel Encoder UNO firmware can be found here: https://synthiam.com/Hardware/Hardware/Arduino-Genuino-Uno-17527

Connect your wheel encoders to port D2 (left wheel) and D3 (right wheel) on the UNO. There will be 2 EZ-Script variables created that hold the wheel encoder values for each wheel, respectively ($LeftWheelCount & $RightWheelCount).

There are ControlCommand() to reset the values, or force get the values on demand rather than automatic on a timer.

#2   — Edited
It was a post several years back about motors and wheel encoders.
I believe ToyMaker and Dave were discussing it.
Toymaker had motors with 64000 clicks for just one wheel revolution.

How many clicks per/revolution do you think a Arduino can handle?
If this makes any sense.
Synthiam
#3   — Edited
That seems quite high - of 64,000 ticks per rotation. The firmware associated with this plugin counts with an unsigned 16bit integer, so the maximum count is 65535 per wheel. It would be easy to change to 32bit unsigned integer, which the maximum count would be 4,294,967,295 ticks

To see how i made the firmware and plugin, watch this live hack event here: https://synthiam.com/HackEvent/Dj-s-5th-Live-Hack-Session-17578
#4   — Edited
Unable to find the answer to this, so here it is to you guys.
I have no experience encoders.

Motor add:
This gear motor is a powerful 12V brushed DC motor with a 131.25:1 metal gearbox and an integrated quadrature encoder that provides a resolution of 64 counts per revolution of the motor shaft, which corresponds to 8400 counts per revolution of the gearbox’s output shaft.

Since the encoder is on the back of the motor shaft does it only read the 64 counts per revolution?
How can you tell, with accuracy what the counts per revolution is at the gearbox's output shaft?

Hope this is clear?
Synthiam
#5  
Yah - you answered yourself in the question :). The shaft on the motor spins 131.25 times per 1 revolution of the output wheel shaft. Therefore if it’s 64 counts in a motor shaft revolution, you multiple 64 by 131.25 to get 8400. So if you used this arduino firmware, every 8400 counts is one wheel rotation.
#6  
I understood all that.
BUT (lol)
The encoder reads the main shaft rotation (at rear) not the output shaft rotation.
How does the encoder know where, lets say, count/click 8399 is at?


Does this make sense?
Synthiam
#7  
The encoder doesn't - you can't easily use an encoder as a servo, if that's what you're asking. If you're attempting to use a wheel encoded motor as a servo, you'd need to first initialize the position and start counting from there.

Are you asking to use a encoded motor as a servo?

Because an encoded motor is designed for odometry.. just like your car. To count the number of wheel rotations so you can increase the confidence of how far your robot has traveled for navigation purposes.
#8   — Edited
Understood



You said "To count the number of wheel rotations so you can increase the confidence of how far your robot has traveled for navigation purposes."
So as I understand, if it counts the number of clicks, say 32, we know that the motor has turned half way around.

Then why would I care anything about 8400 COUNTS at the OUTPUT shaft?

It seems to me the only important number here is the counts per rotation of the rear shaft.

MMMM I'm starting to even confuse myself here ... lol.
Synthiam
#9   — Edited
8400 counts is the wheel turning 1 complete rotation. 4200 counts is the wheel turning half a rotation.

If your wheel radius of your wheel is 10cm, then 8400 counts would be 10 cm of travel.

16800 counts would be 20cm of travel