sloppy sine to square wave

Thread Starter

magnet18

Joined Dec 22, 2010
1,227
Magnet has declared a moratorium on part numbers.
Hahaha, the lm381 was the first in the kicad library, here it is with the correct part number for the opamps :)
Schmidt trigger was also first in library, subject to replacement if I choose a Schmidt/divider combo (most dividers seem to have Schmidts on the input anyway)

Why not a fast comparator?
mostly because I already ordered the 8099's and made this schematic
also I'm unsure if the part you linked has the necessary voltage inputs
 

Attachments

Thread Starter

magnet18

Joined Dec 22, 2010
1,227
The spec sheet says 5V to 12V (12.6V absolute maximum) for the power supply.
Single ended or split, as you wish.

ps, that comparator from ronv looks good, too.
I was referring to the comparator from ronv, the output voltage is only guaranteed to go up to 2.7


anyway, 8099's are in the mail and I'd rather not redesign unless necessary

so, anyone have inputs on dividers? the CD4040/4020 don't seem to guarantee that they can handle 10MHz, not that I need them to, but it would be nice to not worry about it

74hc7292
looks like an option, who doesn't love 8 toggle switches for input :)
(or maybe an ADC, could have fun with this one)

the 74HC393 also looks like an option

both have input schmidt triggers

anyone have any input or advice on things I should avoid?


edit, I think I'm leaning towards the toshiba 7292, unless anyone has a reason to avoid it/toshiba, because it looks like the most fun
 
Last edited:

#12

Joined Nov 30, 2010
18,224
The 1016 comparator is rated for split 5's. +/- 7V absolute maximum.

I finally found that 2.7 volt guarantee at 1 ma output current.
Page 4, first graph shows "typical" 3.5V to 4V at "no load".
 
Last edited:

Thread Starter

magnet18

Joined Dec 22, 2010
1,227
does this look decent for the dc offset and amplitude control?

just a basic summing amplifier, I'm a bit concerned about ending up with a negative rather than positive square wave at the end

EDIT-assuming I put a protection resistor in the line coming from the division chip :p
 

Attachments

#12

Joined Nov 30, 2010
18,224
No. Your offset control will change the gain. You need the offset on the +in so it is not in the gain determining current path. That forces the configuration to be inverting.

Connect your amplitude control to -in like a volume control and your offset on the +in
This immediately causes a problem with DC offset being applied to the -in by the amplifier chip so you need another coupling capacitor to avoid DC feeding back into your divider.

You can not allow the amplitude control to go to zero ohms like that rheostat you drew because the gain would be infinity in an inverting configuration. Use the amplitude control as a voltage divider and then put a relatively high ohm resistor to the -in pin. Choose the amplitude pot to be as low a resistance as the divider will drive then use a higher resistance to the -in pin. That method will keep the inverting configuration from loading down the voltage on the wiper. Maybe 2k for the pot and 50k for the input resistor.
 
Last edited:

Thread Starter

magnet18

Joined Dec 22, 2010
1,227
You can choose 74HC4020, 74HC4040.
odd, for some reason those didn't show up in my search results... mouser definitely carries them though, thanks for pointing it out!

No. Your offset control will change the gain. You need the offset on the +in so it is not in the gain determining current path. That forces the configuration to be inverting.
That makes sense, thank you

Connect your amplitude control to -in like a volume control and your offset on the +in
This immediately causes a problem with DC offset being applied to the -in by the amplifier chip so you need another coupling capacitor to avoid DC feeding back into your divider.
also makes sense, thanks

You can not allow the amplitude control to go to zero ohms like that rheostat you drew because the gain would be infinity in an inverting configuration. Use the amplitude control as a voltage divider and then put a relatively high ohm resistor to the -in pin. Choose the amplitude pot to be as low a resistance as the divider will drive then use a higher resistance to the -in pin. That method will keep the inverting configuration from loading down the voltage on the wiper. Maybe 2k for the pot and 50k for the input resistor.
I realized after I posted the schematic that I neglected to put a resistor in line with the pot
Something like this:
Thanks!


So I have no doubt that your circuit works, but out of curiosity, are there any downsides to the attached circuit?
other than it can't take the amplitude all the way to zero?
(just trying to learn with this one)
 

Attachments

ronv

Joined Nov 12, 2008
3,770
Wow, Like most really high frequency amplifiers they would rather oscillate than amplify. I would worry about that and the response time when you use it as a comparator and it saturates against the rails. I didn't see that in the spec sheet. Are you building it on a PCB??
 

Thread Starter

magnet18

Joined Dec 22, 2010
1,227
Wow, Like most really high frequency amplifiers they would rather oscillate than amplify. I would worry about that and the response time when you use it as a comparator and it saturates against the rails. I didn't see that in the spec sheet. Are you building it on a PCB??
I'm not sure what you're getting at with the first part, I've never messed with high frequency amplifiers before this

yes, it will need to be a PCB, i wouldn't expect anything but trouble from a breadboard
 

#12

Joined Nov 30, 2010
18,224
are there any downsides to the attached circuit?
other than it can't take the amplitude all the way to zero?
(just trying to learn with this one)
That should work. It's just not the way I would do it. Your gain range is .4 to 2.76 You could get a lot more range with the circuit I posted, 0 to dozens.

When I want to do a stage that can't go to zero gain, I use a non-inverting configuration and put the pot in the feedback loop. Gain = 1+ Rf/Rc and I can dial Rf down to zero to get a gain of 1.
 

Thread Starter

magnet18

Joined Dec 22, 2010
1,227
Hello,

When you are still prototyping, you could use tha manhattan art prototyping.
In this post in the tips and tricks thread I posted some info on it:
http://forum.allaboutcircuits.com/showpost.php?p=152539&postcount=29

Bertus
thanks for the links!
That looks like a great idea, much easier than PCB for a prototype :)

That should work. It's just not the way I would do it. Your gain range is .4 to 2.76 You could get a lot more range with the circuit I posted, 0 to dozens.

When I want to do a stage that can't go to zero gain, I use a non-inverting configuration and put the pot in the feedback loop. Gain = 1+ Rf/Rc and I can dial Rf down to zero to get a gain of 1.
gocha, and agreed, just wanted to make sure I understood
Thanks! :)
 

ronv

Joined Nov 12, 2008
3,770
You may need a 2 layer board with a ground plane.
What happens is the output signal rise time is very fast so any capacitance looks like a small resistor. Since the bandwidth is so high the chip can amplify this and go into oscillation. To combat this you need a really tight layout with nothing from the output getting close to an input or the feedback pin. Also if you use large resistor values like you have the ratio of the capacitive reactance to the input is bad, so you need to use low value resistors to set the gain and your source needs to be a low impedance. Where your signal generator pictures driving a 50 ohm resistor? If not go see what it looks like driving 50 ohms.
Take a look at the datasheet examples in figure 65 & 66 for some examples.
Make sure that the gain is not so high that the output swings to it's maximums or it will take it a long time (50ns.) to switch back to the other polarity. You could, I guess, follow it then with a fast Schmitt trigger.

http://cds.linear.com/docs/en/datasheet/1016fc.pdf
 

Thread Starter

magnet18

Joined Dec 22, 2010
1,227
You may need a 2 layer board with a ground plane.
What happens is the output signal rise time is very fast so any capacitance looks like a small resistor. Since the bandwidth is so high the chip can amplify this and go into oscillation. To combat this you need a really tight layout with nothing from the output getting close to an input or the feedback pin. Also if you use large resistor values like you have the ratio of the capacitive reactance to the input is bad, so you need to use low value resistors to set the gain and your source needs to be a low impedance. Where your signal generator pictures driving a 50 ohm resistor? If not go see what it looks like driving 50 ohms.
Take a look at the datasheet examples in figure 65 & 66 for some examples.
Make sure that the gain is not so high that the output swings to it's maximums or it will take it a long time (50ns.) to switch back to the other polarity. You could, I guess, follow it then with a fast Schmitt trigger.

http://cds.linear.com/docs/en/datasheet/1016fc.pdf
I didn't have a 50 ohm on hand (all at school)
I did run it with a 15 ohm that was laying around, got a .23Vpp wave

1/(50+15)*15=.23
if I had used a 50 ohm, I would have gotten a .5Vpp wave

so I'm guessing this signal generator has a 50 ohm output impedance?
is that gonna be low enough?

I know impedance of a cap equals 1/(2*pi*c*f), that doesn't tell me what size to make my resistors for a certain frequency though
 

Attachments

#12

Joined Nov 30, 2010
18,224
Geeze, don't do that! You can smoke the output amplifier of the signal generator by attaching just any old resistor you have laying around. I know because I've done it.

If the output impedance is 50 ohms, lower the resistance of the parts in my drawing to accommodate that. 50 ohm pot, around 1k for the gain resistors. At 10 MHz, you're fighting capacitance problems and the lower resistance reduces the frequency of the poles created by parasitic capacitance.

ps, don't use a 50 ohm pot for the offset. That would require a 5 watt pot. Better a bit of mismatch on the inputs than a burnt potentiometer.
 

Thread Starter

magnet18

Joined Dec 22, 2010
1,227
Geeze, don't do that! You can smoke the output amplifier of the signal generator by attaching just any old resistor you have laying around. I know because I've done it.

If the output impedance is 50 ohms, lower the resistance of the parts in my drawing to accommodate that. 50 ohm pot, around 1k for the gain resistors. At 10 MHz, you're fighting capacitance problems and the lower resistance reduces the frequency of the poles created by parasitic capacitance.

ps, don't use a 50 ohm pot for the offset. That would require a 5 watt pot. Better a bit of mismatch on the inputs than a burnt potentiometer.
Now you're talking about something I know about! :D

I'll play with the values and post what I come up with
 
Top