I am working on a project that requires me to calculate both speed and position of a DC motor. I am using an Arduino Uno, TB6612FNG driver and a 34:1 6V HP gear motor 48 CPR. I am trying to read the pulses and design the project using Simulink.
The motor used is Motor. According to the documentation of the motor, I should be receiving 12 pulses per revolution ( only reading channel A). However, when I try to read the pulses using an Arduino digital input block (pin 4) connected to a scope, I'm only receiving around 4 pulses per second which is well below what I'd expect.
I'm not quite sure if I've configured something incorrectly or I am misinterpreting the scope, but I'm hoping for some clarification or a reason to why this may be the case.
let me know if anymore information is required that i may have missed.
You have misunderstood that encoder. Please post a link to its datasheet.
Quadrature encoders use 2 channels of pulstrain being shifted 90 degrees. You need to use both channels.
Can You post schematics of Your test setup, and the code used?
You say You get 4 pulses per second. That doesn't tell much. What is the speed of the motor?
Check pulses per revolution instead.