Shop OBEX P1 Docs P2 Docs Learn Events
Silly question — Parallax Forums

Silly question

teganburnsteganburns Posts: 134
edited 2012-12-04 08:49 in Propeller 1
So I have the prop chip hooked up to two geared motors that require little power. I had one wire from the motor to pin 38 (3.3 v) on the prop demo board, and the second wire form the motor to Gnd. That worked perfectly. Then i wrote a simple program to give high on pin 0 and the motor wouldn't move. i measured amps and voltages and it should have been working perfectly fine. (gave the same measurements as pin 38) I'm not sure what my problem is here...?

Comments

  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2012-12-02 14:19
    tegaburns wrote:
    So I have the prop chip hooked up to two geared motors that require little power.
    Exactly how little power? The Propeller's outputs can only source tens of milliamps. Even small motors typically require more than that to start turning. Moreover, hooking an inductive load, like a motor, to a Prop pin is not a good idea, because voltage spikes coudl damage the chip.

    A simple transistor driver with a protection diode is a much better way to go about this.

    -Phil
  • Mike GreenMike Green Posts: 23,101
    edited 2012-12-02 14:32
    You haven't described quite what you've done. If I read "between the lines" properly, you tried out your motors connecting one between ground and the 3.3V supply voltage on the Demo Board and it ran. You then connected the motor between an I/O pin and ground and tried setting the I/O pin to high and nothing happened. Is that what you did?

    Assuming so, it won't / didn't work for the following reason:

    You didn't say how much current the motor takes. Usually there's a starting current (starting from a stopped state), a lower running current (once the motor is running at speed), and a highest stall current (when the motor is mechanically prevented from moving). A Propeller I/O pin can only provide a certain amount of current. The transistors that make up the output side of the I/O pin circuitry are a certain size and, because of that and how they're constructed, there's only a certain amount of current they can supply. In the case of a Propeller I/O pin, the current is 40mA (see the datasheet for details). Very few motors will operate at that current. I'll bet the starting current is maybe 250mA and the running current maybe 150mA. The stall current may well be close to an Ampere.

    Typically, you use an I/O pin to turn on a switching transistor which controls the current to the motor. Nuts and Volts Column #6 discusses this in the context of a Basic Stamp, but the same thing applies to any microcontroller including the Propeller. Only the value of the base resistor would be different (due to the lower voltage used).
  • Duane DegnDuane Degn Posts: 10,588
    edited 2012-12-02 18:21
    teganburns wrote: »
    to pin 38 (3.3 v) on the prop demo board,

    I'm guessing you're using a QuickStart board. While the QuickStart is a board to demonstrate the Propeller chip, it is not the "prop demo board".

    The Propeller Demo Board (currently on sale) doesn't have a pin 38.

    It looks like Phil and Mike have the motor question covered.

    It's also common to use a H-bridge chip when controlling a motor with a microcontroller.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2012-12-02 18:44
    Duane Degn wrote:
    It's also common to use a H-bridge chip when controlling a motor with a microcontroller.
    ... but only when you need bidirectional movement. For motor rotation in one direction, a simple transistor switch is adequate.

    -Phil
  • teganburnsteganburns Posts: 134
    edited 2012-12-02 19:05
    Here's what im using...(http://www.parallax.com/StoreSearchResults/tabid/768/txtSearch/p8x32a/List/0/SortField/4/ProductID/748/Default.aspx)
    The Quickstart board ,sorry

    And the H-Bridge Chip looks amazing and thank you all!
  • rjo__rjo__ Posts: 2,114
    edited 2012-12-03 18:11
    We aren't supposed to do this sort of thing... but I hooked a motor directly to a Propeller Pin and it worked just fine. I was attempting to make the worlds cheapest robotic telepresence... (not counting the controller).
    As I said... we aren't supposed to do this for all kinds of reasons... but my Quickstart survived and the motor turned. http://www.goldmine-elec-products.com/prodinfo.asp?number=G18335... $3. and it has an encoder with 563 steps per revolution... so not only can you go very slowly... but you can accurately assess just how slowly you are going. The problem is that to go backwards you need some kind of switches...that's where the h-bridge comes in... you can use reed switches to make sure you understand the logic ... radio shack has them... they say 5V... but they work with the Propeller just fine.

    My guess is that your motor is periodically drawing enough current to cause the Prop to suffer from the electronic version of vertigo. try the following: put a momentary switch on the 3.3v line to your motor. Load some other program that blinks something somewhere into EEPROM. Then load your program into RAM. Wait till everything stops blinking and push the momentary button... your EEPROM program will probably be running when you are done.
  • rjo__rjo__ Posts: 2,114
    edited 2012-12-03 18:49
    sorry... posted to wrong thread. the answer above is ok.... different topic... about eeproms.

    don't see how to get rid of this:)
  • Duane DegnDuane Degn Posts: 10,588
    edited 2012-12-03 20:14
    rjo__ wrote: »
    We aren't supposed to do this sort of thing... but I hooked a motor directly to a Propeller Pin and it worked just fine.

    Just because it survived doesn't mean it wasn't damaged. You may have severely shortened the life of your QuickStart. As Phil mentioned earlier, a motor presents more problems to the Propeller than just the high current. There are very good reasons why "We aren't supposed to do this sort of thing."
  • rjo__rjo__ Posts: 2,114
    edited 2012-12-03 20:29
    I completely agree. As I said, there are plenty of good reasons why this isn't recommended... but the little motor had a no load rating of 25-50milliamps, the pin is diode protected and my robot had no wheels, so it wasn't going anywhere:) And besides the quickstart board has no lifetime warranty. What I really wanted to do was hook up the pin to ground ... and see what would happen:) In my experience, is far better to be stupid than to appear stupid.
    I wasn't about to ask... "hey what happens if I try to draw more than 50milliamps out of a pin?" I could look it up... but that would take time... why not just do it?
  • Mark_TMark_T Posts: 1,981
    edited 2012-12-04 03:17
    rjo__ wrote: »
    I completely agree. As I said, there are plenty of good reasons why this isn't recommended... but the little motor had a no load rating of 25-50milliamps, the pin is diode protected and my robot had no wheels, so it wasn't going anywhere:) And besides the quickstart board has no lifetime warranty. What I really wanted to do was hook up the pin to ground ... and see what would happen:) In my experience, is far better to be stupid than to appear stupid.
    I wasn't about to ask... "hey what happens if I try to draw more than 50milliamps out of a pin?" I could look it up... but that would take time... why not just do it?

    Firstly that no-load rating is already exceeding the Prop pins current rating in the worst case and of course no motor starts up pulling the same current as no-load
    rating (wheels or no wheels), its cold start current will be an order of magnitude higher probably.

    If by diode protected you mean the the inbuilt protection diodes then you perhaps don't realize that these are tiny, and will tolerate a few milliamps or so only.
    They are designed purely to prevent low voltage static discharge damage. Pass too much current through them for too long and they will fry. Pass too much
    current even briefly and you risk sending the chip into a latch-up state which may destroy it (and cannot be stopped without powering it down).

    It also takes time to order a replacement board :)
  • rjo__rjo__ Posts: 2,114
    edited 2012-12-04 04:35
    Nope, I didn't realize that... and my experiment failed because I thought I actually got away with it.

    It does take time to order replacement boards... that is why it is very important to have spares. PropellerPowered has a deal on... time to order a few:)

    Thanks guys,

    Rich
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2012-12-04 08:10
    Mark_T wrote:
    If by diode protected you mean the the inbuilt protection diodes then you perhaps don't realize that these are tiny, and will tolerate a few milliamps or so only.
    The datasheet specs 500 uA as the absolute maximum.

    -Phil
  • Mark_TMark_T Posts: 1,981
    edited 2012-12-04 08:49
    The datasheet specs 500 uA as the absolute maximum.

    Change that "tiny" to "really tiny"!
Sign In or Register to comment.