Dirty sine wave generator

.
t
h

e
t

e
e

o

Why screw with the integrator and the diode mess when you can use a single chip and a few resistors to get a pretty good approximation to a sine wave. A simple filter will get rid of the harmonics. The more steps you use, t he more attenuation you get with the same filter. A 14 pin, 8 FF shift reg ister (74xx164) and anything that inverts plus 8 resistors and a single cap acitor gets you a pretty simple and effective circuit.

Fewer chips than the integrator/diode thing. Simpler. Easy to see if you have something wrong.

BTW, the 2 FF ring counter doesn't even give you as good an approximation a s the other circuit since the timing is equal and the steps have to be equa l. The original circuit has unequal timing on the two amplitude bits and u nequal amplitude to give a better approximation. The OP's simulation is no t correct. It appears his weighting resistors are approximately equal so t he amplitudes are the same and it ends up looking like a triangle more than a sine.

--

  Rick C. 

  +- Get 2,000 miles of free Supercharging 
  +- Tesla referral code - https://ts.la/richard11209
Reply to
Rick C
Loading thread data ...

Not really. Until you get the weights right it will be more like a triangle wave. The wide pulse coming from the FF has to be three times the amplitude of the pulse coming from the clock. It looks like in your circuit the ratio isn't even 2:1.

BTW, something is wrong with the timing, but maybe that's because this is a simulation with unrealistic numbers. The glitch should be much smaller than you are showing.

Why can't you use an 8 bit shift register? It can't be that much more than the dual FF. What parts are you using?

--

  Rick C. 

  ++ Get 2,000 miles of free Supercharging 
  ++ Tesla referral code - https://ts.la/richard11209
Reply to
Rick C

Two chips, 10 passives. The register does need a reset pulse which can be provided with a cap and resistor on power up if you don't already have one.

formatting link

formatting link

formatting link

Can't do any better with anything remotely as simple or few chips.

--

  Rick C. 

  --- Get 2,000 miles of free Supercharging 
  --- Tesla referral code - https://ts.la/richard11209
Reply to
Rick C

The sim is 74HC but 74LVC likely for the actual device as needs to go down to 1.8 volts on the supply hence the CMOS low-voltage type op amps. I already need at least 1 XOR elsewhere. also a square wave that's 90 degrees advanced from the "sine."

A counter could work, too. If I could use up the extra XORs in something like this:

using up the extra gates in a quad 74LVC86 would be nice. D flip flops let you easily make the phase-shifted square.

Reply to
bitrex

a 4 "step" sine will probably be fine. Don't really want to use more op-amp sections 1.8 volt CMOS amps with the bandwidth I need aren't that cheap relatively speaking. this is to go in a semi-disposable product I got a budget!!

Reply to
bitrex

Thank you looks good. How to get a quadrature signal then becomes a question. All-pass phase-shifter, maybe.

Reply to
bitrex

Reply to
bitrex

Add a second set of resistors/capacitor to the Q outputs, same values but slipped along by 2 outputs.

Reply to
Tom Gardner

But, your 8-way flipflop thing only requires a second chip (reset on an edge of bit 4) to a second summing junction. Why would you want a phase-shifted square?

A second 74HC273 is not going to break the bank on cost... Heck, with two of 'em you could lengthen the period to ten steps from eight, and have a D-flop to spare. (fifteen steps is 1.5 periods, use the first ten for I, last ten for Q).

Reply to
whit3rd

Great! I'll use an extra XOR section for inverter A9 and Bob's yer Dad's uncle (is that the saying)

Reply to
bitrex

But, Rick C's 8-way flipflop thing only requires a few extra sections tacked on the end (and a second summing junction).

Why would you also want a phase-shifted square?

A second 74HC273 is not going to break the bank on cost... Heck, with two of 'em you could lengthen the half-period to ten steps from eight, and have a section to spare. (fifteen steps is 1.5 half-periods, resistors to sum from the first ten for I, last ten for Q).

Reply to
whit3rd

Are you intending to use the outputs as oscillator signals to an I/Q (image reject) mixer?

If yes, you do not need to create a sine wave, as practically all analog (non-DSP) mixers work by switching the incoming signal with the oscillator signal sign bit. I balanced mixers the input is inverted according to the sign of the oscillator signal, and in single-ended mixers the input is just switched on and off in sync with the oscillator signal sign bit.

In this case a two-flip-flop twisted ring counter will produce two square waves in perfect quadrature.

--

-TV
Reply to
Tauno Voipio

An XOR is an inverter. A two input AND or OR gate will give you any phasing of square wave you want on the Johnson ring counter.

For an MCU that is the silliest circuit I've ever seen. The MCU can count any sequence needed without the XORs, not that you are talking about using an MCU.

Maybe you need to read a little about ring counters. They have a lot of nice features.

--

  Rick C. 

  --+ Get 2,000 miles of free Supercharging 
  --+ Tesla referral code - https://ts.la/richard11209
Reply to
Rick C

ru

o
a

like

uch

get

ust

more

.

g

Why would you need *more* op amps? Every amplifier is also a filter... or can be.

--

  Rick C. 

  -+- Get 2,000 miles of free Supercharging 
  -+- Tesla referral code - https://ts.la/richard11209
Reply to
Rick C

One of the phases has to be put thru an inductive transducer first, V -> I, then Kelvin-sense V across the transducer. If I had a high supply voltage to work with I'd just use some fast op amps, square waves and no prob as you say. I don't I'm really constrained on the supply voltage in this app.

They can support sines or modified-sines at the freq I need to go at and in my tests with bench signal gen the phase shift detector works great. Drive the analog portion with a square and run into the slew rate limit of the op amps and blech!

Reply to
bitrex

Mind you another requirement is it has to run from a clock I can't just DDS some sines of the appropriate phase relationships from a uP as I'd do in my own project or something.

Reply to
bitrex

o
n
d

I don't get what that means. Why is an MCU not an option because of the cl ock??? The MCU can run on an internal RC clock and sync to the supplied cl ock using an interrupt or polling. Finish the calculation or table lookup and stop the CPU to wait for the clock edge.

--

  Rick C. 

  -++ Get 2,000 miles of free Supercharging 
  -++ Tesla referral code - https://ts.la/richard11209
Reply to
Rick C

The faster you try to clock it the worse things will get with

I am inclined to agree. I thought he was pushing hard up against the actual speed capabilities of the parts not down at a few hundred kHz.

A two step approximation to a sine wave is always going to look pretty dreadful - that is why is suggested piecewise linear approximation which would otherwise work fairly well for a spot frequency - even more so with a bit of diode shaping to lop the top off.

The important thing that the 2 FF ring does provide is a locked phase quadrature output which was one of his other unsatisfied requirements.

--
Regards, 
Martin Brown
Reply to
Martin Brown

This 4 flip-flopper with the outputs taken from Q and "delayed" not Q for two phases the should be good enuff

Reply to
bitrex

300kHz FS square wave out of an op amp with a barely 7 V/uS slew rate (because it's a micro-power part) - sucks!
Reply to
bitrex

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.