my little lab

Discussion in 'Embedded Systems and Microcontrollers' started by Eric007, Sep 17, 2011.

  1. Eric007

    Thread Starter Senior Member

    Aug 5, 2011
    1,044
    33
    Hi All!

    I'm doing a Lab playing a bit with a stepper motor...

    I've seen lots of threads about stepper motor in this forum BUT each one is slightly different...so I decided to post mine!

    First of all, I always like to set up my hardware connection right before I jump into the software part!

    Here's what I have: a stepper motor (SM55-4801, 12 volts, 36 Ohms coil, Fuji Electrochemical co.), a L298n H-bridge.

    The stepper motor has 6 wires: 2 groups (orange, red, yellow and black, green, brown).
    - I did some readings...and I want to confirm if the stepper moter is unipolar since it has 6 wires?
    - using the Ohmeter method, I been able to identify the center tap of each coil (red and green).

    - I'm trying to do my connection according to the schematics attached that I found...

    My questions are:

    - where do I connect the 2 center tap wires??
    - and the 2 other wires of each coil should be connected to the 4 outputs of the L298n as shown in the schematics, right? And it doesn't matter which of the 2 wires goes to which outputs, right?
    - I should feed 12V to pin4 of the L298n and 5V to pin9 of L298n
    - I'm thinking of using PIC16F690, what are pin (enable A and enable B for)?? And do they have to be connected to specific pins of the uc??
    - about pins input 1,2,3,4 of L298n, do they have to be connected a specific pin of uc??

    Any comments would be greatly appreciated!
     
  2. Eric007

    Thread Starter Senior Member

    Aug 5, 2011
    1,044
    33
    Oh I forgot! I can't find the datasheet for the stepper motor...Is it that important??

    Will talk about the software part later...

    Cheers!
     
  3. MMcLaren

    Well-Known Member

    Feb 14, 2010
    759
    116
    Eric,

    Sounds like you've got a "unipolar" stepper. You can drive that directly with the PIC (see below)... I've never had a "bipolar" motor so I've never had the need to use an L298. Sorry! However, I understand that you can drive a "unipolar" as a "bipolar" by simply using the four outer wires and ignoring the ceter tap windings.

    Cheerful regards, Mike
     
  4. Eric007

    Thread Starter Senior Member

    Aug 5, 2011
    1,044
    33
    Thx Mike for you reply!

    Are these transistors in your schematics?
    Since you said I can sill run that unipolar motor with the l298n, does that mean that the 2 center tap will be grounded or just ignored??
     
  5. Eric007

    Thread Starter Senior Member

    Aug 5, 2011
    1,044
    33
    Thx Mike for you reply!

    Are these transistors in your schematics?
    Since you said I can sill run that unipolar motor with the l298n, does that mean that the 2 center tap will be grounded or just ignored??
     
  6. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    It will help if you have the datasheet.

    If the motor has five or six wires, it is probably a unipolar stepper motor; and an L298 really isn't the driver for those.

    If the motor has four wires, it's a bipolar stepper, and needs a dual-H bridge. An L298 is a dual-H bridge, but it's really dated, and is power hungry. However, if you are going to use an L298, you really need the L297 to go along with it.

    If the motor has eight wires, it can be used as a bipolar in parallel or series, or a unipolar in parallel or series.

    Having a datasheet will eliminate a lot of experimenting on your part.

    [eta]
    Oops, I didn't see anything after reply #2 before I made this post. I've been in and out; company and several folks w/computer problems. :rolleyes:
    However, still need to know what you are dealing with there.
    The transistors on Mike's drawing are the TIP122's. They are Darlington transistors.

    Darlingtons are useful, but they're kind of going out of style, as they are somewhat power-hungry.
    If your coils are indeed 12v, 36 Ohms, that means they will pass about 333mA current through a winding when energized. A Darlington will lose somewhere between 0.8v and 1.6v from collector to emitter due to the way they work. This means power wasted in the transistor instead of used in the motor.

    But, it's not even worth talking about until you can locate a datasheet for the motor.
     
    Last edited: Sep 17, 2011
  7. MMcLaren

    Well-Known Member

    Feb 14, 2010
    759
    116
    The photo and drawing show TIP122 transistors. Sarge is correct, don't use those Darlington type transistors. Use logic level gate MOSFET's with low Rds(on) spec' instead (like IRL540, etc.).

    Lookup "jones on stepping motors" for some basics...
     
    Last edited: Sep 17, 2011
  8. Eric007

    Thread Starter Senior Member

    Aug 5, 2011
    1,044
    33
    Thx a lot for your comment SgtWookie!!!

    Can anybody help me find the datasheet for that motor then??? The specs of it are above in my description...

    I can't wait to set up my hardware quicly and move to the software part...

    So guyz u mean there's no way I can run this stepper motor using the l298n?? How about the schematics I attached in my post, can't work if I do my hardware setup that way??

    Thx again guyz!
     
  9. Eric007

    Thread Starter Senior Member

    Aug 5, 2011
    1,044
    33
    Talking about what I wana do...

    Not much...just turning that stepper motor clockwise 6 degree every 1 second!
    So my understanding is after 60 seconds/60 steps (I don't know if step is the correct term) there will be a complete revolution...

    Talking about that implementation on software (PIC), I'll have to know about duty cycle and PWM, is that correct?? And PIC16F690 can handle that, right?

    Lemme do some quick reading on duty cycle and PWM and also read PIC16F690 datasheet on PWM...

    BUT I'm still no fixed about the Hardware connection!! So still need your final suggestion...

    Like Sgtwookie said...I will need l297 along with l298 to make it work, is that corect?? If so how would the connection be?

    Regards,
     
  10. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    Ah, OK. Somehow I missed you mentioning that the motor has six wires; it's a unipolar motor. The L298 is made for driving a bipolar motor. It's possible to run a 6-wire unipolar motor in bipolar mode, but you need twice the input voltage, and the operation is more complex than unipolar mode.

    I ran across this motor:
    http://www.alltronics.com/cgi-bin/item/93I003/55/Stepper-Motor-Semi-Kit-93I002-(5804B)-and-25M003
    and they supplied a spec sheet with that motor:
    http://www.alltronics.com/mas_assets/acrobat/93I003.pdf
    The motors are likely different from what you have, but the spec sheet looks like it could be similar.
    It appears that the motor has 48 steps of 7.5° each instead of the 6° steps that you need - I'll guess that you are wanting to make a sweep second hand for a clock or timer.
     
  11. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    OK, have a look at the attached. It's basically trying to keep the stepper motor driver cheap but effective. The transistors are very inexpensive, and the way I've used them, the 2N2222 transistors wind up having the gain of a Darlington without the disadvantage of the high Vce and power dissipation of a Darlington.

    You can use logic-level MOSFETs instead if you like; but the MOSFETs will be static sensitive. One little "zap" that you wouldn't even feel will destroy them in an instant.

    The diodes are Schottky diodes. Something like 1N5817 through 1N5819 would be suitable. Typical silicon rectifier diodes won't work worth a darn, as they are far too slow. Computer switching diodes like 1N914, 1N4148 won't handle the current required.

    You don't have to start off with a 555 timer and a 4017 Johnson counter if you don't want to, but it's one way to make certain that you know which motor leads are which, getting the motor to step correctly, without the additional complication of software in a microcontroller.

    I haven't shown mandatory power supply bypass capacitors across the 4017 and 555 timer power pins to keep the schematic un-cluttered. If you don't use bypass capacitors, you will have problems.
     
  12. Eric007

    Thread Starter Senior Member

    Aug 5, 2011
    1,044
    33
    Yes Sir! I had a look at those 2 links yesterday BUT how are these helpful?

    I'm kind of stressed right now...

    Ok assuming I'm not gona use the l298n, how would you suggest/require that I do my hardware connection??

    And given that the exact datasheet for the motor can't be found, is it still possible to achieve that 6 degree/step??
     
  13. Eric007

    Thread Starter Senior Member

    Aug 5, 2011
    1,044
    33
    Oh I did NOT notice u post the above...lemme read it!! Thx
     
  14. John P

    AAC Fanatic!

    Oct 14, 2008
    1,634
    224
    I don't see why you shouldn't use a bipolar drive (L298N) with a unipolar motor, ignoring the center input wires as MMcLaren said. If the current is less than it would be with a unipolar drive and one coil on, you'd be using two coils at once and so it would work the same.

    The trick for figuring out the characteristics of an unknown stepper is to find specs for a similar motor, one which has the same size as the unknown one, preferably from the same manufacturer in the same series (i.e. is identical except for the voltage rating). Then figure out, based on the coil resistance and rated voltage or current, the power dissipation in a given coil (V squared over R, or I squared times R). Then using the coil resistance of your motor, calculate the voltage that will generate the same power loss. Basically, the same volume of copper will have the same power loss and the same production of magnetic force, so the motors will be almost identical in operation. It's just that for a high voltage, low current motor they'd use many turns of thin wire rather than a few turns of thick wire.
     
    Last edited: Sep 18, 2011
  15. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
  16. Eric007

    Thread Starter Senior Member

    Aug 5, 2011
    1,044
    33
    Guyz!!

    i been doing some research for a simple interfacing of a Unipolar steper motor with a microcontroller and i found the link bellow:

    http://naveenauvusali.blogspot.com/p/motor-interfacings.html

    i like the interfacing with the L293D as i attached but i can also go for the ULN2003A in case i cant find the L293D!

    BUT i first wana confirm with you guyz if i can go for it...

    Regards, Eric007
     
  17. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    I don't know why you're asking me for my comments, as you seem to have ignored everything I've written and gone off on your own tangent.

    Good luck with that.
     
  18. Eric007

    Thread Starter Senior Member

    Aug 5, 2011
    1,044
    33
    No Sir!! it not like that....
     
  19. Eric007

    Thread Starter Senior Member

    Aug 5, 2011
    1,044
    33
    your solution requires 8 npn transistor + 4 diodes, right? and 4x 10k resistors...
    is that all? and will that be connected straight to the i/o pin of the uc??
     
  20. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    If you want a minimal parts solution, you can go with a ULN2064:
    http://search.digikey.com/scripts/DkSearch/dksus.dll?Detail&name=497-2348-5-ND
    Datasheet: http://www.st.com/internet/com/TECHNICAL_RESOURCES/TECHNICAL_LITERATURE/DATASHEET/CD00000177.pdf
    The two cathode pins (K) get connected to Vcc.
    The four collector pins (C) get connected to the stepper wires that aren't red or green.
    The four input pins (B) get connected to the PIC output pins.
    All four ground pins get connected to GND, and a fairly large copper area for cooling purposes.

    The ULN2003A, although rated for up to 500mA, is not really suited for this stepper, as 333mA is actually "pushing it". The ULN2064 is rated for 1.5A per I/O pin. ST Microelectronics claims 1.75A, but you're better off to err on the conservative side.

    The L293 and L298 schemes won't really work for you, as you want 6° per step, 60 steps per rotation, and your stepper motor turns 7.5° per step, 48 steps per rotation.

    You will need to use PWM on two I/O pins simultaneously to get the stepper to do 60 steps per rotation. It will need to be a version of what's called "microstepping". The L293 and L298 are really for operating steppers in a bipolar mode, and that's just going to complicate your requirements unnecessarily. If you're driving a second hand like I suspect, the method of driving the motor is not going to matter, except for relative complexity.
     
Loading...