in my electronics-simulator sub-project, stuff seemed to be ok when it only had wires.
I could make wires, and short things between Vcc and Gnd, and saw plausible looking voltage drops and amperage values.
then went and added resistors, which sort of work, but a bit of problem emerges:
current values are not really all that consistent.
for example, there is *less* current reported flowing through resistors than through the wires connected to the resistors, ... (resistor says 0.01A, wires say 0.2A).
I am not actually sure I am even approaching things correctly.
as-is, the simulation is driven internally almost entirely off voltages.
yes, in reality, there are volts, amps, watts, ... but my thoughts end up going in circles, and it seems like "volts" is the more fundamental property, and amps is based mostly on a voltage difference and on ohms and time. the amps mostly seem to essentially fall out of the calculations, leaving it mostly a matter of volts, ohms, and time (but, then straightforward application of ohm's law is no longer really doable, as mostly one is calculating amps merely to do something with it).
for example, ohms law seems good for describing the circuits, but problems start popping up when trying to apply it to a simulation.
for example, as one side of the circuit tries to pull the voltage down, the other side tries to push it back up again (so, 1 volt over 1 ohm per second, aka, the amp). but, then, voltages end up taking an unreasonably long time to propagate across resistors, and trying to make this faster seems to increase instability and significantly increases the amount of current "leaked" across the resistor (hence the wires seemingly reporting a higher current-flow than the resistors, and the voltage drops in the wires and similar seemingly implying a much lower resistance in the resistors).
similarly, it takes a bit much from the CPU to try to run the tick loop much higher than 10kHz (tried 100kHz, but then it started lagging pretty bad). but, it also seems a bit questionable that it should take 1000s of iterations for a voltage to make it across a resistor.
as a result of all this, the amps values diverge from sanity, and general intuition would imply watts as a more fundamental property, except there doesn't seem to be any real way to calculate everything else simply knowing the watts value at each point (seemingly, you need either volts or amps).
or, at least, it would be good if all the amperage values added up and there was a more consistent current reported from different locations in the same circuit.
a case could be made for amps as the fundamental value, but then things like batteries would no longer make sense, and the math doesn't really seem to hold up so well.
I don't necessarily need high precision, but answers "in the general area of being correct" would be nice.
it seems like I may be missing something fairly fundamental in all this...
in other notes: I got my "alternator converted into a motor" to turn (albeit slowly and very weakly) while running off of a variable/lab power supply. disturbingly, the MOSFETs seemed to get very hot at only a few amps, and I am not sure what to make of this (or if I can actually run them safely at higher power levels, but they are 30A MOSFETs and in other tests could run 5A with very little heat). I also have doubts about the flyback diodes (I observed notable heating in these diodes, and around 3 amps of flyback current, despite only seeing around 0.4v across the phase coils). in contrast, I had around 1.5v across the field coil.
nevermind, in an earlier test, the field-coil had managed to blow-up a TIP127, but I mostly fixed this issue with some external flyback diodes.
thoughts?...
I could make wires, and short things between Vcc and Gnd, and saw plausible looking voltage drops and amperage values.
then went and added resistors, which sort of work, but a bit of problem emerges:
current values are not really all that consistent.
for example, there is *less* current reported flowing through resistors than through the wires connected to the resistors, ... (resistor says 0.01A, wires say 0.2A).
I am not actually sure I am even approaching things correctly.
as-is, the simulation is driven internally almost entirely off voltages.
yes, in reality, there are volts, amps, watts, ... but my thoughts end up going in circles, and it seems like "volts" is the more fundamental property, and amps is based mostly on a voltage difference and on ohms and time. the amps mostly seem to essentially fall out of the calculations, leaving it mostly a matter of volts, ohms, and time (but, then straightforward application of ohm's law is no longer really doable, as mostly one is calculating amps merely to do something with it).
for example, ohms law seems good for describing the circuits, but problems start popping up when trying to apply it to a simulation.
for example, as one side of the circuit tries to pull the voltage down, the other side tries to push it back up again (so, 1 volt over 1 ohm per second, aka, the amp). but, then, voltages end up taking an unreasonably long time to propagate across resistors, and trying to make this faster seems to increase instability and significantly increases the amount of current "leaked" across the resistor (hence the wires seemingly reporting a higher current-flow than the resistors, and the voltage drops in the wires and similar seemingly implying a much lower resistance in the resistors).
similarly, it takes a bit much from the CPU to try to run the tick loop much higher than 10kHz (tried 100kHz, but then it started lagging pretty bad). but, it also seems a bit questionable that it should take 1000s of iterations for a voltage to make it across a resistor.
as a result of all this, the amps values diverge from sanity, and general intuition would imply watts as a more fundamental property, except there doesn't seem to be any real way to calculate everything else simply knowing the watts value at each point (seemingly, you need either volts or amps).
or, at least, it would be good if all the amperage values added up and there was a more consistent current reported from different locations in the same circuit.
a case could be made for amps as the fundamental value, but then things like batteries would no longer make sense, and the math doesn't really seem to hold up so well.
I don't necessarily need high precision, but answers "in the general area of being correct" would be nice.
it seems like I may be missing something fairly fundamental in all this...
in other notes: I got my "alternator converted into a motor" to turn (albeit slowly and very weakly) while running off of a variable/lab power supply. disturbingly, the MOSFETs seemed to get very hot at only a few amps, and I am not sure what to make of this (or if I can actually run them safely at higher power levels, but they are 30A MOSFETs and in other tests could run 5A with very little heat). I also have doubts about the flyback diodes (I observed notable heating in these diodes, and around 3 amps of flyback current, despite only seeing around 0.4v across the phase coils). in contrast, I had around 1.5v across the field coil.
nevermind, in an earlier test, the field-coil had managed to blow-up a TIP127, but I mostly fixed this issue with some external flyback diodes.
thoughts?...