4046 giving octave down instead of same frequency as input frequency

Started by yanusch, April 06, 2016, 09:56:42 AM

Previous topic - Next topic

yanusch

Hello,
First of all this is my first so hello. I got a lot of information already from al you guys from previous post so thnx for that!
But now i am stuck with a problem where to forum couldn't help me with previous posts.

I am trying to create a stable square wave from my guitar signal to do some synthy stuff with.
So far so good i am getting a good squarewave with a hexinverter.
But when i feed this signal into my 4046 (i want to use this to upshift the signal +1 and +2) the squarewave out of 4046 is an octave down.

i use the following schematic on the 4046
http://electro-music.com/forum/download.php?id=29154

i watched a video on pll's (https://www.youtube.com/watch?v=SS7z8WsXPMk&nohtml5=False) and i thought the idea was that you get the same output frequency as input frequency when you don't divide the signal on certain points (to divide or multiply).

Can anyone shed some light on this to help me out i am kinda stuck now.

Ps. i get the same results with a signal generator as with the square wave from the guitar so the problem isn't in the guitar signal i suppose


Thanks

Yanusch

anotherjim

Ok, the 4046 will try to match the input frequency to VCO via the phase comparator. If, say the VCO is divided by 2 before the comparator, it will run at twice the frequency in order to match the input. In your case, yes it should be the same frequency out of the VCO pin4 because there is no divider in the loop.

I'm puzzled for now -  the problem is usually the other way around -  the VCO keeps jumping up an octave  - not down!

BTW, the schematic limked has the 4046 being abused - the data sheet wants a minimum 10k for timing resistance from pin11. The scheme has it straight to ground.

yanusch

That was what i was thinking also.
I remember that i breadboarded it yesterday and it worked fine. I broke it down to test some other stuff so today i breadboarded it again and checked the schematic like 20 times. I even went to my local electronics store to get a new 4046 in case i've blown up something but even if i swap them it it is still going and octave down.

Here is a picture from my breadboard mayby i got something wrong?

<a href="http://imgur.com/xbwq47w"><img src="http://i.imgur.com/xbwq47w.png" title="source: imgur.com" /></a>

http://imgur.com/xbwq47w


ps. the octave down sounds nice though very good tracking over the entire track ;)

anotherjim


yanusch

I swapped the jumper to ground with 10k but it is still an octave down only the tracking got worse.
Could i have damaged the chip with connecting pin 11 straight to ground?

Does anyone see a mistake on my breadboard?

duck_arse

I have a question - what is your supply voltage? I can see a 74HCT4046 on yr bredbrd, which is specified to 5V, like all 74 series IC's. I dunno nuttin bout 4046's.
don't make me draw another line.

yanusch

http://www.nxp.com/documents/data_sheet/74HC_HCT4046A_CNV.pdf

this is the exact chip i have and if i read the datasheet correct it must me 6.0V max.
I am running at 9 volts. So what do you guys think? chips blown?

edit: when i was building i looked at a non hct datasheet which had a max supply of 15 i believed. Good lesson to really check the right datasheet  :icon_mrgreen:

duck_arse

if you have a way of producing a 5V supply instead of 9V, try it. couldn't hurt.
don't make me draw another line.

yanusch

i made a quick voltage divider to get roughly 5 volts and the octave is gone!
However the output signal is really distorted AND i can play chords and i think the output can only be monophonic from the internal VCO.
So i conclude the IC is broken? im a right?

edit: in my hurry i didn't connect the powersupply. however if i now plug in my function generator the output gets really nasty en "sputtery".
It should work like clean square wave in clean square wave out right?

duck_arse

erm, you'll need more input from jim on the further [non-]workings, I'm afraid, but I am qualified to say "welcome to the forum", even if it's a bit late.
don't make me draw another line.

yanusch

Thnx!
Mayby jim can shed a light on if it is broken or not.
Anyway i think i am going to order some CD4046. Always nice to have around and i can start over again with a clear vision.


R.G.

Of course, the chips should not be run outside their voltage rating. Always read the datasheet first, before just powering a chip.

That aside, there is a very large body of knowledge about PLLs. PLLs have a lot of internal detail. The 4046 was the first PLL that had a wide range suitable for audio and reasonable phase detectors.

A lot of PLL technology has to do with balancing opposing needs. PLLs intended for specific frequencies benefit from NOT having a wide range VCO. Any phase comparator problems become relatively smaller. PLLs with wide range PLLs are sensitive the slightest glitches in the phase comparator and in the filtering.

Loop filter design is touchy, and can radically change how the PLL acts: capture range, hold range, and whether and how much it locks to harmonics instead of fundamentals.

The 4046 and successors have at least two phase comparators. One is an analog PC, the other is a digital. The digital PC is wide range capable, and works only on signal edges. That means that the signal has to HAVE good edges for the digital PC to work. It also means that the cleanup in analog to get clean edges has to be done well. Analog PCs work OK with analog signals to some extent, but are hugely prone to locking on harmonics near where the VCO wants to be anyway, so analog cleanup on the signal before sending it to the PC is mandatory, at least if you're after good tracking, not a random noise maker.

It's tempting to think that one can simply pick up a chip or two and do something amazing, but there is a surprising amount of RTFM needed as well.
R.G.

In response to the questions in the forum - PCB Layout for Musical Effects is available from The Book Patch. Search "PCB Layout" and it ought to appear.

anotherjim

Yes, stable operation of the 4046 is difficult in this case. I've never had other than original CMOS CD4046 so don't know if the 74HC series one is really fried from 9v, but it could well be.

It is a tricky animal anyway. The signal edge is critical. It would help is the input rise time was under 1us, but the guitar waveform being asymmetric, means the edges jitter all over the place out of whatever circuit squares it. If you have a 2 channel scope, look at input and VCO output triggering off the VCO and look close at the positive going edges.
You should get better tracking with the guitar neck pickup and tone control down and pick gently near the neck joint - even using finger tip instead of plectrum.

On that scheme, the 100k before the filter cap off pin 9 could be less (another trimmer). That resistance does help with stability and lock speed, but too little makes it jitter. When the input changes, the correction pulses out of the phase comparator are not smoothed out enough by the capacitor.

Not my scheme, but an example of one with values set & altered for the users needs.

Hands up anyone who's made this tracker work reliably enough to trust? My hands are not up. It is fun if you accept it's limitations and I've had fun making something similar be deliberately unstable.




yanusch

Thnx for all you replies, mayby i was a little over excited with a simple pitch tracker like this.

But i have 2 things i want to get clear from this:

1: If i put in a square wave from my function generator into the 4046 (so not a squared guitar signal) it should put out a proper square wave out of the internal vco from the 4046?

2: how could the tracking be so good when mine gave an octave down because i overloaded the device with too much voltage? I tried octaves down with the 4013 and 4024 with the same square wave shaper for guitar but the tracking was excellent! no glitching at all all over the neck even with the bridge pickup!


Nthorn

that schematic is from the book Handmade Electronic Music by Nicolas Collins. It contains some text that helps explain the circuit.


http://feenelcaos.org/wp-content/upload/Handmade.Electronic.Music.The_.Art_.of_.Hardware.Hacking.pdf

that is the book but its actually missing the page on this circuit(they want you to buy the book so not everything is included)

anotherjim

2 first - it may not have been tracking. Somehow the VCO output could have been clocked by input bleeding through, if only pos or neg edges did this, it could sound an octave low. Did increasing the resistance of the 1Meg tracking pot introduce a portamento effect? If it didn't, it wasn't tracking.

1: The VCO output can be a good square wave very close to 50% duty cycle whatever the input waveform is.
If you get the CD4046 or HEF4046 data sheets, there is a very good description of the chips internals - so good that you could reproduce the internals with standard logic and discrete parts. You'll see the input is a chain of several inverters in series to amplify & square up the signal before it reaches the phase comparators. In addition, there is a special inverter with feedback to bias the input pin level at Vcc/2. According to the data, the input can be either DC or AC coupled.

yanusch

I looked at the datasheets and indeed the building blocks are very well explained and displayed, also i watched some video's on pll's and the 4046 and i kinda get the concept but it is still a bit above my head.

I don't trust my 4046's anymore because when i feed them them with my function generator with a 50% duty cycle square wave the output is all over the place so i think i fried them (must be the internal comparator is think?).

Anyway i ordered a couple of new cd4046's (instead of the hct) online and i'm gonna play with them again in the weekend when they arrive, i don't think i can get good tracking out of them if i must believe the previous reactions. But i think i will learn a thing or two with playing and probing with them :)

Thanks for all the help you guys.

And if i get good tracking out of them of course i will share it!


Rob Strand

PLL's are a feedback loop.  If the feedback loop has too much gain it will misbehave - PLLs do this.

I suggest limiting the frequency span by using using resistors on pins 11 and 12.

http://www.ti.com/lit/an/scha002a/scha002a.pdf

Also, check-out the boss DF-2 Super Distortion Feedbacker schematic; it's not the same as your ckt at all really.  You will see they have a resistor on pin 11.

(Increasing the feedback caps on the inverters can sometimes help.)

Send:     . .- .-. - .... / - --- / --. --- .-. -
According to the water analogy of electricity, transistor leakage is caused by holes.

anotherjim

+1 the Boss fundamental detector.
http://rudn2.nodevice.com/preview/big/322/322272-2.jpg
Pin 11 resistor sets the range, pin 12 resistor centres that range, but you can also do that with the choice of VCO capacitor (6&7) so pin 12 is often unused. HD14046 is Hitachi but same as CD4046.
The fundamental detector strongly filters the guitar to remove harmonics. Then produces a positive and negative envelope signals with precision rectifiers (the amps with diodes in their loops) which keep an average level to compare the peak level with using 2 amps as comparators. When the peaks exceed the average, the HD14013 (same as CD4013) flip flop is set or reset. Set when positive peak detected and reset on negative. Either Q or /Q of the flip flop is used (doesn't care which) as the signal input for the 4046. The other half of the 4013 is the frequency divider between VCO out and the phase detector.
Boss have included a 4066 switch before the loop filter cap which will hold the current VCO pitch when the pedal is bypassed by disconnecting the phase detector output.
Boss also apply the signal envelope (different detection) to the VCO and divider outs using simple transistor VCA's  Q11&12. The Tracker circuit relies on the fact that with no signal into the 4046, the phase detector acts as if the VCO is running too fast and slows it right down by pulling pin 9 voltage to ground. Below about 1v (IIRC) the VCO is extremely slow - virtually stopped, which is why it at least shuts up when you stop playing - but you can hear the pitch drop with large loop filter resistance.