Shop OBEX P1 Docs P2 Docs Learn Events
Servo Noise? — Parallax Forums

Servo Noise?

Circuitbuilder9Circuitbuilder9 Posts: 85
edited 2012-03-04 19:03 in Propeller 1
Hey, guys.
I was making a project that takes a memsic value and converts it, then takes that value and puts it into a servo position value. I interface the values to an LCD. However, although the code is right, the LCD and servo act up. Once the servo turns, the noise (i think that is what it is) turns the LCD off or makes it go wacky. what do i need to do?

Comments

  • Beau SchwabeBeau Schwabe Posts: 6,568
    edited 2012-03-03 14:22
    One thing that would help us is if you posted a schematic of your current setup.

    That said, one way to reduce noise from a servo is to place a 4.7k resistor in series on the signal line, as well as placing a 1000uf capacitor in close proximity to the servo's power connector, and connecting it across the power and ground of the servo there.
  • Circuitbuilder9Circuitbuilder9 Posts: 85
    edited 2012-03-03 14:39
    Thanks for the advice. However, do you mean to put the resistor and capacitor on the LCD or servo? or both? Also, my LCD and servo are in very close proximity. does that effect the noise?
  • Beau SchwabeBeau Schwabe Posts: 6,568
    edited 2012-03-03 14:41
    Since the noise is originating from the servo (most likely) ... I was referring to the Servo.
  • Circuitbuilder9Circuitbuilder9 Posts: 85
    edited 2012-03-03 14:43
    would a 100uF work? don't have a 1000 handy....
  • Duane DegnDuane Degn Posts: 10,588
    edited 2012-03-03 14:55
    Servos draw a lot of power when they start to move. You want to make sure you have a good power source (not a 9V battery).

    The capacitor Beau suggests can help a lot with keeping the power clean enough so a servo doesn't interfere with the Propeller. I've had many projects where a 1000uF cap solved a problem of the Prop resetting as a servo started to move.

    I personally don't use resistors in my (now many) servo projects, but if Beau recommends them, they must be a good idea. (Although I think they can also cause problems with a servo reading the 3.3V logic signal. I know I've had a servo that would work without a series resistor but wouldn't work with one on the logic line.)
  • Duane DegnDuane Degn Posts: 10,588
    edited 2012-03-03 14:56
    would a 100uF work? don't have a 1000 handy....

    Maybe. It's better than nothing. Using a good power source is also important.

    Edit: If you have more than one 100uF capacitor you can use them in parallel for larger capacitance.
  • Circuitbuilder9Circuitbuilder9 Posts: 85
    edited 2012-03-03 15:07
    can i have a schematic or explanation of where to connect my capacitor? Is the positive end connected to the positive power source, or reversed?
  • Circuitbuilder9Circuitbuilder9 Posts: 85
    edited 2012-03-03 15:10
    Just so you can visualize my project, the power source is the schematic from the propeller PE kit.
  • Duane DegnDuane Degn Posts: 10,588
    edited 2012-03-03 15:18
    Just so you can visualize my project, the power source is the schematic from the propeller PE kit.

    What are you using as a power supply?

    I'll look for a picture or schematic about using a cap and get back to you.
  • Duane C. JohnsonDuane C. Johnson Posts: 955
    edited 2012-03-03 15:27
    The + plus on the cap goes to the + plus of the power line.
    The - minus on the cap goes to the - minus of the power line.

    Duane J
  • Duane DegnDuane Degn Posts: 10,588
    edited 2012-03-03 15:28
    can i have a schematic or explanation of where to connect my capacitor? Is the positive end connected to the positive power source, or reversed?

    The preview image of the video of my QuickStart servo tester shows a 1000uF cap being used with the QuickStart board. I have the + side of the capacitor plugged into pin 40 of the female header with the - side (the side with the white stripe) plugged into Vss (using the female headers I added to the board).

    In your case, I'd add the capacitor right next to were you are connecting the servo so it is close to the servo's 5V line and ground line. I'm not sure about this. It might be better to connect it close to the Propeller's Vdd pins.

    I do know, with the servo tester, the QS board kept resetting if I didn't include the capacitor.

    Another sure fire way of getting a project with servos to work is to use seperate power supplies for the Propeller and the servo. You just need to make sure both power supplies have their grounds connected together at some point (and apparently it's best if they're connected at only one point).

    Edit: Apparently two Duanes were posting about the same time. Way to go Duane!
  • Duane C. JohnsonDuane C. Johnson Posts: 955
    edited 2012-03-03 16:01
    Generally, it is good practice to place capacitors close the thing affected by the noise.
    However, when the source of the noise is known, in this case the servo, it is better to put the capacitor closer to the source of the noise.

    Duane J
  • Circuitbuilder9Circuitbuilder9 Posts: 85
    edited 2012-03-03 16:14
    thanks for the advice. I tried a 470 uF (all i had), and it kinda worked, but still had the case of the jitters. The servo would change with the value, but would somehow bounce back and forth.
  • Beau SchwabeBeau Schwabe Posts: 6,568
    edited 2012-03-03 16:37
    "I was making a project that takes a memsic value and converts it..." ... "but still had the case of the jitters" .... What does the memsic signal look like, and how are you filtering it? It could be producing values or 'spikes' that you may not see visually in the readout, because for normal perception, they are too quick.

    Again, looking at your schematic and code might be helpful here.
  • Circuitbuilder9Circuitbuilder9 Posts: 85
    edited 2012-03-03 16:46
    MemsicDemo.spin I don't have a schematic, but here's the code:
  • Duane DegnDuane Degn Posts: 10,588
    edited 2012-03-03 17:07
    Duane Degn wrote: »
    What are you using as a power supply?

    If batteries what size and kind?

    If a transformer, what kind?

    The power source can make big difference in the way projects with servos behave.
  • Circuitbuilder9Circuitbuilder9 Posts: 85
    edited 2012-03-04 17:24
    If batteries what size and kind?

    If a transformer, what kind?

    The power source can make big difference in the way projects with servos behave.

    I am using a 9 volt battery with voltage regulators that cut the 9 volts into 5, then into 3.3v.
  • Circuitbuilder9Circuitbuilder9 Posts: 85
    edited 2012-03-04 18:18
    I know this is hard to ask, but what am i doing wrong in this code? the LCD and servos do not work out well.

    ServoPosition.spinMemsic2125_v1.2.spinDebug_Lcd.spinMemsicDemo.spin

    memsic demo is the main body control.
  • Duane DegnDuane Degn Posts: 10,588
    edited 2012-03-04 19:03
    Duane Degn wrote: »
    You want to make sure you have a good power source (not a 9V battery).
    I am using a 9 volt battery

    I couldn't find a smiley face that's pulling out its hair.
Sign In or Register to comment.