HP 12V 25D Gearmotor Heavy Jitter / Steps

Hi everyone-

I recently purchased several of these motors (https://www.pololu.com/product/4840), hoping to be able to use them in a project. The encoder attached to the motor is able to do 48 counts per revolution (which I was able to get with my arduino), but the motor itself seems to be stepping in a far coarser manner when unpowered. It feels like a very rough stepper motor, despite being a DC motor. Is this something that can be fixed? I need to be able to have a minimal angle change of 14 degrees, which should be possible with the encoder, but the motor pulls the output shaft into its coarser step. Please help!!!

Other info: I’m using a motor driver (https://www.pololu.com/product/2997) with a 12V supply and plenty of amperage available.

Hello.

It sounds like you are trying to do position control with the HP 12V Motor with 48 CPR Encoder for 25D mm Metal Gearmotors and TB9051FTG Single Brushed DC Motor Driver Carrier. Can you post your entire code here? Can you elaborate what you mean by the DC motor roughly stepping when unpowered? Can you please provide more details on your setup and what devices you are using (e.g. power supply and microcontroller)? Posting a video showing the behavior would be helpful.

- Amanda

I’ll be able to post a video in a few hours. Essentially, when we try to move the motor shaft without power, there is a lot of resistance, and it feels like there are steps within the motor, rather than a smooth continuous turning motion. The same happens when it is powered, preventing us from using the encoder for position control because the motor doesn’t run at low speed (sending a PWM signal only activates the motor when the signal is over 40 (out of 255)).

The power supply is 12V 1A, and the microcontroller is an Arduino Mega. I feel like if you grabbed one of these motors off the inventory shelf and tried turning the shaft, you’d know exactly what we mean. Thanks!

The code I’m using is below:

#include <Encoder.h>

const int ENABLE = 4 ;
const int PWM1    = 5 ;
const int PWM2    = 6 ;
const int LED    = 13 ;
const int ENCODERA = 2 ;
const int ENCODERB = 3 ;
int power = 0;

]Encoder myEnc(ENCODERA, ENCODERB);
int target = 0 ;

void setup() {
  Serial.begin(115200);

  pinMode ( ENABLE , OUTPUT ) ;
  pinMode ( PWM1 , OUTPUT ) ;
  pinMode ( PWM2 , OUTPUT ) ;
  pinMode ( LED , OUTPUT ) ;

  while ( !Serial.available() ) {
  }

  target = Serial.parseInt() ;
  Serial.print ( "Sending to " ) ;
  Serial.println ( target  ) ;
  delay ( 1000 ) ;
}

long oldPosition  = 0;

void loop() {

  long newPosition = myEnc.read();
  if (newPosition != oldPosition) {
    oldPosition = newPosition;
  }

  float band = 3 ; // 5% band
  int k = 5 ;
  int minPower = 40 ;

  if ( abs ( newPosition - target ) < ( band  ) ) {
    digitalWrite ( ENABLE , HIGH ) ;
    analogWrite ( PWM1 , 0 ) ; //+cw +ccw
    analogWrite ( PWM2 , 0 ) ;  //-cw +ccw
  } else {
    if ( newPosition < ( target  ) ) {
      power = constrain(abs( newPosition - target ), minPower , 255) ;
      digitalWrite ( ENABLE , HIGH ) ;
      analogWrite ( PWM1 , 0 ) ;
      analogWrite ( PWM2 , power ) ;
    } else if ( newPosition > ( target  ) ) {
      power = constrain(abs( newPosition  ), minPower , 255) ;
      digitalWrite ( ENABLE , HIGH ) ;
      analogWrite ( PWM1 , power ) ;
      analogWrite ( PWM2 , 0 ) ;
    }
    else {
      power = 0;
      analogWrite ( PWM1, 0 );
      analogWrite ( PWM2, 0 );
    }
  }
  Serial.println ( newPosition ) ;
}

It sounds like you might just be referring to the cogging torque of the motor, which is a normal property of DC motors. You can find more information on the “Cogging torque” Wikipedia page. High-power motors like the one you have use extra strong magnets, which results in stronger cogging torque. If you can use a lower-power version, the cogging torque will be less, and you can reduce the effect of it on the output by adding a gearbox.

Out of curiosity, did you consider a stepper motor for your application, or does it need to be a brushed DC motor?

- Amanda