586,096 active members*
3,630 visitors online*
Register for free
Login

Thread: Whaaaaa???

Page 1 of 2 12
Results 1 to 20 of 27
  1. #1
    Join Date
    Mar 2003
    Posts
    332

    Whaaaaa???

    Rec'd a new IMS stepper today (3431-6.3) rated at 637 oz.in. to replace an obsolete 3424 rated at 235 oz.in.

    So I'm reading the specs and fiddling with the motor turning the shaft (nothing is hooked up). Sometimes the shaft spins with only a slight detent feel, other times the shaft turns kinda stiff.

    Then I notice the lead ends are sometimes touching, sometimes not, and if I short the two coil windings (A+ to A-, and B+ to B-) the shaft locks up solid.

    I didn't get out pliers or anything to see how much force was needed, just using my fingers. Figure I might screw something up.

    Anyways, what is going on inside that makes this happen?

  2. #2
    Join Date
    Apr 2004
    Posts
    678
    The stepper works as an AC generator when you turn it. If the 2 leads of a winding touches each other the generator is shorted and the force needed to turn it gets much larger. If you short out all windings this way, you should not feel the detent, just a strong resistance to turn. Try to turn it faster and the resistance increases. You don't hurt the motor doing this unless you turn it faster and more forceful than you can do it by hand.

    I have understood that one use of surplus steppers is as generators for windmills. It makes sense as it is designed for minimum losses.

  3. #3
    Join Date
    Apr 2003
    Posts
    307
    I forget the term for it but isn't that one of the specs for a dc motor? The ratio of the speed that you turn the shaft to the voltage produced?

    Chris

  4. #4
    Join Date
    Mar 2004
    Posts
    37
    Just for information - because a Stepper motor acts as a generator when rotated it makes a good low cost quadrature encoder for jogging inputs. Take a 200 step motor from a old 5 1/4 inch floppy, one opamp, some diodes and a few resistors and you have a a rotary jogging device. Turning that shaft produces a voltage, the voltage is applified, and the output is quadratured encoded. We drive the stepper motor with a quadrature encoded voltage to make it turn. Just reverse the process, turning the shaft by hand produces a voltage that is quadrature encoded.
    Turbocnc has inputs for jogging Channel A and Channel B thats works very nicely with this circuit. To make the jogging circuit work just a little bit better I have tied the quadrature outputs of my stepper motor to a PIC12C508 first. I have coded the PIC so that if you turn the jogging input quickly it outputs a fast jogging pulse stream. Turn the shaft slowly and it outputs a slower stream. This makes fast turns of the shaft mean jog fast and slow moves of the shaft mean jog slow. Your PC's mouse does the same thing when you move it around.

  5. #5
    Join Date
    Sep 2003
    Posts
    1113
    Greg Fill -
    What a cool idea! Now, I'm not much of a "wire-head" , but if you had a hand shetch of a diagram and parts list I'd give that a go! Cool idea.
    BTW I seem to be collecting a lot of used steppers form printers etc. What a greta way to use 'em up!
    Cheers -- Jim
    Experience is the BEST Teacher. Is that why it usually arrives in a shower of sparks, flash of light, loud bang, a cloud of smoke, AND -- a BILL to pay? You usually get it -- just after you need it.

  6. #6
    Join Date
    Apr 2004
    Posts
    678
    Greg, that idea also crossed my mind. Did you find out how much electronics is needed to condition the signal for detection by a microcontroller. If not much, then it is a very cheap way of making an encoder. One stepper, preferrably small (free), one PIC/AVR or whatever ($2-3), 2 opamps, 4 diodes and a few resistors? A stepper from a 3,5" floppy is small enough for fitting into a handy enclosure.

    I will need such a device, so if you have experience on what goes between the stepper and MCU, please share it with us. I can teach a ATtiny15 to convert to step/dir outputs. It doesn't even need a crystal/ceramic resonator, and can drive an opto input directly.

  7. #7
    Join Date
    Mar 2004
    Posts
    37
    I have the circuit on my DIY stepper driver board, I'll post the schematic once I do a cut and paste of the appropriate page and figure out how to attach a PDF file in the forum.

    The BOM (Bill of materials)

    1 - opamp LM358 about the cheapest the DIY can find but any opamp will do
    4 - 1N4148 diodes
    6 - 3K9 1/4 W resistors
    2 - 1M 1/4 W resistors
    1 - 10 uf 10 volt electolytic cap

    alternatively you can use a LM392 comparator then the BOM would be
    1 - LM392
    4 - 1N4148 diodes
    8 - 3K9 1/4 W resistors
    1 - 10 uf 10 volt electolytic cap

    The PIC is not required and is only used to condition the quadrature signal to make it into STEP and DIR or do what I did and have an acceleration function like your PC's mouse.

    BTW ESjaavik I have completed my chopper controller design and built a few proto PCB's. I drive my 8 amp / phase test stepper motors at 35 volts and 8 microsteps. Max. Pulse rate from TurboCNC is set to 19200 equating to 720 RPM. To get to a higher step rate and RPM I need to use a higher voltage. The FETS I am using are only 50 volt rated so I can't go to a higher voltage until I change them which I probably won't do. 720 RPM equates to 144 ipm and with a planned table length of 24 inches it is fast enough.

  8. #8
    Join Date
    Dec 2003
    Posts
    24221
    Here is the link for the schematic stepper as a rotary encoder http://members.iinet.au/~richardh/rotenc.htm
    Al
    CNC, Mechatronics Integration and Custom Machine Design

    “Logic will get you from A to B. Imagination will take you everywhere.”
    Albert E.

  9. #9
    Join Date
    Mar 2004
    Posts
    37
    Thanks Al, I figured out the circuit myself but I guess there are many ways to do the same thing if you know what you are doing. I was interested in your link to see how they made a jogger but the link seems to be dead. Anyways here is a PDF of my circuit. Pretty straightforward. Any voltage generated by the stepper is clipped by the diodes, amplified and output on Quadrature A and B. The negative input of the opamps are biased midway of the +5 volt power supply. C5 is just a small filter. You can tie the quadrature lines A and B directly to the lines defined by TurboCNC for Jogger channel A and B. I process Quadrature A and B with a PIC12C508 before feeding it to TurboCNC. I use a Unipolar stepper for the input but a 6 wire motor works fine as well. For a unipolar motor the common ties to my J8 pin 5. Winding A goes to pin 1, winding B to pin 2. For a 6 wire bipolar motor tie Winding A+ to 1, A- to 2 and the common of A+ and A- to 5. To help with the jog cogging I also tied my Unipolar motor winding A and D together. This gives a more positive feel when turning the motor.

    The part values are quite arbitrary. The 3K9 can easily be anything from 1K to 10K as long as they are the same. The opamp is probably the most widely used general purpose device but any single supply opamp could be used.

    Experiment and have fun.
    Attached Files Attached Files

  10. #10
    Join Date
    Dec 2003
    Posts
    24221
    The guy seems to have abandoned the link but the hard copy I have is just about identical to your pdf.
    A typical motor giving 180 pulses per rev. It uses a LM358 for comparator.
    Al
    CNC, Mechatronics Integration and Custom Machine Design

    “Logic will get you from A to B. Imagination will take you everywhere.”
    Albert E.

  11. #11
    Join Date
    May 2004
    Posts
    82
    Hi
    Just lurking by to see what you where talking about. I found this a while ago but you proberly already have figured it out.

    http://www.webx.dk/oz2cpu/20m/encoder.htm

    Bent

  12. #12
    Join Date
    Mar 2004
    Posts
    37
    Thanks Bent I did figure out all the same things.
    Well it goes to show that nothing is really ever new. Usually someone has already done or designed the same thing. It is a good article and people should read it to get a better understanding what I was trying to say. Lets see how many people actually try the circuit out and improve on it.

  13. #13
    Join Date
    Apr 2004
    Posts
    678
    I'm not sure I like that both will turn positive when standing. It may not be a problem depending upon how the indentation force will work. But Greg, since you seem more well versed in opamps than I am: Would not moving the 1M from C2 (referring to OZ2CPU's schematic) to the output of the opamp give some hysteresis so that you will need to apply a slight amount of opposite polarity to make the output change?

  14. #14
    Join Date
    Mar 2004
    Posts
    37
    You would add a resistor from the output back to the input if you were using a comparator. In this configuration using an opamp if you added a feedback resistor you would be reducing the gain of the circuit. This circuit depends on the high open loop gain of the opamp to work well. I was going to explain why this is so and I started to write but I was getting long winded as usual so I stopped. I am not sure why you are worried that both outputs are high when the motor is not turned because it is not important to the decoding. If you truly want to make the outputs normally low just swap pins 2 and 3, and swap pins 5 and 6.
    To make a STEP and DIR output with this circuit use your micro to look at the two outputs, I call them quadrature A and B. Whenever quadrature A goes from a HIGH to a LOW you look at the state of Quadrature B. If it is already LOW you are turning in one direction. If it is HIGH you are turning in the other direction. This sets your DIR output. HIGH for one direction LOW for the other. Every time Quadrature A goes from HIGH to LOW you output a STEP pulse. The micro is also used to ensure that the output pulses are valid. TurboCNC does an excellent job of decoding the output and ignoring the invalid outputs the circuit can generate if turned very slowly. Your micro will need to do the same. I will post my PIC12C508 code and circuit. I like your idea to add a STEP and DIR output.

    As for the hardware I can explain how the circuit works if you want. Incidentally you can replace the opamp with a LM393. You will need to add the appropriate pullup resistors on the output. When using a comparator you can add a feedback resistor. I am not sure if 1M is the right value. I haven't tried it but I think something smaller like 330K may be better. When I get time I will try it.

  15. #15
    Join Date
    Mar 2003
    Posts
    4826
    I understand some of the words they're using in this thread
    First you get good, then you get fast. Then grouchiness sets in.

    (Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management)

  16. #16
    My comments on the circuit:

    R3 and R5 serve no purpose at all; lose them.

    R2 and R6 should be connected back to each op-amp's output instead of +5VDC. This will add some much needed hysterisis and sharpen up the rise and fall times. Without that, it's entirely likely the circuit will give false counts due to multiple output transitions.

    Better yet, replace the LM358 with an LM393. It is a dual comparator that has the same pin-out as the LM358 dual op-amp. This will make the outputs compatible with digital logic (unlike the LM358). Be sure to use some 1K resistors as pull-ups to +5V from each output if you use the LM393.

    Mariss

  17. #17
    Join Date
    Mar 2003
    Posts
    332
    Originally posted by HuFlungDung
    I understand some of the words they're using in this thread
    That's what I'm thinking when you write about macros.

  18. #18
    Join Date
    Mar 2004
    Posts
    37
    Feedback, this is good. Actually with the LM358 the edges are fine and there are no multiple edge transitions. It helps that the output slew rate of the LM358 is so low (0.1 v/us) but this also means the edges will never really be sharp using a LM358 opamp. The circuit as shown is using the opamp as a comparator. Using a real comparator, such as the common LM393, works as mentioned in previous posts.
    It doesn't matter if you use an Opamp or a comparator most of the problem comes from the fact that when turned slowly the stepper motor produces a very small voltage which relates to a poor quadrature output. OZ2 suggested to use a large heavy wheel to ensure good pulses are made when the stepper is turned. I also used another winding to of the stepper motor to provide extra turning resistance and hence good pulse when the stepper was turned. Due to the inherent problems with the circuit it makes sense to use a micro to weed out the noise pulses.

  19. #19
    Good points. Fast rise/fall times and hysterisis helps when there is noise (60Hz hum) riding on top of the signal. As the signal passes the thru the threshold, the noise may take it thru that threshold more than once.

    On second thought, there should be at least minimal low-pass filtering of the step motor. It is an inductor electrically; this means it will be suceptible to noise unless the leads are kept very, very short. Use a 10nF cap across each motor winding to decrease this noise sensitivity.

    Mariss

  20. #20
    Join Date
    Mar 2004
    Posts
    37
    I like what the OZ2 circuit shows - the PCB right on the back of the stepper. Caps may be a good idea if you are going to use a comparator. With a real comparator the edge transitions will be very fast and hence its susceptibility to any noise will be higher. Sometimes faster isn't necessarily always better. My PIC only polls the quadrature levels and does not react with an edge change. Filtering is actually done with the slow micro code and real fast pulses are not even seen. Every pulse that is seen is timed to ensure that it falls within a certain minimum pulse width. This limits the maximum speed the motor can be turned to generate pulses but the rate is high enough that it is not really practical to spin the motor that fast by hand.

Page 1 of 2 12

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •