Wednesday, February 17, 2016

DC motor blues Part 1

This post is to document a problem I'm having getting some electronics (that will drive a toy I'm building) to work.



The toy is a variation on a mobile inverted pendulum (see https://trandi.wordpress.com/2014/01/05/self-balancing-robot/ for inspiration). 



The parts list seems to be ever expanding but for now I've got an Arduino Nano (sometimes I use an Uno as well), a 7805 Power Supply, an L293D H bridge IC,  a GY 521 gyro/accelerometer combo and a 1.5-3 volt DC motor I got from RadioShack (http://www.radioshack.com/1-5-3vdc-metal-gear-motor/2730258.html), along with typical prototyping essentials (wires, resistors, capacitors, diodes, transistors and a breadboard).  I also grabbed the power supply from my playstation 2 (8.5V, 5amp DC) and another from an old modem and have been using them as the power source(s) when not powering from USB.





As preparatory work I soldered wires onto the motor and a male pin header onto the GY 521. 


For first effort I wired things up as below, powering the Nano through USB and everything else off the +5V pin on the Nano.


The code attempts to alter the speed of the motor based on the orientation of the GY521.  The problem that I encountered was that always after a few times going from stopped to speed the motor would get hung at max speed and the Arduino/Serial output would freeze.  This is a problem others have encountered (see http://forum.arduino.cc/index.php?topic=132493.0 and the comments of the trandi link above) and to my knowledge no one has solved.


The circuit above is a revised circuit based on comments on the trandi link, adding a separate 7805 power supply fed from the 8.5V Playstation AC adapter, a 5V AC adapter for the motor and powering the Arduino from USB still.  This circuit could hardly be more electrically isolated but still the motor locks up at max speed and the Arduino freezes.

This post has languished as a draft for a long time, so I will post now and add more as subsequent parts when I get back to it.


No comments:

Post a Comment