Shop OBEX P1 Docs P2 Docs Learn Events
PPDB labs, projects, and wiring diagrams??? (L293D chip use) — Parallax Forums

PPDB labs, projects, and wiring diagrams??? (L293D chip use)

eiplannereiplanner Posts: 112
edited 2012-12-25 12:00 in General Discussion
I've gotten away, for quite a while, from learning & experimenting with my Professional Development Board and can't recall all the resources I used to use.

I'm trying to test a 4 wire stepper motor and can't find a wiring diagram for how to set up the PPDB to use the L293D circuit. I keep finding lots of references to the L293D data sheet and so on but I need the circuit setup for the PPDB. I remember using this once before and I could have sworn I did it from a Parallax Lab or something. (I'm simply not knowledgeable enough with it to have figured it out on my own - There had to have been a step by step procedure I followed when I worked with it before) I don't see a lab for it in my Prop Edu Kit. I've browsed tons of forum entries and am coming up short.

Can someone point me to a specific project or other resource that explains the use of the L293D circuit as it is laid out on the PPDB?

Thanks

Comments

  • RDL2004RDL2004 Posts: 2,554
    edited 2012-12-23 13:11
    I realize you're using the Propeller PDB, but the PDB for the Basic Stamps has an L293 also. The Stampworks manual (which uses that board) has some code and a wiring diagram which may be helpful. You can download a free copy (pdf).
  • eiplannereiplanner Posts: 112
    edited 2012-12-25 10:45
    This is a diagram of what I have connected on the PPDB. Don't laugh (well, OK, go ahead and laugh). I just did it this way as best I could understand the datasheet for the L293. I wrote a very rudimentary spin program with 'outa' commands from the prop pins that corresponded to the (+,-) sequencing that I determined would make my stepper motor turn.

    Repeat
    outa[4] := 1 '
    outa[6] := 1
    waitcnt(clkfreq*4 + cnt)
    outa[4] := 0
    outa[6] := 0
    waitcnt(clkfreq/16 + cnt)
    outa[4] := 1
    outa[7] := 1
    waitcnt(clkfreq*4 + cnt)
    outa[4] := 0
    outa[7] := 0
    waitcnt(clkfreq/16 + cnt)
    outa[5] := 1
    outa[7] := 1
    waitcnt(clkfreq*4 + cnt)
    outa[5] := 0
    outa[7] := 0
    waitcnt(clkfreq/16 + cnt)
    outa[5] := 1
    outa[6] := 1
    waitcnt(clkfreq/*4 + cnt)
    outa[5] := 0
    outa[6] := 0
    waitcnt(clkfreq/16 + cnt)

    Believe it or not, it worked. I then went in to shorten the time delays between sequences to make the motor spin faster. It worked. I continued reducing the delays by half and about the fourth time. It quit working. The motor just started taking a step forward then a step backward (stepper still ohms out good). My L293 chip was very hot to the touch. Not sure if I've burned it up or not (don't know how to test). Even putting the time delays back to the original values, I never could get it to spin again. Just step forward and backward. The L293 gets very hot within about 10 seconds so I turn it off.

    I don't pretend for a second to know what I am doing with this motor driver circuit, I just wanted to try it. Not being sure what connections are internal on the PPDB, it was rather difficult for me to follow the datasheet for the L293. These are my concerns:

    - Where does the external motor supply voltage connect on the PPDB?
    - What voltage or signals is supposed to connect to the L293 'enable' pins?
    - Is there anything wrong with using the simple 'outa' commands from the prop to supply input voltages to the L293 inputs?

    The diagram is of the exact physical connections I have made on the PPDB. I have no pull-ups, pull-downs, filters or anything else in the circuit except whats on the diagram. I was hoping maybe showing what I did would explain what I am trying to do better than just my explanation. I'm hoping someone can help me get this right.

    Stepper.jpg
    795 x 793 - 48K
  • Duane DegnDuane Degn Posts: 10,588
    edited 2012-12-25 12:00
    I know there's a schematic for the PPDB. IIRC, it's kind of hard to follow. It looks like you've got things pretty well figured out already.

    I'm not stepper motor expert but I've played around with the PPDB and a stepper myself.
    eiplanner wrote: »
    - Where does the external motor supply voltage connect on the PPDB?

    It looks like you've figured this out. Your diagram has it correct.
    eiplanner wrote: »
    - What voltage or signals is supposed to connect to the L293 'enable' pins?

    I'm pretty sure either 5V or 3.3V will work. I know in my test I controlled the enable pin from a Prop I/O pin so it was being controlled with 3.3V. The L293 logic power is hard wired to the PPDB's 5V line but the chip seems to work fine with either 3.3V logic or 5V logic.
    eiplanner wrote: »
    - Is there anything wrong with using the simple 'outa' commands from the prop to supply input voltages to the L293 inputs?

    I don't think there's anything wrong with this approach. I'm pretty sure that way it was intended to be used.

    When I experimented with a stepper I used a bit pattern that I rotated left or right to drive the stepper.
    _InitialPattern = p11001100_11001100_11001100_11001100
    

    I had to use a "p" instead of a percent sign since the forum software eats percent signs.

    After assigning this "_InitialPattern" to a variable "stepPattern", I'd use outa to drive all four pins at once.
    outa[pinD..pinA] := stepPattern
    

    "pinD" and "pinA" where the end pins of a group of four.
    I thought using a rotating pattern made it easier to control the stepper.

    You might have less of a heat problem if you use a lower voltage to drive your stepper? Adding a heat sink to the chip would probably help keep it cooler.
Sign In or Register to comment.