An external power supply connects to the device via the input connectors. The voltage is stepped down to 3.3V to power the display, microcontroller, and voltage controller. A voltage and current sensor measures the external power supply’s voltage and current output and sends the readings to the microcontroller. The user can operate the voltage controller to adjust the voltage sent to the output connector, which involves either a buck or boost conversion as the output voltage can range from 0 to 20V. Another set of voltage and current sensors measures the voltage and current delivered to the load and sends those readings to the microcontroller. The microcontroller processes the signals received from the sensors and sends the processed data to the display, allowing the user to view the voltage and current supplied by the external power supply as well as the voltage and current delivered to the load.
R10 is there to ground node B if the Buck has an Capacitive output impedance, this will prevent the non-inverting input of the comparator from floating
**Original used MAX9095 as the comparator but it wouldn't go high for some reason
Updated simulation schematic to better reflect the hardware implementation
Made a table of the different states the power selector can take, along with the expected output
***Depending on the design of the buck converter, the output impedance when it is not receiving power can be so high it is basically an open circuit or "low"
Either way, you don't want to develop a potential at the output terminal if it is disconnected from it's own power source
Will make a separate file for each state instead of trying to simulate them in the same transient simulation
This is where I noticed the issue of the MOSFETS Bi-directionality
Never actually "electrically disconnected" voltage sources from circuit -> likely created erroneous results
Later tried using the voltage controlled switch "SW" that is native to LTSpice, set Ron = 1 ohm and Roff = 1/10/100 Mohms
Not sure how to explain it, but there may have been some "odd behavior" with this set up, however I do not believe it is worth my time to look into this
For whatever reason, generic transistors in LTspice (pmos, nmos, npn and pnp options) have a large on-state resistance
Whenever I am simulating a transistor circuit ALWAYS use a real transistor to avoid "weird" simulation results
***MOSFETS: both pmos and nmos, are really bi-directional devices, while, for example, nmos transistors are suppose to have current flow from the drain to the source, if the voltage at the source is higher than the voltage at the drain and the gate is high, then current can flow from the source to the drain. Vice versa for pmos transistors.
Need to place two transistors, of the same type (2nmos or 2pmos) in series with their sources connected to prevent this
Making a circuit to automatically select the 3.3V power source:
Buck converter as priority
***Input impedance of buck-boost converter's output pin will vary based on the design of the buck converter. It could range from very high (practically open) to low (due to passive paths or body diodes)
Applying a 3V to the output of an unpowered buck-boost converter, i.e. a pre-biased condition can harm the IC unless it is explicitly designed to handle pre-biased conditions