8
\$\begingroup\$

I have a very small DC motor (from a Walkman), I would like to control the speed from a micro-controller. For that I would like to connect a MOSFET in series and apply a PWM signal to its gate in order to change the speed of the motor.

I have measured the motor's L & R = 4.7mH, 11.5Ohm (Tao 0.41msec).

From running a few experiments with the motor using a bench power supply I can see that it runs well from a voltage of 0.2V up to somewhere around 0.4V - that is all the range I require.

The power supply I have for this is set to 1.8V (used for the digital part of the circuit) so this makes using standard MOSFETs a bit difficult because I can not supply the voltage required for the gate saturation. I bought a few P-channel MOSFETs like this.

So even though I would have thought this setup would work (Vcc -> motor -> FET -> GND) I can't seem to get good resolution over the control and I don't get as much torque from the motor as I used to get when ran from a DC power supply.

I am not sure what freq. I should be using and not sure what other parameters need to be checked in order to make this work as intended. Any help on this will be appreciated.

* UPDATE * Following Olin's answer I have built the circuit he suggested. I have used a 2N3904 transistor, 180Ohm resistor paralleled with a 4.7nF cap. Attached is the collector voltage when running from PWM code 100 (out of 256). Vcc is 1.8V.

enter image description here

\$\endgroup\$
  • 1
    \$\begingroup\$ why not use a BJT instead - its a small motor and you'll easily get a 0.6V signal to turn it on. \$\endgroup\$ – JIm Dearden May 29 '15 at 10:58
  • \$\begingroup\$ @JImDearden I tried some 2N5088 I had around but the voltage drop across the transistor was so big that almost no voltage was applied to the motor so it just hummed and did not move. \$\endgroup\$ – user34920 May 29 '15 at 11:02
  • 1
    \$\begingroup\$ Try a switching transistor like the 2N3904 with a 1k base resistor. Also you'll need a flyback diode on the motor with that much inductance and over-voltage. 1kHz should be okay for the PWM. \$\endgroup\$ – Jon May 29 '15 at 11:26
8
\$\begingroup\$

The simplest solution would be to use a low side NPN switch:

You say the motor DC resistance is 11.5 Ω, so the maximum current it can draw is 1.8 V / 11.5 Ω = 160 mA. Actually the transistor will eat up a few 100 mV lowering the maximum possible current, so this is a safe maximum to design to. Figure the transistor is good for a gain of 50 minimum, so we need at least 160 mA / 50 = 3.2 mA base current. 5 mA is then a good target to make sure the transistor is solidly saturated when on. Figure the B-E drop to be 700 mV, so that leaves 1.1 V across the resistor when on. 1.1 V / 5 mA = 220 Ω.

C1 is there to speed up the turn-on and turn-off. (220 Ω)(4.7 nF) = 1 µs, which is the C1-R1 time constant.

The PWM frequency should be fast enough so that the current thru the motor changes little each on and off phase. The ripple caused by the PWM is a AC voltage superimposed on the average DC voltage. Only the DC voltage goes to moving the motor. The AC component causes no torque, only heat, so you want to keep it low relative to the DC. Generally you run motors a bit above the human hearing limit, which is also usually fast enough to keep the AC component small. At 25 kHz, for example, the PWM period is 40 µs, which should give you plenty of resolution from any reasonable PWM peripheral in a microcontroller.

Added in response to collector scope trace

The basic shape of the waveform looks good, so it appears the transistor is switching properly and the voltage is being applied across the motor properly.

The spikes at turn-off are worrisome. They could possibly be scope artifacts, but if your scope trace is accurate, then the diode is not working or not connected properly. The spikes shouldn't be more than a volt or so above the supply.

D1 not only keeps the transistor from getting fried, but it preserves much of the motor current during the off time. The first is necessary, and the second increases efficiency.

Added 2

Looking more closely at your scope trace, I see that the collector voltage when the motor is off is 2.48 V. You say the supply is 1.8 V, so that makes the off voltage 680 mV above the supply. That means you did not build the circuit as I said. You obviously used a ordinary silicon diode, probably a slow one like a 1N400x. The slow turn on time of the diode explains the voltage spike, and reduces overall drive levels a bit at a specific PWM duty cycle. It will also cause shoot-thru for a time when the transistor is turned on again, since the diode is still conducting. A Schottky diode will have lower forward drop and effectively instant reverse recovery in the context of this circuit.

The system should still generally work, but try with a Schottky diode like I specified.

\$\endgroup\$
  • \$\begingroup\$ I've actually assembled this circuit right now. PWM freq. is about 31KHz. I used a 2N3904 transistor with a 180 Ohm resistor to the base and 4.7nF speed-up cap. I have 8bit PWM resolution from my MCU. At about code 100 (out of 256) I can see the motor starts to spin. Any thoughts about how to increase the resolution? Perhaps adding some DC offset to the base? I would also want to point out that the motors runs with code 100, however it runs a bit faster than the min. speed I require. I can not lower the PWM code as it will stop. \$\endgroup\$ – user34920 May 29 '15 at 12:04
  • \$\begingroup\$ thanks Olin for the nice answer. would you elaborate on the choice of C1? You speak of the time constant, I understand it should be about 1/10 of the switching period, but I would expect C1 size alone should matter for turn on/off time as it provides some "instant" charge. \$\endgroup\$ – Vladimir Cravero May 29 '15 at 12:10
  • 1
    \$\begingroup\$ @vlad: Dumping extra charge into the base at turn on, and sucking out some of the free carriers on turn off are both short-term events. They probably last only a few 100 ns after each edge. You want the time constant a bit longer than that, but also short enough so that the cap "resets" before the next edge. 1 us seemed like a good compromise, but a lot of factors can matter that are hard to predict. I'd start with the values shown, then look at the waveforms and adjust if needed. \$\endgroup\$ – Olin Lathrop May 29 '15 at 12:42
  • \$\begingroup\$ @user: Take a look at the collector waveform. Maybe things aren't happening as intended. What does the motor do with a varying DC voltage? Is there a voltage where it starts but then doesn't go too fast once going? \$\endgroup\$ – Olin Lathrop May 29 '15 at 12:44
  • \$\begingroup\$ @OlinLathrop I added a photo of the collector waveform (this measurment is taken across the transistor's C-E). When using a DC supply the motor starts spinning at 0.2V and that speed is the one I would like as minimum (about 50-60 RPM). \$\endgroup\$ – user34920 May 29 '15 at 12:51
0
\$\begingroup\$

Let's assume you have basic experience with microcontrollers and can build a circuit.

The most straight forward way to drive the motor is using H-bridge, current sense resistor and PWM. Basically H-bridge will allow using 3.3V or 5V,whatever is most convenient.

In fact, depending on application you may even skip the current control, probably you will not cause any damage even if the motor will be stalled.

By the way, do you need speed or position control, of any?

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.