To be honest, I did this next simulation before the transistor-only one, but the message seems the same. And the fact that it was built-in into LTSpice.Ĭ4 smooths the output voltage so that it displays nicely in the simulation. IRFZ46Z was chosen because it had a low Vds (usually signals low Vgs as well) and a high internal resistance. Probably because the current through it matches the current of the transistor in the linear region, but don't quote me on that. R8 was chosen to be 47k as it gives a better output range and yields the maximum linear region in my testing. I've chosen V2 to be 10V and R6 to be 1k so that the voltage divider calculations yield readable results. C1 smooths a bit the driving waveform, not too much. R1 is the needed resistor for driving the gate and R2 the corresponding bleeding resistor. The rest of the circuit is fairly straightforward : If you were to put this circuit into your own analog circuit those nonlinearities would introduce a lot of noise, certainly not something you'd want in a power supply. On the rising edge there is a discontinuity until 15% after which it becomes usable up to 40%. The usable range, with calibration, would be for a PWM between 50% and 5%, but only on the falling edge. We can see that the linear region is small and asymmetric: 7 to 8.2 milliseconds on the rising edge and 12.8-13ms on the falling edge (being generous). That means that the far left vertical axis should corresponds to the value in kiloohms (since R6 is exactly 1k). The red trace calculates the virtual resistance of the circuit by using a resistor divider formula. The blue trace is the output voltage, sampled at the far right of the schematic from the top of C4. The top of the window represents 100%, the bottom part is 0% modulation. The green trace is the modulating sine wave (at 50Hz) and the full width of the window shows once period of that (20ms). Let's go back to the main simulation and I'll walk you through all the details. That's because FETs like to be driven hard and don't work properly otherwise. The keen eye might have noticed that we are driving the gate with 15V, which is way above what an Arduino can handle. Here's a simulation on how the three waveforms interact, the blue trace is the triangle waveform, the green trace is the sine wave (zoomed in), the red trace is the FET gate driving voltage:Ī detail of the PWM output with the sine wave zoomed out, where the red trace represents the gate voltage: V1 is at 50Hz so we give all the components (capacitors) time to follow the output and recover, V3 and B1 work at 33.33kHz, fast enough to not make an annoying sound and slow enough that an Arduino can do it. V1, V3 and B1 form a PWM signal with V3 as a triangle generator (carrier) and V1 as driving main sine wave (modulator). I'll jump right to the simulation results and try to explain what's happening: Let's pick a typical MOSFET that you would use in an Arduino project and try to work with that. The also don't like high voltages on their input, generally going up only to 3.3 or 5V.Ī select number of MOSFETS have a bigger linear region than the usual ones, but let's assume we don't have access to those. Internally, they just switch a network of resistors. There are quite a few of them on the market but they provide only 5-8 bits. Yes, there are opamps - for scaling - or external DACs with reference voltage input but I'd like to keep this build minimal. It would also keep the microcontroller busy a lot of the time with no time to draw the fancy graphics or respond to user commands.Įven if we choose that route, we would need to output a maximum of 1.25V (usual internal reference voltage) which means we would only use less than half the range. We could feed the input through and ADC, sample it, calculate and output the correct DAC value but the latency would be ~1ms while the cheapest converter running at 100kHz is able to do it in 10 times faster. Third, just a DAC is not sufficient as we need to have the feedback voltage adapt to the output voltage. We should not confuse resolution and precision, but I will break the rules for now. A cheap 8-bit DAC ( PCF8591) would provide a resolution of only ~120mV. That means a way to vary the output with 10 bits (1024 steps). Since I'd like the output voltage to vary within 0 and 30V with a 50mV precision the needed resolution is 30/0.05 = 600 steps. The feedback resistors are in the potentiometer with ranges a few kiloohms. The supply already has two buck converters inside the unit, both controlled by their feedback resistors, so it was only natural to try to create a programmable resistor. I wanted a second try on my bench power supply build, something that would allow me to programmatically control the output voltage via an 'Arduino'.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |