I am building a WiFi controlled vehicle out of old Meccano parts, DC motor included. I could not find specs for it, so I thought that L298N used for PWM control would be sufficient. And it was, in a way... As long as my setup (Pro Micro, ESP8266 and L98N) is powered with a network supply (6V, as this was the voltage of the original package), it works as it is supposed to. However, with a 4 AA battery supply it fails: the motor quickly stalls and the Arduino and/or ESP cycle powering up after a few seconds. I have added two batteries to the supply to bring it up to 9V, but it did not help much.
What puzzles me is that if I replace L98N with a simple relay, the rover happily drives around with the same setup, even on four AAs. I could live with that, but I miss the reverse and the ability to vary the speed a bit... Is L298N supposed to work like that, with the power apparently lost somewhere?
The L298N is not efficient at all, its transistors can lose a couple a volts to the motors, wasted as heat. AA batteries also have sometimes large voltage drop under load. Together they make a poor combination.
A good power supply (lithium polymer or a good nimh pack) or more efficient driver would help, or both.
If you meant L298 that is.. your title and post say L98.
The AA batteries have a certain internal source resistance and a certain power handling... current sourcing ability/limit. The L298N output stage motor terminal voltage can be significantly lower than the incoming raw dc voltage. Combinations of these constraints may be responsible for what's happening. Could try sticking some relatively large capacitors across voltage supply rails.
Jabberwock:
What driver would you consider more efficient?
Its hard to suggest one without knowing a bit more about the motor. There have been so many different motors for Meccano dating back a hundred years!
Can you get a bit more info about the motor you have?
I'll give a quick one amp example, the figures aren't exact but close enough for illustration. Most newer motor drivers use MOSFETS instead of BJT transistors in the l298n.
The L298N will drop about 2.5 volts at 1 Amp if I am reading the datasheet correctly, So at 1 amp the chip will be losing 2.5W of power as heat. The motors would only see 6.5 Volts with 9v input.
Texas Instruments DRV8833
A chip like this one DRV8833, Has a resistance of about 0.5 Ohms ( top and bottom MOSFETS added together) . At one amp it would lose 1X0.5 = 0.5 Volts. 0.5 Watts heat loss.. motors would get 8.5v.
It's the one from the set 9550 "50 models". I got it without the instruction sheet and the only specs I could find on the Internet were "3V/6V"... I know, not much to go on with...
Measure the resistance across the terminals of the motor ( should be in the 5-15 Ohm range I am guessing) . Then you can use good old V=IR to find the stall current for a given voltage.
For one motor it is 3.3 ohm, for the other 3.5, which gives about 1.7-1.8A of the current... Fortunately I have abandoned the early design with two independently driven wheels and opted for a servo-driven steering link, so I need only one motor - I can combine the two circuits of DRV8833 for 2A, as stated in the datasheet.
Jabberwock:
For one motor it is 3.3 ohm, for the other 3.5, which gives about 1.7-1.8A of the current... Fortunately I have abandoned the early design with two independently driven wheels and opted for a servo-driven steering link, so I need only one motor - I can combine the two circuits of DRV8833 for 2A, as stated in the datasheet.
A paralleled output DRV8833 should do nicely, the motors draw a little more than I would have guessed. You can find little boards built around that driver fairly cheaply too. You will notice a big difference from the L298.
Thanks again for advice that was very helpful! It will be a few days till I get the driver, so for the time being I will play around with the relay I might swap WiFi for Bluetooth as well, it is a bit unresponsive...
DRV8833 plus a new set of Eneloops work almost perfectly! The range of speed adjustment is rather narrow (between the stall and the too-fast), but I can live with that...