L293D issues . .. ... HELP

Noidea

New Member
Dear All,

Once again I am asking for help, seems like it never ends. .. ...

Attached is the pebbles pic of my breadboard the code and an actual shot of the breadboard.

You will notice that the code refers to pin 0,1 as this activates the LEDS, these connections are not shown in the picture as I couldnt find the icon to use.

ISSUE: Whats happening is that when I connect the motors it trips everything out. I am not sure why. Allthough the jpeg shows a 4.5 & a 6v battery attachment, I am actually using a 12v 7aH Yuasa battery that I am regualting with a 7805 chip (twice)... this gives an output on each power channel of 5.091 volts. One channel to power the picaxe and one channel to connect to pin 8 of the L293D chip. I guess in short ... I have noidea what's wrong and why it trips my circuit. Both sides of the v+ and v- are connected with jumper wire, again not shown as I could not find item in pebbles.

--------------------------
CODE
--------------------------

INIT:
symbol speedL = b1
symbol speedR = b2

let pins = %00000010 `WAIT FOR ALL CHIPS TO WARM UP
pause 1000
let pins = %00000001 `REALLY JUST A WAIT BIT TO FLASH LEDs
pause 100
let pins = %00000010
pause 200
let pins = %00000001
pause 100
let pins = %00000010
pause 200
let pins = %00000001
pause 100
let pins = %00000010
pause 200
let pins = %00000001
pause 100
let pins = %00000010
pause 200
let pins = %00000001
pause 100
let pins = %00000010
pause 1000
let pins = %00000001

`--------------
START:
gosub FRWD:
let pins = %00000010 `STOP MOTORS, RED LED ON
pause 1000
gosub BKWD:
let pins = %00000010 `STOP MOTORS, RED LED ON
pause 1000
goto START:
`----------------
FRWD:
let speedL = 150
let speedR = 150

let pins = %00110001
pulsout 6, speedL
pause 15
let pins = %11000001
pulsout 4, speedR
pause 15

let pins = %10100001 `FORWARD MOTORS, GREEN LED ON
pause 2500

RETURN
`-----------------
BKWD:
let speedL = 255
let speedR = 255

let pins = %00110001
pulsout 6, speedL
pause 15
let pins = %11000001
pulsout 4, speedR
pause 15

let pins = %01010001 `BACKWARD MOTORS, GREEN LED ON
pause 2500

RETURN
`-----------------
IC||227|270|1||U?|||PICAXE18|IC||PICAXE18_1
IC||712|270|1||U?|||L293D|IC||L293D_1
Wire||802|432|11||11|#000000|1|11|||
Wire||802|185|11||11|#000000|1|11|||
Wire||719|462|21||11|#FF0000|2|11|||
Wire||827|379|21||11|#000000|6|11|||
Resistor|10000|535|344|1|Resistor|R?||3||IC||
Resistor|1000|508|454|1|Resistor|R?||3||IC||
Wire||694|377|11||11|#999999|2|11|||
Wire||692|242|21||11|#999999|5|11|||
Wire||371|240|11||11|#999999|12|11|||
Wire||665|214|21||11|#A233C3|7|11|||
Wire||667|405|11||11|#A233C3|8|11|||
Wire||398|212|11||11|#A233C3|10|11|||
Wire||425|185|11||11|#00A060|12|11|||
Wire||452|157|11||11|#3253FF|16|11|||
Wire||721|212|11||11|#CC6633|7|11|||
Wire||719|77|21||11|#FF0000|6|11|||
Wire||827|104|21||11|#000000|5|11|||
Diode|0|776|236|1|1N4001|CR?||2|2|IC||diode_221
Diode|0|776|373|1|1N4001|CR?||2|2|IC||diode_221
Wire||263|405|11||11|#A233C3|8|11|||
Wire||477|269|21||11|#A233C3|5|11|||
Resistor|4700|211|371|1|Resistor|R?||3||IC||
Wire||290|460|11||11|#FF9900|8|11|||
Wire||533|405|11||11|#FF9900|3|11|||
Wire||531|269|21||11|#FF9900|5|11|||
Wire||587|377|11||11|#CC6633|2|11|||
Wire||585|269|21||11|#CC6633|4|11|||
Wire||344|432|11||11|#CC6633|9|11|||
Wire||342|77|21||11|#FF0000|6|11|||
Wire||207|242|21||11|#FF0000|5|11|||
Wire||209|240|11||11|#FF0000|5|11|||
Wire||342|379|21||11|#000000|6|11|||
LED|0|978|104|2|LED|LED?|2|||IC||led_22
LED|0|951|104|2|LED|LED?|1|||IC||led_12
Resistor|330|957|272|2|Resistor|R?||2||IC||
Resistor|330|984|272|2|Resistor|R?||2||IC||
Miscell||907|595|1||XX?||1|14|Miscell||misc_14
Wire||908|379|21||11|#FF0000|8|11|||
Wire||935|544|21||11|#000000|2|11|||
Miscell||206|595|1||XX?||1|13|Miscell||misc_13
Wire||234|544|21||11|#000000|2|11|||
Wire||207|516|21||11|#FF0000|3|11|||
BREADBOARDSTYLE=BB11



* (WESTAUST55, would it be possible to create another 30r, 2 Blk, Red template (for pebbles) but with a-f and g-i, or else tell me how to create the file and I will do the work and pass back for inclusion)

** Does anyone know if there is a picaxe users group in London that actually meet up for help, advice and sharing of ideas?

Once again (oo) NoIdea (oo)
 

Attachments

Dippy

Moderator
What do you mean by 'trip'?

Do you mean the programme comes to a halt?
Or the code resets?
Or a fuse blows?

Sorry, I'm a 'schematic' person, I can't follow pictures/images of breadboards.
(Although, I have to say, you have done it very neatly; far better than mine)
Also, with phone camera quality, I can't easily see chip orientation - and I haven't got time to run it through Photoshop, sorry.

I can't see any nice healthy decoupling caps on the chips.
I can't see how you've connected regulators and caps.
In many cases the power supply (regulator) arrangement isn't man enough.

Have you tried it with something less greedy/reactive than a motor? e.g. a light bulb or low-ish ohmic power resistor?

Have you done any measurements on the power supply lines when connecting motor?

I'm afraid I haven't time to check code. I'm in a rush.

Have you produced (drawn or CADded) a schematic?
Post that as well please.
 

westaust55

Moderator
Dear All,

* (WESTAUST55, would it be possible to create another 30r, 2 Blk, Red template (for pebbles) but with a-f and g-i, or else tell me how to create the file and I will do the work and pass back for inclusion)

** Does anyone know if there is a picaxe users group in London that actually meet up for help, advice and sharing of ideas?

Once again (oo) NoIdea (oo)
@NoIdea,

To create a new image is relatively easy (you could just take an existing image and "stretch" it) it is more in adding the image into the program that requires some knowledge.
In the PEBBLE html file need to add the added entry for the extra BB
In the imagedata javascript file need to link in the new image source file
In the Apps javascript file need to provide dimensions for the new image
In the Utils javascript file need to define the number of rows and columns and the left and right margins from edge of image to first and last “holes”.

I can add it to my wish list . . .


You would also do well to start using the control codes to put your program and PEBBLE listings in sub windows so your total post length is shorter.
the codes are [code] and [/code] for the program then [quote] and [/quote] for other information

with respect to the comment:
You will notice that the code refers to pin 0,1 as this activates the LEDS, these connections are not shown in the picture as I couldnt find the icon to use.
unclear as to what you cannot find. ???
 
Last edited:

Rickharris

Senior Member
L293D is limited to 60Ma per output - Go over this and the chip will internally current limit. is this your problem. Sorry can't see the pictures on this PC.
 

hippy

Technical Support
Staff member
Attached is the pebbles pic of my breadboard the code and an actual shot of the breadboard.
I'm afraid I'm with Dippy, I find a schematic essential to understanding.

A breadboard layout is great for showing others how to wire things up and get it to work, and a schematic can be determined from that, but I just don't have the time nor the commitment to do that. The same goes for PCB layouts. Ideally you want ...

1) Schematic - Others check it is valid and correct
2) Program - Others check it makes sense with respect to schematic
3) PEBBLE/PCB - Others check you implemented the schematic correctly
4) Photo - Others check you built it as per PEBBLE/PCB

PEBBLE/PCB only is just about tolerable when it's something like "Download doesn't work" and it only needs the downcload part checking and the circuit is known. Talking of which ... Your Serial Input is not connected on PEBBLE but floating ( no 0V ). And the 22K isn't.

I think PEBBLE is only going to be useful if it is correct and complete, includes all components used. I don't like the idea of showing one (two) type of power supply but using another in reality. 'This is what I have, but it's different' doesn't motivate analysis, not for me anyway.

Added: I think it's also important to get into the habit of building a real breadboard as per PEBBLE, and drawing PEBBLE exactly as it should be built. A real breadboard should also show all connections being used. You don't show +V2 power; maybe you connected it to the wrong hole ?
 
Last edited:

westaust55

Moderator
@NoIdea,

think you would do well to firstly try and explain what you program is supposed to do one step at a time. Have a look at my comments to your FWD subroutine.
A motor is not going to turn much in 0.0015 seconds pulse followed by a 2.5 sec pause.

Code:
FRWD:
let speedL = 150
let speedR = 150

let pins = %00110001  ; both 4 and 5 high stops motor 1 + both 6 and 7 low stops motor 2
pulsout 6, speedL     ; 1.5ms (= 0.0015sec) pulse on out6 so Motor 2 "bumps"
pause 15
let pins = %11000001  ; both 4 and 5 low stops motor 1 + both 6 and 7 high stops motor 2
pulsout 4, speedR     ; 1.5ms pulse on out4 so Motor 1 "bumps"
pause 15

let pins = %10100001 `FORWARD MOTORS, GREEN LED ON
pause 2500		   ; wait 2500ms = 2.5 seconds

RETURN
Edit: (back after dinner break :) )

Next, when you pulse 6 that puts a high on L293D pin 2A, so 2Y goes high and the 1N4001 diode puts a short to 1Y which is low (0V).
Its no wonder that the circuit "trips" - a dead short on the supply
pulse out on 4 does the same thing
 
Last edited:

Noidea

New Member
Dear All,

Thanks for the replies...

I have attached a schematic, I call it one as its my first ever attempt. I tried to use DipTrace but could not find the parts I wanted, so used ISIS ( :confused: SIDE NOTE is ISIS worth buying?). tried to install eli and libs from WestAust55 to no avail.

WestAust55, the code where i pulse for 15 is to set motor speed, as eventually i want to control speed.

Hope the schmatic clarifies, please be gentle on my first attempt, some people are a bit ruff on us newbs when all we are doing is trying to learn.
 

Attachments

westaust55

Moderator
@NoIdea,

Read the last part of what I wrote at post 8.
(the bit which starts "Next, when you pulse 6 . . . . "

Next remove the two diodes (D4 and D5 in the schematic) and try to run the motors again.

does it trip the power supply then?

EDIT:
QUOTE=Noidea;109018] I tried to use DipTrace but could not find the parts I wanted, so used ISIS ( :confused: SIDE NOTE is ISIS worth buying?). tried to install eli and libs from WestAust55 to no avail.
[/QUOTE]

What do you mean by "to no avail" ?

The L293D is there in mycroft's library. See attached screen shot.

I think that you need to be a little bit more explanatory in what you say.
 

Attachments

Last edited:

Michael 2727

Senior Member
Your regulator may be shutting down due to lack of overhead voltage.

A standard 78XX regulator Must have around 2V to 2.5V above
the rated regulated voltage available on the input side of the regulator for it
to function correctly.
This voltage must be available under all conditions including at FULL LOAD output.

If the regulator shuts down it will only dribble out 1 or 2 mA of power.
You need to remove the power supply to reset the regulator or it may remain
in shutdown mode even if the correct voltage or more is returned to the input.

If you are using a recycled SLA Battery from an old Alarm backup or UPS it may
read 12V on your multimeter but under load the voltage may drop below the
(shutdown ) trip threshold of the regulator.

This is where large sized Capacitors on the supply can help, but they won't
save a failing or weak battery.
 

slurp

Senior Member
Aside from the diode issues I've also found the routing of 5v to PICAXE and motor controller crucial to successful operation.

Motor can be a (relatively) big load, if the supply to these and the controller are in series (back to the regulator) then the controller may brown out as voltage fluctuates.

regards,
colin
 

Dippy

Moderator
Measuring dips under load is why I suggested:

"Have you tried it with something less greedy/reactive than a motor? e.g. a light bulb or low-ish ohmic power resistor?

Have you done any measurements on the power supply lines when connecting motor?"

in Post #2.


ALSO.
1. I don't see the (almost) mandatory decoupling capacitor(s) on PICAXE.
2. I notice ST suggest capacitors on the L293 V+supply in a couple of their Example circuits in their DATA SHEET.

As has been said before: physical Capacitor position is as important as value.
Try a capacitor , say 100 to 200uF between +V and Gnd right next to the L293 chip.

The idea being that the Capacitor supplies the oomph surge locally and thus reduces the IxR dip in the power wire.
If you start plonking capacitors miles away it doesn't help whatsoever.

And as suggested, assuming you have connected it up correctly, it could be feeble wiring or sharing a weedy power wire for PICAXE and L293 or sharing a weedy ground wire.

And I still don't know what 'trips out' means, so I've given up on that one ;)
 
Top