A lot of errors on Update Schematic from PCB

Is there any CAD tool out there which can create a schematic from a pcb? It sounds like it would be somewhat useful but I would think that the uses for it would be much more limited than for the usual workflow.

PCBs are laid out based on assembly and performance considerations, while schematics are mostly laid out according to our brains and our understanding. My guess is that if software could draw a schematic based upon a pcb layout, the schematic layout would be miserably confusing. :grimacing:

I think programs like Fritzing can do this (or at least create a schematic from a breadboard layout). But as I recall from the few times I played around with it (before realizing that creating new components was ridiculously obtuse) the resulting automatic schematic was only a starting point and needed serious cleanup. In order for a schematic to be able to be autogenerated from a PCB, there would need to be some sort of autorouter in the schematic to take the netlist and draw lines. This functionality isn’t in KiCad and hasn’t been since I started using KiCad back in the v3 “bad old days”.

It’s pretty much the result of your own action.
The biggest problem here is that you started with a project that has far to many parts, without knowing how KiCad works. That means that after you’ve placed 150 LED’s wrong, you have to correct it 150 times, and similar for the 48 resistors.

KiCad has a “Replicate Layout” plugin that can help here, and there also is an array plugin. I think that by combining these, this PCB can be designed quite quickly, but figurering out how to do so efficiently is not so easy.

I have some spare time though, and I’ve been curious about the array tool plugin, so I’m now experimenting a bit with this…

1 Like

No, not really.
KiCad-nightly V6.99 has very recently gotten the ability to load background images in the PCB Editor, and this is a quite useful reverse-engineering tool.

I would already be quite happy if there was a way to attach schematic symbols to footprints, and then draw ratsnest lines in the schematic. So pretty much the reverse process of how it works now.

1 Like

I have never tried it but may be if you draw a schematic being right equivalent of your PCB and when Update PCB from schematic you select ‘Re associate footprints by reference’ (it is the text form V5, may be in V6 is little different) than may be you will have to do nothing at your PCB.

It doesn’t work because the footprints haven’t been annotated. There’s no way to reannotate REF** footprints, even Geographical Reannotation doesn’t do that. It’s logical because the footprints don’t have information about the reference designator letter which would be needed for reannotation.

Can you annotate them manually (one by one)?
But even so it is probably more work the just design PCB once more.

I wanted to get some more experience with array tools in KiCad, so I tikered a bit with your project.
At the moment it is pretty much in a working state, although it’s not exactly in a state I would call “finished”.

2022-07-26_KiCad_FirstTestProject.zip (224.8 KB)

I noticed this also, and found it a bit annoying.
I do not find it logical. I’ve tried various things with the array tools, but it’s either quite buggy, unlogical, or it’s my own mind that turns it into a maze, but in the end I think I drew the whole thing 5 times before I found a method that worked quite well. I’ve used various tools. I could not do anything useful with the “Place Footprints” plugin, but when I discovered that KiCad’s own array tool worked reasonably good I abandoned the plugin. I also used the Replicate Layout plugin, and that one worked quite good.

I placed almost all footprints with combinations of arrays and the Replicate Layout plugin. I also added some measurements. Because the PCB was designed in mils, I also kept that, even for the mounting holes, (I much prefer millimeters myself, but it’s not my PCB. Also most tracks were draw by a combination of simple arrays and the replicate Layout plugin. Because I redrew the whole PCB a few times, some things may have shifted a bit, but I did try to put all the LED’s back in the same locations.

I could not be bothered to draw the return path, so I just thew in a zone for that. I did keep the PCB single sided, that may be nice for home-etching, but if you order PCB’s online then you may as well make it a double sided PCB.

I also added some mounting holes. They’re easy to delete if you don’t want them :slight_smile:

I also noted you removed a lot of the layers in the board setup. That is not a very good idea. You easily loose track of things (especially on more complicated PCB’s) if you do that. For the next time, just turn them off in the Appearance Manager (That is the big thing on the right with 3 tab pages).

1 Like

Yes, it’s possible manually, and

A python script could be handy here. It would need to ask the user a new refdes letter for each footprint ID. Or it could work on selected footprints and ask for the letter.

I’m not sure if you mean the fact that REF** can’t be reannotated at once. But it’s logical. The footprints in libraries don’t have any information about the possible reference designator letter, that information is in the symbols. Because there are no symbols here, they can’t be reannotated with the standard letters. There would be two options I mentioned above, and neither of them can be done without some new UI. Geographical reannotation can’t guess the letter.

I am aware that the the function is called “Geographical Re annotate” and that when footprints are placed directly on the PCB, there is no schematic link whatsoever.

However, that does not mean I find this behavior logical.
What is the use of creating an array of Footprints on a PCB if they can not be annotated?

Weirdly, I am also seeing different behavior between the posted KiCad_FirstTestProject and another project I created (called asdf_Array)

In the project posted by Arthur_Khusnutdinov I can not assign any numbers with PCB Editor / tools / Geographical Reannotate, but I can do it in my asdf_Array test project.

Below is a screenshot of a block of 15 resistors:
image

I created this with:

  1. PCB Editor / Place / Add Footprint
  2. Select it and: [Right Click] / Special Tools / Create Array
  3. Select whole array PCB Editor / Toools / Geographical Reannotate

I just can’t get rid of the asterisks this way.
If I first just place a single resistor and rename the RefDes to R1:
image

Then I can easily create a 3 by 3 array of “R1’s”:
image

And then use the Geographical Reannotate function to give them consecutive numbers:
image

After that I can put a bunch of resistors on the schematic and annotate them:

And then use the normal: Schematic Editor / Tools / Update PCB from Schematic with the Re-Link footprints to schematic symbols based on RefDes option.

Note that in a single update, I updated the 9 resistors already on the PCb from 0805 to 0402 and assigned the values and those resistors keep their orientation. R10, R11 and R12 are new and are thus attached to the cursor after the [F8] update.

This behavior is mostly as I expect it, with two exceptions:

  1. The Geographical Reannoate tool can not get rid of the double asterisks in the RefDes.
  2. In Arthur’s project it does not work at all.

image

1 Like

Hello, @paulvdh!
Whoa!
Your PCB results much better, than mine ))).
I am trying to reproduce a similar result.
Currently I have one row of leds.
KiCad_2ndTestProject_v1.zip (207.3 KB)
I’ve downloaded Replicate Layout from https://github.com/MitjaNemec/Kicad_action_plugins by zip file and placed all files and folders of that zip file to C:\Users\artkh\OneDrive\Documents\KiCad\6.0\scripting\plugins . Now I see that KiCad found that plugin

After I select my row and click on Replicated Layout, I see Exception:
image

I am using KiCad 6.0.6.

I also tried to Duplicate my row on PCB with CTRL+D.
After that row duplicated on PCB, I executed Geo Reannotate and got such output log:
report.txt (10.1 KB)
Update schematic from PCB did not get expected results too:
report2.txt (2.9 KB)

I think you have an old version of the plugin. Remove it and use the Plugin and Content Manager from the KiCad project window. The plugin is there to be installed.

1 Like

Oh, it show window now, thank you.
But! Still doesn’t work :slight_smile:
What I did:
By instructions for that plugin:

After the section for replication (source section) has been laid out (footprints, tracks, text objects and zones placed) you need to:

  1. Place the anchor footprints for the destiantion sections you want to replicate. This defines the position and orientation of replicated sections. You can use PlaceFootprints action plugin for this. - done

  2. Select the same anchor footprint within the source section. - selected one resistor on my PCB

  3. Run the plugin. - it shows window without any hierarchy info. OK button in that windows doesn’t work - when I press that button nothing happens:

  4. Choose which hierarchical level you wish to replicate. - stuck on step 3

  5. Select which sheets you want to replicate (default is all of them)

  6. Select whether you want to replicate also tracks, zones and/or text objects.

  7. Select whether you want to replicate tracks/zones/text which intersect the pivot bounding box or just those contained within the bounding box.

  8. Select whether you want to delete already laid out tracks/zones/text (this is useful when updating an already replicated layout).

  9. Hit OK.

You only have one schematic file in your project. That does not work.
The “Replicate Layout” plugin is dependent on having a Hierarchical schematic. Then you place all the footprints of one of the instances of a schematic file, and the Replicate Layout plugin, then replicates the layout for the other sheets.

Have another look at the project I made, and then study it for as long as needed to understand it.

In the root schematic, I just have some mounting holes, and 6 sheets:

All of those “Column” sheets, use the same schematic file.

The schematic symbols for all the parts (only resistors and LED’s in this case) is of course the same, because it is the same schematic, but depending on what sheet you look at, the RefDes assignments are different. Note that the first screenshot has resistors 1 through 8, and the second screenshot below has resistors 9 through 16.

I have experimented a bit with adding another layer of hierarchy. The Idea was to have a main level with 6 sheets for columns, a second level with 8 sheets of rows, and then on the third level just a single resistor with 3 LEDs. When I did that however, I got into some trouble with the replicate layout plugin and the convoluted brainwaves under my scalp. So I took the easy way out and just copied the resistor with the string of LED’s a few times in the schematic. In hindsight that also seemed the proper way, because else I had too many “reference” parts to place for the replicate plugin to work.

But the important thing is you have to use the hierarchical sheets for the replicate layout plugin. Without a hierarchical schematic it simply does not work.

1 Like

Thank you a lot, Paul!
Now it’s work as expected.
A very interesting project for me.
Live long and prosper :vulcan_salute:

@MitjaN I did an experiment with the project in this thread. I first created a root sheet with 6 “column” hierarchical sheets, and in the column hierarchical sheet I created 8 “row” hierarchical sheets. The Idea was to only draw a single resistor and 3 LED’s, and then let the Replicate Layout plugin do the rest, but it did not seem to work. I’m guessing the Replicate Layout does not support nesting in this way.

Because it did not work, I eventually changed it to a schematic sheet with 8 resistors and 24 LED’s (easy copy & paste) and only used the Replicate Layout plugin for a single “replicate level”.

A few questions:

  • Is this supposed to work?
  • Is it useful enough to pursue at all? (It will mostly be for schematics with lots of repetition, you need a lot of “reference” components, and simply using array functions may be a better approach to similar problems).

It could also be related to this:
Apparently there is a bug where the Replicate Layout plugin does not work correctly with empty schematics.

Thanks for the notice. It looks like at least one of my plugins (Replicate Layout) has issues with hierarchical schematics where some middle/bottom layer does not have any footprints. It is quite likely that Place Footprints plugin also has the same issues.

Though I have somewhere in the back of my mind that I already covered this case sometime in the past. It might have been V5 compatible plugin.

Anyhow, I’ll try to get on it, but it’ll take a while before I start. If anybody manages to prepare a test project and open an issue on GitHub attaching _error.log file, I’d really appreciate it.

And finally answers to you questions:

Yes it should work.

Yes, if for no other reason than to stroke my ego. Replicate Layout has two features which were implemented mostly as I find them challenging. First one is possibility to replicate hierarchical sheet which also contains already replicated hierarchical sheets (Altium speak “room containing more rooms”). Second one is the posibility to replicate on flip side where the source layout is.

@Arthur_Khusnutdinov I’ve just looked at your screen shot in post #17. It looks like you are using a (or trying to use) a plugin version intended for use with KiCad V5.1.x and V5.99. With KiCad V6.0.x you should use plugin version which can be installed via KiCad’s PCM (Plugin and content manager)

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.