555 Timer and Servo

Thread Starter

doubledutch1962

Joined Oct 27, 2020
37
My first post so be gentle :)

I'm following a udemy course in electronics, they ask me to build a circuit and I don't understand why it could work (see below). I think I understand what they want to do, the left 555 set in astable mode sends out a pulse to the right 555 where we vary the PWM. My question is about the left 555. If I use this 555 calculator (I tried a few...) with

R10(/R1): 4.7k,
R11(/R2): 1k
C1/C3: 10uF

The frequency I think this 555 generates is 21Hz and when I connect this to my Osciloscope: that seems to be confirmed. The guy on the course even proudly proclaims that it sends out about 25 signals a second (25Hz)

But as I understand it these servo's require 50Hz so in my simple mind: that could never work. I can't believe that this very well respected course on udemy got that so wrong so I must be missing something. Can someone point me in the right direction?

Thanks

555-Servo.png
 

djsfantasi

Joined Apr 11, 2010
9,156
I believe it is the pulse width that is important and the frequency much less so.
To some extent, that’s true. But it is dependent on the RC servo manufacturer. Some will only respond to a much narrower frequency range. For reliable operation over the greatest number of servo manufacturers (and models within a given mfgr ) you need to send the signal close to a 50Hz rate...

The RC servo responding to a 25Hz signal is more a matter of luck rather than design.
 

Thread Starter

doubledutch1962

Joined Oct 27, 2020
37
Thank you both. So you (both) agree that this circuit does not give you a 50Hz frequency?

I tried to "fix" that and changed R1 (4.7), R2 (22k) and C1 (680nF - I only had a ceramic one) and that didn't work at all. I didn't get any pulses at all. Would that be outside the specification of the 555 or is the ceramic capacitor the issue (I seem to get much better results with electrolytic ones but I don't have one of that value)
 

djsfantasi

Joined Apr 11, 2010
9,156
Thank you both. So you (both) agree that this circuit does not give you a 50Hz frequency?

I tried to "fix" that and changed R1 (4.7), R2 (22k) and C1 (680nF - I only had a ceramic one) and that didn't work at all. I didn't get any pulses at all. Would that be outside the specification of the 555 or is the ceramic capacitor the issue (I seem to get much better results with electrolytic ones but I don't have one of that value)
Something’s wrong. Those values (4.7Ω, not 4.7kΩ) should give you an output at 48.2Hz.
 

Thread Starter

doubledutch1962

Joined Oct 27, 2020
37
Again thanks for your suggestions but I'm still confused about what the correct way is to figure this out. Ignoring the current (I'll sort that out later), I believe we agree that the values above resistor / capacitor values will give me a 50Hz frequency. I now need to make sure that tM is between 1-2 ms to drive the servo in the right direction. (I appreciate that the original circuit does this differently but I think that's actually not that relevant for what I'm trying to figure out).

The way I understand we do that is put a large Resistor (e.g. 1m) as R2 with a Diode over it so in effect, R2 is ignored when the capacitor is charge.

But... When I start doing that: surely the frequency calculation (1.44/(R1+2R2) * C1) will be changed so the frequency will change again.

I accept that the 50Hz is probably not that critical but I'm just trying to figure out how you would approach solving for this (besides trial and error). Do you sort our the frequency first, then deal with the duty cycle through R1 or some other way?

Maybe I'm making this too complicated.
 

djsfantasi

Joined Apr 11, 2010
9,156
But... When I start doing that: surely the frequency calculation (1.44/(R1+2R2) * C1) will be changed so the frequency will change again
That is why using 555s for a servo controller is usually controlled by two 555s. When you try to modify the duty cycle, you end up changing the frequency. So, one 555 sets the frequency at 50Hz and which triggers a 555 monostable circuit with the proper duty cycle.
 

Thread Starter

doubledutch1962

Joined Oct 27, 2020
37
Thank you @djsfantasi. That makes perfect sense and was the original author was trying to do in the above circuit. But, and I may just have to try this myself but maybe you know the answer:

  1. To get first 555 to be accurate at 50Hz - I may need to end up at a 50% duty cycle, so 6ms x 50% = Tm = 3ms
  2. So Pin 2 on the second 555 will be "high" for 3ms, much longer then the 1-2ms need to drive the PWM to drive the servo.

Will that cause any issues on the second 555 / impact the frequency / Tm on the second Tm?
 

jpanhalt

Joined Jan 18, 2008
11,087
If you use two 555's like that, the one at 50 Hz does not need to be at 50% duty cycle. It can be anything. An edge triggers the second 555. The second 555 is configured as a one shot. You have pretty good control of that pulse width and it is not related to #1's duty cycle.

There are much better 555 servo controller circuits. Some even use just one 555, but they are not so good. Some don't even use a 555. The one I bought years ago does not. You can also do it with a simple Schmitt inverter or two.

As mentioned, servo sensitivity to the frame rate varies. Going lower can cause sluggish response. Many years ago, that was used to slow servo speed. However, going faster up to about 80 Hz to 100 Hz has no noticeable effect -- at least not to me. In fact, some servos today are designed to work best at a higher frequency (e.g., 100 Hz).

Finally, if your plan is to understand the circuit, does it matter how well it works? If your plan is to drive a servo accurately, use a microcontroller. Sparkfun and others sell those controllers. The code is quite simple.
 

Thread Starter

doubledutch1962

Joined Oct 27, 2020
37
@jpanhalt - Thank you and my aim is to understand the circuit and build it. I accept everything you say about using a Micro Controller as well. As a software guy, I'm actually more comfortable with that compared to soldering :)

Your statement "If you use two 555's like that, the one at 50 Hz does not need to be at 50% duty cycle" is where my lack of understanding is. I don't understand what the process is for calculating the R1+R2+C1 values in that configuration. I can get to 50Hz but the moment I want to reduce the duty cycle by introducing large, 1M resistors and dioces around R2 the frequency changes so it seems a vicious circle and the only way I've been able to get close is just swapping components and guessing, and hoping for the best.....

@Alec_t Apologies and noted.
 

jpanhalt

Joined Jan 18, 2008
11,087
Your statement "If you use two 555's like that, the one at 50 Hz does not need to be at 50% duty cycle" is where my lack of understanding is. I don't understand what the process is for calculating the R1+R2+C1 values in that configuration. I can get to 50Hz but the moment I want to reduce the duty cycle by introducing large, 1M resistors and dioces around R2 the frequency changes so it seems a vicious circle and the only way I've been able to get close is just swapping components and guessing, and hoping for the best.....
My understanding is that duty cycle is set by R12 and C4. They should have minimal effect on the oscillator on the left side. Just set up the left 555 for 50 Hz -- duty cycle matters little -- and deal with the right 555 for your duty cycle. A capacitor between the two 555's (left pin 3 to right pin 2 ) might help but may not be necessary. Try it, if adjusting the right side affects the left.
 

djsfantasi

Joined Apr 11, 2010
9,156
Thank you @djsfantasi. That makes perfect sense and was the original author was trying to do in the above circuit. But, and I may just have to try this myself but maybe you know the answer:

  1. To get first 555 to be accurate at 50Hz - I may need to end up at a 50% duty cycle, so 6ms x 50% = Tm = 3ms
  2. So Pin 2 on the second 555 will be "high" for 3ms, much longer then the 1-2ms need to drive the PWM to drive the servo.

Will that cause any issues on the second 555 / impact the frequency / Tm on the second Tm?
In a two 555 servo controller, the second 555 is triggered by the edge of the pulse from the first 555. Thus, the duty cycle of the first 555 is irrelevant. The edge occurs in the same place in time regardless if the duty cycle is 1% or 50%!
 

djsfantasi

Joined Apr 11, 2010
9,156
A long time ago I made a servo controller with 1 LMC555. If I remember correctly, the .2uF cap was 2 - .1uF discs in parallel.
However as noted above, a controller with a single 555 may not work with RC Servos other than the one used in developing the circuit. Plus, it’s operation may not be reliable resulting in the servo not performing to specification. Such as speed or position. Or jitter may be disabling. Or it simply may not work at all.

You have to be aware that in a single 555 solution, you may also be incurring a great deal of frustration.

Thus, I can’t recommend that approach to the thread starter. I am sure he needs a solution that works; not one that may work.
 
Top