Kicad AI Integration (Artificial Intelligence)

Do Kicad developers have any work on this?

For example, an AI-supported chatbot that could help with a schematic, maybe make suggestions, maybe make suggestions on the PCB layout section would be nice. I am throwing in other creative ideas and challenges on this subject.

Do you have any ideas on this subject? At least suggestions that would be possible in practice?

I was actually thinking about what ideas could come up on this subject, maybe it could inspire designers and developers.

Maybe there are works on this subject, you can leave a link that we can follow…

Also i found this video ; https://www.youtube.com/watch?v=Rf-sYoMxoto&t=3s

You don’t really want to have an AI system integrated into a program. What you want is to have any AI system integrated to your programs. Why, it is much better suited to be a generic tool. It is much better served to be used as a assistant across your applications. But also because this is bleeding edge stuff, AI that is passable today will be lame in a a few weeks or so.

Now the reason you currently seem to want this is that there is no implementation where the AI chatbot can directly enter the data into your tool. You don’t really want a chat bot that tells you how to do chore after all, you want it to do the chore for you. All you really need is a interface designed for the AI to do the chores instead.

The AI is much better if its allowed to work on several software simultaneously

That stuff isn’t AI, it’s LLMs which are marketed as AI but aren’t intelligent in the slightest.

It’s technically far more complex to implement than the internet obfuscates.

For a local LLM, you need a lot of system memory to host the model, as well as a larger modern GPU to run it. This limits who can use it greatly amongst KiCad’s user base.

For a server hosted / cloud LLM, you are looking at significant expenses to host it which is not something the KiCad project can afford.

Do Kicad developers have any work on this?

No, this is very specialized work which none of us have interest in as it would require significant time investment of our already limited personal free time.

On top of it, it needs significant amounts of training data for PCBs which doesn’t just exist on the internet in good quality. Most professional designs are closed source as they are all commerical and the money is in the IP. The stuff floating around that other “AI PCB tools” steal is from github and the quality is all over the place.

1 Like

Except for those vendors who are pushing their customers to store everything in the cloud. Check your click through agreements.

There is a website that uses AI for AOI. It is a paid service, and they get send many gigabytes of pictures of PCB’s daily.

AI  = Artificial Intelligense
AOI = Automated Optical Inspection.

They also have a manual on their site for how to create usable pictures with a relatively affordable camera (EUR 1000 compared to EUR 30000 or more for a complete AOI system).

I think it takes all pictures from above, with some extra focus on lighting to remove shadows.
I wonder how long it will take them to realize they can take a picture from 4 sides just by slanting the camera and putting the PCB on a rotary platform. Simple ideas like that have often been patented. Quite ridiculous, and why I dislike the current patent system, but that is another topic altogether.

I once thought about what AI should do for me. And it is mostly the repetive work. But I could think of some complex tasks

When I start a new project, I would like to tell AI which of my schematic sheets it needs to pull from my library and insert the sheets with their content. And the automated placing of the sheet pins.

I would like to let it dig up a vendor ID code and set the symbol’s footprint and vendor ID properties for me.

Creation of symbol and/or footprint libraries for things like connectors. Or an E12 range of resistors…

For board designing I’d like to let it autoroute, but just one thing at the time on my command.

I also thought of duplicating layouts and placing the footprints, but the current plugins are propably faster to use than to type, “duplicate these components, make groups of them and place them with a 5.08mm distance in X direction”.

Popping ground via’s at all the logical positions.

And specific for me, I would like it to set LED locations using a certain polygon as source.

And: “fix the annotation mess I made.” for that one time a year, you mess something up :stuck_out_tongue:

Give suggestions of component placing. Or let it do component placing (and routing) for you.

If would be cool if it could create a perfect buck converter for you using only components from your vendor and setting all properties and stuff accordingly.

And this command: Do DRC on this board, fix whatever problem it tosses and show me what you did

And than in 20 years we are so dependend that we no longer know how to make a PCB without it :smiley:

At which point you would be laid off and free to get a harder to automate job such as refuse collection

1 Like

There was some talk about this on the forum last year and it referenced the very same video: AI (Artificial Intelligence)

Applying AI to KiCad is probably best done right now using external scripts applied to KiCad files, or within a plugin running in PCBNEW. Integrating into KiCad itself would probably exceed the bandwidth of the dev crew while slowing the introduction of more commonly-desired features.

AI doesn’t require the use of LLMs with multi-billions of parameters. Protein folding was solved using neural nets 1000x smaller than LLMs. And even if you did need a large LLM, the costs for running them have dropped precipitously over the past few years.

You also don’t need a lot of (or even any) training examples. You just need a way to evaluate the quality of the result. This was done with AlphaZero that trained itself to play Go by evaluating the results of its moves. You would need to build a function that would evaluate a PCB or circuit, and then you could use that to train an AI system. This is not trivial, but it gets around the paucity of high-quality PCB examples.

There are a few companies trying to apply AI to circuit design: JitX, Quilter.

1 Like

Exactly, AI is the buzword at the moment due to LLM but this is one face of “AI”. Neural nets and genetic algorithm are what is more useful for this type of work and these have been research for decades - I have a basic weighted neural network for some of my converter sizing

I have one too.

Gross Anatomy

The adult human brain weighs on average about 1.2–1.4 kg (2.6–3.1 lb)

KiCad does have an extremely simple “autorouter”, with the f key that finishes a track to the nearest pad. It is quite useful. With one hand on the mouse and the other on x and f you can quickly draw tracks while keeping the PCB editor zoomed in on the starting point. The finish point can be off screen. This can save quite a lot of panning and zooming.

I also mentioned this in An alternative freerouting plugin Freerouting is not a particularly powerful autorouter, and it’s biggest problem is that it tries to do everything at once, and then makes a mess so big that cleaning it up is more work then manual routing in the first place. I already noticed this when using Specctra with Ultiboard 35 years ago. And now, finally others are beginning to realize that using some form of “guided routing” in which the autorouter is given little pieces at a time, can combine the efficiency and speed of an autorouter with a biological neural network for the intelligence.

As of yet, I don’t have much trust in AI. There are also already concerns for lack of “training data” and that they start recycling their own output. Can you imagine a child growing up sitting behind a PC and without real human interaction?

This is already (partially) the case on some elementary schools nowadays.

I found that chatGPT is not really good in schematics or elektronics. I once showed it 3 resistors of which 2 where in parallel. It could not even calculate the correct total resistance value.

It is however quite good in producing code such as pyhton scripts. I think that is the most viable use for AI at this time, make pyhton scripts for usage in KiCad.

Bas

Sadly true…https://www.nytimes.com/2024/04/10/opinion/schools-technology.html

Back on topic, no matter how much AI technology has advanced, I would never trust the recommendations of an AI chat-bot. What does he know about my application, design constraints, datasheet suggestions, needed compliance, cost-effectiveness, etc., etc.? Would I have to tell it before? Oh my God, it’s not worth it…

1 Like

I gave Claude the following drawing:

resistor_network

Then I asked for it to show me how to calculate the total resistance:

I'd be happy to calculate the resistance between terminals A and B and show you the process step-by-step.

Step 1: Analyze the circuit
We have a 5Ω resistor in series with a parallel combination of two 10Ω resistors.

Step 2: Calculate the equivalent resistance of the parallel portion
For resistors in parallel, we use the formula:
1/Req = 1/R1 + 1/R2

In this case:
1/Req = 1/10Ω + 1/10Ω = 2/10Ω = 1/5Ω

Req (parallel) = 5Ω

Step 3: Add the series resistance
Now we have 5Ω (from the original series resistor) + 5Ω (from the parallel combination).

Total resistance = 5Ω + 5Ω = 10Ω

Therefore, the total resistance between terminals A and B is 10Ω.

This method demonstrates how to simplify a series-parallel circuit by first resolving parallel components and then adding series components to get the total resistance.

Would you like me to explain any part of this calculation in more detail?

I don’t consider this a “practical” application of AI, but it illustrates that what was once impossible is now easy. An increase in the size of the context window is also allowing LLMs to process large documents like IPC standards and component datasheets, so an automated design assistant is getting closer to reality.

1 Like

Yeah LLM’s are great at doing high school/bachelor level stuff solutions. So something that has ample number of examples around. The problem is that they frequently cap out at a bit of convolution to problem. Also surprisingly they often don’t know how to calculate simple arithmetic, because they are language models and maths is at odds in certain language cases.

Funniest one i saw was guy asked a LLM to make G-code for a radial pattern. And the LLM got the numbers wrong, but when asked to explain how to do the calculations correctly. So essentially failed at using a calculator.

Anyway we seriously need a standard AI interface so that i can let my AI see my screen and give it access to my software’s API in some undo proof context. This way i can instruct my AI to work across my software.

But makes you wonder how the next generation of students are going to get through school to get to do stuff.

Yeah, kids today can’t even make a decent bowstring from dried bison gut.

I showed chatGPT a kicad schematic with same resistors (different values) like 2 weeks ago => wrong anwser.

gemini got it https://g.co/gemini/share/b6b26ae48a9d

I might pull up some of my control theory just to push it

I have a T-shirt from around 2002 that reads “Go .com yourself”. Eventually Internet commerce did succeed but with realistic expectations. I think there’ll be some “Go AI yourself” T-shirts when shareholders start questioning the insane spends and some of the extravagant expectations are dropped.

I gave it a try with chat gpt using the picture above, it seem to work fine:

To calculate the equivalent resistance of the circuit shown in the image, let’s break down the components step by step:

  1. Identify the configuration of the resistors:
  • The circuit has a 5 Ω5 , \Omega5Ω resistor in series with a parallel combination of two 10 Ω10 , \Omega10Ω resistors.
  1. Calculate the equivalent resistance of the parallel resistors:
  • The two 10 Ω10 , \Omega10Ω resistors are in parallel. The formula for the equivalent resistance RpR_pRp​ of two resistors in parallel R1R_1R1​ and R2R_2R2​ is: 1Rp=1R1+1R2\frac{1}{R_p} = \frac{1}{R_1} + \frac{1}{R_2}Rp​1​=R1​1​+R2​1​ Substituting the values: 1Rp=110 Ω+110 Ω\frac{1}{R_p} = \frac{1}{10 , \Omega} + \frac{1}{10 , \Omega}Rp​1​=10Ω1​+10Ω1​ 1Rp=110+110=210=15\frac{1}{R_p} = \frac{1}{10} + \frac{1}{10} = \frac{2}{10} = \frac{1}{5}Rp​1​=101​+101​=102​=51​ Therefore: Rp=5 ΩR_p = 5 , \OmegaRp​=5Ω
  1. Add the series resistor:
  • Now that we have the equivalent resistance of the parallel combination Rp=5 ΩR_p = 5 , \OmegaRp​=5Ω, we add the 5 Ω5 , \Omega5Ω resistor that is in series with it: Rtotal=5 Ω+5 Ω=10 ΩR_{total} = 5 , \Omega + 5 , \Omega = 10 , \OmegaRtotal​=5Ω+5Ω=10Ω

Final Result: The total resistance between points A and B in the circuit is 10 Ω10 , \Omega10Ω.

I’d actually like to see the weighted neural net you’re using for converter sizing.