Pages: [1]   Go Down
Author Topic: Problem with L298N and motors  (Read 586 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 10
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I have this DX H-bridge board, which seems to be an exact clone of this one.

I was using it to switch an electromagnet and it works fine as long as I keep the EM away from other USB peripherals. If it's too near the peripherals pick up a lot of interference and stop working until I reconnect.

Now I'm trying to power a small "toy car" DC motor with it - the motor's been harvested a long time ago and has no datasheet or markings but it looks like a 3V motor.
I connected the three control pins to the arduino and used a pot to control speed (PWM < 127 on enable pin to avoid frying the motor) and direction. I'm using 2x16340 batteries for the motor power and USB for the arduino, with the grounds connected.

The interference is so high it's making the computer's USB malfunction even with the motor 1m away. After a couple seconds playing with the pot the serial monitor on the computer stops receiving data (the analog reading of the pot) and I have to reconnect to make it work again, can't even upload a sketch after it "crashes".

I stopped experimenting with this because I'm afraid it'll damage the computer.

Am I doing something wrong? Is there a problem with the H-bridge board or is this normal?
« Last Edit: October 23, 2012, 07:33:11 am by Atomicrox » Logged

Ontario
Offline Offline
God Member
*****
Karma: 20
Posts: 835
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Both of your links are broken, so I do not really know what motor controller you're thinking of.
What is the power source for your motor?  The symptoms you mention could be caused by overloading the USB power supply.
Or they could be caused by excessive noise or voltage transients, if the motor controller does not have proper blocking diodes and bypass capacitors.
Logged

Phoenix, Arizona USA
Offline Offline
Faraday Member
**
Karma: 36
Posts: 5519
Where's the beer?
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Or they could be caused by excessive noise or voltage transients, if the motor controller does not have proper blocking diodes and bypass capacitors.

The correct links are:

http://dx.com/p/l298n-stepper-motor-driver-controller-board-for-arduino-120542
http://www.geekonfire.com/wiki/index.php?title=Dual_H-Bridge_Motor_Driver

As you can see, the diodes all appear to be in place; there are even a couple of caps. Though there appears to be a large (likely electrolytic) cap missing on the board; what it is for - dunno, but you might want to look at that...

Also - does your motor have non-polarized filtering caps installed on it? Most small motors should have these installed if there is excessive electrical noise coming from the motor; basically three of these caps are soldered on: one across the terminals, and one from each terminal to the case (these may be difficult to do put in place, though - start with the single one across the terminals). The caps need to be rated for the voltage of the motor (which shouldn't be an issue; most caps are rated for much more voltage than such a small motor will see). You want something around 0.1µF; see this article for more information:

http://www.beam-wiki.org/wiki/Reducing_Motor_Noise

Also - do you have the jumpers set properly to use your external motor supply? I'm only asking because maybe the motor is still trying to be powered from the USB supply, and is causing a voltage sag or something that is messing up the USB...
Logged

I will not respond to Arduino help PM's from random forum users; if you have such a question, start a new topic thread.

Phoenix, Arizona USA
Offline Offline
Faraday Member
**
Karma: 36
Posts: 5519
Where's the beer?
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hmm - I'm looking at that capacitor C1 that is empty (on the second link, too) - it looks like it is for the on-board voltage regulator of the L298 board; maybe one should be put in place after all (not sure what the value should be; I'd start with the LM7805 datasheet reference design for an idea).
Logged

I will not respond to Arduino help PM's from random forum users; if you have such a question, start a new topic thread.

Offline Offline
Newbie
*
Karma: 0
Posts: 10
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Sorry about the links, fixed.

I'm powering the motor from 2 16340 batteries (3.7V each). I've tried powering both arduino and H-bridge from the batteries and just the H-bridge with the grounds connected. Makes no difference.

The motor has no caps, it looks like this. I'll try soldering some caps but I'll have to go shopping first.

AFAIK there are no jumpers to set the power source.. Shouldn't be a problem since the only wires connecting the arduino to the bridge are the 3 signals and the common ground. That 5V_EN jumper is to disable the regulator (haven't tried that since I'll need to supply 5V externally).

I might try to add that missing cap, might help since it's between the 5V and gnd rails.

I also noted that this board has pull-up resistors for every signal rail, most can be disabled but the ones for the enable pins cannot. Can this get interference back to the Arduino? Should I cut the rails?
Logged

Pages: [1]   Go Up
Jump to: