Question What is an electrical bus exactly?

Linguofreak

Well-known member
Joined
May 10, 2008
Messages
5,038
Reaction score
1,275
Points
188
Location
Dallas, TX
Thanks, that makes things somewhat clearer. So the powersupplies have to connect to a common point in order to really work in parallel, not just be somewhere in the circuit wired in parallel. That's essentially what I was wondering.

I've tried playing around with circuit simulators in the last 2 hours, but I haven't found a single one that does parallel power sources. :(

Maybe http://www.falstad.com/circuit/ ?
 

jedidia

shoemaker without legs
Addon Developer
Joined
Mar 19, 2008
Messages
10,891
Reaction score
2,141
Points
203
Location
between the planets
Jedidia? They are going to make an Electrical Engineer out of you yet.

Other people have tried and failed :rofl:


That's the first one I tried actually, but by now I think that the problem is on my end. I'm applying a simplified model to a full-blown simulator. After further experiments with various simulators I think I'm just shorting it out because I don't know enough about what I'm doing.
 

kuddel

Donator
Donator
Joined
Apr 1, 2008
Messages
2,064
Reaction score
508
Points
113
Suppose in my above diagram I simplified so heavily that I abstracted an entire circuit as a power source. Then the internal resistance of that "power source" would be the overall resistance of the circuit, correct?

In a short-circuit, yes! But you should avoid short-circuits ;) They are mainly only good for calculus.
The electrical circuit (...mind the word circuit! ...from circle, 'cause it's a loop) then consists of the "idealized" source (witch sources 10 V e.g.), the internal resistance of the power source and a short-circuiting wire (that is assumed to have no resistance in all analytic views).

If you have however a power-supply that has over-current-protection, it is designed to limit the current it will deliver in a save way. Most modern power-supplies will have this "feature".
"Constant-Current" Mode and "Constant Voltage" Mode are key features of good (decent) power supplies.
With that (Constant-Current) feature the power-supply will (kind of) change it's internal resistance, so that only the set amount of current (say 1 A) will be sourced. Less current (when the load is less - it has a higher resistance than zero Ohms) is always working, though.

If for example you have a power-supply of 10 V that can deliver up to 1 A, this current will basically only flow if you short-circuit it.
Driving a load with -say 100 Ohms- will result in a current of 100 mA (I=U/R) flowing through the simple circuit.
Ohms law is hard to get around in the real world ;)

The main thing about your power-bus with several contributors (sources) is that they have to be at the same potential (voltage)! That's why photovoltaic modules have to have a device, that boosts the voltage up to a level, that fits the net voltage (230 V AC in your case[1]).
Any lower voltage makes that module essentially a Load, that will get hot and eventually die :facepalm:

By the way,
that is a really good and easy to play with online tool! :thumbup:

Here's a "circuit", you can play with http://tinyurl.com/jjca63z


[1] AC is a little bit more into electrical engineering than this thread can handle I believe...your diagram in question clearly marked the supplies with a plus and a minus :thumbup:
 
Last edited:

Notebook

Addon Developer
Addon Developer
News Reporter
Donator
Joined
Nov 20, 2007
Messages
11,820
Reaction score
641
Points
188

Col_Klonk

Member
Joined
Aug 29, 2015
Messages
470
Reaction score
0
Points
16
Location
This here small Dot
A lot of people get lost in the details...

Electricity is all about energy (Potential (Voltage) and Kinetic (Current)).. once you see it that way.. it all becomes clear as mud.. :lol: no really, it's no more that.
;)
What a lot of people always forget, is that the 3 basic components (that we know of) ..Resistance, Capacitance and Inductance ... exists in every electrical component calculation and is missing in all these posts. It's a good idea to take this into account when playing with Bus-Bars (Electrical Buses), not to mention the mechanical dimensions of the bars themselves..... These things can screw you around if you're not aware
;)

You must be AWAKE when playing with these things - check at 1:14
[ame="https://www.youtube.com/watch?v=rdQR7-Ap6YQ"]https://www.youtube.com/watch?v=rdQR7-Ap6YQ[/ame]
 
Last edited:

kuddel

Donator
Donator
Joined
Apr 1, 2008
Messages
2,064
Reaction score
508
Points
113
...Looks like I was indeed just shorting things out. I'm sure I can try around with that stuff savely at a computer! :lol:
Yes:thumbup: ...really very very little risk of damage or injuries :tiphat:
 

Xyon

Puts the Fun in Dysfunctional
Administrator
Moderator
Orbiter Contributor
Addon Developer
Webmaster
GFX Staff
Beta Tester
Joined
Aug 9, 2009
Messages
6,929
Reaction score
795
Points
203
Location
10.0.0.1
Website
www.orbiter-radio.co.uk
Preferred Pronouns
she/her
Yes:thumbup: ...really very very little risk of damage or injuries :tiphat:

Well, you get cramp if you sit funny, I guess...
 

jedidia

shoemaker without legs
Addon Developer
Joined
Mar 19, 2008
Messages
10,891
Reaction score
2,141
Points
203
Location
between the planets
Aaaand I just realised that, since buses are parallel circuits, any arbitrary complex connection of buses and consumers (of the same voltage) can be abstracted to a single equivalent resistance to calculate how much will be drawn from each connected power source.

Now I need to come up with a good data structure to recalculate that with as little effort as possible when the resistance of a consumer changes. Re-evaluating the whole thing every time something changes its power consumption would probably be a bit of a drain on the CPU for larger vessels. But it's really mostly just structuring, data-managment and algorithmics at this point, which are things I have at least moderate knowledge of.

I wanted to thank everybody that contributed to this thread one more time! I always found electricity a terribly counterintuitive thing (and still do mostly), but your guidancce and patient explanations have enabled me to push through to a level where a generic abstraction of a power distribution system should be possible for me to code. :cheers:
 
Last edited:

C3PO

Addon Developer
Addon Developer
Donator
Joined
Feb 11, 2008
Messages
2,605
Reaction score
17
Points
53
All those rules above are only valid for DC circuits and unregulated power sources. If you want to model 3 phase sinusoidal AC it gets really complicated.
 

jedidia

shoemaker without legs
Addon Developer
Joined
Mar 19, 2008
Messages
10,891
Reaction score
2,141
Points
203
Location
between the planets
All those rules above are only valid for DC circuits and unregulated power sources.

I noticed, but it's enough. All I'm looking for is a bit more depth for power distribution in IMS2 than the original (which just worked by "is there enough total power to power everything", with everything magically connected. It's not like I want to put a complete simulation of electricity in there. Wouldn't have the computing power to do that even if I wanted to...
 

Thorsten

Active member
Joined
Dec 7, 2013
Messages
785
Reaction score
56
Points
43
Now I need to come up with a good data structure to recalculate that with as little effort as possible when the resistance of a consumer changes.

For the FG-Shuttle, I'm using a backward-forward algorithm to model the electric system:

The backward stage tracks power demand from equipment to source:

* every piece of equipment that's on (i.e. not hard failed, not switched off, not circuit-breaker pulled) registers its power consumption with the bus it is connected to

* a bus tie logic averages power consumption across tied buses

* buses register their power with the fuel cells

The forward stage then determines the resulting currents and voltages from the source to the equipment:

* the fuel cell supply function (described earlier in the thread) gives the resulting voltage at the cell

* a loss logic slightly reduces these voltages at the various distribution points

* voltages and delivered power allow to compute currents

* the equipment then checks whether it receives enough operating voltage, if not it does not function (but still draws power till actually switched off)

One crucial element is that equipment may not function but still draw power (it's switched on, just there's too much on to support everything, so things which demand a certain voltage range will go, whereas lights will just dim). The 'is this working' check then get a bit more involved.

If you want to short a circuit in this model, you just crank up the demand you register somehwere to a large value, and you can see voltages floor across the buses and currents ramp up.

I've been rather happy with the algorithm.
 

jedidia

shoemaker without legs
Addon Developer
Joined
Mar 19, 2008
Messages
10,891
Reaction score
2,141
Points
203
Location
between the planets
For the FG-Shuttle, I'm using a backward-forward algorithm to model the electric system:

That was pretty much my first idea, but I'll be running into problems with branching complexity. As soon as you don't know how many power sources you'll have and which characteristics they have, just propagating demand up the branch can get rather horrible.

Also, once Dantassii starts wiring things it might start stuttering a bit. I need a model that pretty much has the characteristics of a propagation model, but can selectively update only the parts that need it when it changes state. It will probably look very similar to what you describe in many ways, just with a few additional layers in between for state managment.
 

jedidia

shoemaker without legs
Addon Developer
Joined
Mar 19, 2008
Messages
10,891
Reaction score
2,141
Points
203
Location
between the planets
It's been five months since I posted this question. It took me all that time to write a library for a simplified constant-voltage parallel circuit simulation (well, I also had a final exam and a no man's sky update in-between). While the math wasn't tough, this turned out to be the logically most complex piece of code I've ever written. I haven't underestimated code complexity this much since my 12 year old self asked the question "why isn't there a game where you can just do anything?". Electricity is evil!

A lot of the complexity came from the fact that I designed the whole thing to be a stateful analytical solution instead of a propagation model, to make it as fast as possible. It only needs to recalculate parts of the system affected by a change, and if the system doesn't change, it doesn't calculate anything at all. At last, it seems I have succeeded and can finally move on to putting the whole thing into IMS2.

It's a completely independant library though, so potentially beneficial for other orbiter projects too (or other game/simulation projects in general). I don't feel quite confident to release it just yet. It's got over 600 lines of unit tests, but I won't know the real kinks until I start actually using it in a real project. Most notably, a messaging system is still missing, and the API is a bit messy. For the first time I missed something like a "package private" concept in C++.

In any case, I wanted to thank everybody here one more time for the patient explaining. Couldn't have done it without some competent teachers! :cheers:
 
Last edited:

Urwumpe

Not funny anymore
Addon Developer
Donator
Joined
Feb 6, 2008
Messages
37,663
Reaction score
2,383
Points
203
Location
Wolfsburg
Preferred Pronouns
Sire
Well, I would be interested in such a library as well - the current propagation model in my library works accurately and is not too bad, but its ineffective. I think a sparse matrix solution would be faster, but I am too unfocused for writing a solver there.
 

jedidia

shoemaker without legs
Addon Developer
Joined
Mar 19, 2008
Messages
10,891
Reaction score
2,141
Points
203
Location
between the planets
I assume that would be for use in SSU? I'm not sure a constant-voltage circuit would be accurate enough there (things will just stop working when there's no current left over instead of the voltage dropping). Depends on how close you want to get to the original systems, but as far as I understand SSU, you want to be as close as possible.
 
Top