Shop OBEX P1 Docs P2 Docs Learn Events
stepper motor — Parallax Forums

stepper motor

beabea Posts: 9
edited 2005-10-11 01:05 in BASIC Stamp
I connected a stepper motor to a basic stamp II and·· a ULN 2803 and ran a example program from parallax to make the motor move, but nothing happen.· Can any help me in maybe giving me suggestions in what I can be doing wrong.· Thanks

Comments

  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-10-09 01:29
    Hello,

    ·· Details are a little vague.· You didn't say which wires were connected where or how you connected the ULN to the BASIC Stamp.· What power supply is running the Stepper Motor?· How about the BASIC Stamp?· Can you post your code?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • beabea Posts: 9
    edited 2005-10-09 02:35
    hope this gives more details of what I want to do.·
    I connected the motor in pins 18,17,16, and 15 of the ULN2803 and the ULN2803 to pins 4, 5, 6, and 7 of the Basic Stamp II.· The power supply was 12volts.

    this was the program I tried

    ' {$STAMP BS2}
    ' {$PBASIC 2.5}
    Phase VAR OUTB ' phase control outputs
    StpsPerRev CON 48 ' whole steps per rev
    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:
    FOR idx = 1 TO StpsPerRev ' one revolution
    GOSUB Step_Fwd ' rotate clockwise
    NEXT
    PAUSE 500 ' wait 1/2 second
    FOR idx = 1 TO StpsPerRev ' 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
    PAUSE stpDelay ' pause between steps
    RETURN
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-10-09 02:47
    A few notes...It matters what order the wires go in terms of color.· I don't know if you accounted for that.· Also, the 12V supply need to be connected to the common line of the Stepper Motor as well as to the V+ pin on the ULN2803.· There needs to be a common ground between the supplies.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • beabea Posts: 9
    edited 2005-10-10 15:26
    The following is how I connected the motor to the ULN2803:

    Black to pin 18 of ULN2803
    orange to pin 17 of ULN 2803
    brown to pin 16 of ULN 2803
    yellow to pin 15 of ULN 2803
    red to the 12 volts

    I don't think·I connected the 12 volts to the ULN 2803.· Is that how much I need to connect to the ULN 2803.·

    What about the program was that correct and what about the way I connected it to the Basic stamp II.

    Thanks
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-10-10 16:08
    Where did you get the Stepper Motor from?· You need to use the datasheet to find out which colors go to which phases on the motor.· And by connecting the supply to V+ on the ULN2803 it allows the protection diodes to be used.· Without that terminal those diodes aren't connected.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • beabea Posts: 9
    edited 2005-10-10 16:14
    The motor, ULN 2803 and basic stamp were all bought from parallax. I am using the board of education, can that be a reason should I just get the basic stamp II on its own, or can I use that board.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-10-10 17:03
    Okay,

    ·· The +12V common (Red wire) would connect to PIN 10 on the ULN 2803 as well as the +12V supply.· Pin 9 of the ULN2803 must be connected to the Vss on the BOE (Yes, you can use it).· P4-P7 should be connected to Pins 1 through 4 on the ULN2803.· I haven't tested the code, but it look s like the demo code, so it should work.· What exactly is happening?· Is the Stepper Motor doing anything?· Humming?· Is the ULN2803 getting warm?


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com


    Post Edited (Chris Savage (Parallax)) : 10/10/2005 5:29:09 PM GMT
  • beabea Posts: 9
    edited 2005-10-10 17:27
    No it does nothing, not even a humming noise and the ULN2803 does not get warm either. So the Black wire and the red wire of the motor are both connected to the common. On the data sheet it says that for the Mitsumi motor phase 1 (pin 18 of the ULN2803) is connect to the black wire and the red wire was connected to the common of the ULN2803
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-10-10 17:30
    Sorry about that...No, the black wire is phase 1...The RED wire is the common on this Steper (We had one where Black was common).· Are you sure you have a common ground with your 12V supply and the Vss on the BASIC Stamp?· They must have a common ground.


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • beabea Posts: 9
    edited 2005-10-10 17:33
    I will try it again. Thank you
  • beabea Posts: 9
    edited 2005-10-11 00:32
    Hello, I connect everything as suggested but now it is only humming. What could I have done wrong.
  • beabea Posts: 9
    edited 2005-10-11 00:40
    it stopped humming and it is now working, thank you for the suggestion. But now I am trying to add another motor which pins do I use when connecting the ULN2803 to the basic stamp. I know that pins 4-7 are the outputs for the first motor but which pins would be the output for the second motor.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-10-11 01:05
    You can add another Stepper Motor no problem...The ULN2803 has 8 outputs, and the BASIC Stamp has plenty of I/O pins.· What you really should do now is study the code you're using.· All the answers are there.· That code is using port B, so it would make sense to use Port A.· Some code needs to be duplicated for the extra pins, while some needs to be integrated, such as the code to step the motor.· It would help to understand how the code works.· That code looks like it came from the StampWorks manual.· I would read the section in there on how the code works.· Theory of operation always helps.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
Sign In or Register to comment.