0%

Encoder

1. Intro

Usage

  1. Active, can be used as motor controller, like a physical button to tell the system how much speed/volume you want
  2. Passive, can be used as a motor sensor, reading the rotation of a motor, can be further calculated as angular speed

image-20221206215355653

2. Usage

Typically, the encoder on a motor would have 4 channel,

  • VCC: in general, 5V
  • GND: ground
  • ChA and ChB, two channel of the encoder that output PWM
  • two channel can be used at same time to determine the direction of motor
  • In reality, only ONE channel is enough since the direction is controlled by the controller (us)

3. Resolution

Resolution need to be known to calculate the speed

3.1. PPR

Pulses Per Revolution

Describe the number of high pulse an encoder will have over a single revolution

image-20221207215312381

3.2. CPR

Counts Per Revolution

image-20221207215255380

4. Datasheet

image-20221207233224754

Gearbox output shaft shows 751.8, but when I rotate the wheel for a revolution, the encoder increased by around 180, what’s wrong?

  • There are two channel A/B

  • Each square wave would have two pulse (although only one is rising)

  • So 751.8/4=187.95, that’s right :white_check_mark:

Ref