limit max amps to a motor?

Thread Starter

sirchuck

Joined Feb 14, 2016
150
L298N Part:
https://www.amazon.com/TIMESETL-L29...n&qid=1552463514&s=gateway&sr=8-2-spons&psc=1

Explanation:
I have a Raspberry Pi controlling two motors from an L298N board. I want to power both the RPi & L298N from a Solar Panel Array that offers 10v @ 500mA.
When I run both motors I see Amp spikes up to around 600mA. I might be able to get away with that because I run through a buck converter and I suspect it will change volts to amps if needed, assuming good Sunlight. However, I want to limit the motors to only being able to draw a maximum of say 300mA.

After googling all I could figure out was throwing resisters at the problem, but I don't know if that actually limits the number of Amps drawn from the source, or if it just limits the number of Amps the load will receive.

The goal - don't draw so many amps with the motors that it steals needed power from the Pi.
 

pmd34

Joined Feb 22, 2014
529
Hi sirchuck, the stepper motor driver is made so that you sense the current taken by the motor as a voltage across the sense resistors. You are then supposed to use this to modulate the digital signals to the L298 to then switch the motor off an on, and so limit the current. (If you look at the data sheet, it suggests using a L297 to carry out this pulse width modulation. It is a bit messy to implement however.

The L298 is actually quite an old IC now, and there are some smaller more sophisticated ones around which actually have current limiting built in.. the A4988 for example, which is used a great deal in 3D printers.

Actually however, if you are only seeing short spikes of 600mA, then so long as you have some reasonable value of capacitance in your powersupply, it should all work OK. You tend to need a bit of a "Kick" to get a motor to first move, and its really the total average current that is most important.
 

Thread Starter

sirchuck

Joined Feb 14, 2016
150
The L298 is actually quite an old IC now,
Gah, it figures. You always find this out it's obsolete after you buy 10 of them.

I'm using a DC motor, not a stepper on this hacked rover.

Yaakov,
I = V/R, yup seen it plenty.

In my test case I used 5v, the resistance through the L298n is not known, but maybe it says in the docs, I can check later. It's no longer important.

I think my question is answered though, a resistor does not only limit the amount of current that can be pulled but sets a maximum that will be pulled in total.

The thing that confused me a bit was, when you use a voltage regulator from 9v to 5v for example, you are still sending 9v it's just 4v is being turned into heat. - I know that's probably not exactly right in terms of how you might say it, but basically, regulators output less than they take.

I suppose this is because the current is pulled by the load device, while voltage is sent from the source. That sound right?
 

pmd34

Joined Feb 22, 2014
529
Ah sorry, you want the A4952 then!

The IC should have negligible resistance, but you normally put in "sense resistors" so you can measure the actual current you are using.

Capture2.PNG

Your sort of correct, with your regulator. You put 9V in and your regulator has to "loose" 4V internally, to get to 5V at what ever current you are taking from the 5V supply. For linear regulators this is effectively done resistivly so all that 4V @ what ever current is turned into heat.
This can take alot of doing when your current gets high, so its much more common to use switching regulators now.

Similarly for your motor control you can limit the current with a resistor, but you have to cope with the heat it generates. The alternative is to pulse the motor off and on when you see the current its drawing gets too high.
 

Thread Starter

sirchuck

Joined Feb 14, 2016
150
A4952, is there another name for that? I just checked Amazon and Ebay but nothing that looked like a chip or PCB showed up.

Does the A4952 chip do the pulsing of the motor you were talking about? For my project, the motor will only run for about 1 second and then pause for a few minutes on a busy day, so heat on a small resistor shouldn't be a problem.
 

pmd34

Joined Feb 22, 2014
529
Ah I see that IC has also gone out of fashion too!
If you have a look for "H-Bridge driver with PWM" you might find something suitable.
As you say using a resistor would probably be OK for your application, the only issue might be that if you use a too big a resistor, then you dont have a high enough voltage to start the motor moving initially.
 
Top