Motor Voltage Drops

Hi,

I am using the Pololu motor “100:1 Metal Gearmotor 37Dx73L mm 12V with 64 CPR Encoder (Helical Pinion)” with a power source of around 12V (3 of the XTAR 14500 1200mAh 3.7V Protected 2.8A Lithium Ion (Li-ion)). After applying power to the motor with no load, I noticed there are voltage fluctuations where the voltage drops at a certain point of every revolution. This was tested using a multimeter and with the encoder through a USB oscilloscope revealing the period of the square wave changing.

Q: Is this expected for this motor to do this?

Thanks,
Matthew

Hello, Matthew.

Your description of the problem is not entirely clear to me. Could you post more details about your setup and how your multimeter and oscilloscope are connected? Are you just connecting the motor outputs directly to a battery or do you have other electronics involved (such as a motor driver)?

Also, could you post pictures of your setup that show all of your connections? If you think it would help, a video showing the problem might also be good.

Brandon

Hi Brandon,

Below KiCad schematic represents my setup in terms of the I/O connections.

TEST CASE 1: L298N Motor Controller
The multimeter probes are connected to motor power and gnd coming from the L298N.
Expected: voltage is constant throughout.
Actual: voltage is fluctuating. In the video below, you can hear the difference of the motor speeding up and slowing down.

Source code steps

  1. Supply PWM value (hard coded to 100 out of 255) to signal MOT_A_EN_PWM.
  2. Set Motor logic pins to allow movement

Videos
Test_Case_1_Multimeter, Test_Case_1_Oscilloscope_Encoder

TEST CASE 2: Power Supply straight to the Motor
Bypassing the L298N and plugging the power supply directly to the motor. I don’t have a multimeter video for this one, but it was 11.1V fluctuating with 11.2V (mostly 11.1V though).

Video
Test_Case_2_Oscilloscope_Encoder

SOURCE CODE

/**********/
/* MACROS */
/**********/
#define FALSE    0
#define TRUE     1

#define FORWARD     1
#define BACKWARD    0

/* Motor A */
#define PIN_POS_MOT_A_LOG_IN_1      5U
#define PIN_POS_MOT_A_LOG_IN_2      7U
#define PIN_POS_MOT_A_EN_PWM        6U
#define PIN_POS_MOT_A_ENC_A         2U
#define PIN_POS_MOT_A_ENC_B         3U

/**************/
/* DATA TYPES */
/**************/
typedef uint8_t U8;
typedef uint16_t U16;
typedef uint32_t U32;
typedef int8_t S8;
typedef int16_t S16;
typedef int32_t S32;

/*********************/
/* FUNC DECLARATIONS */
/*********************/
void Get_Encoder_Val(void);
void Set_Motor(U8 param_dir, U8 param_pwm);

/*************/
/* VARIABLES */
/*************/
volatile S32 Mot_A_Pos; /* Enc_A_Read_Val */
static U8 Mot_A_Enc_B;

void setup(void)
{
    Serial.begin(9600);
    while(Serial == FALSE);

    pinMode(PIN_POS_MOT_A_LOG_IN_1, OUTPUT);
    pinMode(PIN_POS_MOT_A_LOG_IN_2, OUTPUT);
    pinMode(PIN_POS_MOT_A_EN_PWM, OUTPUT);
    pinMode(PIN_POS_MOT_A_ENC_A, INPUT);
    pinMode(PIN_POS_MOT_A_ENC_B, INPUT);

    attachInterrupt(digitalPinToInterrupt(PIN_POS_MOT_A_ENC_A), Get_EncoderA, RISING);
}

void loop(void)
{
    Set_Motor(FORWARD, 100);
    
    Serial.print("Mot_A_Enc_B: ");
    Serial.print(Mot_A_Enc_B);
    Serial.print("\t\t");
    Serial.print("Mot_A_Pos: ");
    Serial.println(Mot_A_Pos);
}

/* ISR */
void Get_EncoderA(void)
{
    Mot_A_Enc_B = digitalRead(PIN_POS_MOT_A_ENC_B);

    if (Mot_A_Enc_B > 0)
    {
        Mot_A_Pos++;  
    }
    else
    {
        Mot_A_Pos--;
    }
}

void Set_Motor(U8 param_dir, U8 param_pwm)
{
    analogWrite(PIN_POS_MOT_A_EN_pwm, param_pwm);

    if (param_dir == FORWARD)
    {
        digitalWrite(PIN_POS_MOT_A_LOG_IN_1, HIGH);
        digitalWrite(PIN_POS_MOT_A_LOG_IN_2, LOW);
    }
    else if (param_dir == BACKWARD)
    {
        digitalWrite(PIN_POS_MOT_A_LOG_IN_1, LOW);
        digitalWrite(PIN_POS_MOT_A_LOG_IN_2, HIGH);
    }
    else
    {
        digitalWrite(PIN_POS_MOT_A_LOG_IN_1, LOW);
        digitalWrite(PIN_POS_MOT_A_LOG_IN_2, LOW);
    }
}

I would not expect that behavior from the ancient, extremely inefficient L298N driver. It is a completely inappropriate choice for that motor. For one, the L298N is limited to 2A maximum and the start/stall current of that motor is estimated to be 5.5A, so the driver may be overheating and going into thermal shutdown.

Keep in mind that the stall current is briefly drawn every time a brushed DC motor shaft starts rotating.

Best to use a modern, appropriately chosen MOSFET-based motor driver. (I have no affiliation with Pololu).