Emile666 / THD_Analyzer

Bob Cordell's THD-Analyzer, microcontroller based (STM8S105) and with relays (G6K-2Y-F)
4 stars 3 forks source link

Signal generator issues #1

Open bengtssk opened 3 months ago

bengtssk commented 3 months ago

Finished the signal generator (PCB 1) today. The 200hz and 20khz range worked as they should and THD was very low too, about 0,0005 % which probably is as low as I can measure.

How ever the 2khz range gave about half of the frequency as it should. And the 200khz distorted heavily and the amplitude was way to high.

I suspect that I got some problem with the RC link network. Using of board caps and resistors connected to e1-e9 (as Bob suggest in the original article to test the board) and only activating NOT OFF relay worked for the 2khz range.

Some more debugging will be done, but I have to asked if you encountered any similar problems?

Emile666 commented 3 months ago

Thanks for debugging this! I am very happy with your THD measurements, it proves that the concept itself works! I had similar issues, especially on the higher frequencies, 2 and 20 kHz). I got it almost completely solved by changing opamps. I had cheap opamps from Aliexpress and by replacing them with originals, most problems were gone, only 200 kHz is not working. So have you used authentic opamps? I will check today if I made other adaptations to PCB1.

bengtssk commented 3 months ago

I've used original opamps from Digikey only. Only substituted the JFET for J111, since I couldn't get there original. However Vp and rDSon is very similar so I don't think it will be a problem. Didn't thought about speed but 200k is pretty slow for and jFET... but I was just thinking, that FET did you use? Could be a problem for 200k ranges if it's to slow, I'm just speculating now.

Well thanks for a great project. As soon as I get time I'll double check my board again. At least it the issues seems to be narrowed to the two ranges.

Emile666 commented 3 months ago

The changes I made on PCB1 are: 1) solder CKM4 (220p) and CLN4(220p) with their resistors as close to the E2-E3 pins and E4-E5 pins as possible, removing them from the current location on the board. Also the resistor values of RKM4 and RLN4 were changed to 330 Ohms instead of 68 Ohms. Don't know if that is still needed, but you could test try that. 2) IC2 and IC4 (NE5534) were replaced by an OPA1612 opamp. This is experimental as I was searching why higher frequencies were not working. The OPA1612 has double the slew-rate and 4 times the bandwidth of a NE5534. Don't know if this is still needed now that I have original NE5534s. But I left it in because it worked.

I got several PN4091 from Aliexpress and tested them with a transistortester. Their pinch-off voltage was around -7...-8 Volt. It is pretty easy to see when the generator stops working just by observing the Q1 gate voltage. If it gets close to 0V or -8 Volt, then you know the generator will stop working. With better opamps, the variation of this gate voltage was much less when changing frequencies. The 200 kHz itself should not be a problem, much more crucial are the slew-rate and gain-bandwidth-product in my perception.

bengtssk commented 3 months ago

1) Did this solve the problem with the 200khz range? I tried that, but it didn't have any effect. What did (almost) work was to increase the capacitance to about 470 pF. Then the oscillator work in the 200kHz range, but with the half frequency of course. Interesting is that giulianodes at diyaudio.com seem to got the same problem with his realization of the oscillator. https://www.diyaudio.com/community/threads/another-realization-of-bob-cordells-thd-analyzer.165386/post-2261708

2) OPA1611, I guess (the single version). Well it should work with the original NE5534's as well. So I think I'll stick with them.

2N4091, as in the original, are actually available at Mouser, for 13 eur/pcs (!). That's why I substituted them with J111. Tested the bunch of them I bought from Digikey. And Vp was all between -7,5 and -8,5 volt. So that sounds promising, probably not the JFET that is the problem here.

Finally got it working in the 2k range though. Just to dry solder joints (which took forever to find). Works fine now at all frequencies except 200kHz range.

Emile666 commented 3 months ago
  1. The 20kHz-200kHz range works fine, only the 200kHz option does not work. I got it working up until 160kHz and thought that would be enough.
  2. No, I used the OPA1612 to replace 2 single NE5534. I made an update to PCB1 where both types of opamps can be populated. I will publish that design here shortly, together with the Eagle source files.
  3. The J111 will probably be fine, it is a good alternative for the 4091 FET.

Good to hear you got it working!

bengtssk commented 3 months ago

The 200k range was tricky to get working. Basically one of two things keeps happening; either the output is too high in amplitude, distorted and the gate voltage at Q1 strongly negative. Or the oscillation stops and gate voltage of Q1 is positive instead. Placement of of CKLM4, CKM4 and its series resistors seem to have great effect of these two phenomena.

The latter, then output is distorted seem to happen around IC4. And interesting the cure for this is to add a small capacitance between E3 and E4 (across R(E)). Two wires twisted about 10 turns together did the trick. I guess that the original design using lots of wires and switches some stray capacitance could have been present, which is why this problem occurs with this board and not in the original design.

De-soldered CKMN4 and CKLN4 and put them between E2-E3 and E4-E5 with 270+68 ohm in series. It actually worked with the "capacitor" between E3 and E4. The other ranges weren't affected and was still working as they should.

20240603_122044

However it didn't like this solution for some reason, so I replaced the 68 ohm series resistors with 330 ohm at its original location. Also put back the CLM4, CLK4 caps at its original location. Actually increased to 200pF now, 'cause I had no others around. Now the oscillator works until around 97kHz, then it stops. Tweaking the values of RLN4 and RKM4 should probably be a good idea, possibly pushing the bandwidth further.

But for now I think I'm satisfied with 80kHz bandwidth and can move on with this project. Tested all other ranges and they worked fine, with descent THD figures too (all just measured at the bench with no shielding or anything);

10kHz; 0,0003% 1kHz; 0,0004% 100Hz; 0,0005%

If you design a new board you should substitute the NE5534 anyway, they're obsolete and newer OP-amps can probably do the job better. Also getting rid of compensating capacitor saves a few cents... Though, I still don't think it's the 5534's that's limiting the bandwidth.

Emile666 commented 3 months ago

Interesting idea of adding a capacitor across R(E), didn’t think of that. However I tried 10pF and 22pF and both stopped oscillation in the 20kHz range completely! Removing it and I got stable oscillation up to 130 kHz again. I said 160 kHz before, but that is actually 130 kHz, which is fine I think. So only 160 kHz and 200 kHz are not working. Thank you for your valuable feedback!