Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Solving for logarithms

Status
Not open for further replies.

antknee

New Member
I need to solve the equation in the picture. I choose p and have to find q. I did study maths and physics to a reasonable level so if I'm given a pointer it won't be a problem. The equation can be found at the link below, it is used to determine a resistor value to set a 555 timer with a 50% duty cycle.

Thanks for your help.

**broken link removed**

screen_03-gif.43205
 

Attachments

  • screen_03.gif
    screen_03.gif
    2 KB · Views: 561
hi,
If you just want a 50% duty cycle from a 555 timer, its possible to use a circuit configuration as shown in this image.
 

Attachments

  • AAesp05.gif
    AAesp05.gif
    10.5 KB · Views: 315
Hi,

Eric:
How much temperature stability will be lost and how much power supply voltage stability will be lost using that method?

antknee:
I dont think you can solve for q explicitly, but you can solve for p if that helps any. I think that may allow us to prove that the interval for q is between 0 and 0.5, but i havent gone through the whole thing yet.
Normally that kind of equation is done numerically, using a numerical solver algorithm like Newton's.
 
Last edited:
Hi Eric. I did see that equation, essentially R2 is put to zero ohms and I should get a 50% duty cycle. But I tested it and it wouldn't work, I don't know why so I moved on. I will try it again, maybe I made a simple error.

Hi MrAl. The calculation is just too complicated, I can test it quicker than solving the equation. I will set p=1 on the proto board and then alter q till I can home in on it.
 
Hi, I did but still no luck. I'm wondering if there is a chip difference. I have a NE555, whereas i think the later chip is LM555. I'm fairly sure I read that 555's shouldn't have a duty cycle less than 55%, I forget in which context exactly though. I think trial and error may have to be the case, and I'll order some LM555's when I next need some kit.
 
Last edited:
I think this thread just goes to show that the ubiquitous 555 is not the device to use if you want an accurate 50:50 mark space ratio.
There are circuit configurations with a 555 that do give 50:50, but why not just use a divide by 2 circuit if 50:50 mark space ratio is important in your application.

JimB
 
I think this thread just goes to show that the ubiquitous 555 is not the device to use if you want an accurate 50:50 mark space ratio.
There are circuit configurations with a 555 that do give 50:50, but why not just use a divide by 2 circuit if 50:50 mark space ratio is important in your application.

JimB

I think that is fair comment. I don't know how to set up or use a divide by 2 circuit though, and it may be difficult! I do have a little experience of 555 timers.

A 50% duty cycle is referenced in the LM555 datasheet with a schematic but not in the NE555. I will make up the exact circuit in the LM555 datasheet with my NE555. If it doesn't work I will know what the problem is.
 
Hi again antknee,

How accurate do you need the 50 percent duty cycle to be? Would it be a problem if it was 51 percent, or 49 percent?

Yes, the data sheet shows a 555 with connections for a true 50 percent duty cycle, but the design information is lacking.
We need to get t1=t2 to get a 50 percent duty cycle, so that means:
ln((R2-2*R1)/(2*R2-R1))/(R2+R1)-ln2/R2=0
where
R1 is the upper resistor,
R2 is the resistor in series with pin 7,
ln2=ln(2)
and
Frequency=1/(2*ln2*R1*C)
or alternately:
R1=1/(2*Frequency*ln2*C)

So say we want 10kHz, that makes R1=7213.475 ohms, and using the equation above to get R2 we end up with R2=3053.726 ohms.

To make it simpler, the following may be true (i'll have to test this idea out better later though):
R2=R1*0.4233363273

so we can select R1 with the formula for R1 above and then calculate R2 like that (test R2 with the big equation above first though just to make sure).
This design info is only for the circuit on the data sheet of course and is only for a theoretical 50 percent duty cycle output.
 
Last edited:
Hello again,

Ok the solution set:
R1=1/(2*Frequency*ln(2)*C)
and:
R2=R1*0.42333632728275

is a valid solution for the 50 percent duty cycle oscillator shown on the data sheet for the 555 timer ic.
I guess they didnt feel like calculating the proper design info when they wrote that data sheet up :)

When R2 is made as per above the following equation is always satisfied:
R2*ln((R2-2*R1)/(2*R2-R1))/(R2+R1)-ln(2)=0

and so R1 and R2 are easy to calculate.

The final circuit may need some slight adjustment anyway however if the frequency is not exact due to component variations, and if R1 is varied then R2 has to be varied also to maintain the 50 percent duty cycle ratio, unless some slight difference is ok in the application.

The circuit Eric was nice enough to post will probably be easier to adjust, but it may not be as good as to power supply variation tolerance and temperature tolerance. It may still be good enough however, depending on the application.
 
Last edited:
Hi MrAl,

I have built a piezo driver. The setup is currently sig gen -> amp -> transformer. So +/-0.5V at the sig gen gets turned into +/-90V on the piezo at 100KHz. It works very well and I'm happy with it. I need to make the driver portable which means replacing the sig gen with a timer. So the first complication is that with large amounts of amplification an imperfect signal will get a lot worse. The second complication is that I need a bipolar supply for the piezo, so this thread entails ensuring I get a 50% duty cycle so I can use a cap to give me a bipolar supply that is +/-90V. With a duty cycle of say 60% I will end up with say +120/-60V.

I have been looking at 3 ways of getting +2/-2Vpp at 100KHz

1) Using the timer in a standard config - maybe decide a cycle of 52% is ok.
2) Trying to get a 50% cycle changing the config - can't currently get it to work.
3) Set the ground to -2V and bump it up by 4V - haven't looked into it yet.

I only started electronics projects 6 months ago so I have to spend a long time with something before I find the right path. I will try again tomorrow. Thanks.
 
hi antknee,
If you get a type of flip-flop IC ?
eg: 4013, 4027, etc
We could post a simple divide by 2 circuit, which would follow the 555 astable.
 
Hi Eric,

I decided I can live with a duty cycle that isn't exactly 50%. I can't get the schematic you posted working nor the one referenced in the LM555 datasheet, I'm not sure why. Starting down another track is something I will have to leave for another time, thanks for the offer though! I will shortly begin putting this on a stripboard, I will use leads for R1, R2 and C so I can change values later, prior to final build. The only question I'd have is how does output voltage compare to supply voltage? I'm thinking it is about 2/3 so If I want 2V I should supply 3.
 
It is early here in the UK! :)
hi,
The output level from the 555 depends to some extent on the load its driving, I would think that the 1V overhead would be a good idea.

Where in the UK.??

BTW: I did run some LTspice tests with varying temperatures and supplies, I found VERY little change in the frequency.
I would have thought this configuration, ie: output linked back thru a resistor is no more susceptible to Δt and Δv changes than the 'standard' astable configuration.
 
Last edited:
I'm in Wrexham at the moment. The weather is supposed to be nice for the rest of the week so I'm looking forward to that. Will go to Leeds this weekend to see some friends.

I just put the 555 timer through the amp and cracked one of my piezo's. It was sparking :) 1.5Vrms from the 555 is too much. I make the piezos myself so there is no shortage. I did buy a pot with 10K resistance, I'm hoping to use that and a 1K resistor in series. So the setup would be 555 -> pot -> amp. I'm somewhat following the amp datasheet, but wondering if the pot has too high a value. Thanks for your help.
 
hi,
The output level from the 555 depends to some extent on the load its driving, I would think that the 1V overhead would be a good idea.

Where in the UK.??

BTW: I did run some LTspice tests with varying temperatures and supplies, I found VERY little change in the frequency.
I would have thought this configuration, ie: output linked back thru a resistor is no more susceptible to Δt and Δv changes than the 'standard' astable configuration.

Hi Eric,

I dont think a spice test will show the difference anyway. A real life test may or may not show the difference depending on the actual specific ic chip, but it probably will.

Check out the data sheet variation over temperature for the output transistors and compare to the 'discharge' transistor variation. When using the discharge transistor the circuit is more stable. For another thing, the supply voltage can not change relative to the internal divider as it can with the output.

The 555 was made to be pretty darn stable when used correctly, but then again if the application does not need that level of stability it's all academic anyway :)

One thing is for sure though, the output resistor drive is a lot easier to adjust and maintain a 50 percent duty cycle at the same time.
 
Last edited:
hi Al,
I guess you feel the same as I do, if you want excellent frequency stability for your project, the 555 is not the answer.
If I used a 555 and required a reliable 50/50 ratio I would use a divide by two after the 555 output.
If one examines the temperature coefficients of the supporting timing components for the 555, ie: resistors and capacitors they are usually 'worse' than the 555 itself.
Likewise the tolerance on value for most general purpose caps is abysmal, so to get the desired frequency many use low grade carbon trim pots which is another source of drift versus temperature.

I am aware that you know these limitations of the 555 already, I have posted my comments for prospective Wanabees.

Regards
 
I made up the circuit on a stripboard, I used 2 potentiometers for R1 and R2 with a fixed cap. I then adjusted for frequency and output on the piezo. I have +92 and -91V at 100Khz. That is fine.

Better a wannabee than a never been.
 
Hi again,


Oh that sounds very good.
So did we solve for any logarithms in this thread? :)
I do want to note however that there may be a solution for q in your original question but it's not immediately apparent. I did find an approximation using an 8th order polynomial which may be good enough, but numerical methods these days are so fast it's not even worth storing it on the computer any more :)
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top