Shop OBEX P1 Docs P2 Docs Learn Events
how to use an oscilloscope to measure stepper motor signal from basic stamp? — Parallax Forums

how to use an oscilloscope to measure stepper motor signal from basic stamp?

mike56mike56 Posts: 22
edited 2009-08-12 04:14 in BASIC Stamp
It's been a while since I used an oscilloscope and it seems like I'm doing something wrong.

I trying to debug a stepper motor circuit using the ULN2003 chip like this diagram: http://www.doc.ic.ac.uk/~ih/doc/stepper/control2/connect.html

For Data 0-3 I have the basic stamp hooked up.· I can use "pulsout" and get a pulse on pins 2,3,4,5 of the ULN2003 as shown in the diagram.

However, I want to measure the voltage on the outputs.· So I hooked up a DVM between pins 9 and pin 14 then set pin 2 of the ULN2803 to +5V.· I read +12V.· I set pin 2 to 0V and I see an open collector output.·

Now here is the weird part, I hook up an oscilloscope between grnd·and pin 2 and I see the +5V but if I hook it up between pins 9 (12V) and pin 14 (coil 1) then I read 12V all the time and the circuit starts to get very hot fast even if pin 2 is 0V!·

It seems that by hooking up a scope on the ULN2003 it screws something up and voltage flows between pins 9 and 14 even without an input voltage.

This seems very weird to me.· Isn't an oscilloscope supposed to be a high impedance probe like a DVM?

How do I properly measure the +12V volt out of the ULN2003 to ensure the waveform is driving my stepper correctly?· Thanks for the help!

Comments

  • Desy2820Desy2820 Posts: 138
    edited 2009-08-12 03:11
    The chip provides·GROUND, not power.· You should read full voltage at the chip until that channel is activated, which supplies·GROUND to the coil, completing the circuit, thus energizing the coil.· The Stamp sends a high signal to the ULN chip, which activates a connection to ground for that channel.

    Positive power --> coil --> ULN 2001·---> ground.·· Also, make sure that the diode connection (pin·9)·is also to positive power, this will protect the chip from inductive kickback.

    Not sure why the scope connection is causing the heating issue.· I'd expect to see·continous DC, until the channel activites, then it should go close to ground.·

    Lastly, why PWM from the Stamp?· To drive a stepper, you need to activate the outputs in sequence (A, B, C, D).· The faster the sequence, the faster the motor turns.· Double check your wiring to the stepper, if you get some of the wires reveresed, the stepper won't turn.

    If you haven't already found it, you can try the Stamp Works text, look for experiment 27, page 150:· http://www.parallax.com/Portals/0/Downloads/docs/books/sw/Web-SW-v2.1.pdf· The L293D serves the same purpose as the ULN 2001.

    One last idea, what are you using for a power source?· Could your batteries be weak?· AC adapter unable to supply sufficient current?· Voltage drop under load can do strange things, including reset the Stamp.· Make sure that·VSS·of your two power supplies are connected together at one place, and only one place.




    Post Edited (Desy2820) : 8/12/2009 3:24:06 AM GMT
  • mike56mike56 Posts: 22
    edited 2009-08-12 03:14
    Yes I understand it supplies GND.

    So if I measure between pins 9 (+12 V) and pin 14 with 0V on pin 2 of the ULN2003 then I should read no voltage as the circuit is open.

    If I measure between pins 9 and 14 and put +5V on pin 2, I should read +12V as the circuit is now grounded.

    However, if I hook up my scope to pins 9 and 14, it always reads +12V regardless if it is 0V or 5V on pin 2!

    It works fine with the DVM however. Weird!

    What is my scope doing?
  • Desy2820Desy2820 Posts: 138
    edited 2009-08-12 03:27
    Mike,

    Almost, but not quite.· You should read "+12."· Why?· Because the ULN is acting as an open switch·to ground in the circuit.

    +12--->coil ---> ULN* --> GND

    * You'll read +12 until the chanel is activated.· Not sure how to better explain it, but if the circuit is open, you'll read full supply voltage right up to the open section, after the open section·will read ground.· Directly across the open, you'll read full voltage.·

    Sorry, last edit:· Remember, voltage is a difference in potiental.· Anywhere there is a potiental difference, you will read voltage.

    Post Edited (Desy2820) : 8/12/2009 3:35:50 AM GMT
  • phil kennyphil kenny Posts: 233
    edited 2009-08-12 04:14
    Desy2820 said...
    However, if I hook up my scope to pins 9 and 14, it always reads +12V regardless if it is 0V or 5V on pin 2!

    It works fine with the DVM however. Weird!

    What is my scope doing?

    Where is the ground of your oscilloscope connected to and
    where is the oscilloscope probe hooked to?

    Your DVM is completely isolated from all pins of the ULN2003
    and you can probe between any two pins.

    I suspect that the oscilloscope ground and pin 8 of the ULN2003 are not
    isolated from each other. If so, the oscilloscope ground should only be
    connected to UNL2003 pin 8 and nowhere else.

    phil
  • Hi, looking for expected waveforms from a stepper motor, but while I'm here
    very late seeing this
    get a meter and check the SUT is within safe limits of your oscilloscope signal ground on a probe.
    ONLY if your signal is within specified limits
    look on the rear of the scope, some have a ground link which you can remove to have the scope float
    now you can look at a fully isolated signal, join earths on A & B probes, one probe to A+ other probe to A-
    set to A-B
    WARNING Will Robinson - after taking your reading, put the link back in

    my CRO is a usb job on a laptop, so it is always floating, so I always check for levels
  • Its only floating if the laptop isn't being charged!
Sign In or Register to comment.