Home \ Help \ Search \ Login RSS

Welcome, Guest. Please Login

This forum is now READ-ONLY! Please visit http://forum.wiring.co/ for the new forum.

Wiring ForumWiring HardwareTangible computing › Balancing Robot (NEED HELP!)

Pages: 1 2 
Balancing Robot (NEED HELP!) (Read 16751 times)
02/06/08 at 06:00:22

arakourchians   Offline
YaBB Newbies
._ ._. ._
Los Angeles

Posts: 29
*
 
Hello all!

I am currently making a robot that self balances. I wrote some drivers for the accelerometer I purchased and have that working just great! I have one problem that I can't seem to figure out. I bought an L293D H-Bridge. I want to control these motors to move backward and forward with controllable speed. I can't seem to wire this up right and when I used: http://wiring.org.co/learning/examples/dcmotor.html to figure out a way to make a motor controller it only spun one direction. Problem is, I can't get it to go backwards and forwards. The motor I am using is a regular DC motor. Someone please help!!

Thanks,
Ara
 
IP Logged
 
Reply #1 - 02/06/08 at 17:20:18

barragan   Offline
YaBB Administrator

Posts: 939
*****
 
Dear Ara, well the effectiveness if regular DC motors depends on how you are using it (gears or pulleys), if the motor has load it will stop very fast and change direction very fast. Perhaps stepper motors are more suitable for this since they can be precisely controlled. Check this diagram: ... it uses a 74HC10 chip to control de direction of the two motors with the L293D.
 
IP Logged
 
Reply #2 - 02/06/08 at 18:16:36

arakourchians   Offline
YaBB Newbies
._ ._. ._
Los Angeles

Posts: 29
*
 
Awesome! This is exactly what I was trying to do, I can always run out to the store and buy a 74HC10, but I went through my collection of IC's first and found a 74HC00. It seems like it's a 2-input positive-NAND gate. In the diagram above it seems like all 3 inputs are connected together, looking at the both of the diagrams it seems like it would work even though it has 2 inputs. Would a 74HC00 work, or am I making a mistake here? Also is the 74HC10 a positive-NAND?
 
IP Logged
 
Reply #3 - 02/07/08 at 18:48:53

arakourchians   Offline
YaBB Newbies
._ ._. ._
Los Angeles

Posts: 29
*
 
I tried the 74HC00 and it works just fine, the problem now is that if I use the USB as a power source the motor spins slowly (no matter what the input is), but it does go back and forward, and when I use the external battery it just spins in one direction and doesn't even follow the code. Whats going on?
 
IP Logged
 
Reply #4 - 02/08/08 at 00:02:09

barragan   Offline
YaBB Administrator

Posts: 939
*****
 
Have you tried with an external power supply attached to the wiring board?, what voltage your motor use? how are you powering it?
Things can be erratic when something draws too much power from the wiring board, for example the wiring board can power up to 2 servos (it is possibe to connect up to 8), in such case an external or different power supply must be used for the servos or motors in general.
 
IP Logged
 
Reply #5 - 02/08/08 at 06:51:55

arakourchians   Offline
YaBB Newbies
._ ._. ._
Los Angeles

Posts: 29
*
 
barragan wrote on 02/08/08 at 00:02:09:
Have you tried with an external power supply attached to the wiring board?, what voltage your motor use? how are you powering it?
Things can be erratic when something draws too much power from the wiring board, for example the wiring board can power up to 2 servos (it is possibe to connect up to 8), in such case an external or different power supply must be used for the servos or motors in general.

I am using a regular 9V battery for the motors and another 9V battery to power the wiring board. Now I have it wired up and all, and when I run it, it runs great until the motors work to hard, or just likes to cut out. I have told LED (built in) 48 to turn on when the loop is running. During these cut outs the LED turns off, so I feel that I am tripping something.
 
IP Logged
 
Reply #6 - 02/08/08 at 17:47:09

barragan   Offline
YaBB Administrator

Posts: 939
*****
 
yeah, that indicates the board is resetting, are the grounds of the two batteries tied together?
 
IP Logged
 
Reply #7 - 02/08/08 at 19:05:24

arakourchians   Offline
YaBB Newbies
._ ._. ._
Los Angeles

Posts: 29
*
 
Yes they are grounded. I solved the problem by powering the L293D and 74HC00 using the positive power from one of the digital outs.
 
IP Logged
 
Reply #8 - 02/09/08 at 00:37:12

barragan   Offline
YaBB Administrator

Posts: 939
*****
 
cool, it could be of great help if you post a tutorial about it, or maybe an example. I can help witht he diagrams etc. Let me know.
 
IP Logged
 
Reply #9 - 02/09/08 at 03:33:20

arakourchians   Offline
YaBB Newbies
._ ._. ._
Los Angeles

Posts: 29
*
 
Sure, I will be glad to post this up. I even wrote some drivers (it's a void method) for the memsic accelerometer, so I have accelerometer code that will take in the pulse from the accelerometer, and either export the true pulse or give a number in G's. I can also, when I am done, post the code to balance, plus the wiring.
 
IP Logged
 
Reply #10 - 02/09/08 at 21:38:03

arakourchians   Offline
YaBB Newbies
._ ._. ._
Los Angeles

Posts: 29
*
 
Well it turns out this shut off power issue still exists. The robot may balance for a while, then the pin 48 light will turn off indicating the loop stopped. About 5 seconds later it will turn back on and it will reset in a shorter amount of time than the previous reset. It seems exponential, and if I leave it alone for about 5 minutes it works for a longer time, then starts to do this. Now I am not sure what I am doing wrong, I would like a list of possibly things that are happening. My guess is that I am running to much current through the poor board, but nothing is heating up.
 
IP Logged
 
Reply #11 - 02/10/08 at 00:28:04

barragan   Offline
YaBB Administrator

Posts: 939
*****
 
Please post an image/diagram of your connections, that would help.
 
IP Logged
 
Reply #12 - 02/10/08 at 02:47:15

arakourchians   Offline
YaBB Newbies
._ ._. ._
Los Angeles

Posts: 29
*
 
Great news! I figured out that this problem was caused by a simple mistake. I was using a 9 Volt battery to power the Wiring board and when I replaced it with 6 AA batteries the problem went away! I guess there may have been to much current being drawn (NOT sure) and it may have cut the connection, and reset. The bot stays on and what is even better is that it balances!!! I have very rough code on bot at the moment, but soon I will be revising it to be smoother. (I am afraid the poor thing will shake itself apart) Tongue
 
IP Logged
 
Reply #13 - 02/13/08 at 20:42:23

Vaccumdiode2   Offline
Full Member
chicago, IL USA

Posts: 120
***
 
arakourchians,
          Would you be will to share your code and you basic set up.  I sounds like a fun project and I would like to play with it.

Rich
 
IP Logged
 
Reply #14 - 02/14/08 at 02:27:24

arakourchians   Offline
YaBB Newbies
._ ._. ._
Los Angeles

Posts: 29
*
 
I will be glad to share my code, and I encourage improvements. I am currently refining the code to balance the robot more effectively. Within a week or so I will post:

-Code for the balancing
-Drivers for the Memsic accelerometer
-Wiring diagrams for the motor controller and the entire setup.

I talked with Mr. Barragan and I believe he is thinking about posting this up as a project and/or example.

-ara
 
IP Logged
 
Pages: 1 2