Electrical-Age / ElectricalAge

Electrical Age (ELN) is a Minecraft Mod offering the ability to perform large-scale in-game electrical simulations.
https://electrical-age.net/
Other
211 stars 98 forks source link

Power Capacitor breaks the network #235

Open Baughn opened 9 years ago

Baughn commented 9 years ago

Place blocks like this (from above):

(capacitor) - (medium-voltage cable) - (voltage-oriented battery) - (ground cable)

Do not put anything in the capacitor.

Check the voltage at the cable. It will read as zero, though no power will be flowing. In a larger network this can (has) cause(d) a dramatic series of explosions. Notice the lack of ground cable at the left of the capacitor; this happens whether or not you put a ground cable there.

Baughn commented 9 years ago

Correction: Although I'm sure I saw that behaviour before, this now seems only to happen without placing a ground cable to the left of the capacitor.

serathius commented 9 years ago

My Experiments:

Dolu1990 commented 9 years ago

Hi, Thanks for issue, i have to solve looot of them, and i have to try it to ^^ Actualy i'm very busy with a very limiited connection (30 KB/s pic) XD

Dolu1990 commented 9 years ago

serathius, Is it a sequancial order of experiment that finaly product the final bug (raising voltage on capacitor) ? What is the setup of the capacitor ? how many redstone, how many dielectric ?

Thanks :)

serathius commented 9 years ago

Experiments were conducted on independent circuits. Capacitor setup: like issue author "Empty" Do you need different capacity tests?

Dolu1990 commented 9 years ago

No, it's just to know the exact setup ^^ Currently i can't test, but i will soon.

serathius commented 9 years ago

I'm thinking of rewriting electrical simulator from base up.

Baughn commented 9 years ago

The current one seems to work pretty well, if you avoid capacitors... though I'm having trouble computing the open circuit voltage for batteries based on closed circuit voltage and load, but that's probably just an error on my part.

Not that I'd protest. It'd be great to have something in-between "works" and "exploding"; some visual indication that you're driving components beyond their tolerances, and more realistic failure modes.

But this probably isn't the bug for that discussion. I'd love to help with the coding, but I'm not an EE.

serathius commented 9 years ago

Real fun starts with capacitors.

If you want help with electronics ask. "Trust me i'm an engineer"

Baughn commented 9 years ago

Well, would Dolu1990 actually accept our work? And what kind of electrical system redesign did you have in mind, anyway? I'd very much prefer not to fork, if at all possible, especially as Dolu appears to still be alive. ^^

I'm a pretty decent programmer, but a lot of what's in there right now might as well be black magic to me. If you can write a design doc, though, I can probably implement it. (With a bit of help, to explain some of the EE concepts.)

This mod is far too good not to follow up.

serathius commented 9 years ago

Yea same question!

I'm programmer and Electrical Engineer (CS && EE student).I know have everything should work, but I'm not sure what will work with mod.

I had no problems undearstanding code. Found some flaws with MNA so I'm creating model that correct them, and make code cleaner.

Baughn commented 9 years ago

@Dolu1990 So this bug got derailed a bit, but--the way I understand it, you're motivated to work on the mod but don't have enough time and/or internet access.

Would you be able to join IRC this weekend and talk about it? I don't expect you to immediately just decide to accept whatever we throw your way (because, let's face it, there's a chance we'll get bored and wander off.. or just not be very good at this), but I could imagine a general agreement like having us work on a fork, and then you pulling in changes whenever you're happy with what we've got. I could set up a build server, for anyone who really likes playing with fire.

If you don't have an IRC client, https://madoka.brage.info/#irc should work well enough.

For my part, I'd mostly be debugging and working around the edges of the simulation, or reviewing @serathius' changes, but my current wishlist includes things like full Forge microblock support, a bit more mod integration and a nicer (more realistic, but also slightly more forgiving) damage model. We can talk about that, though; I'd be happy to comply with a roadmap.

Or I might make a realistic steam turbine. :D

Hum. High-end, slow power storage... pumped-water would be weird, maybe molten metal? Heat-based? Would just produce steam... Brainstorms ahoy

Dolu1990 commented 9 years ago

Hi, So i' have two problems, internet connection, and multiple project in same time XD About the electical age simulation model. Initialy, it was a simulation model like Red Power, that simulate electricity by using a very simple model based on a resistance and a grounded capacity at every node (like a big rc rc rc rc rc filter) very easy to simulate, but not nice in therm of simulation.

So from that i have migrate the simulation model into a MNA algorytme, with the addition of some optimisation to make it real time like : Serial resistance symplification Subdivision into multiple sub network with iterative solving interconnection point (It's very very important in therm of performance to keep each sub system not bigger than 50 node)

It was a trash migration, and the code is maybe not very pretty XD

In addition of that there is some minecraft beavoral that are some time totaly unexpected/undocumented that make save currupted, some time ^^ if you exit the game not cleanly.

The reason why Node information are not saved into the TileEntity is : I realy need to have a complet simulation at any time. else some part of your electrical network are not loaded, and could product explosion.

So i save information into a map NBT. and this NBT if you exit the game not cleanly, is not saved, some time, for unknown reason.

My skype is Capons1785. Else i can come on IRC ^^

Dolu1990 commented 9 years ago

n.b. I have the best broken english on the earth, forgive me XD

Dolu1990 commented 9 years ago

@serathius Do you know about ♫ VHDL/Verilog ♪ ?

Dolu1990 commented 9 years ago

About the Ground - Capacitor - Cable - Battery: Uc=Ucable=Slowly raising (0.07 V every second, until reaches 101V), Ic=0 experiment It's not a bug at all. It's the wanter beavoral. Letz me explain.

So Having something with a floating voltage (high impedance to the ground) is something bad in a simulation. Because all is solved in function of the ground level (matrix equiation solving) For this reason, to every bipolar component, i have add high value resistor connected from each side, to the ground)

It's the reason why when you connect a floating battery to a capacitor charged to zero volt, that the side of the battery that is not connected has a little current, that charge the capacity. So to resume, it's not a bug, it's not a simulation mistake, it's the wanted beavoral.

serathius commented 9 years ago

OK, after I read about RC filter at every node everything was clear. Good job. I mainly read mna package, nbt was to messy for me so I only briefly looked at usege of processes for diode.

@Dolu1990 I focused on different Domain and only read now about VHDL/Verilog. I plan to rewrite mna, maybe we could discuss changes sometime. skype: siara_91

Dolu1990 commented 9 years ago

@serathius RC simulation model is not used anymore. Now it's a real model with real equiation. I don't know if i have write it very clear XD About VHDL/Verilog, if you find them dirty (because they are very very very... very very dirty). Try this alternative <3 https://github.com/SpinalHDL/SpinalHDL