Author Topic: Controlling the speed of a DC motor  (Read 3300 times)

0 Members and 1 Guest are viewing this topic.

Offline engineheatTopic starter

  • Frequent Contributor
  • **
  • Posts: 274
  • Country: us
Controlling the speed of a DC motor
« on: January 12, 2018, 06:07:45 pm »
Hi,

I have a low speed, low torque application that I want to use a DC motor for. Here is a motor that satisfy my size requirement:



It appears to be a brushed DC motor. But the rpm at around 20,000 and that's way too high. I need about 500 to 1000 rpm. Again, the load is very light (close to nothing). To bring down the rpm, I can either use a gear train, or use PWM. I have a few questions:

1. A gear train trades rpm for torque, so if I get 1000 rpm at the output, I get a corresponding multiplier for torque. Is this also true for PWM speed control approach?

2. Is it even possible to bring down the rpm from 20,000 to something like 500 using PWM? That's a super small duty cycle.

3. Can you recommend a general approach for my problem? FYI, I also want to reverse the spin periodically (I guess a H bridge is for this?)

I have been playing around with the 28byj-48 stepper motor lately. I guess I can use a stepper motor but I heard it's not as efficient.

Thanks
 

Offline phil from seattle

  • Super Contributor
  • ***
  • Posts: 1063
  • Country: us
Re: Controlling the speed of a DC motor
« Reply #1 on: January 12, 2018, 07:29:05 pm »
I would definitely use a reduction gear. You can reduce the size of the motor if you do that. PWM does not increase torque.

Yes, HBridge for reversing. gear reduction to get you close to your speed range. PWM for fine control.  I'd also suggest and encoder fro feedback to control the exact speed.  PID is a good way to control speed, btw.
 

Offline Nusa

  • Super Contributor
  • ***
  • Posts: 2418
  • Country: us
Re: Controlling the speed of a DC motor
« Reply #2 on: January 12, 2018, 07:31:52 pm »
The generic answer is change the voltage to change the speed. However, you have to have enough voltage to start the motor in question.

2) Doubtful. You're clearly way outside the limits of that motors design.

3) Find a motor that's intended to operate in the range you desire.
 

Offline oldway

  • Super Contributor
  • ***
  • !
  • Posts: 2172
Re: Controlling the speed of a DC motor
« Reply #3 on: January 12, 2018, 07:58:27 pm »
What's the power supply voltage ? I guess 5V, is it right ?
Choose a 24V motor instead of a 3.6V motor.

What's the precision and stability of the speed you need ?
For high stability, you should use a feedback.
Speed information can be obtained from another dc brushed motor coupled on the same shaft or from an optical or magnetic pulse generator.
 

Offline engineheatTopic starter

  • Frequent Contributor
  • **
  • Posts: 274
  • Country: us
Re: Controlling the speed of a DC motor
« Reply #4 on: January 13, 2018, 04:45:28 pm »
I'd also suggest and encoder fro feedback to control the exact speed.  PID is a good way to control speed, btw.

By “encoder” do you mean a rotary encoder? with the shaft of the rotary encoder coupled to the motor output shaft?

thanks
 

Offline engineheatTopic starter

  • Frequent Contributor
  • **
  • Posts: 274
  • Country: us
Re: Controlling the speed of a DC motor
« Reply #5 on: January 13, 2018, 04:48:29 pm »


3) Find a motor that's intended to operate in the range you desire.

I understand voltage is roughly proportional to rpm, and current is proportional to torque. But what determines the rpm of a motor when there is no load? For example, if the same voltage is applied to 2 different motors under no load, and they have different rpm, what factors influence this? Is the no load rpm similar to terminal velocity in free fall? So theoretically a motor will keep on speeding up until it explodes if there is no friction?

thanks
 

Offline phil from seattle

  • Super Contributor
  • ***
  • Posts: 1063
  • Country: us
Re: Controlling the speed of a DC motor
« Reply #6 on: January 13, 2018, 08:42:22 pm »
yes, rotary encoder.
 

Online Zero999

  • Super Contributor
  • ***
  • Posts: 20363
  • Country: gb
  • 0999
Re: Controlling the speed of a DC motor
« Reply #7 on: January 13, 2018, 08:46:22 pm »


3) Find a motor that's intended to operate in the range you desire.

I understand voltage is roughly proportional to rpm, and current is proportional to torque. But what determines the rpm of a motor when there is no load? For example, if the same voltage is applied to 2 different motors under no load, and they have different rpm, what factors influence this? Is the no load rpm similar to terminal velocity in free fall? So theoretically a motor will keep on speeding up until it explodes if there is no friction?

thanks
It depends on the voltage generated by the motor, when its shaft is rotated at a certain speed. For example, if a motor generates 1V, when its shaft is spun at 1000rpm, then it will rotate at 12 000rpm when connected to a 12V supply.

The strength of the magnets and number of turns on the armature, determine the voltage generated. More turns and weaker magnet will result in lower speeds per volt.

The torque depends on the current. Stronger magnets and more turns result in greater torque, although there's a limit to the number of turns for a given armature size and thinner wire, results in greater power dissipation, thus limiting the maximum allowable current.

Stronger magnets result in a higher efficiency motor, because fewer turns are required for the same speed, so the wire gauge can be thicker.

Higher voltage motors, use thinner wire and more turns, given everything else remaining equal.
 

Offline Paul Price

  • Super Contributor
  • ***
  • Posts: 1433
Re: Controlling the speed of a DC motor
« Reply #8 on: January 14, 2018, 12:17:38 am »
If the load is light enough, you can get just about any speed you want out of the motors you've bought using pwm, but some feedback from the motor will let you set and hold any speed steady. but for any speed, a certain precisely set PWM value will hold the lightly loaded motor at a fixed speed, even without feedback control. You just have to find out what that PWM value is by playing with PWM values.

I've taken a round piece of stiff plastic and using a black felt pen, spaced 8 or more evenly spaced  black stripes across the diameter of this disc and then placed it on the motor shaft as close to the housing as practical. No, using a LED and a photodector LED I was able to generate pulses that clearly show the speed. I salvaged the rotary encoder from a discarded printer(it had two of them).

Since I know a thing or two about MCU's, I was able to create the PWM waveform to drive the motor using a MOSFET in series with the return (Neg Terminal) of the motor. The MCU was very easy to program to be able set the PWM waveform to drive the MOSFET. I was able to know the speed of the motor from the rotary encoder.

The real issue is to get the motor to start from a stalled non-rotating condition. Then PWM will easily do the rest with a very light load.

The idea is simple, you first determine the startup voltage of the motor and apply this voltage for the time it takes for the motor to start, then reduce or set the correct PWM to control the voltage (in series with the motor) to keep it at the desired RPM.

Not so clever with MCU's? You can use a LM555 chip to easily create a PWM to control your motor. The PWM chip can then control a MOSFET or a darlington transistor to control your motor. Lots of circuits like this posted on this website.

You can even just use a SPDT relay to switch betweena starting voltage and  a desired speed set voltage.

Stable operation at the slowest of RPM might be a problem(<5 RPS), but you won't know this for sure until you try it!
« Last Edit: January 14, 2018, 12:26:11 am by Paul Price »
 

Offline VanitarNordic

  • Frequent Contributor
  • **
  • Posts: 277
  • Country: 00
Re: Controlling the speed of a DC motor
« Reply #9 on: July 17, 2019, 12:15:36 pm »
Try this circuit. it looks like that it is completely built and tested with PCB

 

Offline David Hess

  • Super Contributor
  • ***
  • Posts: 17428
  • Country: us
  • DavidH
Re: Controlling the speed of a DC motor
« Reply #10 on: July 18, 2019, 01:36:19 am »
PWM will not allow trading speed for torque any more than lowering the voltage will.

The motor accelerates to the point where the back EMF plus the voltage drop through the windings is equal to the input voltage.  Since the current is proportional to the torque, so is the voltage drop across the windings.

There are a couple of other ways to regulate the speed:

1. Periodically disconnect the motor and measure the back EMF to get the speed.  This can be done as part of the PWM cycle.  A completely analog design can do this using a sample-and-hold circuit.

2. Since the motor's winding resistance is effectively in series, give the driver a negative resistance characteristic.  The voltage drop across the winding resistance is proportional to current so increase the drive voltage as the current goes up to cancel it out.
 

Offline pepelevamp

  • Regular Contributor
  • *
  • Posts: 101
  • Country: nz
Re: Controlling the speed of a DC motor
« Reply #11 on: July 20, 2019, 02:40:07 am »
they say 20,000rpm at 3 volts, but you want 500rpm.
20,000/500 = 40. you need 1/40th duty cycle, or 6.4/256. maybe round it up to 7 out of 256 to get 540rpm.

seems well within reason to use a PWM.
do you have more than one motor? do they have to go at different speeds or can they all roll the same speed?

theres probably some cool motor-controller IC chips around with lots of options. i'd be keen on that.


 

Offline planet12

  • Regular Contributor
  • *
  • Posts: 83
  • Country: nz
Re: Controlling the speed of a DC motor
« Reply #12 on: July 20, 2019, 04:03:57 am »
1. Periodically disconnect the motor and measure the back EMF to get the speed.  This can be done as part of the PWM cycle.  A completely analog design can do this using a sample-and-hold circuit.

I can confirm this method works quite well. I used it with FreeRTOS on an ATMega328P, pausing PWM 50 times a second and taking several samples with the ADC, and using that to control a PID loop. This makes for a very simple hardware setup; a MOSFET for the motor, some fast diodes to clamp back-EMF spikes, and an RC filter on the ADC input to keep as much noise out as I could.

The ADC measurements will still be very noisy - depending what the brushes/back-EMF are doing, you could be reading zero, the back-EMF, or VCC+diode drop - or something in-between.

What I found to work well in the end was to take a number of samples, sort them, then take the median (NOT the mean/average). This removes the outliers from the mix, and gave me a stable speed with quick response to changing load. I'm taking 15 ADC samples - this was empirically determined with the speed range and motor I was using once everything was put together - you want to sample enough over a long enough period so that your median value is useful).
 

Offline Mechatrommer

  • Super Contributor
  • ***
  • Posts: 11714
  • Country: my
  • reassessing directives...
Re: Controlling the speed of a DC motor
« Reply #13 on: July 20, 2019, 12:33:18 pm »
i know this is nearly a 2 years old thread, some member already got banned in the process, and the OP probably already found a solution to his problem, but fwiw and to be concise to what he was asking...

1. A gear train trades rpm for torque, so if I get 1000 rpm at the output, I get a corresponding multiplier for torque. Is this also true for PWM speed control approach?
no you wont get torque multiplier with PWM.. gear train will convert power received from battery between torque and speed, but with PWM, you are reducing battery power in the first place, so no torque nor speed increase achieved by reducing battery (input) power.

2. Is it even possible to bring down the rpm from 20,000 to something like 500 using PWM? That's a super small duty cycle.
possibly... with tuning a trimpot with the right tongue angle, beside changing PWM % duty cycle, changing PWM frequency or increasing period is another way to further reduce power to motor hence slower RPM is achievable. but once load is changed, RPM will change dramatically and you'll need to adjust again with tongue at different angle. load is not necessary what you have put to the motor, but things like bearing friction, contact resistance etc or even diminishing battery power (voltage) will change the motor operation in load vs power chart.

3. Can you recommend a general approach for my problem? FYI, I also want to reverse the spin periodically (I guess a H bridge is for this?)
while others have suggested other method such as EMF monitoring, those open loop control like the above manual trimpot control will still subject to RPM changes, another problem is if you want for accurate positional control which open loop control methods are poor in achieving. one proven method is using encoders for closed loop control, coupled with control algorithm SW to achieve desired speed, acceleration and position.

and yes, if you want reverse direction, H-bridge is common and the better known way after manual mechanical switches..

btw, its going to be fun playing with this built-in encoder motor.. china provided us with cheap solution such as ...
https://www.ebay.com/itm/130-Motor-DC6V-12V-7800RPM-Metal-Speed-Encoder-Tachometer-Motor-AB-Phase/192486576192?epid=18003843567&hash=item2cd1181040:g:hKUAAOSw5k1cdyBy

motor with built in gear train also available at cheap, bless to them for providing to hobby engineering community... may they find the true path...
https://www.ebay.com/itm/Silver-40RPM-DC-1-5V-6V-Small-Micro-Metal-Geared-Box-Electric-High-Torque-Motor/222858882418?hash=item33e36cad72:g:HxkAAOSw~~xalWy4

before this, there was/is brand name system that cant be afforded from west or germany iirc... i bought several version of these china motors incl the bigger one and had a little moment playing with them before going into another directive... until i come back to this again. cheers...
Nature: Evolution and the Illusion of Randomness (Stephen L. Talbott): Its now indisputable that... organisms “expertise” contextualizes its genome, and its nonsense to say that these powers are under the control of the genome being contextualized - Barbara McClintock
 

Offline pepelevamp

  • Regular Contributor
  • *
  • Posts: 101
  • Country: nz
Re: Controlling the speed of a DC motor
« Reply #14 on: July 23, 2019, 10:56:52 am »
What I found to work well in the end was to take a number of samples, sort them, then take the median (NOT the mean/average). This removes the outliers from the mix, and gave me a stable speed with quick response to changing load. I'm taking 15 ADC samples - this was empirically determined with the speed range and motor I was using once everything was put together - you want to sample enough over a long enough period so that your median value is useful).
hahaaa dude thats actually pretty clever. with regards to the median - did you count each ADC value once and then look for the median value?
 

Offline planet12

  • Regular Contributor
  • *
  • Posts: 83
  • Country: nz
Re: Controlling the speed of a DC motor
« Reply #15 on: August 05, 2019, 05:48:06 am »
What I found to work well in the end was to take a number of samples, sort them, then take the median (NOT the mean/average). This removes the outliers from the mix, and gave me a stable speed with quick response to changing load. I'm taking 15 ADC samples - this was empirically determined with the speed range and motor I was using once everything was put together - you want to sample enough over a long enough period so that your median value is useful).
hahaaa dude thats actually pretty clever. with regards to the median - did you count each ADC value once and then look for the median value?

I just looked at the code to remind myself.

I disabled the motor PWM, then took 15 successive samples into a uint16_t array. Once completed, I qsort'ed them and used the middle of the array - adc_readings[7] - and fed that into the PID, then re-enabled PWM using the new motor setting from the PID code.

In retrospect, I could probably have hooked up the scope and figured out a reasonable settling time instead, but this seemed to work well. I suspect I only had my old 1960's analogue scope at the time, rather than my shiny DSO - t'was almost a decade ago now  :D
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf