need help with my robot - h-bridges

Discussion in 'The Projects Forum' started by MelbMike, Sep 4, 2013.

  1. MelbMike

    Thread Starter New Member

    Sep 4, 2013
    4
    1
    Hi there,

    I'm building a robot, and am using a servo controller to control a bunch of servos. I'd also like to control the motors (via a h-bridge IC) with this servo controller.

    I'm stuck on how to supply on/off to the h-bridge pins using the PWM signal of the servo controller. There is always a PWM signal (it's never off), so right now if i connect it directly the motor is always on.

    Is there a way to "cut off" the PWM signal if it's below a certain theshold, and when not "cut off" it's a digital 1? It would be great if I can control motor speed, but a digital on/off would be fine as well.

    Cheers,
    Mike
     
  2. shortbus

    AAC Fanatic!

    Sep 30, 2009
    4,015
    1,531
    How are you controlling which direction is chosen?

    You are just PWMing the low side of your H-bridge, right?

    If you give a 1/high in place of the PWM signal the motor would keep turning.

    The PWM signal is what is used for speed control in most motor controls. A 4066 or other analog switch chip can be used to interrupt a signal, and a second of the four switches in the 4066 along with an inverter gate could also be used to give your 1/high when the PWM is off.

    Post a schematic of what you have so far. So we know exactly what you doing.
     
  3. MelbMike

    Thread Starter New Member

    Sep 4, 2013
    4
    1
    Hi Shortbus,

    Thanks for your reply.

    Right now, I have 2 RC circuits - one for the motors and one for the servos.

    For the motors, I have an RC module with 4 of it's outputs connected to a h-bridge IC, so I can turn two motors on/off in both directions. This works fine.

    The other circuit is a servo controller module with servos hooked up. The controller feeds the correct PWM signal to the servo's, and it also works.

    What I want to do is remove the RC module and only use the servo controller. This is because the servo controller can handle up to 32 servos. I don't need that many, so want to use 4 of it's channels for the h-bridge/motors and have just one RC link (to the servo controller)

    The problem I have is that the servo controller is specifically designed for servo's only - I can't set it to 0% duty cycle or 100% duty cycle (on/off for the motors) - I can only give it a range that's valid for servo's.

    I'm wondering if it's possible with some transistors, capacitors etc. to feed the PWM signal, and if it reaches a certain threshold output a 1, otherwise stay at 0, then feed this output to the h-bridge.

    Then, I'll set the 4 "servos" high or low, which will control the h-bridge. I don't really need speed control, so just a PWM signal to digital on/off would work for me.

    Cheers,
    Mike
     
  4. tubeguy

    Well-Known Member

    Nov 3, 2012
    1,157
    197
    You can convert the servo pulse into a variable voltage using a low-pass Resistor-Capacitor filter. Then feed that into a comparator circuit. This would give you a high or low depending on the pulse width.

    A circuit could be made to convert the variable voltage into PWM, also using a comparator and/or op-amps.
     
  5. MelbMike

    Thread Starter New Member

    Sep 4, 2013
    4
    1
    That's a brilliant idea tubeguy - a comparator sounds perfect for the job.

    I did a google search and found the LM339 comparator IC which has 4 comparators, just what I need.

    I'm new to electronics, so don't really know what a low pass resistor capacitor filter is but I'll google it.

    Just a thought though - if I use a 5th PWM signal as a reference for the comparator would it be possible to feed the other 4 PWM signals directly to the comparator? Or would I still need filtering?
     
  6. shortbus

    AAC Fanatic!

    Sep 30, 2009
    4,015
    1,531
    @MelbMike, when you said "servo" I was thinking servo motor, not RC servo's. Sorry for the confusion. The word servo should, at least in my mind, be qualified by the type. Since there are so many types. It's one of those words that means many things and nothing at the same time.:) Servo is really just part of the description. Sorry for the rant, just a pet peeve of mine.

    And welcome to AAC!
     
  7. Jibby

    New Member

    Sep 12, 2013
    15
    1
  8. MaxHeadRoom

    Expert

    Jul 18, 2013
    10,565
    2,379
    I too often get confused until I realize the OP is referring to radio control type servo.

    It should be pointed out that the video shows open loop stepper type servo rather then the closed loop PID type servo.
    Max.
     
Loading...