1
\$\begingroup\$

I'm trying to drive a small DC motor with a PWM with the circuit below, where I'm using a TIL111 optocoupler and a IRF510N MOSFET. The PWM (50% duty cycle) is generated by a MCU STM32F103C8T6, the +3.3V source comes from this MCU and the +5V source is another one.

enter image description here

The motor drives, but the waveform over the motor looks like the one below (sorry for my oscilloscope). The image isn't clear but what happens is that this output have some waves (resembling coil discharging waves) when it should be off, or 0V (the ON semi-period is working ok). Since I have a +5V source and a 50% duty PWM, I should measure 2.5V over the motor, but, with this signal, I'm measuring 3.55V.

enter image description here

If I remove the motor and put some 120 ohm resistor in its place, I can visualize the correct waveform below. I also verified the waveform over the opto and over the MOSFET's gate, and it's working fine (with or without the motor).

enter image description here

I'm using this dummy dc motor below, but I have tested with other two dummy motors and having the same result. Actually, I tried to drive these motors with a TIP before, using a similar circuit; that time, I changed pretty much all the components (TIPs, resistors, diodes, motors, protoboards) and I still ended with this same result. If someone could tell me some tip about why I'm having this behavior, I would be grateful.

enter image description here

\$\endgroup\$
2
\$\begingroup\$

It would be more illuminating if you trigger your oscilloscope off of FET gate -- that should be a cleaner signal.

What's happening is that the circuit will push current into the motor, but it won't pull it out. So when the FET is on, if the motor is spinning any slower than it's no-load speed with 5V applied, the motor will speed up. When the FET is off, the motor will coast along, generating a voltage proportional to its speed. Because the system is lossy, the motor isn't spinning quite fast enough to generate 5V -- but it's pretty close to it. You're reading the average of 5V and whatever the motor generates as it's coasting.

\$\endgroup\$
  • \$\begingroup\$ So what should I modify in the circuit to get this right? \$\endgroup\$ – Marcos Monteiro Oct 19 '18 at 15:43
  • \$\begingroup\$ If by "right" you mean you want the motor to be driven by a PWM that follows your input PWM, then you need a half-bridge driver in place of the 1N4007 and IRF510. That gets complicated (the easiest "analogish" way to do it with that opto-coupler in there involves finding a gate driver that prevents shoot-through, and all of those that I know of need a 10-12V supply). If by "right" you mean holding the average motor voltage to some commanded value, then it can be done with even MORE analog circuitry while keeping your final drive stage -- but again, that opto-coupler complicates things. \$\endgroup\$ – TimWescott Oct 19 '18 at 15:57
  • \$\begingroup\$ So what is "right"? \$\endgroup\$ – TimWescott Oct 19 '18 at 15:57
  • \$\begingroup\$ It is the first option, I guess I'll just use a H-bridge. I tried to use a single MOSFET because I have seen this circuit sometimes on the internet, but after what you said I realized that it really wouldn't work the way I wanted, since the motor coil current can't keep flowing. Thanks man! \$\endgroup\$ – Marcos Monteiro Oct 19 '18 at 16:41

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.