Shop OBEX P1 Docs P2 Docs Learn Events
Please Help!! — Parallax Forums

Please Help!!

crgwbrcrgwbr Posts: 614
edited 2006-06-18 22:09 in Robotics
Dear Helpful People,

I am trying the control a motor using and IRFZ44N Mosfet and the Basic Stamp Homework Board.· A picture can explane my circuit better, so I will post one.··The problem is that the motor will not turn on.· I can manually turn it on, by taking the resitor that·is plugged into I/O pin 1, and plugging it into Vdd.· I really need this project to work, so I am offering a reward of one Gmail invite to anyone who can help, just leave your current email address in your post.

Thanks.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
NerdMaster
For
Life
1024 x 768 - 147K
«1

Comments

  • GadgetmanGadgetman Posts: 2,436
    edited 2006-06-06 20:16
    Why not post the code you have tried?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Don't visit my new website...
  • crgwbrcrgwbr Posts: 614
    edited 2006-06-06 20:22
    This is the Code:

    '{$STAMP BS2}
    '{$PBASIC 2.5}

    Do
    · DEBUG "Go"
    · HIGH 1
    · PAUSE 2000

    · DEBUG "Stop"
    · LOW 1
    · PAUSE 2000
    LOOP


    I'm just using this to test the motor before it goes on my robot.



    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    NerdMaster
    For
    Life
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2006-06-06 20:26
    I say you need to add a pull-up resistor to Pin1 (P1), keep everything the same, but add a 1K from P1 to VDD.
  • crgwbrcrgwbr Posts: 614
    edited 2006-06-06 20:41
    I just tried the pull-up resistor. The motor trys to run for 1/2 a second or so, then the stamp led turns off, like I disconnected the power, but I didn't. I feel the problem must lye in the power source, and dirty power or somthing. Is the motor dirtying the power enogh to hurt the basic stamp's operation?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    NerdMaster
    For
    Life
  • GadgetmanGadgetman Posts: 2,436
    edited 2006-06-06 20:57
    Most probably, the motor draws too much current for your PSU. Try getting a more powerful one, or power the BS2 with a 9V battery and the motor with the PSU.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Don't visit my new website...
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2006-06-06 20:58
    It's hard to tell from your picture because of the two criss-crossed yellow wires (can't tell them apart), but one lead of the motor should go the FET center terminal and the other should go to +V.· It looks like you have the Gate correct, but the 3rd terminal of the FET (S) should go to GND.)

    [noparse][[/noparse] The terminal, left to right on the printed side are G-D-S, looking like you have it G-S-D.· Again, it's hard to tell. It really looks like S is going to +V, but it should go to GND. ]

    Post Edited (PJ Allen) : 6/6/2006 9:06:24 PM GMT
  • crgwbrcrgwbr Posts: 614
    edited 2006-06-06 21:01
    That's how I have it hooked up. Also I can't power the BS2 and motor seperatly, because the fet won't work with a different gate voltage than source voltage.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    NerdMaster
    For
    Life
  • Jim RicheyJim Richey Posts: 82
    edited 2006-06-06 21:05
    What are you using for a power source?

    You might try to place a couple of different size caps across the +/- rail on the breadboard to filter unwanted trash the motor may be generating.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Thanks, Parallax!
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2006-06-06 21:09
    I also note the absence of a free-wheeling diode across the motor (shamey-shamey).
  • crgwbrcrgwbr Posts: 614
    edited 2006-06-06 21:09
    I tryed with some 0.1uf caps (the only ones I have right now), no effect. I am using a model HGL5-12 Battery (12volt 5 amp hour)

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    NerdMaster
    For
    Life
  • GadgetmanGadgetman Posts: 2,436
    edited 2006-06-06 21:14
    Sure you can power the BS2 separately, you only need ot make certain that it uses the same GND as the rest of the circuit.

    Though, it doesn't seem like you have a problem with the motor drawing too much power...
    (I assume that's a sealed Lead-Acid battery?)

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Don't visit my new website...
  • Beau SchwabeBeau Schwabe Posts: 6,568
    edited 2006-06-06 21:30
    I'm with Pj,

    It looks as though your power is reversed.· If this is the case I would expect that the motor would continuously be "ON"
    from the "reverse diode" unless it has been damaged.

    Reference:
    http://www.semiconductors.philips.com/acrobat_download/datasheets/IRFZ44N_1.pdf










    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.

    Post Edited (Beau Schwabe (Parallax)) : 6/6/2006 9:34:21 PM GMT
    1465 x 857 - 169K
    1000 x 549 - 155K
  • bennettdanbennettdan Posts: 614
    edited 2006-06-06 21:32
    Try to PWM the output instead to just full on to see if it keeps the stamp from reseting.

    Post Edited (bennettdan) : 6/8/2006 1:17:06 AM GMT
  • crgwbrcrgwbr Posts: 614
    edited 2006-06-06 21:46
    Ok, first, what's a free-whelling diode; second, no, I do not thinks my power is reversed, the motor isn't countinuisly on; third, how do I PWM the output and why would the gate be pulling to much amperage.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    NerdMaster
    For
    Life
  • bennettdanbennettdan Posts: 614
    edited 2006-06-06 22:54
    Beau I think he has it connected, I think the 9vdc lead he has are reversed when they are supplying the porwer to the stamp. Are you using the 220 ohm resistor like Beau has in his diagram crgwbr?
  • Beau SchwabeBeau Schwabe Posts: 6,568
    edited 2006-06-06 23:50
    bennettdan,

    "Beau I think he has it connected, I think the 9vdc lead he has are reversed..."

    Ohh I See what you are saying....Sorry crgwbr



    crgwbr,

    You say it works when you take the gate to Vdd. Can you measure what Vdd is in reference to GND (Vss)
    as a sanity check?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
  • bennettdanbennettdan Posts: 614
    edited 2006-06-07 00:56
    The free wheeling diode protects the Mosfet when the motor is not being supplied power and on its way to stoping.

    Also try this code to see if you get it to move with PWM

    Rotate:
    PWM 1,128,40
    Pause 2000
    GOTO Rotate

    Post Edited (bennettdan) : 6/7/2006 1:03:55 AM GMT
  • crgwbrcrgwbr Posts: 614
    edited 2006-06-07 22:54
    Vdd is 5v. Also, I am using a 10 k resistor, not a 220 k one, but, I beleive the homework board has built-in 220 K resistors. Also, I tried the PWM code, it doesn't help.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    NerdMaster
    For
    Life
  • bennettdanbennettdan Posts: 614
    edited 2006-06-08 01:04
    The board has no resistor built into the pin that I am aware of, also Beau said to use a 220 ohm not a 220k try it with a 220 ohm and see what happens. I wired up the curcuit Beau sent you and it works great on my board. Also try a different mosfet on a different pin and change the PWM code to match your pin.

    Change PWM *,128,40······· change the * to what pin you are using.

    Post Edited (bennettdan) : 6/8/2006 1:12:43 AM GMT
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2006-06-08 02:35
    Coming into this a bit late, but I see a single wire connected to the posts on the Radio Shack Breadboard.· The red wire is connected to the black post.· The fact that the red wire from the 9V connector also connects to this same post makes me wonder if the power is backward as well.· But if not, where is the ground line connected from your battery in the picture?· One more thing to consider is connecting the Gate directly to the I/O pin, since it already has a 220 ohm resistor in-line with it.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2006-06-08 03:42
    [noparse][[/noparse] Yes, that's the thing here, CS; not sure, but maybe somebody isn't into the red wire = + and blk wire = Gnd power wiring convention / practice. ]
  • PARPAR Posts: 285
    edited 2006-06-08 04:24
    crgwbr said...
    ....· A picture can explane my circuit better, so I will post one.·· ...
    Maybe not. You don't show the power supply polarity. Which rail of the RS board (top row or 2nd row) do you intend to be your + rail?

    And, your 9v. battery connector should be RED wire is positive pole, BLACK wire is negative pole, so you need to make sure that the RED wire is inserted into the + rail of your RS board and the BLACK wire is inserted into the - rail of the RS board.

    It appears to me from your photo of the wiring setup that you have at least one if not more pairs of wires crossed, but without knowing how your 12v.·battery (power supply) is connected to the RS board, it's not possible to go further.

    Then, we can take the next step.

    PAR
  • Beau SchwabeBeau Schwabe Posts: 6,568
    edited 2006-06-08 04:50
    PAR,

    "...And, your 9v. battery connector should be RED wire is positive pole, BLACK wire is negative pole..."

    Not if he's using the battery connector in reverse, Which it looks like he is.
    In the case where the battery connector is being used in place of a 9V battery, then the RED is
    actually negative and the BLACK is actually positive.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.

    Post Edited (Beau Schwabe (Parallax)) : 6/8/2006 4:53:40 AM GMT
  • PARPAR Posts: 285
    edited 2006-06-08 07:43
    Beau Schwabe (Parallax) said...
    PAR,

    "...And, your 9v. battery connector should be RED wire is positive pole, BLACK wire is negative pole..."

    Not if he's using the battery connector in reverse, Which it looks like he is.
    In the case where the battery connector is being used in place of a 9V battery, then the RED is
    actually negative and the BLACK is actually positive.
    Beau, You are so right!· I had wired up·some DC·lamps exactly in·that way with those connectors for the reason you state. Shame on me!· Thanks for the correction. ·:>)
    PAR
  • Jim RicheyJim Richey Posts: 82
    edited 2006-06-08 12:20
    I believe the circuit is wired properly (though a little confusing).
    Does anyone believe the motor is causing a voltage drop,which may be causing the BS2 to reset?
    How about pulling the motor out and making a substitution to find out.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Thanks, Parallax!
  • BeanBean Posts: 8,129
    edited 2006-06-08 15:13
    Pull the resistor from P1, put an ampmeter on it to Vdd.
    If it draws less than 20mA there is no reason the pin shouldn't control it, unless the pin is blown (A definate possibility).
    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Cheap 4-digit LED display with driver IC·www.hc4led.com

    Low power SD Data Logger www.sddatalogger.com

    "I reject your reality, and substitute my own." Mythbusters
    ·
  • crgwbrcrgwbr Posts: 614
    edited 2006-06-08 18:07
    I don't have an ampmeter, but I did check the pin, it's fine. I switched to a diferent fet, now, the motor stays on for 2-3 seconds, then the stamp's power led turns off, and the motor stops. I removed the motor, and replaced it with a volt meter, it reads 12v continuously, the stamp does not turn off.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    NerdMaster
    For
    Life
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2006-06-08 19:19
    crgwbr said...
    I switched to a diferent fet, now, the motor stays on for 2-3 seconds, then the stamp's power led turns off, and the motor stops.
    · This is telling you something... something important -- seems it's taking the STAMP down.· Do you have a 1N4000-series rectifier diode?· If so, place it in parallel with the motor, with the banded end (cathode) going to +V and the other going to the other motor terminal (or FET's Drain.)
    · Also, when the LED goes out, what is VDD = ?
  • allanlane5allanlane5 Posts: 3,815
    edited 2006-06-08 19:22
    Yes, the regulator on the BOE board does have an over-heat shutdown, which can activate if you try to pull too much current through it. It's called a "crow-bar", because it WILL drop the output voltage to zero on over-heat conditions.
  • crgwbrcrgwbr Posts: 614
    edited 2006-06-08 20:07
    Unfortunatly, I don't have any diodes right now; also, I'm not using the BOE, can't afford one, I'm using the Homework board. Does the Homework board have the crow-bar? As far as what Vdd reads after the LED goes out, it drops from 4.95V to 2.24V.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    NerdMaster
    For
    Life
Sign In or Register to comment.