Maker Pro
Maker Pro

Why don't I get a Sine wave?

hevans1944

Hop - AC8NS
I made a copy. Can you see it? U1 is an RC square-wave oscillator, U2 is a unity-gain inverting buffer, and U3 is the so-called "integrator" or low-pass fllter or magic sine wave converter.

mod: see here for the (fixed) circuit.

15302484_1423705977669642_902397143_o.png
 
Last edited by a moderator:
What should I do so the third one gives me a sine ?
With your post #1 circuit, if you increase the time constant R7C2 to at least ten times the period of the triangular wave you should see an approximation of a sine-wave at the output, albeit of much lower amplitude than the triangular wave. The greater the time constant the better the approximation will be, but the lower the amplitude.
 

davenn

Moderator
I made a copy. Can you see it? U1 is an RC square-wave oscillator, U2 is a unity-gain inverting buffer, and U3 is the so-called "integrator" or low-pass fllter or magic sine wave converter.

15302484_1423705977669642_902397143_o.png


I don't see the pic

mod: see here for the (fixed) circuit.
 
Last edited by a moderator:

hevans1944

Hop - AC8NS
Maybe @Ian can fix the image retention problem. The image I saw in the first post is now gone.

mod: see here for the (fixed) circuit.
 
Last edited by a moderator:

Ian

Administrator
Unfortunately, it looks like that image was hosted by Facebook as has "expired" according to the info when I visit the URL ("URL signature expired"). If @Erick Navarro still has the image, it may be better to upload it to the site as an attachment :).

mod: see here for the (fixed) circuit.
 
Last edited by a moderator:
Regardless of what the OP wants to do, if the task was to generate a sine wave I would totally go with a microcontroller setup. The code can be very simple, 100 lines of code is a walk in the park. The lookup table and timing can all be calculated dynamically at startup. A little bit of filtering may be needed to remove the "staircase-nature" of the DAC output. Lots and lots of cheap integrated MCU packages out there, no need to worry about a compiler, programmer, and so forth. Just plug in USB and start writing code...
Advantages that I see:
* Complete control over the output
* Easy to implement
* Very stable
* Adjustable
I think this is also how to pro's do it. I bet if you open up a modern arbitrary wave generator you will find that the output is ultimately generated by a DAC, easy as pie.
 
Pretty much by definition, all arbitrary waveform generators are DAC based. But I don't think the most complicated signal source topology in the world is a good path for someone who is "pretty new at this." Also, I don't think relative or indexed addressing is "easy as pie" for someone who has never written a line of code.

ak
 

hevans1944

Hop - AC8NS
I don't think relative or indexed addressing is "easy as pie" for someone who has never written a line of code.
I will agree with that. For some reason, it took me years to understand the concept of pointers in C programming. I still "feel uncomfortable" using indirect addressing even in assembler programming. Apparently I am not very good at abstracting. So, to answer the OP's original question, "Why don't I get a Sine wave?" I think I will defer to @Alec_t's explanation in his post #22.

The last stage is, in fact, a first-order low-pass filter that attenuates higher frequencies more than lower frequencies. But that isn't enough to leave just the fundamental frequency and eliminate everything else. It never is, no matter what the RC values are or the order of the filter, because a low-pass filter cannot remove all the harmonics of the triangular wave... see @LvW's post #8. it can only attenuate them, the amount depending on the order of the filter.

Is there an "easy" solution, a simple circuit that will take what you want and leave the rest behind? I think not, but that all depends on what the OP wants to DO. Too bad he never returned with an answer to THAT question. But then, again, they almost never do. <sigh>
 
...don't think relative or indexed addressing is "easy as pie"...
Quite easy, all you need is a good teacher ;)

Declaring a simple array with 10 elements (each element is one byte):
unsigned char MyArray[10];

Assign a number to the first element:
MyArray[0] = 55;
.....
MyArray[7] = 20;
....
And the last element:
MyArray[9] = 222;

There you go, pretty easy indeed. MyArray is actually a pointer but the [brackets] make it so easy to "address" the individual elements.
 
I don't think you got my point. Your explanation is fine, except that the OP might not know what an array is, what a byte is (from a programming point of view) what an element is, what those brackets mean, what an unsigned integer is, what an I/O "port" is, or what C, C++, assembler, basic, cobol, watfor, or snobol are, or how to write anything in them, or compile them, or debug them, or program a device.

ak
 

hevans1944

Hop - AC8NS
I am sure the OP has long fled this scene. Anyone who takes as gospel anything found on the Internet without further confirming research or actual experience has a LOT to learn. And perhaps even more to "un-learn".:rolleyes:
 
FINALLY!! I take back half the things I've said about you.

ak
Thank You.
The original schematic was a mess with power supply wires and oscilloscope wires all over the place and had so many errors that at first I did not want to bother with it. Then I thought I might simulate it to see if when it is fixed the output roughly resembles a sinewave but I did not sim it because I cannot remember how to sim a squarewave signal.
 
Top