How do I drive a DC motor at a low frequency?

Dear all,

I am trying to drive a 23.5V DC motor at 6 RPM using a MOSFET and the PWM pin of the Arduino Uno.

I converted RPM to Hertz by using the following formula:

1 RPM = 1/60 Hz

therefore, 6 RPM = 6/60 Hz = 0.1Hz.

Is it possible to run a 23.5V DC motor at such a low frequency of 0.1Hz?

I am using the following code from Adafruit but it does not work. When I lower the PWM signal to 5 (out of 255) the motor stops completely. At a PWM signal of 6, the motor runs but definitely not at 6 RPM.

/*
Adafruit Arduino - Lesson 13. DC Motor
*/
 
 
int motorPin = 9;
 
void setup() 
{ 
  pinMode(motorPin, OUTPUT);                                                                                                                                                                           
  Serial.begin(9600);
  while (! Serial);
  Serial.println("Speed 0 to 255");
} 
 
 
void loop() 
{ 
  if (Serial.available())
  {
    int speed = Serial.parseInt();
    if (speed >= 0 && speed <= 255)
    {
      analogWrite(motorPin, speed);
    }
  }
}

Please find the file attached which contains my circuit diagram.

Any kind of help will be much appreciated.

Kind regards,

Deadman

Motor require enough power to overcome internal friction in order to run at all.
It sounds like yours won't do what you want, so consider using gears.

This motor?

A motor with a nominal output speed of 3000 rpm?

No. You are going to want to run it at a much higher speed and use use a several gear reductions to get down to the output speed you want.

The only way to do that is turn it into a servo motor by adding an encoder and
making a control PID loop... You'll have to derate the motor too, as without the
internal fan spinning fast it won't handle as much current.

Do you mean an external gear? If so, could you recommend any please?

Kind regards,

Deadman

MarkT:
The only way to do that is turn it into a servo motor by adding an encoder and
making a control PID loop... You'll have to derate the motor too, as without the
internal fan spinning fast it won't handle as much current.

I should have stated this from the start but my 23.5V DC motor is already integrated with a optical incremental encoder.

Could you tell me or provide me with sources that can help me make a control PID loop with the Arduino?

Also, what do you mean by 'derate the motor'?

Kind regards,

Deadman

I want to drive the motor from 0° to 360° in clockwise direction only and at 6 RPM.

Kind regards,

Deadman

I mean static 6RPM is so slow that PID control seems overkill. You could take the encoder signal and wait for it to hit 360 deg, cut power and the overshoot would be so minimal you wouldn't even notice it.

I would contact the manufacturers of your motor, and get their recommendations on gear reducers. If you can get 25:1 & 20:1 ratio boxes then that's your 3000:6 right there. You run the motor at it's optimal speed of 3000, the output shaft runs at 6 and use the encoder feedback to very simply tell you when you reach your destination.

Deadman:
I should have stated this from the start but my 23.5V DC motor is already integrated with a optical incremental encoder.

Could you tell me or provide me with sources that can help me make a control PID loop with the Arduino?

Have you looked at PID control example (in the playground I think)? You basically
implement a feedback loop driven by the error in position (desired_position - actual_position)

Also, what do you mean by 'derate the motor'?

If its 10A (for example), call it say 5A instead - derate it because its not being cooled.

Kind regards,

Deadman

MarkT:
Have you looked at PID control example (in the playground I think)? You basically
implement a feedback loop driven by the error in position (desired_position - actual_position)

If its 10A (for example), call it say 5A instead - derate it because its not being cooled.

I'll have a look at PID control.

Also, will adjusting the Arduino frequency make any difference to the speed of the motor?

Kind regards,

Deadman

Deadman:
Also, will adjusting the Arduino frequency make any difference to the speed of the motor?

The Arduino clock frequency or PWM frequency? The PWM frequency needs to be reasonable,
the Arduino system clock is irrelevant (upto a point)

Hi,
What is the application of the motor, what are you trying to accomplish?

Tom... :slight_smile:

TomGeorge:
Hi,
What is the application of the motor, what are you trying to accomplish?

Tom... :slight_smile:

My aim is to drive a DC pancake motor (integrated with an encoder) in continuous clockwise rotation at 6 RPM using an Arduino Uno if possible.

The following link is of the specification of the DC motor:

http://docs-europe.electrocomponents.com/webdocs/0dc0/0900766b80dc0c02.pdf

Kind regards,

Deadman

MarkT:
The Arduino clock frequency or PWM frequency? The PWM frequency needs to be reasonable,
the Arduino system clock is irrelevant (upto a point)

The PWM frequency, will it make any difference to the speed of the motor?

Kind regards,

Deadman

ApexM0Eng:
I mean static 6RPM is so slow that PID control seems overkill. You could take the encoder signal and wait for it to hit 360 deg, cut power and the overshoot would be so minimal you wouldn't even notice it.

I would contact the manufacturers of your motor, and get their recommendations on gear reducers. If you can get 25:1 & 20:1 ratio boxes then that's your 3000:6 right there. You run the motor at it's optimal speed of 3000, the output shaft runs at 6 and use the encoder feedback to very simply tell you when you reach your destination.

Do you mean something like this?

Kind regards,

Deadman

With such a small motor you could likely get away with a 500:1 ratio box, I think.
But I don't think the one you linked is even compatible with your 10mmØ shaft, and flange PCD.

Like I said, if you contact the manufacturers of your motor, they will give you their recommendations for gearboxes to use. Often you can even describe your application and their engineers will give advise on how to complete it. You can then go through your local suppliers for pricing afterwords.

You can't use the PWM for your application. The PWM works at a frequency about 490hz.

You can switch an output pin at any speed you want tho.

If you are not in love with that motor, you may look at stepping motors.

6rpm, is 1 revolution ever 10 seconds. How smooth do you need this? Can it run once ever 10 seconds for one revolution, or how about once ever minute with 6 revolutions ?

How accurate do you need it, If it was 9rpm, or 4 rpm, would that work?

Hi,

Have you checked the drive units that are used in microwave ovens?

Tom..... :slight_smile:

Your right, the Arduino PWM only operates at 490 Hz, regardless of the speed of the output pin.

I am using the following code from Adafruit. When I lower the PWM signal to 5 (out of 255) the motor stops completely. At a PWM signal of 6, the motor runs but definitely not at 6 RPM, the motor also make a whining noise.

/*
Adafruit Arduino - Lesson 13. DC Motor
*/
 
 
int motorPin = 9;
 
void setup() 
{ 
  pinMode(motorPin, OUTPUT);                                                                                                                                                                           
  Serial.begin(9600);
  while (! Serial);
  Serial.println("Speed 0 to 255");
} 
 
 
void loop() 
{ 
  if (Serial.available())
  {
    int speed = Serial.parseInt();
    if (speed >= 0 && speed <= 255)
    {
      analogWrite(motorPin, speed);
    }
  }
}

I just want it to run at around 6 RPM at a smooth and continuous speed until the shaft of the motor has turned from 0° to 360° or over.

Anything below 10 RPM would be fine.

Kind regards,

Deadman

TomGeorge:
Hi,

Have you checked the drive units that are used in microwave ovens?

Tom..... :slight_smile:

That a good suggestion because motors in microwave oven run at around 5/6 RPM.

Do you mean a circuit diagram for the motor driver in a microwave oven?

Kind regards,

Deadman