Shop OBEX P1 Docs P2 Docs Learn Events
substitution — Parallax Forums

substitution

science_geekscience_geek Posts: 247
edited 2007-07-09 01:01 in Robotics
can you substitute a relay for an h-bridge to drive a motor on the boe bot or can do you absolutely have to use an h-bridge, i dont need speed control

Comments

  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2007-06-04 20:06
    If you want forward, reverse and stop you would need two Relays, but yes, if you don’t need speed control you can substitute them. Take care.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
  • D FaustD Faust Posts: 608
    edited 2007-06-04 21:03
    Science Geek,
    I was also looking for an H-bridge substitute and I was thinking that a MOSFET, relay·and the stamp's PWM command would give me direction and speed control.
    You might·want to change the name of the thread to give more info ex Relay vs. H-bridge.· (Just a suggestion.)


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    D Faust

    Post Edited (D Faust) : 6/4/2007 9:08:14 PM GMT
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2007-06-04 22:48
    D Faust,

    The BASIC Stamp PWM command will not be suitable to drive an H-Bridge or even a MOSFET for speed control, especially if you plan on doing anything else in your loop.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
  • Beau SchwabeBeau Schwabe Posts: 6,566
    edited 2007-06-04 23:07
    You could even use a Hybrid approach. Use a Relay for switching direction, and a couple of MOSFETs in parallel for speed control.
    ·
    Whether or not you use mechanical relays, solid state relays, or an H-Bridge configuration depends on how you want your application to perform.
    Something to consider though... a transistorized H-Bridge will experience a 1.2V voltage drop.· A solid state relay can also experience a voltage
    drop.· With MOSFET versions it is important to keep the RDS (Resistance between the Drain and Source) as low as possible to deliver as much
    power to the motor as possible.· This is none other than "smart" energy efficient design practice.
    ·
    Example 1:
    If you have a voltage supply of 12V and·your motor requires 5 Amps and you are using a transistorized H-Bridge, the amount of power that your
    H-Bridge will need to dissipate in the form of heat would be 6 Watts (P = I * V)
    ·
    Example 2:
    If you have a voltage supply of 12V and your motor requires 5 Amps and you are using a MOSFET H-Bridge with an RDS of .055 Ohms, then the
    amount of power that your H-Bridge will need to dissipate in the form of heat would be·1.375 Watts (P = I^2 * R)
    ·

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

    IC Layout Engineer
    Parallax, Inc.

    Post Edited (Beau Schwabe (Parallax)) : 6/5/2007 4:02:56 PM GMT
    1533 x 873 - 233K
    ESC.JPG 232.7K
  • DgswanerDgswaner Posts: 795
    edited 2007-06-05 00:13
    I use 4 relays to control 2 motors, forward and reverse, works like a champ. the relays are driven by a ULN2003 (I think it's obsolete now). you have to utilize the NO and NC part of each relay to do it with 4 relays. but it's not complicated. the sound of the relays makes me want to name my bots Clicky or some variation there of.

    I do long for speed control, but that's another $ another day!. good luck.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    A complex design is the sign of an inferior designer. - Jamie Hyneman, Myth Buster
  • D FaustD Faust Posts: 608
    edited 2007-06-05 00:53
    Why would you use a couple of MOSFETs for speed control rather than one, to get more amperage?· Wouldn't you have to use a co-proccessor to keep the MOSFETs to the desired voltage.· If I set a pin HIGH·on the stamp to control a relay·will it stay high·until I set it low?·

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    D Faust
  • Beau SchwabeBeau Schwabe Posts: 6,566
    edited 2007-06-05 02:59
    "Why would you use a couple of MOSFETs for speed control rather than one..."

    To keep·the RDs "ON" as low as possible so your MOSFETS run cool.

    "Wouldn't you have to use a co-processor to keep the MOSFETs to the desired voltage."

    It would be the same for any other speed control driving a MOSFET.

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

    IC Layout Engineer
    Parallax, Inc.
  • DgswanerDgswaner Posts: 795
    edited 2007-06-05 03:57
    Somebody said...
    If I set a pin HIGH on the stamp to control a relay will it stay high until I set it low?
    yes, this is quite nice so you can say move forward, setting pins high, and then move on to other code like sensing the object your about to hit.

    If your looking for the best motor controller solution it's not relays. they do work but the duty cycle of a really isn't nearly as long as a solid state solution. Yes I'm using them but it was a temporary solution with parts that I had on hand. you'll be much happier in the long run if you get a motor controller with speed control.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    A complex design is the sign of an inferior designer. - Jamie Hyneman, Myth Buster
  • edited 2007-06-05 04:00
    Hey fellas... I wanted to add my 2 cents... smile.gif

    The NEC EN2-1N1S relay is a H-bridge type of relay.. fairly simple to use since it only requires one relay per motor... it consists of two relays internally (one per each side of the H-Bridge) but you can connect both coils and operate them with a single signal.. this way... a logic 0 means Forward.. and logic 1 means reverse, quite simple.... you can control direction with only one signal smile.gif ,· of course, you will still need the means to control speed,·· this relay was designed for automotive applications, so it is sealed and rugged, and quite compact... here is the datasheet link:

    http://www.worldproducts.com/pdfs/en2.pdf

    And here the Mouser link if you are interested in buying a couple:

    http://www.mouser.com/search/refine.aspx?Ntt=551-EN2-1N1S

    I myself got a couple but have not used them yet, I will you know the results as soon as I try these relays... I hope this helps!!!.. happy roboting!!

    Post Edited (Joe "Bot" Red) : 6/5/2007 4:42:43 AM GMT
  • D FaustD Faust Posts: 608
    edited 2007-06-05 10:26
    They don't sell solid state relays with NO and NC do they? That would be needed to control a motor foward and reverse.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    D Faust
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2007-06-05 14:50
    D Faust,

    SPDT Relays have both N.O. and N.C. terminals on them.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
  • D FaustD Faust Posts: 608
    edited 2007-06-05 19:36
    Perfect! Much better than the mechanical ones, if I can find some. I only knew about the simple solid state relays where if one circiut is on the other is too. Thanks alot.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    D Faust
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2007-06-06 20:17
    Hmmmm, missed the word "Solid State" somehow...I don't know if there are any SPDT SSRs...

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
  • D FaustD Faust Posts: 608
    edited 2007-06-07 00:34
    I found this on the web: http://www.vsholding.com/datasheets/7124_EDR83914_SPDT.pdf
    It looks like an SPDT·SSR based on the data.· I was suprised when you said that and when I found this.· Found this by searching for "SPDT solid state relay". Thanks for being misleading!!lol.gif

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    D Faust
  • D FaustD Faust Posts: 608
    edited 2007-06-07 01:24
    I have been thinking about controlling a motor with the schematic in Beau's first post on 6/4.· is there a way for the stamp to set a voltage (with PWM command?) and keep it at that while running other code.· Obviously, an outside circuit would be needed. Right?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    D Faust
  • Beau SchwabeBeau Schwabe Posts: 6,566
    edited 2007-06-07 04:57
    D Faust,

    The PWM signal from the Stamp is not particularly ideal for motor control, it is designed as a way to provide an analog output with simple external RC filtering and is not the same as a fixed frequency duty cycle based PWM signal. Ideally the motor needs a PWM signal with a fixed frequency duty cycle that is capable of adjusting the pulse width to a specific value. The PWMPAL provides such a signal and can be found here...

    http://www.parallax.com/detail.asp?product_id=28020

    In answer to your question... "is there a way for the stamp to set a voltage (with PWM command?)" ... yes, but that isn't exactly what you need to drive a motor with a MOSFET transistor. The PWM supplied to the MOSFET
    should have a fixed frequency typically 3 kHz to 20 kHz. This means that you have a pulse that arrives at the MOSFET on regular intervals that will completely turn it 'On' when present and completely 'Off' when not present.
    To adjust the motor Speed, you simply vary the PWM ratio of how long the pulse is On verses how long the pulse is Off. For instance if you have a 12Volt supply and your PWM ratio is 50% then the "Averaged" voltage that you will see will be approximately 6V ... with a 25% Duty cycle ; 3V ... Keep in mind however that most if not all motors do not have a linear response to voltage. Meaning, that you should not expect twice the speed out of a motor simply because you double the voltage.

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

    IC Layout Engineer
    Parallax, Inc.
  • D FaustD Faust Posts: 608
    edited 2007-06-07 10:41
    A while ago I was wondering what the PWMPAL was for.· Thanks for the clearing all that up.· Voltage limit on the PWMPAL is 5V right, but that could be used to "transist" whatever voltage the MOSFET could handle, right?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    D Faust
  • Beau SchwabeBeau Schwabe Posts: 6,566
    edited 2007-06-07 14:28
    D Faust

    "Voltage limit on the PWMPAL is 5V right, but that could be used to "transist" whatever voltage the MOSFET could handle, right?" - Yes

    There are also a few other motor control options you might consider exploring...
    http://www.parallax.com/html_pages/products/motorcontrol/motor_control.asp

    Also, here are a few Nuts and Volts articles that cover motor control that might be of interest...
    http://www.parallax.com/dl/docs/cols/nv/vol1/code/nv23.zip
    http://www.parallax.com/dl/docs/cols/nv/vol2/code/nv58.zip
    http://www.parallax.com/dl/docs/cols/nv/vol4/col/100.pdf···· ········· PWMPAL specific
    http://www.parallax.com/dl/docs/cols/nv/vol5/col/nv106.pdf

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

    IC Layout Engineer
    Parallax, Inc.
  • D FaustD Faust Posts: 608
    edited 2007-06-07 19:28
    Thank you for all the advice.· I think I will end up using either the pwmpal-relay-Mosfet method or the Pololu dual serial motor controller.· I am leaning towards·using the PWMPAL becaus I like the option of working with higher voltages and current.· What is more user friendly at the PBASIC end?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    D Faust
  • edited 2007-06-07 21:32
    Hey D Faust ... talking about Solid State SPDT... I actually found a couple options, but they all seem to be for industrial applications, and as such.. really expensive!!!.. anyway.. here is one that I found:

    http://www.vsholding.com/datasheets/7139_SPDT_with_true_NC.pdf

    So.. it does not seem to be a practical alternative for fellow robotic enthusiasts... :-(
  • D FaustD Faust Posts: 608
    edited 2007-06-08 00:08
    Joe "Bot" Red,
    I found one on vsholding.com a few days ago and it is in one of my previous posts.
    (http://www.vsholding.com/datasheets/7124_EDR83914_SPDT.pdf)
    I did not check the price though, so thanks for the info.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    D Faust
  • D FaustD Faust Posts: 608
    edited 2007-07-09 01:01
    I've been doing some testing with a kit that I have, and it doesn't seem to take much amperage to keep a MOSFET from changing the voltage at the gate. Could a capacitor be used to hold the voltage for a short time? Thanks.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    D Faust
Sign In or Register to comment.