Author Topic: Sine/Square/Triangle Wave - Signal Function Frequency Generator 0.1Hz - 200kHz  (Read 7064 times)

0 Members and 1 Guest are viewing this topic.

Offline doctormordTopic starter

  • Regular Contributor
  • *
  • Posts: 190
  • Country: cx
  • !nop
    • #fine_arts & #electronics - 360customs.de
I made a writeup for an easy to build (fully analog/oldschool) signal/frequency/function generator on my website.

http://www.360customs.de/en/2015/04/signal-frequenzgenerator-1hz-200khz-sinus-rechteck-dreieck/

If you like it, please feel free to help me with the translation.  :-/O

#fine_arts & #electronics  - www.360customs.de
 

Online moffy

  • Super Contributor
  • ***
  • Posts: 1738
  • Country: au
For Q3 and Q4 you might want to use the matched dual BCM847, the sine shaping distortion figures are very match dependent.
 

Offline richard.cs

  • Super Contributor
  • ***
  • Posts: 1191
  • Country: gb
  • Electronics engineer from Southampton, UK.
    • Random stuff I've built (mostly non-electronic and fairly dated).
Looks good, I might build one. :) Are you planning to provide the PCB artwork?
 

Offline bktemp

  • Super Contributor
  • ***
  • Posts: 1616
  • Country: de
What software did you use for rendering the PCB images? They look almost like photos but are bit too smooth.
 

Offline doctormordTopic starter

  • Regular Contributor
  • *
  • Posts: 190
  • Country: cx
  • !nop
    • #fine_arts & #electronics - 360customs.de
For Q3 and Q4 you might want to use the matched dual BCM847, the sine shaping distortion figures are very match dependent.

Well, the sine shaper implementation is "invented" in 1979, where they got k<=0.5% @1kHz. Several later patens rely on that work (with some advancements) But might be worth to see if a BCM847 will improve the distortion figures, thanks.

Looks good, I might build one. :) Are you planning to provide the PCB artwork?

Yeah, no problem. It is done in Eagle 5.1, haven't had the motivation to redo it in KiCAD yet. (As i'm still a bit unhappy with the charge pump inverter, which is supposed to work as expected but never tested on the bench yet. Dual supply works well of course.)

The limiting factor is the used opamp at the moment, please see the attached plots. The LMH6644 seems not to be fast enough to handle 200kHz+. I might be a good idea to change the square wave part for a real comparator or flip-flop. But for <=200kHz it works ok. There measurements were done with the first version, so perhaps the new board layout is doing better by design.

For the attached plots, please note that they were done AC-coupled, thats why the square wave signal looks "wrong" at low frequencies.

What software did you use for rendering the PCB images? They look almost like photos but are bit too smooth.

This is done in POVRay via modified "Eagle3D" scripts. As this project is no longer maintained, there is only a thread left on mikrocontroller.net (German). I made my scripts available there.

Link: http://www.mikrocontroller.net/topic/114555?page=3

Regards,

doc
« Last Edit: April 16, 2015, 10:05:06 am by doctormord »
#fine_arts & #electronics  - www.360customs.de
 

Offline atferrari

  • Frequent Contributor
  • **
  • Posts: 314
  • Country: ar
Hola Dr

WRT the picture in the OP, the sine signal appears jagged. Is it actually like that or it is an artifact created by your digital scope? Hope it is the last.

While composing this, I've seen the fresh pictures in your second post. With more reason my question stands. And there is a blip at the top peak, isn't it?
Agustín Tomás
In theory, there is no difference between theory and practice. In practice, however, there is.
 

Offline dom0

  • Super Contributor
  • ***
  • Posts: 1483
  • Country: 00
That's just feedthrough of the unclean triangle wave, the op amp doesn't seem to be particularly fond of saturated operation.
,
 

Offline paulie

  • Frequent Contributor
  • **
  • !
  • Posts: 849
  • Country: us
I'm guessing that 1m resistor on the output of the LM386 charge pump was an April Fools day joke.
 

Offline doctormordTopic starter

  • Regular Contributor
  • *
  • Posts: 190
  • Country: cx
  • !nop
    • #fine_arts & #electronics - 360customs.de
It's in there for simulation and current measurement  (only in LTSpice).  :-/O
#fine_arts & #electronics  - www.360customs.de
 

Offline richard.cs

  • Super Contributor
  • ***
  • Posts: 1191
  • Country: gb
  • Electronics engineer from Southampton, UK.
    • Random stuff I've built (mostly non-electronic and fairly dated).
It's in there for simulation and current measurement  (only in LTSpice).  :-/O
In case you're not aware you can use voltage sources set to zero for current measurements in place of a resistor. Though there's nothing wrong with a suitably chosen resistor either.
 

Online Kleinstein

  • Super Contributor
  • ***
  • Posts: 14202
  • Country: de
The circuit looks very much like a bad implementation of an old school generator. There are a few obvious problems:

The output should have a termination resistor (e.g. 50 Ohm), just at the output. Having the Feedback from behind the resistor makes the resistor a bad idea instead of a good one. The resistors directly at the output of the other OPs are similar bad ideas. At least the fast feedback should come directly from the output.

The sine shaper would like to have an amplitude proportional to temperature. So distortion depends on temperature.

The lower current mirror in the sine shaper should use emitter resistors as well.

 

Offline atferrari

  • Frequent Contributor
  • **
  • Posts: 314
  • Country: ar
Hola Dr

WRT the picture in the OP, the sine signal appears jagged. Is it actually like that or it is an artifact created by your digital scope? Hope it is the last.

While composing this, I've seen the fresh pictures in your second post. With more reason my question stands. And there is a blip at the top peak, isn't it?

Hola Dr again,

Would yyou mind replying to my question?  ;)
Agustín Tomás
In theory, there is no difference between theory and practice. In practice, however, there is.
 

Offline doctormordTopic starter

  • Regular Contributor
  • *
  • Posts: 190
  • Country: cx
  • !nop
    • #fine_arts & #electronics - 360customs.de
The circuit looks very much like a bad implementation of an old school generator.

Please excuse my ignorance but what makes it "really" bad at all. The sine shaper is refered in some/many patents as shown, (with its minor drawbacks) and not an invention of me.  :-/O

Quote
The sine shaper would like to have an amplitude proportional to temperature. So distortion depends on temperature.

Are your sure?

Regards,

Christian
#fine_arts & #electronics  - www.360customs.de
 

Offline doctormordTopic starter

  • Regular Contributor
  • *
  • Posts: 190
  • Country: cx
  • !nop
    • #fine_arts & #electronics - 360customs.de
Hola Dr

WRT the picture in the OP, the sine signal appears jagged. Is it actually like that or it is an artifact created by your digital scope? Hope it is the last.

While composing this, I've seen the fresh pictures in your second post. With more reason my question stands. And there is a blip at the top peak, isn't it?

Yeah, there are some artifacts from the scope, the "blip" seems to come from saturation, i guess.
#fine_arts & #electronics  - www.360customs.de
 

Online Kleinstein

  • Super Contributor
  • ***
  • Posts: 14202
  • Country: de
The Description of the sine shaper give an optimum Amplitude of 3,25 * U_t. The voltage U_t is proportional to absolute temperature. This temperature dependence is typical of circuits using the nonlinear diode curve. If the temperature is reasonable stable one may live with that. Beside distortion the output amplitude will also depend on temperature a little. An improved sine shaper may use a regulated temperature for that part, or temperature dependent resistors (e.g. R24 and R19 as PT100 and PT1000 (or similar)). A current mirror with discrete transistors should use emitter resistors for more accuracy. Well coupled and matched transistors may work, but two extra resistors are easier.

One particular bad point is the output amplifier. At least this is easy to fix: feedback has to be on the other side of R30. One could replace R30 with a short and have 50 Ohms directly at the output connector.

With the measured curves, it is not clear weather the distortion is from the generator, or just from the way how the scope is connected. A poor ground connection and the poor output amplifier without termination - may produce such ringing, especially if 1:1 probes or similar are used. Such ringing also depends on layout and power supply decoupling.

The low frequency signals just show the effects of AC coupling of the scope, and the ringing is lost by the DSO - it's very likely still there, just not visible. So the bigger trouble may be due to the Scope, though not a DSO artefact, but more likely a ground problem.
 

Online moffy

  • Super Contributor
  • ***
  • Posts: 1738
  • Country: au
For Q3 and Q4 you might want to use the matched dual BCM847, the sine shaping distortion figures are very match dependent.

Well, the sine shaper implementation is "invented" in 1979, where they got k<=0.5% @1kHz. Several later patens rely on that work (with some advancements) But might be worth to see if a BCM847 will improve the distortion figures, thanks.


It is very important to have good Vbe matching for Q3 and Q4 otherwise you end up with asymmetry in your sine wave (The offset causes the top half to be different to the bottom half). Jim Williams in his 10Hz to 1MHz oscillator with triangle to sine shaper used LM394 matched pair which have a max   Vbe mismatch of 300uv. Hope that helps.
 

Offline doctormordTopic starter

  • Regular Contributor
  • *
  • Posts: 190
  • Country: cx
  • !nop
    • #fine_arts & #electronics - 360customs.de
Thanks for the input.
#fine_arts & #electronics  - www.360customs.de
 

Offline doctormordTopic starter

  • Regular Contributor
  • *
  • Posts: 190
  • Country: cx
  • !nop
    • #fine_arts & #electronics - 360customs.de
@Kleinstein,

i must say, that R30 is there do dampen ringing at the output and to limit current for the feedback as it is capacitor loaded. The same is for R33. R34 needs to be sized empirical as i had problems at the first build when not having this resistor in place. It highly depends on the attached wiring and layout. R31 were not a problem for the first build. (square wave is fine)

Any suggestions on the emitter r's value?

Regards,

doc
#fine_arts & #electronics  - www.360customs.de
 

Online Kleinstein

  • Super Contributor
  • ***
  • Posts: 14202
  • Country: de
R30 looks like it is meant to dampen output ringing, however its just at the wrong place. At least there needs to be an extra resistor at the output to set it to something like 50 Ohms output impedance.

At least most OP-Amps don't need the resistor directly at the output like R31 or R33. It may be that they help, if power supply decoupling is poor.

Emitter resistors for Q5 / Q6 could be something like 1 K. The value is not that critical, it's just to get a more stable current.

Ps. : The photo of the PCB does not even show R30. The output goes directly to the connector.
       The ceramic capacitors for the low frequency ranges are not that good - expect these ranges to be rather nonlinear.
« Last Edit: April 17, 2015, 10:43:22 pm by Kleinstein »
 

Offline doctormordTopic starter

  • Regular Contributor
  • *
  • Posts: 190
  • Country: cx
  • !nop
    • #fine_arts & #electronics - 360customs.de
Nonlinearity would be function of amplitude, AVX/Murata got some fine X7R ceramics with rather low DC-bias-coefficient.
#fine_arts & #electronics  - www.360customs.de
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf