Connect with us

Servo Controller Help

Discussion in 'Sensors and Actuators' started by Railroadguy, Mar 31, 2014.

Scroll to continue with content
  1. Railroadguy

    Railroadguy

    5
    0
    Mar 31, 2014
    Greetings all-

    First post so be gentle ;o)

    Back when I was growing up, I used to tinker a lot with electronics and became pretty good at designing simple circuits. Then I went to college where they confused the crap out of me with Ebers-Moll propaganda and the like. As a railroad/transit signal and train control engineer, I deal more at the application level with respect to design and thus, my understanding of electronics has become pretty rusty.

    I have built a conveyor model that I intend on using to demonstrate automation controllers and general automation concepts to 5th grade elementary students. The model uses a color sensor to detect the color of like-objects as they pass the device. Then the objects are pushed off the conveyor by diverter gates where they land in one of three classification bins (sorted by color). I had considered using soleniods to control the gates but found that they tended to be too forceful in their movement and instead decided to use servos that are typically used for radio-controlled cars, boats, planes, etc.

    Servos typically respond to a pulse whose period/width is varied between 1-2msec which in turn translates to a rotation of 0-90 degrees respectively. Attached is a copy of the circuit which is based on an NE555 timer. Under "normal" or non-operating conditions, contact CR1 is open and the output of the timer is a pulse train with an on-duration of 2ms. When the relay contact is closed (based on an output of a PLC), it shunts the series-combination of 5K pot and 5.6K resistor and the output pulse changes in duration to about 1ms causing the servo to turn 90 degrees.

    I was concerned about using relays and my intuition was correct as there is a minor problem with this arrangement: Contact-bounce. In addition, the relays that I am using (simple industrial control model) have 24V coils which are being operated at 12V which doesn't help the situation (The conveyor motor can only run on 12VDC and I didn't want to have two different supplies for the model. This may qualify me as being lazy!).

    Does anyone have any advice, ideas, thoughts, suggestions or the like regarding how I might remedy this problem? To be honest, the "chatter" that I am experiencing is not too bad but let's just say that, 1. It bothers me, and, 2. I'm sure that there is a better way which would avoid the issue, and of course, 3. I really don't want to have to explain contact-bounce to some smart-alec 5th grader who will find that more intriquing than the model itself!

    Thanks in advance!
    Jim
     

    Attached Files:

  2. jpanhalt

    jpanhalt

    426
    4
    Nov 12, 2013
    Welcome to the forum, Railroadguy.

    Given how slowly servos respond (relative to many other devices), I am a little surprised contact bounce is the culprit. What are the symptoms?

    You can use an RC debouncer or more sophisticated debouncer chip (See: http://www.ganssle.com/debouncing.pdf ).

    Why not use automotive relays that are cheap?

    Finally without knowing the symptoms (is it jitter?), it is hard for me say more. Your circuit is fairly standard for getting duty cycles <50% . Do you have access to a scope to see what it is really doing? What type of servos are you using. The more expensive digital servos are known to have problems with that circuit. The cheap, entry-level analog servos, by today's standards, do fine.

    John
     
  3. Railroadguy

    Railroadguy

    5
    0
    Mar 31, 2014
    John-

    Thanks for the reply and see below:

    The problem is more pronounced when the relay de-energizes/"a"-contact opens. The servo will jitter as it moves back to the neutral position.


    I'll check that out.

    I'm guessing that this suggestion is based on the availability of 12V. I don't use automotive relays much. Do they tend to bounce less? I used what I had on hand since, well, I had them on hand ;o)

    As I mentioned, the symptom is jitter. In fact, I get different amounts when the coil voltage is increased or different contacts of the same relay are used. If I replace the relay contact with pieces of wire that I touch together to shunt the resistors, the servos operate correctly.

    I do have a scope but I didn't bother because I was pretty much convinced that bounce is the culprit. I can certainly connect it tonight and verify.

    Finally, the servos that I am using are all simple analog servos manufactured by Futaba. Two are about 20 years old and two are brand new (only major difference is rotational speed). Regardless of new or old, they all seem to jitter similarly.
     
  4. jpanhalt

    jpanhalt

    426
    4
    Nov 12, 2013
    You may need a diode across the relay for the inductive "kick" and a bit more decoupling for the 555. 0.1 µF is sorta minimum. Try adding 10 µF in parallel.

    Edit: Sometimes it also helps to add a small capacitor across the relay too. That can help take up the spike faster than a diode.

    I agree with Adam. I just assumed the values you chose gave a frequency of 50 Hz and a duty cycle of 10% or less. I didn't check them however. Servos are pretty tolerant of the pulse rate. Thirty Hertz to 100 Hz usually works just fine. Outside those limits, it could be contributing to the problem.

    John
     
    Last edited: Mar 31, 2014
  5. Arouse1973

    Arouse1973 Adam

    5,164
    1,081
    Dec 18, 2013
    RC servos require a break between pulses of around 6-20ms depending on the type of servo 20ms is a quite standard frame rate. This could be your problem.
    Adam
     
  6. Railroadguy

    Railroadguy

    5
    0
    Mar 31, 2014
    Oops, my bad. I always add the free-wheeling diode. It's there. I just forgot to draw it. I'll try upping the capacitance as you suggested.


    The values were chosen to create a pulse-width of 1-2msec (typical for all analog hobby servos) and an off-time of 40ms. The 40msec is pretty typical as well. With 2msec being the longest pulse width that the servo will expect, that allows for basically 20 servo channels to be served (based on reading that I did). The biggest problem that I read about was having too short of an off-time, say 10msec, which would tend to cause jitter. When I originally built the circuit several weeks ago, I scoped it and the pulse widths and off-times are pretty spot-on.
     
  7. Railroadguy

    Railroadguy

    5
    0
    Mar 31, 2014
    Thanks Adam. I contacted Futaba tech support a while back and their recommendation was a minimum of 20msec (no less). They warned that, with less off-time between pulses, the servo would likely buzz/jitter. From reading that I did on some robotics websites, 40-50ms seems to be typical.

    Based on the reply I just made prior to this one, the off-timing is pretty darn close to the 40msec that I was shooting for (based on what I saw with my scope).

    Thanks again!
    Jim
     
  8. jpanhalt

    jpanhalt

    426
    4
    Nov 12, 2013
    No, that is not typical. The usual "off time" is 20 mS - pulse width. In other words, the pulse repeats every 20 mS (50 Hz).

    A much slower pulse rate can cause problems and slow response. A pulse rate much greater (say 200 Hz) will also cause problems. I have run servos at 100 Hz, but never at 25 Hz.

    John
     
  9. Arouse1973

    Arouse1973 Adam

    5,164
    1,081
    Dec 18, 2013
    I agree with John, most analogue servos require approx. 20ms period which is 1/20ms=50Hz

    Adam
     
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

-