4
\$\begingroup\$

In a student lab project, we tried to drive a DC motor from FAULHABER Schöneich 2230V024S (148) and a reductor 81:1 22B (298) 2-16V L=35uH, see the 024S variant in the datasheet, consuming about 600mA at 12V during normal operation (driving a pendulum). We soldered the Schottky diode SB260 (=SR260) 2A/60V directly across the leads of the motor as a flyback bypass.

We use a PWM signal from the uC (Arduino uno) powered through its USB connection to a hub and a Raspberry Pi-3. This is a very common and largely discussed setup with an N-MOSFET as a low-end switch, and I didn't expect any caveats. However, since the ground of Pi3+hub+uC is isolated, I decided to add an optocoupler, which seems to be also a very commonly used solution (see the figure below from https://bestengineeringprojects.com/interfacing-optocoupler-with-arduino/, cf EE.SE question MOSFET switch using an optocoupler),
arduino optocoupler interfacing and scope connections arduino-optocoupler-interfacing-osc-768x435.png

Available also as a breakout board from Robotdyn with IRF540N (and an external flyback Schottky diode, see its supposed schematics on https://forum.arduino.cc/t/mosfet-power-module-and-optocoupler/508996). We have tried both of them. Our power is taken from a stabilized 12V lab voltage source, and our R2=R3=R4=1K. As an additional test load, we use a brushless 12V PC fan. In further tests, we replaced the uC with a square signal from a function generator at 470 Hz allowing duty cycles from 15 to 85% (nb: the standard Arduino library call uses a PWM frequency of 490Hz). Our scope is attached at the gate (channel 1) and the drain (channel 2) as shown in the schematics below.  n-MOSFETswZ.png showing our circuit with different loads In all cases, we ended up with similar observations illustrated below. no load (LED only) no load (LED only) PWM-GBF-470-0load.png resistive load (brushless fan) resistive load (brushless fan) PWM-gbf-470-Rload.png resistive + motor resistive + motor PWM-gbf-470-LRload.png motor only motor only PWM-gbf-470-Lload.png

All works as expected for resistive loads: when the gate is high (5V), the FET closes (i.e., lets the current flow from its drain to the source), and channel 2 drops to 0 (ground). However, when the motor (= inductive, or more correctly -inertial, see the answers) load is added in parallel, things go south, and driving the motor alone (last picture) turns into a disaster: For some reason, despite the flyback diode, the voltage at the drain is low as if the FET remained almost totally closed, even when our gate is kept at 0V!? I cannot see exactly why.

With an additional ohmic load (second last figure), the FET appears sort of half-closed. The voltage at the drain (ch 2) during off time also depends on the duty cycle: 15% duty cycle, Vgs=6V (pwm-gbf-470-15duty-Lload.png 15% duty cycle, Vgs=6V, motor only). The FET appears to open more for shorter cycles as if something gets saturated during longer cycles (the two last plots differ in their duty cycles).

Question(s):

  1. Explain this circuit and the case of the function generator (Note 1).

  2. Suspecting that what we have is not a bug but a feature, i.e., this is how things are supposed to run, how can we achieve our goal of controlling the speed of that motor in a most simple and adequate fashion? Can our setup be salvaged somehow through some few additional elements or another circuit/strategy imposed?

In this context, let me recapitulate our situation:

  • we want to use our uC (Arduino) for one-directional speed control of a small classic permanent magnet DC motor operating between 0 (preferably, or 5) and 12V (optionally, up to 15) and consuming around 100-500mA.

  • The motor is almost freewheeling unopposed, i.e., mechanical resistance (load) is very low, and braking, if necessary, should occur through other means.

  • Furthermore, while the 81:1 gearbox reduces the speeds to around 50 rpm, the motor itself runs at 4000 and has significant kinetic energy and back-EMF.

  • uC-wise, the most direct and frequently used output at our disposal is the 5V PWM with frequencies from about 500 and up to 10kHz and 8-10 bit duty cycle resolutions.

  • thinking of potential future use of these setups by students, we prefer to isolate the signal side (uC and computer) through an optocoupler.

  • for the same reason, despite that in the lab, we do have easy access to stabilized positive and negative rail DC power, we like to keep the supply as simple as a small 12-24V 2A DC adapter.

  • we are, obviously, not electrical/electronic engineers ...


Note 1: The motor+diode can be driven happily with a 470Hz PWM Vpp=10V signal supplied directly from the amplified function generator without any intermediate circuit. Also, we tried the circuit at higher PWM frequencies with similar results, but the capacitance of the optocoupler or gate (? visible in the pictures, channel 1) becomes more of an issue in that case. In view of the answer by @Bravale, the following test may be interesting.scope trace showing PWM directly from the amplified function generator and the current through the amperemeter to the groundpwm-gbf-470-Lload-GBF-circuit.png. Here we added a benchtop amperemeter in the true-rms AC mode with shunt resistance of about 0.1 to 10 Ohm between the motor and the ground. The impedance of the function generator amplifier is 1 Ohm; the DMM reading is around 80mA. Unlike in the MOSFET circuit, the motor here remains connected to the mains for all times, and the current (Ch 2) flows during both the duty cycle (+10V on Ch 1) and the "off-duty" period (0V on Ch 1). In the latter case, the EMF from the motor (see @Bravale's answer) seem to discharge in the amplifier?

Note 2: Taking another motor+reductor of the same model, connecting the digital multimeter (DMM) to that motor's leads, and turning it by hand, we can observe EMFs of +/- 5 to 7V DC, depending on the rotation sense and speed. Both senses feel similarly. This seems to agree with the datasheet: that motor alone does max 8000rpm at 24V which is reduced to 100rpm. Our motor is equipped additionally with the snubber diode soldered across its leads. That makes directions (and leads) differ: with DMM's COM at the anode of the snubber ("anode lead"), turning in one direction is easy and produces +5..7V, while the opposite direction is sensibly impeded and produces -100..-300mV. The latter seems to be the voltage drop on the SR260 diode: according to its datasheet, its max forward voltage drop can be 0.7V at 2A, suggesting 200mV at 600mA, which is the typical current that we observe when running this motor+reductor at ~50rpm (so that the motor itself does 4000rpm). The motor is connected to our circuit (in parallel with the LED in the drawing) so that the "anode lead" is at the drain (channel 2 point) and the "cathode lead" is at the Vin=+12V. The "easy" direction of rotation, is the direction in which the motor normally turns when powered up (through PWM, when the FET closes).

Note 3: Following the advice by @D.A.S., we raised the voltage at the gate (Vgs) to 10V by putting R3=1k and R2=220ohm. This, however, seems to produce little difference, from the plot below to the last one before notes.15% duty cycle, Vgs=10V, motor only (15% duty cycle, motor only *73duty10V-Lload.png). The phenomenon of the FET appearing more fully "closed" for longer duty cycles persists:33% duty cycle, motor only (33% duty cycle, motor only *33duty10V-Lload.png) 73% duty, Vgs=10V, motor only (73% duty cycle, motor only *73duty10V-Lload.png)

\$\endgroup\$
20
  • \$\begingroup\$ Did you mean "FET keeps CLOSED even when our gate is kept at 0V! was it running full speed no-load with back EMF on drain? \$\endgroup\$
    – D.A.S.
    Commented Nov 17 at 22:16
  • 1
    \$\begingroup\$ Disable the PWM, rotate the motor by hand and watch the drain voltage. \$\endgroup\$
    – Jens
    Commented Nov 17 at 23:50
  • \$\begingroup\$ to @D.A.S. : yes, sorry. I think of FETs as if they were valves, i.e., I say open when it connects its drain to source and lets the current flow through it. From your comment, I understand that the common thinking of FETs is rather that they work as switches, i.e., they should be CLOSED to let the current flow. So basically, we both call the same thing the opposite ways. If my terminology is so misleading, please let me know, I'll edit the post. \$\endgroup\$
    – Dimitri
    Commented Nov 19 at 7:20
  • \$\begingroup\$ Yes this is not plumbing, so it ought to be corrected. It's an electrical switch. I assume the motor is connected across the LED load and not to 0V which would cause your disable failure. All transistor switches are inverting from In to Out and MOSFETS need a Vgs = 2 to 2.5 times the Vgs(th) turn off threshold. to reach rated current for low loss. (Vds*Id=Pd) \$\endgroup\$
    – D.A.S.
    Commented Nov 19 at 17:19
  • 1
    \$\begingroup\$ to @D.A.S. : Ok, corrected that. Sorry again. I'm no good at plumbing either, I teach theoretical physics... \$\endgroup\$
    – Dimitri
    Commented Nov 20 at 12:42

3 Answers 3

2
\$\begingroup\$

Your circuit is able to switch load current on and off very well, since the MOSFET is behaving like an open or closed switch. If you were to plot current \$I_L\$ through the load, be it a motor, a LED or a resistor, that plot would show a nice clean zero-level, alternating between 0A and some maximum.

This does not necessarily mean that load voltage \$V_L\$ would also be clean and rectangular, alternating between 0V and +12V, though. \$V_L\$ across a resistive load \$R\$ would indeed appear rectangular, oscillating between 0V and +12V, because \$V_L=I_LR\$. For a resistor, you would expect that when current is cut off (MOSFET off) then \$I_L=0A\$ and so \$V_L=0V\$.

I should point out that what you are measuring on your 'scope is drain potential \$V_D\$ where:

$$ V_D=(+12V) - V_L $$

Voltage across a motor is a different story, because it is rotating and generating an EMF \$V_L\$ roughly proportional to its angular velocity, even though current \$I_L\$ is zero. This is manifest in your plots as \$V_D\$ failing to rise to the full +12V when the MOSFET is off, and \$I_L\$ is zero.

With certain loads, such as a motor, you must not assume that if \$I_L\$ is zero, then so must \$V_L\$ be zero. Clearly that is not the case for a motor. The assumption is only true with resistive loads, whose \$V_L\$ is directly proportional to \$I_L\$.

There remains the question of why the "amplified function generator" does produce \$V_D=+12V\$ (corresponding to \$V_L=0V\$), while your simple MOSFET switch does not. This can be explained by comparing your MOSFET switch with a simplified version of the function generator's output system. This is how the MOSFET behaves:

schematic

simulate this circuit – Schematic created using CircuitLab

Here, the MOSFET is SW1, and is only able to sink current to ground via the load, when SW1 is closed. It is able to produce the condition \$V_D=0\$, but when SW1 is open, that MOSFET has no control over the potential at D. Contrast this with a naive representation of how the function generator behaves:

schematic

simulate this circuit

The function generator has what is known as a "push-pull" output. Like the single-switch MOSFET arrangement, it is able to sink current through SW1 to ground via the load, effectively "pulling current" from the load. Crucially, though, it is also able to source current to the load, via SW2, effectively "pushing" current into that load. This extra current sourcing ability gives it control of \$V_D\$ at all times, and can enforce both conditions \$V_D=0V\$ or \$V_D=+12V\$.

Using such a push-pull drive, I would expect \$V_D\$ to oscillate between 0V and +12V with any type of load, motor or resistance, because control of \$V_D\$ is never relinquished.

I called the above representation "naive" because the function generator does not employ switches. Rather, it has an analogue output stage consisting of transistors operating in a linear fashion, able to produce sinusoidal or triangular or even arbitrary output waveforms. In this application, though, where you are asking the function generator to produce a rectangular 0V or +12V waveform, my switch analogy above is a close enough representation of what's happening.

That's not to say that the waveform will be a pristine rectangle, the function generator is still fighting against a source of energy in both states, and who "wins" in the battle for control of \$V_D\$ will depend on which is "stronger", having the lowest source impedance, and which is able to respond more quickly to changes.


There is another quirk of behaviour for a push-pull drive that distinguishes it from a single-MOSFET arrangement. In the single switch/MOSFET scenario, when the MOSFET is off (SW1 open), the motor is effectively disconnected at one end, and is permitted to free-wheel under its own momentum.

In the push-pull arrangement of your function generator, when its output is \$V_D=+12V\$ (SW2 closed, SW1 open, above right) the motor is effectively short-circuited, having +12V applied somewhat brutally at both ends, for a potential difference \$V_L=0V\$. In this state the motor's kinetic energy is being drained rapidly (energy lost as heat in its own internal resistance), and the motor experiences hard braking. Therefore, with push-pull PWM, the motor alternates between phases of active acceleration and active deceleration.

In your own circuit, the motor is actively accelerated, but the only cause for deceleration is friction.

This has interesting consequences for motor speed control, in a closed loop. A mechanically unloaded motor will accelerate very rapidly, even at low PWM duty-cycle, and without any means to actively decelerate it (such as you have when using push-pull), it is disturbingly easy for motor speed to overshoot, and take an age to slow down to the desired set-point speed. This is an argument in favour of a push-pull driver, mostly referred to as a "half-bridge".

\$\endgroup\$
8
  • \$\begingroup\$ to @SimonFitch : thank you for your answer. You may see from my Note 1 that I have anticipated it (saying that in the case of the sig. gen. the motor stays connected to the mains at all times) but needed more time to arrive at the same explanation that you give, and so waited timidly for expert's opinion. I plan to edit Note 1 to make more explicit references to the answers. \$\endgroup\$
    – Dimitri
    Commented Dec 8 at 19:31
  • \$\begingroup\$ to @SimonFitch : with explaining what goes on out of the way, could you advice on what we should actually do to control that motor's speed? I have added this to the post as a Question section before Note 1. In particular, could we add a capacitor to store and recycle that braking energy from back-EMF. a bit like in a buck-boost converter? \$\endgroup\$
    – Dimitri
    Commented Dec 8 at 19:33
  • \$\begingroup\$ @Dimitri For one-directional control, the single MOSFET is fine, but the motor can free-wheel, and you have no braking ability. Typically PWM frequency for motors is kept in the low kilohertz or lower. 470Hz is fine. Higher than 1kHz is not advised when using opto-coupler, because opto-coupler transistor switch-off time can be significantly longer than shortest PWM pulse. Short PWM pulses are somewhat elongated, diminsihing control at low duty-cycle. Any capacitance anywhere will further reduce PWM precision. \$\endgroup\$ Commented Dec 9 at 3:28
  • \$\begingroup\$ @Dimitri For braking, you need a half-bridge, consisting of two MOSFETs. If you don't mitigate shoot-through yourself, a half-bridge gate driver IC is recommended. Consider an IC with gate driver and MOSFETs built-in, to handle everything. You can still free-wheel, you don't have to switch either MOSFET "on", but such control requires at least two digital control signals. For instance, one for speed/braking PWM, the other to "disable" the half-bridge to allow free-wheeling. \$\endgroup\$ Commented Dec 9 at 3:44
  • \$\begingroup\$ @Dimitri Even the ancient L293D can do this. There are more modern alternatives (such as DRV8906), but you should at least explore the half-bridge option, or even full H-bridge (also possible with the L293D). \$\endgroup\$ Commented Dec 9 at 3:55
1
\$\begingroup\$

You must take in account that a DC motor running, will generate a EMF in their terminals. A simple model of this motor could be a armature resistance, armature inductance and voltage (EMF) that is proportional to speed.

With "resistive" load (LED) , you see that everything matches in the oscilloscope. A brushless fan will have some electronics to turn DC into AC for the motor, it is not a resistance, but we can guess current will increase when voltage rises.

enter image description here

When you connect the DC motor, when the MOSFET switches off, the motor is running and will generate a voltage (value will depend on speed). That voltage will not be clamped by the flywheel diode, because it is the same polarity than mains voltage. The diode will only clamp the inductance spike. What you measure in Vd is 12 V-(EMF - voltage drop), you are feeding the LED and the fan (so voltage drop will be some amount).

enter image description here

In the last shot, as the fan is not connected, the voltage drop will be lower, and you can see more EMF voltage from the motor.

enter image description here

EDIT Note 1. The current in low-side FET will only flow when FET is activated. But if you measure the current on one terminal of the motor, with a load connected, you can see that when FET is off, current will change polarity and will feed the load. See simulation with EMF=10 V and load 60 Ohm, current through R3 is shown. With a wave generator will happen the same, the output will be forced to ground and current will flow from motor (generator).

enter image description here

\$\endgroup\$
4
  • \$\begingroup\$ Thank you. This is the explanation that I was slowly coming up with, influenced by some of the comments (notably by @Jens). The way I understand you, is that these motors, more specifically, their rotors, have mechanical inertia in addition to inductance and (small) ohmic resistance. In fact, their principle exploits inertia for pole commutation. It seems also that the 81:1 reductor fitted to our motor works towards increasing significantly its inertia. The phenomenon depends on speed: at small duty cycles, when the rotation is slow, that EMF is smaller and all looks "better"! \$\endgroup\$
    – Dimitri
    Commented Nov 24 at 19:51
  • \$\begingroup\$ to @Bravale : Thinking of your explanation, I have tried to understand why the function generator (through its amplifier) is able to regulate motor speeds with pwm. This resulted in the additional test described in the newly expanded Note 1. Can you comment on that figure in light of your EMF explanations? In particular, why is the current through the ammeter to ground negative during off-duty periods? \$\endgroup\$
    – Dimitri
    Commented Dec 5 at 18:25
  • \$\begingroup\$ to @Bravale : thank you for your answer. You may see from my Note 1 that I have anticipated it (saying that in the case of the sig. gen. the motor stays connected to the mains at all times) but needed more time to arrive at the same explanation that you gave, and so waited timidly for expert's opinion. I plan to edit Note 1 to make references to the answers. \$\endgroup\$
    – Dimitri
    Commented Dec 8 at 19:35
  • \$\begingroup\$ to @Bravale : with explaining what goes on out of the way, could you advice on what we should actually do to control that motor's speed? I have added this to the post as a Question section before Note 1. In particular, could we add a capacitor to store and recycle that braking energy from back-EMF. a bit like in a buck-boost converter? \$\endgroup\$
    – Dimitri
    Commented Dec 8 at 19:37
0
\$\begingroup\$

The results look normal for an SPST PWM switch to a DC motor.

If the driver were complementary it would perform better with a bipolar Nch or complementary Pch/Nch switches just as the signal generator with 50 Ohms is bipolar, and with Rs=50 limits torque from the current limit. An Electronic Motor Controller (EMC) would have an Rs much less than the DCR coil resistance of the motor so that it operates with a low temp rise.

It looks normal because when the switch opens, the current stops flowing, and the motor begins to coast. First, the back EMF is generated V=LdI/dt and then I*Rs drop is eliminated since I goes to 0, so V(switch) rises a bit after the exponential inductive flyback decay. If a slow trace was taken, you would see the RPM slow down and the BEMF decrease proportionally depending on the motor drag/load.

Added:

That's better, for Rs=1 from the sig gen to a linear amplifier and DCR of motor = TBD , the transfer function near 0 RPM for motor Vm and source Vs, voltages is \$\dfrac{Vm}{Vs} =\dfrac{DCR}{DCR+R_{dsOn}+ Rs}\$

Then the impedance of coil \$sL\$ is added with BEMF = -RPM/RPMmax x +V and \$I_{start} = +V/(R_s+R_{dsOn} + DCR) \$

Please verify yourself; No load current = ~ 1% of start current ~10% of rated current.

But with an open FET switch, you are current-limited due to the open switch resistance and the duty factor of RdsOn & DCR.

\$\endgroup\$
3
  • \$\begingroup\$ to @D.A.S. : thank you. I'm glad that we all have arrived at the same explanation. Now, with explaining what goes on out of the way, could you advice on what we should actually do to control that motor's speed? I have added this question to the post in a section before Note 1. In particular, could we add a capacitor to store and recycle that braking energy from back-EMF. Thinking naively of a buck-boost converter analogy (cf electronics.stackexchange.com/questions/56170/…)? \$\endgroup\$
    – Dimitri
    Commented Dec 8 at 19:45
  • \$\begingroup\$ to @D.A.S. : check Note 1. we use not the standard 50 ohm output from that function generator but the amplified signal with impedance 1 ohm. so the result should be similar to a half-bridge motor driver allowing active braking. \$\endgroup\$
    – Dimitri
    Commented Dec 8 at 20:56
  • \$\begingroup\$ yes but Rs should be << DCR also never use PWM on a BLDC fan as this stresses the Cap inside. \$\endgroup\$
    – D.A.S.
    Commented Dec 8 at 22:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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