Shop OBEX P1 Docs P2 Docs Learn Events
Darlington — Parallax Forums

Darlington

Jonathan AllisonJonathan Allison Posts: 96
edited 2005-07-27 18:07 in BASIC Stamp
Hello everyone


I'm having a tough time trying to get a stepping motor working off my stamp.



The motor works. I can use the power supply and make it "step"



The stamp works, I can light an LED with the pins I am using.



The wiring to the motor is ok, I tested the wire where its pushed in the breadboard, steps that way too.



As far as I know, and from all the information I can find the darlington is hooked up correctly.



I attached a picture, might help...



Any suggestions would be awesome



Thanks

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Johnny

Post Edited (Jonathan Allison) : 2/25/2005 2:51:48 AM GMT
2048 x 1536 - 295K
«1

Comments

  • MacGeek117MacGeek117 Posts: 747
    edited 2005-02-25 01:56
    A wire is disconnected.freaked.gif You might also want to include a schematic.
    bugg

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Geordi: "It's like the laws of physics went right out the window!"
    Q: "And why shouldn't they, there so inconvinient!"

    Geordi LaForge, Chief Engineer, USS Enterprise, NCC 1701-D
    Q, Omnipotent Prankster
  • Jonathan AllisonJonathan Allison Posts: 96
    edited 2005-02-25 02:42
    Here are some schematics I drew up in paint [noparse]:)[/noparse] My girlfriend just complemented me on my MS-Paint abilities lol

    Anyway, please let me know if there is anything obviously wrong.



    That wire that is not connected, must have come disconnected as I moved it around to take the pic, but just incase, I tried it again with it connected, still nothing :S

    Forgot to mention, the wire furthest to the right, is a red wire off the stepper, and the stepper is a Mitsumi M35SP - 9T.

    The code I am using to (try) to drive it is directly from parallax (Under Components - >Motors and Control -> Stepper Motor). The motor they feature is also a Mitsumi.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Johnny

    Post Edited (Jonathan Allison) : 2/25/2005 2:54:39 AM GMT
  • Jonathan AllisonJonathan Allison Posts: 96
    edited 2005-02-25 04:22
    I was just looking at a diagram that showed the unl2803 as being hooked up with pin 9 and 10 sharing the same ground, with a .1uf cap between the bs2 vss and the power supply negative. Does that make sense is that what I am doing wrong?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Johnny
  • kb2hapkb2hap Posts: 218
    edited 2005-02-25 13:46
    Johnny,

    ··· It looks good except for possibly one thing (maybe). on your diagram you have pin 10 of the 2803 connected to ground? If thats the case then thats were your problem is that should be connected to + from you incomming voltage and pin 9 of the 2803 and Vss on the stamp should be connected to ground or -. he is a good nuts and volts article that may help you

    http://www.parallax.com/dl/docs/cols/nv/vol1/col/nv6.pdf


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    DTQ

    Post Edited (kb2hap) : 2/25/2005 1:51:51 PM GMT
  • Jonathan AllisonJonathan Allison Posts: 96
    edited 2005-02-25 16:19
    Ok, I've tried that, and still nothing.

    Its obvious I must have it hooked up wrong somewhere along the way.

    The motor works, you can see this by connecting the wires of the power supply directly to the motor and watch it move.

    the stamp works, and those paticular pins work. You can connect an LED to them and watch the flasing sequences as it runs the stepper motor code.

    I'm not sure where to go from here!

    "pin 9 of the 2803 and Vss on the stamp should be connected to ground or -."
    Is this to say that, I should connect a wire from 10, To the negative of my stepper power supply to pins 9 and from pin 9 to VSS of the stamp?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Johnny

    Post Edited (Jonathan Allison) : 2/25/2005 4:24:27 PM GMT
  • Bruce BatesBruce Bates Posts: 3,045
    edited 2005-02-25 16:46
    Johnny -

    It may be time to show us a copy of your program so that we can take a look at what you have. While we're looking at it, you may want to add the following line to the beginning of your program, and try it again:

    DEBUG "Starting"

    If that line shows up only once, that's fine. If it shows up more than once during the execution of your program the Stamp is resetting and re-executing your program without really doing anything. If that's the case (multiple displays) we need to look for an over-current problem somewhere, probably in the wiring.

    If that works okay, you may want to intersperse a number of DEBUG statements in your program to check the program flow, and hopefully "see" where the problem may be occuring.

    Regards,

    Bruce Bates
  • Jonathan AllisonJonathan Allison Posts: 96
    edited 2005-02-25 17:10
    Here is the code, its copied directly from some parallax had as an example. You can see I have added the DEBUG line here, and yes, it does get displayed repeatedly.


    Phase VAR OUTB ' phase control outputs
    idx VAR Byte ' loop counter
    stpIdx VAR Nib ' step pointer
    stpDelay VAR Byte ' delay for speed control
    Steps DATA %0011, %0110, %1100, %1001

    Setup:
    DIRB = %1111 ' make P4..P7 outputs
    stpDelay = 15 ' set step delay

    Main:
    DEBUG "hi", CR
    FOR idx = 1 TO 48 ' one revolution
    GOSUB Step_Fwd ' rotate clockwise
    NEXT
    PAUSE 500 ' wait 1/2 second
    FOR idx = 1 TO 48 ' one revolution
    GOSUB Step_Rev ' rotate counter-clockwise
    NEXT
    PAUSE 500 ' wait 1/2 second
    GOTO Main
    END


    Step_Fwd:
    stpIdx = stpIdx + 1 // 4 ' point to next step
    GOTO Do_Step

    Step_Rev:
    stpIdx = stpIdx + 3 // 4 ' point to previous step
    GOTO Do_Step

    Do_Step:
    READ (Steps + stpIdx), Phase ' output new phase data
    HIGH Phase
    PAUSE stpDelay ' pause between steps
    LOW Phase
    RETURN

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Johnny
  • David BDavid B Posts: 591
    edited 2005-02-25 17:20
    A good way to test steppers is to take pretty much exactly what you heve wired already, connect wires to the Darlington inputs, then connect them by hand to either ground or power, to energize or turn off each stepper winding. It helps to label the stepper inputs like A, B, C, D.

    Each wire that you energize should make the stepper shaft jump.

    That is, if you even have any current flowing at all; getting the Darlington wired properly would be the first step.

    It's pretty easy to discover the pattern that you need to make the shaft continue to jump in the same direction of rotation. You should find a pattern is needed like (where the letter means the stepper lead has current flowing)

    AC
    AD
    BD
    BC
    AC
    AD
    ...

    Then you just program the stamp to produce that same pattern. Reversing the motor will need a different but similar pattern.

    If you pass a lot of current through a coil (like a stepper winding) then disconnect it, inductance can generate a large voltage across the coil, like hundreds of volts, which can zap unprotected transistors. Do you have any protection diodes? Some Darlingtons come with these built in.

    David
  • Jonathan AllisonJonathan Allison Posts: 96
    edited 2005-02-25 19:18
    I'm using an ULN2803, which is has the protection diodes

    I found the pattern to excite the coils properly, it seems to be like the darlington is not outputting. I have four new ones, I tried two different ones but no luck.

    Can somone confirm the schematics above are correct for the hookup of a ULN2803?

    Thanks

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Johnny
  • kb2hapkb2hap Posts: 218
    edited 2005-02-25 19:32
    Did you read that N&V article?

    the 2808 does not output!
    it will sink the current to ground

    the stamp pins inface to the base off the transistor.
    the 2803 pins that you call outputs are the collectors of the transistors
    and the emitter of the transistor goes to ground

    so that means that you want to wire the + side to the + side of your load
    and on the - side of your load will go to each 2803 pin
    when you active the base on the 2803 it opens the gate so your current can flow through you motor to the transistor and on off to ground.

    also take a close look at the 2803 datasheet

    test your stamp pins if your getting output on them at the neccessary time. the it is probably the way you have your 2803 wired
    also pin 9 on the 2803 goes to ground
    pin 10 goes to + whatever volts you use

    hope it helps

    seriously if you stamp works and you motor works then its probably the way you have the 2803 wired take a look at n&v its you friend. ha ha

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    DTQ
  • NewzedNewzed Posts: 2,503
    edited 2005-02-25 19:34
    Your schematic is wrong.· The power supply positive goes to the stepper and the·negative side of the power supply goes to a Darlington pin.· When the Darlington is turned on, the collector goes to ground, completing the power supply circuit.· The positive side of the power supply should also go to Pin 10 of the 2803.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Sid Weaver
    Do you have a Stamp Tester?

    http://hometown.aol.com/newzed/index.html
    ·
  • NewzedNewzed Posts: 2,503
    edited 2005-02-25 19:39
    CORRECTION!· The negative side of the stepper goes to the Darlington pin.
    Sorry about that.· The negative side of the power supply goes to ground, as does Pin 9 of the Darlington.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Sid Weaver
    Do you have a Stamp Tester?

    http://hometown.aol.com/newzed/index.html
    ·
  • Bruce BatesBruce Bates Posts: 3,045
    edited 2005-02-25 20:06
    Johnny -

    After you get the wiring straightened out, I fear you may have another problem. According to the documentation I was able to find on that stepper motor, it draws 517 mA per phase, and the ULN2803 will only handle 500 mA. Thus, you are exceeding the capacity of the ULN2803. I've no idea how it will react to those conditions, but I would submit it may be potentially dangerous to the Stamp. The documentation I found came from the Mitsumi web site.

    Regards,

    Bruce Bates
  • NewzedNewzed Posts: 2,503
    edited 2005-02-25 20:14
    Johnny, Bruce is correct.· You would be better off going to a TIP120 Darlington transistor.· It has the built-in diode, and will handle 5A at 60V.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Sid Weaver
    Do you have a Stamp Tester?

    http://hometown.aol.com/newzed/index.html
    ·
  • NewzedNewzed Posts: 2,503
    edited 2005-02-25 20:33
    Johnny, Digikey has the TIP120 - $0.74 each.· Comes in a TO 220 package, just like a voltage regulator.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Sid Weaver
    Do you have a Stamp Tester?

    http://hometown.aol.com/newzed/index.html
    ·
  • Jonathan AllisonJonathan Allison Posts: 96
    edited 2005-02-26 02:42
    Thanks for the feedback.....

    Looks like I've got some more research to do before I proceed.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Johnny
  • Jonathan AllisonJonathan Allison Posts: 96
    edited 2005-02-26 04:24
    I can get the motor to turn in a counter-clockwise direction, by connecting ground of the power source to the red wire, then making a connection from + of the power source to the other wires in the following order: black, brown, orange, yellow. I am assuming to go clockwise I simply would reverse the order. Now, my power source is rating at 7.5v @ 340mA output, in that case, even though it might not bring out the full potential of the motor, would it not be safe to use the ULN2803 for experimental / learning purposes ?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Johnny

    Post Edited (Jonathan Allison) : 2/26/2005 4:59:34 PM GMT
  • Jonathan AllisonJonathan Allison Posts: 96
    edited 2005-02-26 17:03
    One more thing, if I use an ohms meter to test things out, on the BS2 pin side, I can see the pulses at each pin (4 thru 7), however if I test from the + of the power source for the stepper, each pin gives me max ohms, no visable pulses. There obviously is something wrong but I can't see what the problem is as I have double checked all connections etc, I know the motor works etc. I included a "debug" LED at P15 and I can watch that flash as the BS2 executes the code which should be running the stepper.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Johnny
  • Jonathan AllisonJonathan Allison Posts: 96
    edited 2005-02-28 17:26
    Let me see if my understanding of a darrlington is correct

    below is a simple representation of a 2803

    1·18
    2 17
    3 16
    4 15
    5 14
    6 13
    7 12
    8·11
    9 10

    - between 1 and 18 would be the half moon cut-away, indicated the top of the chip
    - 1 through 9 are to be connected to bs2 pins.
    - 9 goes to VSS on bs2
    - 18 throw 10 are to be connected to power supply / device requiring higher power supply
    - 10 goes to ground of power source
    - The device gets powered with the + from power source (obviously)
    - When one of the pins is activated (1 to 8) (set HIGH) it allows the power to sink through the pins (11 throw to 18)
    - When that pin is set low the power stops.

    If my understanding is correct, my wiring is correct, and I have no idea why the pins aren't sinking the current from the stepping motor.

    Again, if anyone has any ideas at all I would be very interested in hearing them.



    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Johnny
  • NewzedNewzed Posts: 2,503
    edited 2005-02-28 18:04
    Pin 9 goes to Vss - system ground, which inckluded power supply ground.

    Pin 10 goes to the positive side of your power source.

    The positive side of your power goes to the positive side of the device.· The negative side of the device goes to Pins 11-20.
    One device (or motor wining) per pin.
    A high to the pin opposite 21-11 turns that channel on, a low turns it off.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Sid Weaver
    Do you have a Stamp Tester?

    http://hometown.aol.com/newzed/index.html
    ·
  • NewzedNewzed Posts: 2,503
    edited 2005-02-28 18:07
    Don't you have a datasheet for the ULN2803?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Sid Weaver
    Do you have a Stamp Tester?

    http://hometown.aol.com/newzed/index.html
    ·
  • SunflowerSunflower Posts: 48
    edited 2005-02-28 18:48
    The negative side of the device goes to Pins 11-20. One device (or motor wining) per pin.

    Question: Can I connect several pins of the ULN2803 together to handle more power?
  • NewzedNewzed Posts: 2,503
    edited 2005-02-28 19:06
    Yes, but you are still limited to 500ma max for the chip.· I believe I recommended you go to a TIP120, which will handle 5 amps.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Sid Weaver
    Do you have a Stamp Tester?

    http://hometown.aol.com/newzed/index.html
    ·
  • SunflowerSunflower Posts: 48
    edited 2005-02-28 20:27
    Yes, thanks for the TIP. I will use them for our drivers.
  • Jonathan AllisonJonathan Allison Posts: 96
    edited 2005-03-01 04:32
    I hope I'm not tiring anyone with this post

    I'd just like to get this working. I started off by following data sheets etc. The wiring appears correct acording to all sources, the code is ok too.

    So instead of hooking the motor up etc and trying to make it run, I've taken a few steps backwards to just do some debugging / trouble shooting.

    So I have my breadboard, darlington inserted in the middle, bs2 connected to darlington pins, 1, 2, 3, and 4. Pin 9 of the darlington is connected to the VSS on the bs2. Correct me if I am wrong, but that is all that needs to be done on the bs2 side.

    On the other side, I had the motor wired, correctly to the best of my knowledge, power source ground to pin 10 darlington and positive to red wire on motor (its a mitsumi). The other motor wires connected to pins 18, 17, 16, 15 darlington. That didn't work. No movement in the motor what-so-ever, no indication of any power flowing through it. Its not hard to tell when power is running through a stepping motor, it holds its position. Now I have the motor disconnected (a few steps back). If i read with an ohm meter pin 9 and pin 1 I can clearly see the electrical pulses generated by the bs2. If I connect the ohm meter using pin 18 and 10 on the darlington, I get a reading - however, it is constant, and much weaker then the one from the bs2 side.

    Has anyone heard of or encoutered this b4?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Johnny

    Post Edited (Jonathan Allison) : 3/1/2005 4:35:32 AM GMT
  • Bruce BatesBruce Bates Posts: 3,045
    edited 2005-03-01 06:47
    Johnny -

    One of the best resources for learning about stepper motors, how they operate, how to wire them, how they can be driven, and how to troubleshoot problems can be found here:
    http://www.doc.ic.ac.uk/~ih/doc/stepper/

    That is Ian Harries classic treatise on stepper motors and the place where many of us learned all the basics. There a loads of links, tutorials, and descriptions.

    Going back to the very beginning, and identifying which leads represent which coils within the stepper motor, is probably the most important thing you can do at this juncture. From that you can then determine the correct wiring. "Ringing out the motor" which is what this is often called, is done using an ohmmeter with no power applied, and the motor disconnected from the entire circuit.

    I'm not sure whether you're mis-using the term "ohm meter" or misunderstanding its use, but an ohmmeter should NEVER be used on a live circuit, if that's what you're doing. The internal diodes in the Darlington array may also be causing you to get unusual readings.

    Since it appears there's a lot of on-the-fly re-wiring going on during troubleshooting, you may want to fuse the leads coming from the ULN2803 Darlington array at 500 ma. to gain some measure of over-current protection and to prevent any short circuits.

    Regards,

    Bruce Bates

    Post Edited (Bruce Bates) : 3/1/2005 7:05:22 AM GMT
  • NewzedNewzed Posts: 2,503
    edited 2005-03-01 12:52
    Pin 10 DOES NOT GO TO GROUND.· Pin 10 goes to the positive side of your motor power supply.·

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Sid Weaver
    Do you have a Stamp Tester?

    http://hometown.aol.com/newzed/index.html
    ·
  • kb2hapkb2hap Posts: 218
    edited 2005-03-01 13:47
    You almost got it! keep trying heres my quick and dirty pic (not as· nice as yours but the pin layouts are the same

    Hey I'm editing the fact that you dont want to hook up your stamp to the 24v supply that your supply you motor with

    also I just found this I'm not sure if you have already seen it its for a parallax stepper

    http://www.parallax.com/dl/docs/prod/motors/27964.pdf


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    DTQ

    Post Edited (kb2hap) : 3/1/2005 2:04:38 PM GMT
    2803.bmp 464.9K
  • MacGeek117MacGeek117 Posts: 747
    edited 2005-03-01 14:57
    Um, guys, check pg 299 of the book Build Your Own Robot for a schematic of the 2803. pin 10 goes to ground.
    bugg

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Geordi: "It's like the laws of physics went right out the window!"
    Q: "And why shouldn't they, they're so inconvenient!"

    Geordi LaForge, Chief Engineer, USS Enterprise, NCC 1701-D
    Q, Omnipotent Prankster
  • NewzedNewzed Posts: 2,503
    edited 2005-03-01 15:19
    Pin 10 DOES NOT· - I repeat, DOES NOT - go to ground.· It goes to the positive side of the power supply for whatever the Darlington is controlling.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Sid Weaver
    Do you have a Stamp Tester?

    http://hometown.aol.com/newzed/index.html
    ·
Sign In or Register to comment.