Author Topic: DC Motor crashing uController  (Read 4641 times)

0 Members and 1 Guest are viewing this topic.

Offline free_electron

  • Super Contributor
  • ***
  • Posts: 8515
  • Country: us
    • SiliconValleyGarage
Re: DC Motor crashing uController
« Reply #25 on: February 21, 2018, 09:30:14 pm »
put a diode from 20v to the 100uf capacitor.
That way your motor can not suck energy out of that bulk capacitor.
the capacitor energy only goes to the regulator. so when 20v collapses due to motor current the 100uf act as 'backup' for the microcontroller.

Professional Electron Wrangler.
Any comments, or points of view expressed, are my own and not endorsed , induced or compensated by my employer(s).
 

Online Benta

  • Super Contributor
  • ***
  • Posts: 5839
  • Country: de
Re: DC Motor crashing uController
« Reply #26 on: February 21, 2018, 10:03:47 pm »
Those caps across the motor are going to pull a bit of current every time the mosfet turns on, as someone already mentioned.

Yes, of course they will.

The brush suppression caps are a compromise between PWM effects and brush arc damping. There is no "One Perfect Solution", and no closed loop mathematical calculation for this.
It's empirical, and my original suggestion of "try 22 nF and 2 x 10 nF" was intended to give ballpark values. As the OP tried this with success, it wasn't far off. I'm certain it can be optimized, the question is whether it's worth the effort.

MOSFETs are rugged, and the small current needed for the brush caps have in my experience never caused problems.


 
The following users thanked this post: ez24

Offline nuno

  • Frequent Contributor
  • **
  • Posts: 606
  • Country: pt
Re: DC Motor crashing uController
« Reply #27 on: February 21, 2018, 11:41:52 pm »
put a diode from 20v to the 100uf capacitor.
That way your motor can not suck energy out of that bulk capacitor.
the capacitor energy only goes to the regulator. so when 20v collapses due to motor current the 100uf act as 'backup' for the microcontroller.

+1

I've solved uC resets many times with this technique, it isn't even necessary to add anything else. It's good when the power stage pulls alot of current causing a dip in the system's power supply.
But the cap across the motor poles is still highly recommended and will reduce noise. Even small 3V toy DC motors can cause quite some excursions on the power supply.
 
The following users thanked this post: ez24

Offline elkayemTopic starter

  • Contributor
  • Posts: 12
  • Country: us
Re: DC Motor crashing uController
« Reply #28 on: February 22, 2018, 03:21:45 pm »
Looks like I need to catch up with this thread... 

Solution: Do you happen to have some 10uH inductor capable of currents that are needed for 5V rail? Supposedly 100mA for that blue pill shall be more than needed. Put one such inductor and 10 Ohm resistor in series before C2/C7. if no inductor, then just use resistor alone. It together with following caps will do some of filtering job as well.

High frequency 2vpp pulsations on 5V bus is still *very* bad. You have to get them down to 100mVpp or so.

I do have the series resistor, but no inductor.  I think you are right that the next step would be to design a proper LRC filter.  I don't doubt that 2V P-P is still bad.  They look a lot worse on the screen shots I showed because I zoomed way into a single transient.  The transients themselves are very short, and most of the time the line is dead quiet.  I can't recall exactly, but seem to remember the transients lasting on the order of a few usec at most.  Still, I'm sure it doesn't take much to reset the uC.

I really should start looking at the 3.3V power.  It isn't just the uC, but also a number if ICs including 3 SPI devices, an I2C device, and an LCD screen.  Most (except the LCD) draw from 3.3V, so that is where I need to worry about the transients.  Sum total current draw is around 100 mA.   I've now run for up to an hour at a time with no issues so tempted to leave the circuit as is.  Now that I have everything soldered in place on a strip board, it's a pain every time I need to pull out the solder wick... 
 

Offline elkayemTopic starter

  • Contributor
  • Posts: 12
  • Country: us
Re: DC Motor crashing uController
« Reply #29 on: February 22, 2018, 03:24:48 pm »
Check out the lt3042.
Thanks for the tip!

Quote
How time and temperature stable are the noise profiles generated by brushed dc motors?
Unknown.  I'll need to continue to monitor.
 

Offline elkayemTopic starter

  • Contributor
  • Posts: 12
  • Country: us
Re: DC Motor crashing uController
« Reply #30 on: February 22, 2018, 03:27:23 pm »
Are you using a 24v motor?  I find that 20v are rare.  On Aliexpress there are only 3, and they are rated for 6-20v.  And there are about 8,000 rated for 24v.

Are you using a laptop power supply?  My Dell puts out 19.6v.  I am just curious about the 20v since it seems odd to me.

Indeed it is a 20V motor.  It has 20.5V stamped on the side of it.  It is repurposed from an old appliance, so I'm sure it isn't available from aliexpress.  Also, yes I am using a laptop power supply. 
 

Offline Siwastaja

  • Super Contributor
  • ***
  • Posts: 8106
  • Country: fi
Re: DC Motor crashing uController
« Reply #31 on: February 22, 2018, 03:34:56 pm »
DC motor voltage ratings are rather arbitrary. The same motor may be stamped with 24V or 12V or 48V for different customers.

Current ratings are way more important (and more exact!), but often omitted from cheap motors.

You can't just apply x volts to most "x volt" DC motors, which is quite funny when they lack the current spec :-). Then, the voltage spec may be read as: "it's safe to apply this voltage when there is no significant mechanical load and hence no significant current".
 

Offline elkayemTopic starter

  • Contributor
  • Posts: 12
  • Country: us
Re: DC Motor crashing uController
« Reply #32 on: February 22, 2018, 03:42:35 pm »
Those caps across the motor are going to pull a bit of current every time the mosfet turns on, as someone already mentioned. Maybe put 10 ohms in series with each of those caps? Also perhaps increase the mosfet gate resistor to slow down the switching transition, but not so much that the mosfet gets warm.

I should point out that these transients are not caused by the mosfet switching.  They are present even when I am running at 100% duty cycle.  They are almost certainly caused by arcing with in the motor, as another poster pointed out. 

Incidentally, the mosfet switches look really clean now, but when I was first prototyping the circuit, I clipped the flyback diode directly to the motor, and the transient rang like a bell!  It was an almost textbook lightly damped oscillator. 
 

Offline elkayemTopic starter

  • Contributor
  • Posts: 12
  • Country: us
Re: DC Motor crashing uController
« Reply #33 on: February 22, 2018, 03:46:04 pm »
DC motor voltage ratings are rather arbitrary. The same motor may be stamped with 24V or 12V or 48V for different customers.

Current ratings are way more important (and more exact!), but often omitted from cheap motors.

You can't just apply x volts to most "x volt" DC motors, which is quite funny when they lack the current spec :-). Then, the voltage spec may be read as: "it's safe to apply this voltage when there is no significant mechanical load and hence no significant current".

Nothing gets past you guys!  The motor also has 1.8A stamped on it.  It draws pretty close to that at 20V with the current load. 
 

Offline Siwastaja

  • Super Contributor
  • ***
  • Posts: 8106
  • Country: fi
Re: DC Motor crashing uController
« Reply #34 on: February 22, 2018, 04:13:25 pm »
Nothing gets past you guys!  The motor also has 1.8A stamped on it.  It draws pretty close to that at 20V with the current load.

Stamped "nominal currents" are also quite difficult to actually decipher, but far better than nothing. My rule of thumb has been that I tend to exceed that rating by 3x for short time (a few seconds), or by 1.5x for longer pulses (minutes). But never more than 3x-4x, since it usually doesn't offer more output torque due to iron saturation.

Note that if you just connect an "X volt" DC motor to "X volts" with stalled axle, it might easily take 10x the "nominal" current - only the resistances limit the current. Back-EMF is 0V, so current is (X volts - 0 V) / R.

Also note this is completely normal behavior - every motor is running at 0 rpm when you first power it, thus taking this full current when connected to a dumb, hefty DC source (such as a big battery). Most motors completely saturate their iron in this state, giving out only the same torque they would give out at far lower current - this means efficiency is very poor, extra amps and watts go in with no extra work out!

For this reason, proper PWM control should include current sense and feedback which allows you to set the output current limit - have the same work done with less heat. Then you can also do both speed and torque control, which is kinda cool!

Of course, this is often utterly irrelevant with cheap small motors, and simple use cases. They are inefficient anyway, and have so much resistance in windings and brushes that current is fairly limited even when full DC is applied with stalled rotor, which protects the MOSFETs as well.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf