4017 counter signal to toggle between two PWM signals

Thread Starter

christiannielsen

Joined Jun 30, 2019
380
I am trying another way around in my project concerning a "Santa Jumping Jack" where I want a servo motor to simulate 5 pulls in the string of the santa jumping jack.

I have found a 555-circuit that provides the two PWM signals I need for the servo motor to toggle between to positions 0 and 180 degrees when pushing the two buttons.
ServoTester.gif

I need help to replace the two buttons (forward and reverse) with something automated that simulates a push on the two buttons combined with this 4017 circuit:
aac.png
I want a 4017 counter to control when "Forward" and when "Reverse".
When 4017 outputs a signal the position of the servo motor shall be "forward" and when there is no output signal from 4017 the servo motor position shall be "reverse".

Can anyone help me with a solution to this?
 

dendad

Joined Feb 20, 2016
4,451
This may be a real good project for a try at Arduinos.
No 555 or 4017 needed. Just an Arduino, like a Nano.
They are available for well under $5 and once you incorporate an Arduino, it opens up other possibilities, like making it light dependent or with ultrasonic sensing to do something else as people get closer, just for a couple of examples. Lots of other things too.
If you have not tried an Arduino, why not give it a try?
 

Thread Starter

christiannielsen

Joined Jun 30, 2019
380
I know how to programme so that is no fun for me. I like learning electronics.

The other circuit couldn't make the servo travel the whole way from 0 to 180 degrees and also couldn't stop making noise.

Do you have a suggestion to combine these two circuits?
 

crutschow

Joined Mar 14, 2008
34,280
How fast should it toggle between forward and reverse?

That servo tester circuit significantly changes the frequency along with the duty-cycle of the PWM signal.
Is that okay?
 
Last edited:

schmitt trigger

Joined Jul 12, 2010
868
Since the switches are "floating", perhaps the simplest (and with greater chances of success) is to replace them with reed relays.

Otherwise, you could use transistor photocouplers.

Or even perhaps a solid state switch like the CD4066. This would be my preferred solution.
 

Thread Starter

christiannielsen

Joined Jun 30, 2019
380
How fast should it toggle between forward and reverse?

That servo tester circuit significantly changes the frequency along with the duty-cycle of the PWM signal.
Is that okay?
Thanks for making your time.

To me it seems to withhold the speed through out its movement from 0 to 180 degrees. I would love for it to run a little slower but if this is what I can get I won't complain. In order to make it run slower I maybe think I have to regulate the duty cycle but i am not sure and it is not that important right now.

It has to change its frequency in order to control the servo motor. But I am not sure if that is what you want to gain from your comment?
 

Thread Starter

christiannielsen

Joined Jun 30, 2019
380
Since the switches are "floating", perhaps the simplest (and with greater chances of success) is to replace them with reed relays.

Otherwise, you could use transistor photocouplers.

Or even perhaps a solid state switch like the CD4066. This would be my preferred solution.
Thank you

I actually thought two transistors would do the job? why not? Output from counter to base of transistors?
and the connection from the resistors in servo tester on collector and emitter? does it makes sense?

I think I have a photocoupler but I havent come to use them yet. How should they be connected to replace the two button switches and can it be pulled by the counters output signal?

Is it this CD4066 you mean? can this be pulled by the counters output signal?
 

ElectricSpidey

Joined Dec 2, 2017
2,757
Any new circuit could end up with the same problem, I would suggest you need to adjust the length of your output pulses, instead of trying a new circuit. And be sure the 4017 isn’t switching too soon.

Use trim pots in place of some of the fixed resistors in your original circuit, chose ones that put the wiper somewhere in the middle to match the original resistors. Those 20 turn small square versions should do the trick.

As far as making the new circuit work, something very much like the original would work, that being using a transistor to make the switch connections with the diode arrays.

4066s or optos would work as well, but take up space you don’t really need to use.

In fact when I look at your original circuit I don’t really see the need for the transistor, because the 4017 should source enough current to bypass the resistor. (without the LED)

I have built many a circuit controlling the frequency of 555s using a 4017 varying the resistance to VCC. Creating two separate paths to positive using the diodes and resistors should work, if fact I know it works…just need some control over the resistance to make it work properly.

In you new circuit idea you cannot use the 4017 to directly source the positive.
 

Thread Starter

christiannielsen

Joined Jun 30, 2019
380
Use trim pots in place of some of the fixed resistors in your original circuit, chose ones that put the wiper somewhere in the middle to match the original resistors. Those 20 turn small square versions should do the trick.
Thank you very much
I did use trim pots at first in the original circuit to define what fixed resistors I could replace the trimpots with as I am not suppose to be changing it once the position is found.

As far as making the new circuit work, something very much like the original would work, that being using a transistor to make the switch connections with the diode arrays.

In fact when I look at your original circuit I don’t really see the need for the transistor, because the 4017 should source enough current to bypass the resistor. (without the LED)
But I wasn't able to fix the original circuit. I needed help.
 

Thread Starter

christiannielsen

Joined Jun 30, 2019
380
One of the positions of the servo are controlled by one of the resistors between pin 6 and 7. Why cant I use a transistor to make connection between the two pins?

like this:
IMG_1968.JPG
 

ElectricSpidey

Joined Dec 2, 2017
2,757
You can, but what if you end up with the same problem?

Go back to your original circuit...remove the transistor and the LED, tie the diode array directly to the junction between R4 and R5.

A 4017 can easily supply the .00022 amps needed (5 divided by 22k)

Let me know if that works at least as well as with the transistor.

Forget about the LED for now.
 

Thread Starter

christiannielsen

Joined Jun 30, 2019
380
You can, but what if you end up with the same problem?

Go back to your original circuit...remove the transistor and the LED, tie the diode array directly to the junction between R4 and R5.

A 4017 can easily supply the .00022 amps needed (5 divided by 22k)

Let me know if that works at least as well as with the transistor.

Forget about the LED for now.
All right I will do that and write in the other thread.
 

Thread Starter

christiannielsen

Joined Jun 30, 2019
380
Normally a PWM signal does not significantly change frequency, that's why I asked.

What exactly are the characteristics of the two signals the servo motor needs to move in both directions?
I am no expert but I have seen several videos on controlling a servo motor with a pwm signal and they showed it needed a 1.0 ms frequency to position in 0 degrees and 2.0 ms to position in 180 degrees with a dutycycle between 5 and 10%. But I have also seen videos showing a spand from 0.5 ms to 2.45 ms...
 

Thread Starter

christiannielsen

Joined Jun 30, 2019
380
What do you want to happen after the 5 pulses?
It's just suppose to stop. And I'd like a infrared sensor to start it. But I haven't looked too much into that yet.
I was thinking another 555 timer in monostable mode to switch on with help from the IR sensor and to switch off with help by a signal from decade counter to reset on 555 ?
 

djsfantasi

Joined Apr 11, 2010
9,156
Let’s go back to some servo basics...

Position is controlled by changing the pulse width of a 50Hz signal. That is, the period of your signal MUST be 20ms. And the time that the pulses are high are what determine the servo position. 1500μs is usually defined as neutral or centered.

If your control signal frequency diverges significantly, your servo may not respond or will chatter.

Other sources of chatter are a) driving through servo beyond it end points (end points are usually a hard stop). Or b) insufficient current available to drive the servo.

You cannot control the speed of a servo by modifying the control signal. While I won’t say it’s impossible with a circuit, IMHO it’s damn difficult.

First, one of the specifications of a servo is the amount of time it takes to move from its minimum position to its maximum position. You can’t move it faster than that.

To move a servo slower, is typically done by dividing the angle by the desired time, and sending commands/signals to the servo in increments while pausing between changes in the pulse width.

For example, you want to move from 180° to 90° over 9 seconds. send a 2000μs pulse with at 50Hz, delay 1000ms, send 1889μs, delay 1000ms, etc... until you are sending a 1500μs pulse signal at 50Hz!

I’m sure you can do this in hardware, as you’re a hardware-kind-of-guy. But my preference is in software, so I can’t explain how to do it.

This link is a description of an RC servo control signal. Maybe you’ll find it useful.
 
Top