LLM Circuit Analysis #241
Replies: 10 comments 22 replies
-
|
Shane, I sent you a LinkedIn request. |
Beta Was this translation helpful? Give feedback.
-
|
Hello! I've recently been working a little on getting ChatGPT o4 to output circuit schematics in SKiDL. I have been working with electronics and PCBs for a while and then started doing it for work. My hobby is building modular synthesizers, and I've been asking ChatGPT for completely original ideas or variations of modules using new math and concepts. It's quite fun even just to read. ChatGPT typically offers to share a schematic with me and occasionally I accept. The results have always been, and still are, quite terrible. A low detail block diagram with a couple of lines maybe pointing in the right directions.... Until yesterday when I saw it attempting to use SKiDL. It didn't have the library installed in its built in interpreter, but I installed it locally and fell into the rabbit hole. I noticed that we can use KiCAD projects and convert them to SKiDL. That gives us a great path forward in training any AI, or LLM in particular, to be able to build functioning circuits. I'm rather sad that KiCAD removed the ability to import net lists into the schematic editor, so we'll have to either try to get that functionality in SKiDL updated (generate_schematic), or just go straight to board layouts. Either is ok, I suppose, since the SKiDL file IS a schematic already.. just one that isn't as easy to read with human eyes. I've found that ChatGPT needs a lot of hand holding and pushing from behind to build a functioning circuit. In its first attempt, it placed a couple of ICs and half a dozen resistors, but nothing else. Power seemed to be correctly hooked up, but an opamp with no capacitors is not going to work at all. I'll be continuing to experiment, and I'll share my results as things improve. I'm a self taught programmer, and I can do most things that I need doing (mostly embedded), and I'm alright with reading, editing, some light debugging, but deep object oriented stuff I'm still quite amateurish with. I'll help where I can, but don't be too surprised if I end up in over my head sometimes. I find SKiDL is similar in nature to OpenSCAD, so I think I'll pick it up rather quickly. |
Beta Was this translation helpful? Give feedback.
-
|
Hello all, recently I came across this library and I decided to investigate the letterature regarding netlist generation by LLMs. Bests to all, |
Beta Was this translation helpful? Give feedback.
-
|
@eugenio You might want to try Google Cloud Platform for this. They offer 300USD worth of free credits and you can get a L4 GPU which has 24GB VRAM. I did the same for fine tuning a LLM using unsloth QLoRA. You can find the fine tuning script for reference in my repo: transqlate |
Beta Was this translation helpful? Give feedback.
-
|
Your implementation of the agentic circuit generation: I believe you call
it Circuitron?
Il giorno gio 10 lug 2025 alle ore 17:57 Shaurya Sethi <
***@***.***> ha scritto:
… My implementation of?
—
Reply to this email directly, view it on GitHub
<#241 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AACHMZE32HQCXNPNUSYDVIT3H2ENHAVCNFSM6AAAAABUUH3ENSVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTGNZSGI2TMMQ>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
|
That's great. If I understood correctly from above, you are lamenting the
lack of material on which to train your model, correct?
Il giorno gio 10 lug 2025 alle ore 18:05 Shaurya Sethi <
***@***.***> ha scritto:
… ohh okay. Yeah Its still in development - Having some trouble lately with
getting my agents to correctly write SKiDL code but I'll get it working
soon and let everyone know here. Hopefully it takes off and the community
can make it better as time moves on.
—
Reply to this email directly, view it on GitHub
<#241 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AACHMZHYJKLFDIC2OW5KNEL3H2FMLAVCNFSM6AAAAABUUH3ENSVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTGNZSGI3DIOI>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
|
Ok, thanks for the clarification.
I took the liberty of cloning your Circuityron repo and modifying it to
work with my local fine-tuned model. I'll let you know how it goes!
Thanks again for your help!
Il giorno gio 10 lug 2025 alle ore 18:11 Shaurya Sethi <
***@***.***> ha scritto:
… I'm not taking the fine tuning/training approach at all. I am building an
agentic system where specialised agents work sequentially and utilise
custom tools and MCP to programmatically generate kicad schematics and pcb
layouts using the SKiDL library.
—
Reply to this email directly, view it on GitHub
<#241 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AACHMZGNUEM4MHR3KF436WL3H2GDZAVCNFSM6AAAAABUUH3ENSVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTGNZSGI3TEMA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
|
Thanks, I'll check it out!
Il giorno gio 10 lug 2025 alle ore 18:32 Shaurya Sethi <
***@***.***> ha scritto:
… I'm not sure if it will work with your current set up since the framework
I am using is OpenAI Agents SDK. If you still wish to take a look, the main
branch is outdated - view refactor/kg-validation.
—
Reply to this email directly, view it on GitHub
<#241 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AACHMZDDJHCJUY7LOPUUBQD3H2IS7AVCNFSM6AAAAABUUH3ENSVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTGNZSGI4DSMY>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
|
Wow, there's a lot of stuff in circuitron! I'm going to read through it and see how I can better support things like that in SKiDL. Let me know your suggestions. I'm excited by all these efforts to insert AI! One thing I'm doing is to use the docstring for a with Group(purpose='VCC power supply decoupling')):
for _ in range(10):
c = Part('Device', 'C', value='0.1uF', purpose='Decoupling cap')
VCC & c & GND # Attach cap between power and ground.Hopefully, this would help guide an AI-assisted circuit reviewer in understanding the circuit. With regards to schematics and KiCad V5 versus more modern versions, I would avoid dependence upon generating schematics. As I've said before, my code doesn't output very nice-looking schematics and often fails to generate a correctly-routed schematic at all. My naive notion of AI-assisted circuit designing looks like this: flowchart LR
A[AI Circuit Generator] --> B[(SKiDL Code)] --> C[Python] --> D[(netlist)] --> E[PCBNEW]
B --> F[AI Design Reviewer] --> G[(Review)]
I think we can pack everything into the netlist file that PCBNEW needs to layout a PCB. There doesn't appear to be a need for a schematic (especially an editable schematic which leads to a whole lot of issues). And this allows the use of KiCad 6, 7, 8, 9, 10, ... However, schematics can be helpful for feedback and understanding by the designers and downstream consumers of the design. For that reason, generating a static schematic in SVG might be a good idea: flowchart LR
A[AI Circuit Generator] --> B[(SKiDL Code)] --> C[Python] --> D[(netlist)] --> E[PCBNEW]
C -.-> H[(Static SVG Schematic)]
B --> F[AI Design Reviewer] --> G[(Review)]
The SVG schematics could be output by the existing schematic generation code, but I'd need to improve that code to fix the existing problems it has. That's not something I'm planning to do soon. With regards to examples for training the AI, the flowchart LR
A[(KiCad netlist file)] --> B[netlist_to_skidl] --> C1[(SKiDL file 1)]
B --> C2[(Skidl File 2)]
B --> C3[(Skidl File 3)]
C1 --> C2
C1 --> C3
|
Beta Was this translation helpful? Give feedback.
-
|
I started working on the KiCad-python APIs to add functionality for the addition of components, symbols, and values in Eeschema, the schematic editor of KiCad. I also added the missing classes and methods for the APIs in Kicad's sources, and it compiles correctly. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I opened up #239 but I'm posting here for visibility.
I've been using LLM's to check my circuit theory and help with circuit design and PCB design in general. I thought SKiDL's python based circuit descriptions would work great with LLM's. So far the results seem to be promising, but it's clear that I need to include more information on each subcircuit, part, and connections for the LLM to give better analysis.
Here's an example output analysis file:
subcircuits_analysis.txt
Which was generated from running this code:
Beta Was this translation helpful? Give feedback.
All reactions