# Debugging my Tri-Sine waveshaper

**URL:** <https://lookmumnocomputer.discourse.group/t/debugging-my-tri-sine-waveshaper/2877>\
**Category:** DIY STUFF\
**Created:** [February 4, 2021, 9:42pm UTC](https://lookmumnocomputer.discourse.group/t/debugging-my-tri-sine-waveshaper/2877 "2021-02-04T21:42:28Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![nschagen](https://avatars.discourse-cdn.com/v4/letter/n/94ad74/32.png) [@nschagen](https://lookmumnocomputer.discourse.group/u/nschagen)\
**Post date:** [February 4, 2021, 9:42pm UTC](https://lookmumnocomputer.discourse.group/t/debugging-my-tri-sine-waveshaper/2877/1 "2021-02-04T21:42:28Z")

</div>

Hey guys,

I just breadboarded the Thomas Henry waveshaper and hooked it up to the (buffered) triangle output of my AS3340 vco but no matter what I do, I can’t get a proper sine out of it. Instead I get only the first half of the wave and the second part is flipped over, like so:

 ![IMG_20210204_220503](https://global.discourse-cdn.com/free1/uploads/lookmumnocomputer/original/2X/e/eaedd8c4204bd23d5d159005f93d7499ee411d80.jpeg)

Here is the schematic of the waveshaper I’m attempting to build:

 ![](https://global.discourse-cdn.com/free1/uploads/lookmumnocomputer/original/2X/9/9a292f2fba13cdc613daf9eb14114fdde5ca6b65.jpeg)

Some notable differences are that I’m using 12V rails and that the triangle wave out of the VCO is not 10V p/p but rather around 6V p/p. Also, it is not centered around ground. I tried AC-coupling it with a 10uF cap + 10k resistor but I didn’t have any luck properly doing this.

There is this separate opamp dangling in space. I haven’t connected it because it is not clear to me how it should be connected.

Perhaps this is exactly the intended output and I need to add more components to flip the second half of the sine period? It does say it is a “part of” the sine waveshaper. :🤔

Any tips or debugging info would be highly appreciated! :😁

---

<div class="post-metadata">

**Author:** ![Dud](https://yyz2.discourse-cdn.com/free1/user_avatar/lookmumnocomputer.discourse.group/dud/32/610_2.png) [@Dud](https://lookmumnocomputer.discourse.group/u/Dud)\
**Post date:** [February 4, 2021, 10:11pm UTC](https://lookmumnocomputer.discourse.group/t/debugging-my-tri-sine-waveshaper/2877/2 "2021-02-04T22:11:18Z")

</div>

> [@nschagen](#):
>
> There is this separate opamp dangling in space. I haven’t connected it because it is not clear to me how it should be connected.

The TL072 chip has 2 Opamps and the second unused is connected as shown in the schematic so as not to leave floating pins (not good to have floating pins on opamp 😉 )  
So you connect pin 6 and 7 together and the 5 to the GND .

---

<div class="post-metadata">

**Author:** ![Dud](https://yyz2.discourse-cdn.com/free1/user_avatar/lookmumnocomputer.discourse.group/dud/32/610_2.png) [@Dud](https://lookmumnocomputer.discourse.group/u/Dud)\
**Post date:** [February 4, 2021, 10:41pm UTC](https://lookmumnocomputer.discourse.group/t/debugging-my-tri-sine-waveshaper/2877/3 "2021-02-04T22:41:31Z")

</div>

I imagine you must have tried to adjust the trimpot ?  
and also it looks like it’s the kind of circuit that uses matched transistors, but i don’t think that resolve your problem

---

<div class="post-metadata">

**Author:** ![analogoutput](https://yyz2.discourse-cdn.com/free1/user_avatar/lookmumnocomputer.discourse.group/analogoutput/32/29663_2.png) [@analogoutput](https://lookmumnocomputer.discourse.group/u/analogoutput)\
**Post date:** [February 4, 2021, 10:43pm UTC](https://lookmumnocomputer.discourse.group/t/debugging-my-tri-sine-waveshaper/2877/4 "2021-02-04T22:43:41Z")

</div>

I had a go at simulating this. If I did it right, with R1 at about 65k I get a fairly sine-ish output. It’s not the full 10 Vpp claimed, and it has a -12 V DC offset:

 ![image](https://global.discourse-cdn.com/free1/uploads/lookmumnocomputer/original/2X/e/e197ed8d5ced9037aec8bb34def9b05e6d48be7f.png)

(This was at a much higher frequency than yours but I don’t think that matters.) With the input offset by +5 V, though, the output’s bad:

 ![image](https://global.discourse-cdn.com/free1/uploads/lookmumnocomputer/original/2X/a/a3b525a1defa1f89278fab513d075ec5810656c2.png)

and if I then set R1 to about 30k it looks like this:

 ![image](https://global.discourse-cdn.com/free1/uploads/lookmumnocomputer/original/2X/b/b9561e555a5b5258089a5e7b8c32761ea58a65bb.png)

which is remarkably like your picture, but still with that -12 V offset.

So I think you need to figure out your input offset problem. I tried adding a series 10 µF cap and a 10k resistor to ground before R1, and changed the frequency to 40 Hz, and got this (the blue is the offset input triangle and the brown is after the cap):

 ![image](https://global.discourse-cdn.com/free1/uploads/lookmumnocomputer/original/2X/8/8850f717f00e729ac2c8d5c3585af0b9eca6639b.png)

So it ought to work. (This was with ±15 V.)

---

<div class="post-metadata">

**Author:** ![analogoutput](https://yyz2.discourse-cdn.com/free1/user_avatar/lookmumnocomputer.discourse.group/analogoutput/32/29663_2.png) [@analogoutput](https://lookmumnocomputer.discourse.group/u/analogoutput)\
**Post date:** [February 4, 2021, 10:49pm UTC](https://lookmumnocomputer.discourse.group/t/debugging-my-tri-sine-waveshaper/2877/5 "2021-02-04T22:49:40Z")

</div>

With ±12 V it looks like you might need to use a different trimmer setting and might need to play with some of the resistor values (I’m seeing saturation at -12 V on the bottom of the sine) but I’d guess it should be workable.

---

<div class="post-metadata">

**Author:** ![eric](https://avatars.discourse-cdn.com/v4/letter/e/898d66/32.png) [@eric](https://lookmumnocomputer.discourse.group/u/eric)\
**Post date:** [February 5, 2021, 6:43am UTC](https://lookmumnocomputer.discourse.group/t/debugging-my-tri-sine-waveshaper/2877/6 "2021-02-05T06:43:00Z")

</div>

Isn’t the triangle out of the AS3340 only positive ?  
See here how to fix that :

> [@1222 Tuner VCO Module fixes/improvements](https://lookmumnocomputer.discourse.group/t/1222-tuner-vco-module-fixes-improvements/2072/7):
>
> If anyone is interested here is level adjustment for all waves, with additional pulse wave reshaper to make it a lot sharper. Trimpots are used to recenter the wave perfectly at 0, as it always bothers me if its slightly off. You can remove the trimpots and replace them with ~242.2K resistor if you don’t care about that. And here is sine shaper with commonly available parts: [image] In the following month or two I will release a new module that uses lots of good ideas from other de…

You can use that second unused OpAmp of the '072 for that.

---

<div class="post-metadata">

**Author:** ![nschagen](https://avatars.discourse-cdn.com/v4/letter/n/94ad74/32.png) [@nschagen](https://lookmumnocomputer.discourse.group/u/nschagen)\
**Post date:** [February 5, 2021, 7:29am UTC](https://lookmumnocomputer.discourse.group/t/debugging-my-tri-sine-waveshaper/2877/7 "2021-02-05T07:29:37Z")

</div>

Oh my god. So many helpful replies. Thanks guys :❤

> I had a go at simulating this. If I did it right, with R1 at about 65k I get a fairly sine-ish output.

Fantastic. Thank you so much! I also have a circuitlab subscription (the cheapest one). I will have a go at simulating this too.

> Isn’t the triangle out of the AS3340 only positive ?

Yes, I tried fixing that with a rudamentary high-pass filter but it didn’t work properly. Perhaps I made a mistake. I will look into your suggestion.

I’ll get back to you with my findings.

---

<div class="post-metadata">

**Author:** ![eric](https://avatars.discourse-cdn.com/v4/letter/e/898d66/32.png) [@eric](https://lookmumnocomputer.discourse.group/u/eric)\
**Post date:** [February 5, 2021, 7:31am UTC](https://lookmumnocomputer.discourse.group/t/debugging-my-tri-sine-waveshaper/2877/8 "2021-02-05T07:31:20Z")

</div>

A high-pass filter won’t solve that.  
You need to shift it down so it is symmetrical about 0V.

---

<div class="post-metadata">

**Author:** ![Rusty](https://yyz2.discourse-cdn.com/free1/user_avatar/lookmumnocomputer.discourse.group/rusty/32/7835_2.png) [@Rusty](https://lookmumnocomputer.discourse.group/u/Rusty)\
**Post date:** [February 5, 2021, 11:03am UTC](https://lookmumnocomputer.discourse.group/t/debugging-my-tri-sine-waveshaper/2877/9 "2021-02-05T11:03:45Z")

</div>

Just to recap - issue is that this sine shaper needs a bipolar signal.  
As @eric said high-pass filter won’t help you there. You need to shift it with opamp. You can skip the trimmer in my design, it is used to achieve “perfect” symmetry. I only did it in my design because I have LFO mode and it bothered me that it wasn’t exactly on point. Don’t think it will make any difference as a regular oscillator if it is few % off center.

---

<div class="post-metadata">

**Author:** ![analogoutput](https://yyz2.discourse-cdn.com/free1/user_avatar/lookmumnocomputer.discourse.group/analogoutput/32/29663_2.png) [@analogoutput](https://lookmumnocomputer.discourse.group/u/analogoutput)\
**Post date:** [February 5, 2021, 12:22pm UTC](https://lookmumnocomputer.discourse.group/t/debugging-my-tri-sine-waveshaper/2877/10 "2021-02-05T12:22:59Z")

</div>

No, an op amp isn’t required. A cap and resistor will do fine.

---

<div class="post-metadata">

**Author:** ![jaradical](https://yyz2.discourse-cdn.com/free1/user_avatar/lookmumnocomputer.discourse.group/jaradical/32/12069_2.png) [@jaradical](https://lookmumnocomputer.discourse.group/u/jaradical)\
**Post date:** [February 5, 2021, 12:29pm UTC](https://lookmumnocomputer.discourse.group/t/debugging-my-tri-sine-waveshaper/2877/11 "2021-02-05T12:29:11Z")

</div>

Indeed - use a capacitor for AC coupling - as part of a HPF is good too, you just need to pick the right values. Think of the DC offset like a really low frequency - so you want to block it and let through higher frequencies.

For a simple RC filter the 3db cutoff point is 1 / (2 \* pi \* R \* C) - you want to pick values that give a low 3db point, below the frequency of the signal you want shaped. In @analogoutput’s simulations he picked 10uF and 10k - this gives Fc of something around 1.6Hz - so unless this is for an LFO you should be good to go.

Cheers,  
Jared

---

<div class="post-metadata">

**Author:** ![nschagen](https://avatars.discourse-cdn.com/v4/letter/n/94ad74/32.png) [@nschagen](https://lookmumnocomputer.discourse.group/u/nschagen)\
**Post date:** [February 8, 2021, 10:50pm UTC](https://lookmumnocomputer.discourse.group/t/debugging-my-tri-sine-waveshaper/2877/12 "2021-02-08T22:50:57Z")

</div>

Its working. 🙌 I must have made a mistake when I initially set up my RC filter. I caught myself recently placing the resistor to ground in front of the cap, so it might have been a bug like that.

 ![IMG_20210208_233613](https://global.discourse-cdn.com/free1/uploads/lookmumnocomputer/original/2X/f/faf81f83e14c38d201ec0569dcf3d295ed08aba0.jpeg)

Now it looks like this. The great thing is that I didn’t even had to modify the schematic at all. After the RC filter (10uf / 10k), even 5V p/p signals can be transformed into sines. I’ve also made the circuit in circuitlab and I must say that it is a perfect little toy to play around with in a simulator 🕶

I think this makes for a fun extension of a VCO because if you turn R1 into a proper knob, you can use it to fade between triangle, sine and something that resembles pulse which is pretty awesome for a little circuit like this. Making this voltage controlled would be a great exercise. Perhaps this is possible using an LM13700, which might be a next exercise for me to try.

I’m definitely going to check out other waveshaping circuits. Does anyone have any good & simple one I can try out?

Thanks again 😁

---

<div class="post-metadata">

**Author:** ![CTorp](https://yyz2.discourse-cdn.com/free1/user_avatar/lookmumnocomputer.discourse.group/ctorp/32/15023_2.png) [@CTorp](https://lookmumnocomputer.discourse.group/u/CTorp)\
**Post date:** [February 8, 2021, 11:16pm UTC](https://lookmumnocomputer.discourse.group/t/debugging-my-tri-sine-waveshaper/2877/13 "2021-02-08T23:16:22Z")

</div>

Barton musical circuits has a couple of cool ones. The MultiPWM or the 4046 shaper. Think he has a couple more too

---

<div class="post-metadata">

**Author:** ![analogoutput](https://yyz2.discourse-cdn.com/free1/user_avatar/lookmumnocomputer.discourse.group/analogoutput/32/29663_2.png) [@analogoutput](https://lookmumnocomputer.discourse.group/u/analogoutput)\
**Post date:** [February 8, 2021, 11:31pm UTC](https://lookmumnocomputer.discourse.group/t/debugging-my-tri-sine-waveshaper/2877/14 "2021-02-08T23:31:05Z")

</div>

The 4046 “shaper” isn’t really a waveshaper in the usual sense; it creates square waves at the frequency of the input and up to 3 octaves higher and lower, and then lets you mix them.

If you include wavefolding as a kind of waveshaping there are several of them around including the Nonlinear Circuits Timbre.

---

<div class="post-metadata">

**Author:** ![CTorp](https://yyz2.discourse-cdn.com/free1/user_avatar/lookmumnocomputer.discourse.group/ctorp/32/15023_2.png) [@CTorp](https://lookmumnocomputer.discourse.group/u/CTorp)\
**Post date:** [February 8, 2021, 11:39pm UTC](https://lookmumnocomputer.discourse.group/t/debugging-my-tri-sine-waveshaper/2877/15 "2021-02-08T23:39:16Z")

</div>

The MultiPWM may not be a true waveshaper either, in that case! 😬

---

<div class="post-metadata">

**Author:** ![analogoutput](https://yyz2.discourse-cdn.com/free1/user_avatar/lookmumnocomputer.discourse.group/analogoutput/32/29663_2.png) [@analogoutput](https://lookmumnocomputer.discourse.group/u/analogoutput)\
**Post date:** [March 1, 2021, 1:24pm UTC](https://lookmumnocomputer.discourse.group/t/debugging-my-tri-sine-waveshaper/2877/16 "2021-03-01T13:24:18Z")

</div>

I don’t know if you’d want to consider this a waveshaper or not, but Barton has this [new module](http://www.bartonmusicalcircuits.com/4hp/freqdoubler/index.html). It’s designed to take a triangle wave and double its frequency, but it also turns a ramp/saw wave into a triangle and it makes a sine wave into something more complex.

[![](https://global.discourse-cdn.com/free1/uploads/lookmumnocomputer/original/2X/f/fab34ca20286fe04090ca460f5248623e6f1db27.jpeg "BMC82 Triangle Frequency Doubler") ](https://www.youtube.com/watch?v=JYJDlBU5Tzk)

 ![image](https://global.discourse-cdn.com/free1/uploads/lookmumnocomputer/original/2X/8/883c53cfd9d91434f890b321c3390951fdcec770.jpeg)

---

<div class="post-metadata">

**Author:** ![Caustic](https://yyz2.discourse-cdn.com/free1/user_avatar/lookmumnocomputer.discourse.group/caustic/32/15588_2.png) [@Caustic](https://lookmumnocomputer.discourse.group/u/Caustic)\
**Post date:** [March 1, 2021, 3:36pm UTC](https://lookmumnocomputer.discourse.group/t/debugging-my-tri-sine-waveshaper/2877/17 "2021-03-01T15:36:03Z")

</div>

![image](https://global.discourse-cdn.com/free1/uploads/lookmumnocomputer/original/2X/a/ae497be6c41cb75713771ec1bede6021ecb7cfa7.png)

---

<div class="post-metadata">

**Author:** ![hemmer](https://yyz2.discourse-cdn.com/free1/user_avatar/lookmumnocomputer.discourse.group/hemmer/32/21078_2.png) [@hemmer](https://lookmumnocomputer.discourse.group/u/hemmer)\
**Post date:** [May 27, 2022, 12:34pm UTC](https://lookmumnocomputer.discourse.group/t/debugging-my-tri-sine-waveshaper/2877/18 "2022-05-27T12:34:38Z")

</div>

FYI I stumbled across this thread whilst doing a [falstad mockup](https://falstad.com/circuit/circuitjs.html?ctz=CQAgjCAMB0l3BWcMBMcUHYMGZIA4UA2ATmIxAUgoqoQFMBaMMAKADcQ9sURuqueAFm5ReIQVTBVpUaAhYB3TiL4hiKPLzRQWAJ2QJCWyZEPiwRqijSQWAFwNHVzSIOOiIDBNEFg8JQjx8MGwMSDBiWUEMPGIQ3ww4jEJBBDcpKgATOgAzAEMAVwAbO3twbDAeZyI3VUkQL2hrUhRK4mxiFL8kGAQMBBQ04MFCDUgNZCzcwpKWAHNlIREBcRTRWwWpM18jLaMRt2kWPPL1EEweMAGrDB5NK4aHjPhaJoj27Aq8PzDBHm9WsQ8MDvoQMH5IODJvBFKceINdh1LskdPoQmcwCirtpMZZobYlNjJFjrudbjpCaSLuBCCJqbYAPI0unkzGVMk8I4AJXAFnuWL54AmMgk4B66zksJctVcvNlCIpcrcCvR8LMtjRUmVZml4BRJhhhK1et2gtxqKFaw09xqJo8LylZqxtvNBMtyuBcPOnrdlStnr9MsO83K7OwgVDQjg6z0kfcITDEasNkdss+ptlEiOhNt6fd4mjGqVBcktqzog6vuN5d1gkEmlsmPS1fr+YO4Bo8CiYVwLz7iBAAGUAJ4AW1HdDsumHUrL0cD4lbReYeDc7ZXbjSh3AQTgsdV3vuSN4SfxIYP4aPZ3LRybagmzlMThx+Ok0BCoRAABVdABLUewuomiqEBHKKqB1ItGBbpQZBZy4MGPIbhQda8quFBnCKVBMOKb7yAA9kKIBrFQEhAucb4QFQ2DrBWLBAA) of the sin shaper - I also find it’s not 10V p-p output.

---

<div class="post-metadata">

**Author:** ![analogoutput](https://yyz2.discourse-cdn.com/free1/user_avatar/lookmumnocomputer.discourse.group/analogoutput/32/29663_2.png) [@analogoutput](https://lookmumnocomputer.discourse.group/u/analogoutput)\
**Post date:** [May 27, 2022, 1:23pm UTC](https://lookmumnocomputer.discourse.group/t/debugging-my-tri-sine-waveshaper/2877/19 "2022-05-27T13:23:14Z")

</div>

The version I’ve used is adapted from the Thomas Henry VCO Maximus, its op amp output is above 10 Vpp and then there’s a voltage divider after it; I’ve used a trimmer for the bottom resistor to adjust the amplitude since it depends on the other trimmer settings as well. Comparing to yours it looks like the chief difference is the 20k resistors on the op amp stage instead of 10k.

![image](https://global.discourse-cdn.com/free1/uploads/lookmumnocomputer/original/3X/e/8/e8d89183f9d202ec5583963122cdbac1c5327d91.png)

---

<div class="post-metadata">

**Author:** ![nohar](https://yyz2.discourse-cdn.com/free1/user_avatar/lookmumnocomputer.discourse.group/nohar/32/15516_2.png) [@nohar](https://lookmumnocomputer.discourse.group/u/nohar)\
**Post date:** [September 27, 2022, 9:18pm UTC](https://lookmumnocomputer.discourse.group/t/debugging-my-tri-sine-waveshaper/2877/20 "2022-09-27T21:18:47Z")

</div>

Hi there, I’ve been struggling with the TH sine shaper as well.  
I had a PCB built based on the following schematics:

 ![image](https://global.discourse-cdn.com/free1/uploads/lookmumnocomputer/original/3X/c/7/c7ea7aac86f7cfbabdb720f8c8ecba668c127a89.png)

My problem being: the signal coming in the shaper is a beautiful bipolar triangle. And what comes out is not a sine.

 ![image](https://global.discourse-cdn.com/free1/uploads/lookmumnocomputer/original/3X/4/d/4dc13e720e3f141218e5bd258c8135016a7024d5.png)  
 ![image](https://global.discourse-cdn.com/free1/uploads/lookmumnocomputer/original/3X/8/3/839da02a277af93317631c88b0564e36c06564d2.png)

In yellow, is what comes in the opamp. Turning the trims only changes the shape of the peaks (pointier or rounder). The shaper behaves like there is an offset on the input signal, when the is not.

I changed the transistor for a matched pair, but nothing really changes. I am kinda lost here 🙃

[Next page](https://lookmumnocomputer.discourse.group/t/debugging-my-tri-sine-waveshaper/2877.md?page=2)
