Pages: [1]   Go Down
Author Topic: Help Needed: Nano hangs driving L298N break out  (Read 309 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I use the L298N break out board (similar to this one: http://www.ebay.com/itm/Dual-H-Bridge-DC-Stepper-Motor-Drive-Controller-Board-Module-Arduino-L298N-/221406103645?pt=LH_DefaultDomain_0&hash=item338cd5085d) to drive four motors (two in parallel) such as in this link: http://www.ebay.com/itm/4WD-Robot-Smart-Car-Kits-Chassis-Mobile-Platform-4-drive-Wheels-Gift-/111242553159?pt=LH_DefaultDomain_2&hash=item19e692a747.

The L298N motor power uses 6 Ni-MH rechargeables, and the logic power uses the onboard 7805.
The Nano v3.0 chip power is separate and uses 4 Ni-MH rechargeables connecting to 5V.
Thus the only connection between Nano and the L298N breakout is the ground and four control lines.

In stress tests, I let the motors spin forward and backward every half seconds. Nano hangs after a few seconds randomly.
The breakout board already has diodes for back-EMF. and I also put 100uf and 0.1uf along the power lines.
What else should be done to make Nano v3.0 run stable?
Logged

Offline Offline
Faraday Member
**
Karma: 100
Posts: 5985
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
  The Nano v3.0 chip power is separate and uses 4 Ni-MH rechargeables connecting to 5V. 

I certainly hope you don't mean this literally .  Do you mean you are NOT connecting the batteries to Vin but instead are connecting
them DIRECTLY to the +5V pin (which happens to be the OUTPUT of the regulator) ?
Why am asking this question ?
What is the nominal voltage per cell of NiMh ? (answer: 1.2V)
What is the SPEC for TTL (look it up on Wikopedia if you don't know what TTL means) (Answer: 4.75-5.25Vdc)
What is the chance that 4 NiMh batteries (charged) will always be within this range ? (Answer: SLIM to none)
Logged

Arduino UNOs, Pro-Minis, ATMega328, ATtiny85, LCDs, MCP4162, keypads,
DS18B20s,74c922,nRF24L01, RS232, SD card, RC fixed wing, quadcopter

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

I might have missed this point. 4.8V works for most of other projects. Save me additional batteries. Might be too low however driving loads.

Did not help much though. Tried connecting 7.2V (and even 9.6V) to VIN. No big difference. I still get to enjoy only about 1 or 2 seconds of arduino control.

Any other thoughts?


Logged

Offline Offline
Faraday Member
**
Karma: 100
Posts: 5985
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Can you post a schematic ? (maybe hand drawn with pen and paper and photographed with a cell phone ?)
(Unless you are using one off the web you can link)
Logged

Arduino UNOs, Pro-Minis, ATMega328, ATtiny85, LCDs, MCP4162, keypads,
DS18B20s,74c922,nRF24L01, RS232, SD card, RC fixed wing, quadcopter

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

I root-caused the issue.

Turns out it has nothing to do with power and interference from motors. In preparation of the schematic, I tried to strip down the programs as well. I suddenly found out that the motors ran perfectly fine if I did not run the gyro function in the program. It is a numeric exception of some sort that hangs the program. Not power. Not interference. Under control.

Thanks guys for your help. Having a peer review really helps.
Logged

Pages: [1]   Go Up
Jump to: