1. Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.
    Dismiss Notice

First ROBOT with L293D problem

Discussion in 'Robotics & Mechatronics' started by c36041254, Aug 30, 2008.

  1. c36041254

    c36041254 Member

    Joined:
    Apr 1, 2008
    Messages:
    154
    Likes:
    1
    Location:
    Newzealand, Auckland
    Hi there !
    I been not able to work on my robot for a long time for some reasons and also not on electro-tech, but finaly I have finished it but it has just one problem that output of L293D is just 50mA. I am attaching a schematic of my robo.
    The LEDs connected to MCU pins ( in alternate polarity to the same pins ) are the input pins for L293D and the LDR sensor section is shown far right. I know that these LEDs connected directly to MCU drop volatage so I tried removing them but did'nt help. I connected LEDs just for indication that at least digital part is O.K. Please help me I selected this robot for my collage project and have to submit in a week !
    I am using 12V adapter for power supply for testing and then will switch to +9V battery.
     

    Attached Files:

    Last edited: Aug 30, 2008
  2. ericgibbs

    ericgibbs Well-Known Member Most Helpful Member

    Joined:
    Jan 4, 2007
    Messages:
    21,240
    Likes:
    645
    Location:
    Ex Yorks' Hants UK
    hi Chris,
    A quick look, whats the purpose of the reverse parallel LED's across the PIC pins to the L293.? Depending upon the forwad voltage drop of the LED's wont they clamp the L293 drive signal.?

    Whats the current rating of the motor and the 12V adaptor.?
     
    Last edited: Aug 30, 2008
  3. c36041254

    c36041254 Member

    Joined:
    Apr 1, 2008
    Messages:
    154
    Likes:
    1
    Location:
    Newzealand, Auckland
    Yes it will clamp it and that's why I wrote that I tried with removing those LEDs but then even the current falls to 50mA, so I connected them back just to make sure that at least MCU is doing it's job, and that's why I add them in schematic actually they are not permanently soldered there so please ignore them, and the worst thing is that before I tried removing LEDs the current was at 160mA but that was not enough to carry the load of ROBOT ( the motors were moving ) so I tried removing the LEDs and then THIS HAPPEN JUST 50 mA:confused::confused:
     
  4. dave

    Dave New Member

    Joined:
    Jan 12, 1997
    Messages:
    -
    Likes:
    0


     
  5. ericgibbs

    ericgibbs Well-Known Member Most Helpful Member

    Joined:
    Jan 4, 2007
    Messages:
    21,240
    Likes:
    645
    Location:
    Ex Yorks' Hants UK

    hi,
    Sorry, I missed some of the first post detail.:(

    Can you give details of the motor current and 12V adaptor.?
     
  6. c36041254

    c36041254 Member

    Joined:
    Apr 1, 2008
    Messages:
    154
    Likes:
    1
    Location:
    Newzealand, Auckland
    Sorry ! I also missed some of your post, I actually don't know the current ratings of motor but it reads 2200 rpm, 6V , motors are those bulky one used in cassette players. The adapter reads 9V,500mA but it actually gives 11.56 v at output so I take it as 12 V.I also have two small motors used in china made toys (just like shown here http://www.societyofrobots.com/actuators.shtml as DC motor ) as it is taken from a toy it doesn't have any ratings on it but the toy runs on a single 3V pencil cell. When I connect these motors every thing stops and have to restart the ROBOT but attaching some resistance in series makes the motor run but very slow ( resistor is of 47 ohm)
     
    Last edited: Aug 30, 2008
  7. ericgibbs

    ericgibbs Well-Known Member Most Helpful Member

    Joined:
    Jan 4, 2007
    Messages:
    21,240
    Likes:
    645
    Location:
    Ex Yorks' Hants UK
    Hi Chris,
    The voltage you measuring from the adaptor, is that when the motor is trying to run.?
    Some adaptors have a very poor regulation. It also sounds as though when you connect the 3V motors you are pulling the 12V so low its resetting the PIC.
    Measure the adaptor when its on load.
     
  8. c36041254

    c36041254 Member

    Joined:
    Apr 1, 2008
    Messages:
    154
    Likes:
    1
    Location:
    Newzealand, Auckland
    This is the situation now, connecting those tiny toy motors not those cassette player's

    currents at output pins of L293D - 84.5mA :) (for both motors)

    Voltage at output pins without connecting motors - 8.05V

    Voltage at adapter with motors connected - 8.05V

    currents through motors while connected - 83.5mA

    hope this will help you to help me :)

    By the way I don't get that how a motor that runs on three volts connected at the output of L293D and not to MCU can reset the micro controller, I mean we are connecting it to output and not to input and a motor is a passive device, it runs on 3V doesn't generate 3V :confused:
     
    Last edited: Aug 30, 2008
  9. ericgibbs

    ericgibbs Well-Known Member Most Helpful Member

    Joined:
    Jan 4, 2007
    Messages:
    21,240
    Likes:
    645
    Location:
    Ex Yorks' Hants UK
    hi Chris,
    Taking the second part first, as I understand you said, when I connect the 3V mtrs the robot stops and you have to restart, is that correct.

    If yes, most likely whats happening is that the +5V is being pulled so low that the PIC is crashing, so you have to restart.

    Some of these small mtrs [3v and the like] can draw a heavy current when starting up, a battery will be able to supply this heavy current, but the regulator probably not.
    Your drawing is not showing a large value capacitor on the +5V line. A large cap is usually fitted in order to supply current surges required by the mtr.

    I would measure the current drawn by both types of motor using a 3V battery for toy mtrs and a 5V supply for the cassette mtr.

    When doing this test apply finger pressure to the shaft of the mtrs so that they have a load.
     
    Last edited: Aug 30, 2008
  10. c36041254

    c36041254 Member

    Joined:
    Apr 1, 2008
    Messages:
    154
    Likes:
    1
    Location:
    Newzealand, Auckland
    Hi Eric,
    I tried the 1000uF capacitor between +5v and GND of 7805 and the motor runs like a harly devidson :) for few seconds and then it stops, I think the capacitor is not discharging its self, though there is only 59mV charge in it as I measured it and it start increasing during measurement ( I disconnected it from ckt and then measured ). Don't know what to do about this.
    Here is the data you asked for:

    Current through toy motor with 1.5 V ( with 3V more than 200mA and less than a Ampere ) 127mA

    Current through cassette ply. motor with 5V 110mA

    I still don't get why capacitor increase current , I thought it is just for the filtering purpose.
     
  11. c36041254

    c36041254 Member

    Joined:
    Apr 1, 2008
    Messages:
    154
    Likes:
    1
    Location:
    Newzealand, Auckland
    After posting above reply I just strike with weird problem, that adapter is not giving 11.50V when connected to ckt, while disconnected it works fine , though ckt also works fine with 9V battery. The adapter has an LED and it becomes very light when connected to ckt. I tried another 7805 but doesn't work. Is it possible that though voltage of adapter is O.K. it might not giving current (rated 500mA ) ?

    Edit :

    I tried it with just a 7805 on bread board but then even it didn't work, there must be a diode got fused in the bridge of adapter.
     
    Last edited: Aug 30, 2008
  12. ericgibbs

    ericgibbs Well-Known Member Most Helpful Member

    Joined:
    Jan 4, 2007
    Messages:
    21,240
    Likes:
    645
    Location:
    Ex Yorks' Hants UK
    hi Chris,
    I have been convinced from the start that the problems that you describe are related to the adaptor and series regulator not having the voltage/current capacity to drive the mtrs.

    The fact that it runs for a while with a 1000uF cap then slows/stops suggests that the 7805 or adaptor are overheating.
    If the 7805 gets HOT it will go into thermal shut down, it may require a heatsink.
    Also a 500mA adaptor is IMO under rated for the job, try a 9Vdc at say at least 1Amp.

    Lets know how it goes.:)

    EDIT:
    I am suggesting an adaptor voltage that will give at least 3v to 4v drop across the 7805.
    If an adaptor of a higher voltage is used the 7805 has to dissipate more heat.!
    If for example the mtrs draw 0.5A, with a 12V adaptor there is 7V across the 7805.

    Heat/power = 7 * 0.5 = 3.5Watts!......... for the 9v adaptor it becomes 4 * 0.5 = 2Watts.
     
    Last edited: Aug 31, 2008
  13. pkshima

    pkshima Member

    Joined:
    Jan 23, 2003
    Messages:
    343
    Likes:
    1
    Location:
    New Delhi, India
    I faced similar problems in my first robots as well. The problem WAS teh adaptor. I was using a 12 v 500mA adaptor.

    Thanks to this foroum, I started suspecting the adaptor. I then open my computer and used teh 12 V supply from it. and wow The robot got mad with power !!!

    so Chris, go for it !!! try running your robot on the 12 V from your computer. Then when you are convinced on how much power you need to put into the robot to get more power from it, go buy a 1A or 2A adaptor of say 9 V.
     
  14. c36041254

    c36041254 Member

    Joined:
    Apr 1, 2008
    Messages:
    154
    Likes:
    1
    Location:
    Newzealand, Auckland
    Hey ! that works but not so well, The motor runs really fast but only when the robot is on the black line as it gets off the line on either side the MCU and whole ckt gets hang ( every thing stops), I thought the back emf of motor might be the problem and attached 0.1uF capacitor across each motor but that did not solve the problem .:confused:

    And Pradeep you have suggested the computer source but I have an ATX 2.03 that has 12V but 16A and 15 A, I tried that once before and had my ckt fused, How to use that ? Will a simple current divider do the job ?
     
  15. ericgibbs

    ericgibbs Well-Known Member Most Helpful Member

    Joined:
    Jan 4, 2007
    Messages:
    21,240
    Likes:
    645
    Location:
    Ex Yorks' Hants UK
    Hi Chris,
    I wouldnt recommend connecting the motor to the PC internal supply lines.

    You could use a separate +5V regulator just for the PIC's supply.

    EDIT:
    The 4 diodes shown in the dwg will reduce the back emf.
     

    Attached Files:

    Last edited: Aug 31, 2008
    • Like Like x 1
  16. Pommie

    Pommie Well-Known Member Most Helpful Member

    Joined:
    Mar 18, 2005
    Messages:
    10,161
    Likes:
    340
    Location:
    Brisbane Australia
    Is that 9 squares I see. Congratulations, couldn't happen to a more deserving poster.:D

    Mike.
     
  17. ericgibbs

    ericgibbs Well-Known Member Most Helpful Member

    Joined:
    Jan 4, 2007
    Messages:
    21,240
    Likes:
    645
    Location:
    Ex Yorks' Hants UK
    hi,
    I hadnt noticed, oh crap.!
    Im going to get even more unsolicited PM's asking, heeeeelp meeee plzzzzz.
     
  18. c36041254

    c36041254 Member

    Joined:
    Apr 1, 2008
    Messages:
    154
    Likes:
    1
    Location:
    Newzealand, Auckland
    I don't get that how that reduce the back emf, I don't understand how the back emf voltage get grounded with those diode.

    I am not sure that the problem I have asked about in the last post is because of back emf or is it ?

    By the way what you (Eric) and Mike are talking about ? I don't get it ?:confused:
     
    Last edited: Aug 31, 2008
  19. ericgibbs

    ericgibbs Well-Known Member Most Helpful Member

    Joined:
    Jan 4, 2007
    Messages:
    21,240
    Likes:
    645
    Location:
    Ex Yorks' Hants UK
    hi Chris,
    Ref the diodes.
    When the back emf from the motor is greater than the suppy voltage [+ diode voltage drop] the diode will conduct and clamp the back emf to to about Vsupply + Vdiode.

    If any back emf trys send the motor connection to a minus voltage, the lower diode will conduct and clamp it to about 0V [allow for diode drop]

    Back emf on the power rails can get back into the PIC and other logic, thats why its essential with motor and relays etc, the decoupling caps are present.

    I would have at least a 470uF and say 4 or so 100nF on the +V rail to 0V.
    A 100nF should be close to the PIC power pins.
     
    Last edited: Aug 31, 2008
  20. pkshima

    pkshima Member

    Joined:
    Jan 23, 2003
    Messages:
    343
    Likes:
    1
    Location:
    New Delhi, India
    The guys are talking about the reputation squares. See the green squares beneth their names.
     
    • Like Like x 1
  21. c36041254

    c36041254 Member

    Joined:
    Apr 1, 2008
    Messages:
    154
    Likes:
    1
    Location:
    Newzealand, Auckland
    I tried that diode ckt with zener diodes but didn't work , I am trying to figure out whats wrong, hope will find it. I have a spare ATX PC power supply and I have spent already over my budget so I really need to know how to use that, please tell me because soon I'll be out of battery.

    Edit:
    I just have those zeners and hope that may work because can't afford to buy 8 new diodes right now.
    Adding that diode ckt makes the motors very slow, and now MCU doesn't hangs when the ckt detects light on one side but for the other side it still needs to be reset.:(
     
    Last edited: Aug 31, 2008

Share This Page