square to sine wave blending?

Started by corbs, May 27, 2005, 04:43:53 AM

Previous topic - Next topic

gez

Quote from: corbscoolies - gonna give it a go. btw do you think a LM339N would be an ok substitute? - i'm gonna have two together :). btw if the speed bunches up at one end - would a log pot be better?

Don't know this chip.  Most op-amps should work if you keep the amplitude small, but might have problems when you start increasing it.  All depends on how large you need the sine to be (what are you using it for?), you might need to tweak values...

Do you have a scope?  Running blind is difficult when you're messing with oscillators...

As Ton said, anti-log is what you need if everything bunches up at one end.  You can use an active device instead of a pot to mimic the response you need, rather than use a pot on its own, but things get a little over-complicated for such a simple little circuit, better to build something else in that case.
"They always say there's nothing new under the sun.  I think that that's a big copout..."  Wayne Shorter

David

Quote from: corbsDavid: don't worry about it  - i'm glad it got people discussing :)

Good.  Thanks for that, corbs.  Does anybody know where I can find out more about smoothing the output from a PIC?  If a simple filter is enough, that's great.  If it takes a resistor ladder, cool.  I'm having trouble seeing how a 4046 fits into this equation.

By the way, I'm not doing a top-octave generator.  I just want to do the second-lowest octave on a piano.

corbs

Quote from: gezAll depends on how large you need the sine to be (what are you using it for?), you might need to tweak values...

Quote from: corbswell i should say that i'm wanting to use this for controlling the flashing of an led/ldr combo, not to create a synth. the simpler the circuit the better really, a close approx would be fine.

maybe i should have been clearer :oops: - i am wondering how to add the led - i was going to try adding the led part of this lfo

Quote from: gez
Do you have a scope?

sadly not. although i should get one - even if i just wanted to add a mad scientist vibe to the room.

gez

Quote from: corbsi am wondering how to add the led

I'm just off out to watch a film so don't have the time to look at the schematic you linked to.  If you use a low current LED you might be able to get away with just connecting it (plus current limiting resistor) directly to the sine output, a lot will depend on the output capability of the amp you use.  Don't know how much amplitude you'll need though (been ages since I used LDRs, can't stand the buggers), but the circuit is easy to tweak.

Again, what are you using it for?
"They always say there's nothing new under the sun.  I think that that's a big copout..."  Wayne Shorter

corbs

Quote from: gezAgain, what are you using it for?

an ldr combo is acting as a pot replacement in a fuzz and i'm adding a set of controllable flashing led's that can be switched in for modulation as well (not enough modulation used in fuzzes imho :D)

gez

This is how I used to do this (take your pick, number of ways of doing it):



The regulator isn't strictly necessary, you could do away with it but it will help maintain consistency as a battery flattens.

There shouldn't be any need to adjust the amplitude of the LFO I posted if you use this approach (though I can't guarantee things won't need tweaking if you sub in a different amp).
"They always say there's nothing new under the sun.  I think that that's a big copout..."  Wayne Shorter

corbs

well i'm still having trouble... :(

i've built this:


(i have a 12v power supply for testing)

which has the exact same logic as this:


but i can't get it to work - the led will light but just stay the same brightness - funny thing is there is a higher controll voltage on the base (~2.5v) of the NPN than there is at the emitter (~2.2v) - is this normal?

i must admit i'm getting close to being licked.

btw - how would i go about calculating the resistor values i would need for a 9v supply?

/edit correcting url for rabid h/w article

Mark Hammer

I'm way out of my league when it comes to this sort of thing, but would it not be possible to tinker with the gate-source and gate-drain diodes in this circuit (http://ampage.org/hammer/files/hypertriangleclock.gif) and get outcomes that vary between triangular and sinusoidal, in addition to other arrangements?

gez

Don't you just hate it when people draw up things in a manner different from how you prefer to see it!  :)

At first glance (and I find it confusing the way it's been drawn) it's wrong.

R5 needs to be smaller than R3.  If it's equal to or larger than R3 the whole thing latches up.

Formulas are:

f= R3/(4XR5XR4XC)

The Cap should be non-polarised, though really I'd use larger value resistors and use a smaller value (.47u) cap to avoid electrolytics (will go leaky with time and bugger things up).

Amplitude of triangle = (R5 X Vsupply)/R3

Edit: I'm going by the schematic, not the layout (I don't even bother to look at those things)!  :P
"They always say there's nothing new under the sun.  I think that that's a big copout..."  Wayne Shorter

gez

Oh b*llocks, I wish you'd have posted one or the other, the resistors are named differently on both diagrams...

I'll redraw it and revise my post in a moment.
"They always say there's nothing new under the sun.  I think that that's a big copout..."  Wayne Shorter

gez

OK, as drawn up in the layout it should work (using a NP cap).

As mentioned, the resistor numbers in the schematic don't correspond with those in the layout diagram.  The formulas I gave relate to the schematic only.

My choice would be to use a smaller value cap and increase the value of the resistor leading to the integrator input (R3 on both layout and schematic) to compensate.
"They always say there's nothing new under the sun.  I think that that's a big copout..."  Wayne Shorter

corbs

sorry for the confusion gez - thanks for struggling through though.

Quote from: gezusing a NP cap

D'OH! i've just tried electrolytics - i'm guessing they won't work  :oops:

gez

Quote from: corbssorry for the confusion gez - thanks for struggling through though.

Quote from: gezusing a NP cap

D'OH! i've just tried electrolytics - i'm guessing they won't work  :oops:

The integrator input, Pin 6 in the shematic, is acting as a virtual earth and is held at half the supply voltage.  The output of the integtrator, Pin7 in the schematic, swings below and above this midpoint voltage, so the cap will be reversed each time the triangle output swings high.

It will probably work with a polarised as shown, but I wouldn't chance it.  Better to make this cap smaller and compensate by making the risistor leading to the -ve input of the integrator larger, that way you can do away with electrolytics altogether...
"They always say there's nothing new under the sun.  I think that that's a big copout..."  Wayne Shorter

puretube

sometimes, I use 2 polarised caps in "anti-series" connexion:
+&+ connected, while the minusses form the connections to the world outside...
(yes, gez, I know you know...  :) )

corbs

wooo thank you people - finally got this working. would you believe i was using 47R resistors instead of 47k?

it sounds great although it has a quirk which i like but would like to understand. i'm guessing that due to the way this thing pulls voltage from the rest of the fuzz circuit i've intergrated it in, it produces a buzzy click noise each time the leds switch.

incidentally i'm using the alternating led circuit here

also the led connected to the pnp transistor seems to stay brighter for a longer time - but that might just be the way the circuit works.

puretube

hehe, if R1/2 were 47 ohms, and if you were using a 9V battery,
you`d have noticed it within 5 minutes, or 2 batteries...

gez

Quote from: corbsit produces a buzzy click noise each time the leds switch.

You mean in the rhythm of the LFO?  Is so, you need separate ground paths for audio and for the LFO.  Keep wires etc from LFO away from audio wires/traces.  Layout is everything with these types of oscillator.

Also try a large cap across the rails close to the LEDs.
"They always say there's nothing new under the sun.  I think that that's a big copout..."  Wayne Shorter

puretube

if it worx out: Riedenburger and/or Sam Smith  :lol:

gez

"They always say there's nothing new under the sun.  I think that that's a big copout..."  Wayne Shorter

corbs

Quote from: gezYou mean in the rhythm of the LFO?  Is so, you need separate ground paths for audio and for the LFO.

would they not have to run off seperate batteries for that? - as the -ve terminal has to go to the two seperate grounds.

running off seperate batteries works btw :)