Connect with us

Motor Servo Controller

Discussion in 'Sensors and Actuators' started by Vangaurd, Mar 13, 2015.

Scroll to continue with content
  1. Vangaurd

    Vangaurd

    6
    0
    Mar 13, 2015
    Hello all. This is the second circuit I've designed so I thought i would get some feedback. I have a pretty solid understanding of motor controllers and my first circuit i made was an emitter follower so i decided to work on a signal source for the motor controller first.

    This circuit changes the behavior of a motor to a servo by using potentiometer as a position sensor to provide the signal for switching directions. I used a sine wave generator in the circuit to simulate the signal that is generated by the potentiometer. Obviously the actual signal will be different because the voltage on the signal will change when the motor switches directions. The reason there is a separate voltage source for the motor controller is because this source will be provided by a signal from a sensor to control the slew rate on the motor.

    Notes:
    Q7 should almost always switch on first.

    Q1-Q4 behave like a nand latch

    Q5 & Q6 determine when the latch flips ((Voltage > 4.9) || (Voltage < 1.5))

    The resistors are are all stock values accept R2 & R4 which are a combination of stock values.

    Edit:
    Already fixed something. I added a 200Ohm resistor above the Q6 emitter to lower the current on Q2's base.

    Is there anything I should do to make the operation of this more stable? Are there ways I could simplify this? Is there anything I am missing? Is this fine as it is?

    Any feedback will be appreciated! servo-signal.png plot.png
     
    Last edited: Mar 13, 2015
  2. (*steve*)

    (*steve*) ¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd Moderator

    25,412
    2,780
    Jan 21, 2010
    It strikes me that a comparator driving an H Bridge would be a better option, and dual comparators with a small window even better.

    What do Q7 and Q8 control?
     
  3. Vangaurd

    Vangaurd

    6
    0
    Mar 13, 2015
    A dual comparator would be great. The LM339 looks like it would be perfect for what I'm doing.

    Q7 and Q8 are controlling the PWM signal to a full bridge MOSFET driver.
     
  4. Vangaurd

    Vangaurd

    6
    0
    Mar 13, 2015
    Well, now that I've sat down and tried the circuit with the comparator I'm realizing that it might not be as simple as i had hoped. Were you thinking that the comparators would use the signal provided by Q5 and Q6 and just replace Q1-Q4? Otherwise it looks like i would need to invert the signal to one of the comparators to get rid of Q5 & Q6. Of course i might be approaching this thing wrong...
     
  5. (*steve*)

    (*steve*) ¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd Moderator

    25,412
    2,780
    Jan 21, 2010
    You need to google "window comparator". This circuit will allow you to have one output active when the position of the pot is one side of your desired point and another active when it is the other side. The "window" part comes in because there is a small and adjustable region around the set point where neither output is active.
     
  6. (*steve*)

    (*steve*) ¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd Moderator

    25,412
    2,780
    Jan 21, 2010
    Note that in many (most) window comparator circuits the outputs of the two comparators are connected together. You will need to keep them separate. Note that comparators need a pull-up resistor on their outputs.
     
  7. Vangaurd

    Vangaurd

    6
    0
    Mar 13, 2015
    It turns out that I was pretty much setting up a window comparator unbeknownst to me. I'll have to play around with the circuit using your advice, but here's what i have:
    window-comp.png

    Right now I'm struggling with latching the outputs. Every configuration i've played with has caused some erratic behavior. I'm hoping that if I split the outputs like you said, I'll be able to work out a configuration that will achieve what i'm looking for. I really need this circuit to behave like a nand latch. Here's an example of what I mean. Where the outputs overlap, the first high output should keep the other output low until the first output is pulled low, and this pattern should repeat. Here you can see the output for the circuit above, and i've highlighted how the output needs to be changed:
    window-plot.png

    So you can see that for the operation of the motor, if 0.5 Volts = 0 Degrees and 4 Volts = 90 Degrees. The output for V1 is high for 0.5V and up, and the output for V2 is high for 4V on down. So V1 drives the motor from 90 to 0 degrees and V2 drives the motor from 0 to 90 degrees. Of course in reality the operation is nowhere near that exact and the plot above doesn't exactly match my description, but I'm not worried about precision. Anyway, you can see that both outputs can be high roughly in the 0.5-4V range and outside this range the output switches and then holds. I hope that clarifies what i'm trying to do.

    Of course I do have this feeling that I'm over complicating this...
     
  8. Vangaurd

    Vangaurd

    6
    0
    Mar 13, 2015
    Ok, I just realized that when both outputs are high on a nand latch, the output is metastable. That's why i was getting the "erratic" behavior. I'm not sure how or why my first circuit avoids metastability. The only logic combinations i know that allow both inputs to be high do not match my output requirements. Given the fact that DC servos have a built in microcontroller, I don't think there is a simple solution to this problem.
     
  9. Vangaurd

    Vangaurd

    6
    0
    Mar 13, 2015
    After taking some time away from this I think I came up with the solution:

    servo-signal2.png

    It produces fairly neat output:
    signal-plot.png

    I think I could accomplish this with the LM339, but I'm not positive. Do you see any improvements I could make or have a better suggestion for a comparator I should use?
     
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day

-