Electronics > Beginners
Fast square wave with arduino and mosfet
<< < (9/10) > >>
fourfathom:
Here's a very simple circuit and simulation waveform.  I'm using a 2n3904 bipolar transistor and a 10K resistor for the LC tank stimulus coupling.  Actually, with the inductor and capacitor values in your LC tank, the output capacitance of the transistor (either bipolar or mosfet) is fairly inconsequential, but the 10K resistor does serve to limit the transistor current and reduce the voltage peaks on the ringing tank circuit.  If I drop this resistor to 100 Ohms (for example), when the transistor switches off the collector voltage spikes up to 140V -- well past the collector breakdown voltage -- and then swings down negative and forward-biases the base-collector junction.  Neither of these is a good thing, and show how you need to watch the voltage spikes when dealing with an inductive load.

I have a 1KHz square wave driving the transistor, but you could go with a much narrower "on" pulse if you like.  You could replace the bipolar transistor with a mosfet if you like.

You can also insert a small diode (1n4148 or similar, cathode towards the collector) between the transistor collector and the series resistor.  This will block the reverse voltage and avoid collector-base-diode clamping.  Doing this lets you substitute a 1K resistor for the 10K to increase the stimulus current and give you a bigger tank waveform voltage to measure.

The tank voltages and duration of ringing will somewhat depend on the inductor series resistance.  I assumed a resistance of 10 Ohms in my simulations.  Lower resistance will give you a slightly bigger ringing voltage and a much longer ringing duration.  Looking at the damping on your waveform, I would guess that the inductor resistance is closer to 100 Ohm.
ManlishPotato:
Ok i've tried the schematic you sent me, it gave a nice oscillation, but the frequency was wrong! It had a frequency of about 4.90kHz, whereas it should be closer to 33.93 kHz. Any ideas what the reason of this could be?
I was using a BC337 npn bjt transistor and a 1n5255b zener diode (which i hope is a good stand-in to the diode you were using since i didn't hava any on hand).
The voltage was still +7v and the cap and coil values are the same. The base resistor was the same you were using, 1k.

The images are respectively using the following resistors:
10k
1k
560
220
fourfathom:

--- Quote from: ManlishPotato on September 26, 2019, 01:27:42 pm ---Ok i've tried the schematic you sent me, it gave a nice oscillation, but the frequency was wrong! It had a frequency of about 4.90kHz, whereas it should be closer to 33.93 kHz. Any ideas what the reason of this could be?
I was using a BC337 npn bjt transistor and a 1n5255b zener diode (which i hope is a good stand-in to the diode you were using since i didn't hava any on hand).
The voltage was still +7v and the cap and coil values are the same. The base resistor was the same you were using, 1k.

The images are respectively using the following resistors:
10k
1k
560
220

--- End quote ---

Are you sure about the component values?  I agree, your 10mH / 2.2nF tank should resonate around 33.9 KHz.

The frequency of the ringing tank circuit will only be affected by the values of L and C, and any stray reactance in the circuit.  The zener you used has a reasonable low capacitance when reverse-biased, and even if you removed it from the circuit the tank ringing frequency will be virtually unchanged.  Your transistor is a fine choice for this circuit (as long as the ringing voltage doesn't exceed the Vce breakdown voltage, which it doesn't).  The transistor output capacitance is about 15pF, which is trivial here given the 2.2nF tank capacitor.

I notice in your previous post you also show a 4.9 KHz tank oscillation frequency.  I suspect that your inductor is not really 10mH, or possibly the capacitor is not 2.2nF (or both).

Another interesting thing is that your ringing tank voltage is much smaller than I get in my simulation (with a 1K series resistor I get 20V P-P but you get about 3.7V P-P).  Can you measure the DC resistance of your inductor?  In my simulation I have the inductor resistance at 100 Ohms, which is pretty high for a 10mH part.

Finally, in your previous schematics you show "DSO", which I assume is your digital storage oscilloscope connected directly across the tank circuit.  Is this a differential measurement?  The top of the tank is at +7V so I hope your scope ground isn't connected there.  The fact that the tank voltage goes negative when the transistor switches off tells me that the +7V rail is your ground reference.  I don't see how this will affect the resonant frequency, but it might be simpler to measure the tank signal relative to DC ground.  There will of course be a +7V offset.

alsetalokin4017:
Here's where we would like to see photos of the components.

Sure enough the scope trace, measured by the horizontal graticule markers, agrees with the "numbers in boxes" 4.9 kHz displayed by the scope (although there is some error there due to the way the Rigol measures frequency when the screen isn't completely filled with the waveform). And sure enough your favorite tank calculator says, given the stated tank component values, that the ring frequency should be about 33.9 kHz. And as we have seen the simulation also agrees. And we believe that the schematic of the probing connection, while "unorthodox" should still yield the correct resonant frequency.

So please let's have a nice look at the components in question so we can verify their values, as that seems to be the only explanation for the discrepancy.
fourfathom:

--- Quote from: fourfathom on September 26, 2019, 04:25:09 pm ---The fact that the tank voltage goes negative when the transistor switches off tells me that the +7V rail is your ground reference.  I don't see how this will affect the resonant frequency, but it might be simpler to measure the tank signal relative to DC ground.  There will of course be a +7V offset.

--- End quote ---

When I wrote the above comment I got my reference points turned upside down.  It looks like your 'scope "ground" reference is on the driven side of the tank circuit, and the probe point is on the +7V rail.  If this is a true high-impedance differential measurement this shouldn't matter.  If somehow your actual scope ground is connected to the driven side of the tank, then this could dramatically affect the oscillation amplitude and frequency.

And yes, some photos of the components might give us a better idea of what's going on.
Navigation
Message Index
Next page
Previous page
There was an error while thanking
Thanking...

Go to full version
Powered by SMFPacks Advanced Attachments Uploader Mod