Author Topic: Servo capacitor filtering question.  (Read 3988 times)

0 Members and 1 Guest are viewing this topic.

Offline Pedro R.Topic starter

  • Newbie
  • Posts: 2
  • Country: br
Servo capacitor filtering question.
« on: March 21, 2016, 12:41:27 pm »
I am designing a PCB for a hexapod robot with 19 servos(3 for each leg, 1 for a ultrasonic sensor positioning), controlled by an Arduino Mega and it kind has some jitter to it, and I wish to use some capacitors in it so it can have less external noise. I was wondering if there is a quick answer for the following question. Where should I put the capacitor with which value? I've seen EEVBlog recent video about bypass capacitors but I'm not really sure how to get ESR and ESL values so I can calculate the resonance frequency and all that stuff, and I think there is probably a rule of thumb for that, my guess, that I've made from previous research is, just put a 10nF ceramic capacitor between VCC and GND. My doubt is, for a servo, is it better to put the capacitor to VCC or SIGNAL? Also, is 10nF an appropriate value? Also, I'm using a 7.4V LiPo battery to supply, and I drop this voltage to 6V with some diodes, and have 10k pull up resistors in the signal pin (I know diodes are not the best way to regulate, but I'm from Brazil, and we don't actually have many parts available here, so It's kind hard to find regulators others than LM317 or 78XX that needs 2V drop, which we don't have in this case, and everything from the internet takes 1 mouth+ to arrive and have salty shipment fee).

So resuming my questions.

  • Should I put capacitors between VCC and GND, or SIGNAL and GND?
  • Should I use 10nF as a rule of thumb, or there is better method?

If someone can explain me the decision making process on this situation I would be really happy. I appreciate your time trying to helping me, sorry if I said anything wrong or misspelled anything, English isn't my first language, tell me if I've got anything wrong. Already, Have a good day!    O0
« Last Edit: March 23, 2016, 12:39:59 am by Pedro R. »
 

Offline retrolefty

  • Super Contributor
  • ***
  • Posts: 1648
  • Country: us
  • measurement changes behavior
Re: [NEWBIE] Servo capacitor filtering question.
« Reply #1 on: March 21, 2016, 02:29:42 pm »
Servo jitter as a symptom could have a number of root causes each of which should be considered:

Insignificant current/voltage source for driving the number of servos that may have variable mechanical load(s) and always variable current requirements between moving, stalled, or at position. This is best seen with an o-scope and cannot be fixed with bypass filtering.

Firmware/software problem(s). Only posting actual code can anyone other then yourself look it over.

Bypassing between signal and ground is almost never the correct electrical fix for a jitter problem.



 

Offline Kilrah

  • Supporter
  • ****
  • Posts: 1852
  • Country: ch
Re: [NEWBIE] Servo capacitor filtering question.
« Reply #2 on: March 21, 2016, 06:35:22 pm »
Given the signal to a servo is the width of a square pulse, putting a cap on that would basically destroy the one important characteristic of that signal.

But your problem is very likely firmware, cleanly driving 18 servos from a Mega sounds impossible without clever tricks and external hardware. You can't really drive multiple servos without jitter with a software-only solution on a processor of that speed, and there aren't 18 hardware PWM outputs on a 2560.
 

Offline Ian.M

  • Super Contributor
  • ***
  • Posts: 13076
Re: [NEWBIE] Servo capacitor filtering question.
« Reply #3 on: March 21, 2016, 08:44:29 pm »
100uF 10V low ESR electrolytics between +5V and 0V right at each servo can be very helpful if the servos have long wires to them.  Use a switching regulator for the servos (e.g. a DC-DC buck converter module off EBAY if you cant get anything better easily) and a 5V LDO regulator for the Arduino Mega (as the on-board regulator needs too much headroom for operation down to 6V), and powering the MCU from the noisy servo power rail is asking for trouble.

Its possible to drive up to eight Futaba compatible servos from one hardware PWM channel (capable of arbitrary pulse generation), by using a 74HC238 demultiplexer to steer the generated pulse (applied to its E pin) to each servo in turn, and in an ISR, while the pulse is low, changing its address pins to select the next servo, + updating the pulse width.  The result is interrupt driven background jitter-free servo control with all edge timings handled in hardware.  To do this successfully you'll have to throw out the Arduino servo library and write directly to the ATMega registers.
 

Offline danadak

  • Super Contributor
  • ***
  • Posts: 1875
  • Country: us
  • Reactor Operator SSN-583, Retired EE
Love Cypress PSOC, ATTiny, Bit Slice, OpAmps, Oscilloscopes, and Analog Gurus like Pease, Miller, Widlar, Dobkin, obsessed with being an engineer
 

Offline Pedro R.Topic starter

  • Newbie
  • Posts: 2
  • Country: br
Re: [NEWBIE] Servo capacitor filtering question.
« Reply #5 on: March 23, 2016, 12:39:18 am »
Thanks a lot for all the good people who wrote useful information, the aggregate of all will certainly help me with my decision process. If anyone wants help out with more information, I would be pleased if you did. Again, thanks a lot people.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf