Recent

Author Topic: A proposal for an app - Electrical Circuit Simulator  (Read 2353 times)

CM630

  • Hero Member
  • *****
  • Posts: 1197
  • Не съм сигурен, че те разбирам.
    • http://sourceforge.net/u/cm630/profile/
A proposal for an app - Electrical Circuit Simulator
« on: November 09, 2024, 07:58:40 pm »
I am not sure that my topic is appropriate but I believe it will not harm.
I am also not sure that this shall be in this section.  :-[


Recently yet another drawing app in Lazarus was announced.
So probably there are people that like making drawing apps.
I am not an optimist that a single person can handle and mantain such an app and make it comparable with for example FreeCad (I use it and it has significat problems).
But years ago I have come across this app: https://veppa.com/ekts/
As far as I understood, it was made (and abandoned) by a student, so it is doable by a single person. It is very useful, it would be even more, if it did not have some serious bugs.

So maybe the next time when somebode decides to do some drawing app, maybe (s)he might consider this idea.

Note: This has nothing to do with P/LT Spice, it about relays, buttons and switches.
Лазар 4,0RC1 32 bit (sometimes 64 bit); FPC3,2,2

zamtmn

  • Hero Member
  • *****
  • Posts: 640
Re: A proposal for an app - Electrical Circuit Simulator
« Reply #1 on: November 10, 2024, 01:59:54 pm »
An editor of relay electrical circuits, and ideally a simulator, is one of the goals of the zcad project. But there are a lot of difficulties along the way))

CM630

  • Hero Member
  • *****
  • Posts: 1197
  • Не съм сигурен, че те разбирам.
    • http://sourceforge.net/u/cm630/profile/
Re: A proposal for an app - Electrical Circuit Simulator
« Reply #2 on: November 11, 2024, 09:13:48 pm »
Please let me know (maybe PM) when/if there is some progress? I might do some testing.
Лазар 4,0RC1 32 bit (sometimes 64 bit); FPC3,2,2

VisualLab

  • Hero Member
  • *****
  • Posts: 575
Re: A proposal for an app - Electrical Circuit Simulator
« Reply #3 on: November 12, 2024, 12:03:24 am »
I would say that this is quite an ambitious project. It looks like a lot has been done. But there is still a lot to do. In any case, it requires knowledge not only of the basics of electrical engineering but also of the basics of electrical equipment and vector graphics and the operation of graphic controls (editor).

Thaddy

  • Hero Member
  • *****
  • Posts: 16199
  • Censorship about opinions does not belong here.
Re: A proposal for an app - Electrical Circuit Simulator
« Reply #4 on: November 12, 2024, 02:20:25 pm »
I would say that this is quite an ambitious project. It looks like a lot has been done. But there is still a lot to do. In any case, it requires knowledge not only of the basics of electrical engineering but also of the basics of electrical equipment and vector graphics and the operation of graphic controls (editor).
zcad goes a long way in solving that. For electronics just a database needs to be added and their values and that data is readily available for most standard components like resistors, transistors, capacitors, tubes, you name it: that it how we all design our circuits after all. And a couple of classes that solve the min/max values of those components. A working example should not be too difficult, just labour intensive.
I used to build tube guitar amplifiers like that. (and got shocked multiple times, so don't trust me! high voltage dc is not the fun part of ac/dc. Cause: usually self build trafo's)
« Last Edit: November 12, 2024, 02:30:22 pm by Thaddy »
If I smell bad code it usually is bad code and that includes my own code.

Edson

  • Hero Member
  • *****
  • Posts: 1314
Re: A proposal for an app - Electrical Circuit Simulator
« Reply #5 on: November 12, 2024, 03:48:11 pm »
I've created a library to work with diagrams: https://github.com/t-edson/ogEditGraf

I've used it to implement the real-time electronic simulator of my IDE-compiler PicPas:  https://github.com/t-edson/P65Pas

It includes logical inputs, resistors, 7 segments display, and leds and it's easy to add switching or digital electronic components that have electrical reference to ground (GND) such as logic gates. So easy that I have postponed that task in favor of working on improvements to the compiler, and it is what is currently taking me the most time.

It would be possible to separate this simulation module into a library an extract it from the IDE. I have already worked a lot on the modularity of the IDE but I have not taken the time to work on the electronic simulator.

« Last Edit: November 12, 2024, 03:49:50 pm by Edson »
Lazarus 2.2.6 - FPC 3.2.2 - x86_64-win64 on Windows 10

VisualLab

  • Hero Member
  • *****
  • Posts: 575
Re: A proposal for an app - Electrical Circuit Simulator
« Reply #6 on: November 12, 2024, 04:39:32 pm »
I would say that this is quite an ambitious project. It looks like a lot has been done. But there is still a lot to do. In any case, it requires knowledge not only of the basics of electrical engineering but also of the basics of electrical equipment and vector graphics and the operation of graphic controls (editor).
zcad goes a long way in solving that. For electronics just a database needs to be added and their values and that data is readily available for most standard components like resistors, transistors, capacitors, tubes, you name it: that it how we all design our circuits after all. And a couple of classes that solve the min/max values of those components. A working example should not be too difficult, just labour intensive.

I won't comment on ZCAD (although the descriptions and screenshots suggest that it is used similarly to AutoCAD, i.e. mainly for creating 2D mechanical/construction drawings). However, the program mentioned by CM630 (i.e. ekts) from the descriptions and screenshots resembles an electrical installation simulator, designed for people dealing with power and electrical equipment - not electronics! It looks like its author tried to create a program where:
  • the user draws a wiring diagram using: engines, transmission lines, switches, contactors, fuses, etc., where high voltages and very large currents occur,
  • the user enters operating parameters of individual devices and installations,
  • the program performs calculations and then shows how the designed installation will behave.
This is quite an ambitious engineering project. What you write is an illusion, that a database and element symbols are enough. This is only the external part of this program, a graphical editor. In order for it to be useful, you need to implement a set of classes performing complex calculations in order to simulate the operation of such an industrial high-power circuit. And this is no longer such a trivial task. However, it is true that implementing it takes a lot of time.

I used to build tube guitar amplifiers like that. (and got shocked multiple times, so don't trust me! high voltage dc is not the fun part of ac/dc. Cause: usually self build trafo's)

Because making transformers for tube equipment was not only science and technology, but also a secret art (requiring a lot of proactive experience), transmitted somewhat through the shamanic way :)
« Last Edit: November 12, 2024, 04:45:12 pm by VisualLab »

Thaddy

  • Hero Member
  • *****
  • Posts: 16199
  • Censorship about opinions does not belong here.
Re: A proposal for an app - Electrical Circuit Simulator
« Reply #7 on: November 12, 2024, 04:42:11 pm »
;) and don't your mother's wooll equipment to wind them...
If I smell bad code it usually is bad code and that includes my own code.

VisualLab

  • Hero Member
  • *****
  • Posts: 575
Re: A proposal for an app - Electrical Circuit Simulator
« Reply #8 on: November 12, 2024, 04:43:46 pm »
I've created a library to work with diagrams: https://github.com/t-edson/ogEditGraf

I've used it to implement the real-time electronic simulator of my IDE-compiler PicPas:  https://github.com/t-edson/P65Pas

It includes logical inputs, resistors, 7 segments display, and leds and it's easy to add switching or digital electronic components that have electrical reference to ground (GND) such as logic gates. So easy that I have postponed that task in favor of working on improvements to the compiler, and it is what is currently taking me the most time.

For now it's simple because you're at the beginning of its construction. As new options and functionalities are added, things will get more complicated and the simulator will not be that simple.

Curt Carpenter

  • Hero Member
  • *****
  • Posts: 566
Re: A proposal for an app - Electrical Circuit Simulator
« Reply #9 on: November 12, 2024, 05:17:39 pm »
Building something like this would be a good and challenging project.  For what it's worth though, I think learning to use any CAD or simulation program well requires a significant investment in time and practice, and you will want to make those investments wisely.

I'd suggest starting with an internet search for free simulators and related programs.  You will find a lot of amazing free resources like LTSpice from Analog Devices and TINA-TI from Texas Instruments in the electronics domain (and similar programs in for PLCs and ladder logic) that are very well supported and have large active user communities.  Learning to use them (and understanding their limitations) can be a profession.   If nothing else, taking a look at these tools will give you a good idea of how versatile and complex projects like this can be before you set out on your own development adventure.

zamtmn

  • Hero Member
  • *****
  • Posts: 640
Re: A proposal for an app - Electrical Circuit Simulator
« Reply #10 on: November 12, 2024, 05:27:04 pm »
As an electrical engineer, I will note that EKTS is an excellent program (I used it once to test circuits), but it is very bad that you cannot make a project in it, you can draw and simulate simple relay logic, but this is not suitable for the release of project documentation

VisualLab

  • Hero Member
  • *****
  • Posts: 575
Re: A proposal for an app - Electrical Circuit Simulator
« Reply #11 on: November 12, 2024, 07:55:20 pm »
;) and don't your mother's wooll equipment to wind them...

Well, in the early years of radio engineering (before WWI), a spinning wheel could be a useful tool for "manufacturing" inductive components: transformers and chokes :)

As an electrical engineer, I will note that EKTS is an excellent program (I used it once to test circuits), but it is very bad that you cannot make a project in it, you can draw and simulate simple relay logic, but this is not suitable for the release of project documentation

Probably its author lost the enthusiasm and creative inspiration to develop his program. Someone new (assuming there was someone willing to continue this work) would perhaps develop the project not necessarily in the direction that the original author would have wanted (and aimed for).

zamtmn

  • Hero Member
  • *****
  • Posts: 640
Re: A proposal for an app - Electrical Circuit Simulator
« Reply #12 on: November 13, 2024, 09:55:37 pm »
Someone has already used openmodelica.org with fpc?

MarkMLl

  • Hero Member
  • *****
  • Posts: 8039
Re: A proposal for an app - Electrical Circuit Simulator
« Reply #13 on: November 15, 2024, 09:34:20 am »
I am not an optimist that a single person can handle and mantain such an app and make it comparable with for example FreeCad (I use it and it has significat problems).

I also use FreeCAD, the company that tried to commercialise it has just folded, and I feel that there are lessons to be learnt.

The first is that very often "less is better": if somebody has something to be done it's easier to use a simple program that does an adequate job than a complex program that does a perfect job.

The second is that it's far too difficult to work out how to do... well frankly, just about anything. Just about every mature application package has that problem, and it applies "in spades" to open-source projects where there isn't a single whipper-in who can dictate that for the next six months all effort will be turned towards documentation. In principle AI- "spicy pattern matching"- should be able to help with that.

IBM lost out to DEC, DEC lost out to CP/M and PC-DOS. ALGOL-68 lost out to Pascal and C. C's losing out to Rust, Pascal's losing out to Python. And I recently passed over a piece of antenna-design software (that needs a PhD to use) in favour of 1970s abandonware.

If users can't find out succinctly how to get the prevalent product to do a job, they'll use something simpler. It affects FreeCAD, and it affects us.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Logitech, TopSpeed & FTL Modula-2 on bare metal (Z80, '286 protected mode).
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

CM630

  • Hero Member
  • *****
  • Posts: 1197
  • Не съм сигурен, че те разбирам.
    • http://sourceforge.net/u/cm630/profile/
Re: A proposal for an app - Electrical Circuit Simulator
« Reply #14 on: November 16, 2024, 01:47:48 pm »

... However, the program mentioned by CM630 (i.e. ekts) from the descriptions and screenshots resembles an electrical installation simulator, designed for people dealing with power and electrical equipment - not electronics! It looks like its author tried to create a program where:
  • the user draws a wiring diagram using: engines, transmission lines, switches, contactors, fuses, etc., where high voltages and very large currents occur,
  • the user enters operating parameters of individual devices and installations,
  • the program performs calculations and then shows how the designed installation will behave.
This is quite an ambitious engineering project. What you write is an illusion, that a database and element symbols are enough. This is only the external part of this program, a graphical editor. In order for it to be useful, you need to implement a set of classes performing complex calculations in order to simulate the operation of such an industrial high-power circuit. And this is no longer such a trivial task. However, it is true that implementing it takes a lot of time....

Yes, that is the idea.
And it is something much - much different than PSpice, LTSpice, etc. I think it should be much simpler, and much easier (as I mentioned, it was made as a diploma work in an University, I suppose it was made in 3-4 monts of university life).
I think it is rather binary calculations, than float. There is voltage- the circuit relay is on, the lamb is lit, etc. When there is no voltage - the relay is off, the bulb is off...
Indeed, there are 3 phases, but if they mix, there shall be rather a warning than a calculation.
A ready device should look like this:
No resistors, capacitors, definitely no semiconductors, except some lightning protector, which could be drawn, but not calculated. No transient processes.


As an electrical engineer, I will note that EKTS is an excellent program (I used it once to test circuits), but it is very bad that you cannot make a project in it, you can draw and simulate simple relay logic, but this is not suitable for the release of project documentation

Indeed, I like it, too. But I have come to a case when it did not detect a short circuit or something like that (it was a long time ago).
« Last Edit: November 16, 2024, 01:52:54 pm by CM630 »
Лазар 4,0RC1 32 bit (sometimes 64 bit); FPC3,2,2

 

TinyPortal © 2005-2018