I am designing a variable digital load and I am controlling it with a PWM signal from an ESP32. The problem is that I don't know how to control the P-channel MOSFET. What would the circuit be?
As previously mentioned, voltage being switched. Also switching frequency, and possibly current being switched to, and possibly the load being switched as well.
It's simple, I have two mosfets, one channel N and another channel p, both are being controlled by a PWM signal that passes through a filter so that it becomes "DC", the channel n mosfet is in charge of the positive half cycle and the channel mosfet P from negative
You need to learn how 1. full FET bridges work 2. loads must defined up front 3. To include a symbol of a load in your schematic. 4. How to define results before a schematic
This is not a trivial thing to design. You absolutely can't just use an RC low pass filter to turn PWM into an adjustable DC voltage in this context. Trying to slam the MOSFETs on and off at max \$I_d\$ is going to be an EMI hellscape. You have to be careful with MOSFET FBSOAs, and probably need planar MOSFETs that are designed for linear operation. You need a control feedback loop and a low inductance layout to ensure stable operation and avoid shoot-through. You need to properly characterise the \$Q_g\$ vs. \$I_d\$ and \$V_{ds}\$ transfer functions as part of that.
It's impossible to advise further without at least knowing your source voltage range, AC source frequency, the amount of power you want to dissipate, what level of precision you require in the power dissipation setpoint, and any other design parameters.
Ok, let me answer this step by step, @Hoagie points 2 to 4 are nonsense and instead of trying to find an answer or something you say to me "Read a book".
now @Polynomial, got no idea whay FBSOAs are, what Qg is, the only thing i want to know is a circuit that controls a P channel mosfet with a positive signal, i didn't even touch mosfets in my college
@NicoCano In which case you are trying to run before you can walk. I'd advise that you study electronics further before attempting to jump in with something like this. I'd also ask that you be respectful to others on here - your last reply to Hoagie was both incorrect and rude.
Digital loads don't work like that. You can't just short across your load like that. You also cannot switch MOSFETs like that..at all. It looks like you are trying RC filter a square wave to smooth it out and then apply it to the MOSFET gate which is not switching the MOSFET. That will force the MOSFET into a state between full conduction and no conduction (the actual two states you want for a switch) and make it dissipate lots of heat and burn it out. Frankly, there's too much wrong. It's not a matter of making corrections to the circuit.
So right now you have a choice between an all digital variable load that actually switches current between 100% and 0% and using transistors averages that out through a dissipative element OR you can use the transistors as linear devices where the transistors operate somewhere between 100% and 0%. No switching involved there but lots of heat.
The video you showed is explicitly not a digital variable load. It even says so in the title. Nothing is being shorted in that video either there is clearly a load resistor. What is being shown in that video is the "transistor as a linear device" approach I mentioned.
@Polynomial i'm being rude because it seems like everybody knows the answer but dont want to tell me and instead give me a live lesson, i can't just wait for knowing the solution, i may not even still on this career by then
@NicoCano No one is telling you because you lack the fundamentals to understand the answer. Right now it is like asking how to do algebra when you don't know the basic operations.
Does that video have a schematic?
I don't see one. But I clearly see a giant load resistor on the breadboard.
The only difference between the second video and the first video is that the opamp has been replaced with a MCU that uses an RC filter and PWM as a DAC
@NicoCano Nobody's telling you the answer because you haven't provided any information about the design requirements. The reason you're struggling is due to a gap in your knowledge. We'd would've been perfectly happy to explain why your design won't work, and what a better approach would be to achieve the goals given a set of design requirements, in order to help you bridge that knowledge gap. But instead of engaging in good faith, you were rude.
@Polynomial theres no design, no circuit, i'm just testing concepts before doing anithing, i saw that video and a thought, what a cool circuit lets make one
start with the circuit in the first video that is a op-amp driving a NMOS source follower
with a current sense resistor (the load really) making it act as a current source
once you get that working then you can replace the op-amp output with a DAC from the Arduino. In the second video it uses an RC filter to smooth out a PWM signal to simulate an analog voltage
and it reads the current sense resistor voltage with the ADC to replace the op-amp feedback path
if you're audio the opamp part should be easy. Once you get that working then you can struggle learning the ARduino part
and only after you have it working then, then you can try it with the AC which is kind of two of those mashed together
Then your question about how to drive the PMOS will be answerable
since by that point that question will mostly stand alone with everything behind it working
well good luck with that. Maybe you shoudl gravitate towards the more micro side but like you said, more specialization and needs more advanced education and the jobs aren't as widespread
I see. sounds like a lot of work. If that's what you're intersested in that really is like microchip design but there's lots of different things in that
like there's the actual physical semiconductor fabrication, the architecture, and the silicon libraries
and pretty much no one can do the fabrication or silicon libraries because it's pointless without a wafer foundry