Out of curiosity, I redrew the Supercon Vectorscope badge schematics in KiCad last year. As you might suspect, going from PCB to schematic is opposite to the normal design flow of KiCad and most other PCB design tools. As a result, the schematics and PCB of the Vectorscope project were not really linked. I decided to try it again this year, but with the added goal of making a complete KiCad project. As usual, [Voja] provided a well drawn schematic diagram in PDF and CorelDRAW formats, and a PCB design using Altium’s Circuit Maker format (CSPcbDoc file). And for reference, this year I’m using KiCad v8 versus v7 last year.
Importing into KiCad
This went smoothly. KiCad imports Altium files, as I discovered last year. Converting the graphic lines to traces was easier than before, since the graphical lines are deleted in the conversion process. There was a file organizational quirk, however. I made a new, empty project and imported the Circuit Maker PCB file. It wasn’t obvious at first, but the importing action didn’t make use the new project I had just made. Instead, it created a completely new project in the directory holding the imported Circuit Maker file. This caused a lot of head scratching when I was editing the symbol and footprint library table files, and couldn’t figure out why my edits weren’t being seen by KiCad. I’m not sure what the logic of this is, was an easy fix once you know what’s going on. I simply copied everything from the imported project and pasted it in my new, empty project.
While hardly necessary for this design, you can also import graphics into a KiCad schematic in a similar manner to the PCB editor. First, convert the CorelDRAW file into DXF or SVG — I used InkScape to make an SVG. Next do Import -> Graphics
in the Kicad schematic editor. However, you immediately realize that, unlike the PCB editor, the schematic editor doesn’t have any concept of drawing layers. As a work around, you can instead import graphics into a new symbol, and place this symbol on a blank page. I’m not sure how helpful this would be in tracing out schematics in a real world scenario, since I just drew mine from scratch. But it’s worth trying if you have complex schematics.
Note: this didn’t work perfectly, however. For some reason, the text doesn’t survive being imported into KiCad. I attribute this to my poor InkScape skills rather than a shortcoming in KiCad or CorelDRAW. Despite having no text, I put this symbol on its own page in sheet two of the schematic, just for reference to see how it can be done.
Just like last year, the footprints in the Circuit Maker PCB file were imported into KiCad in a seemingly random manner. Some footprints import as expected. Others are imported such that each individual pad is a standalone footprint. This didn’t cause me any problems, since I made all new footprints by modifying standard KiCad ones. But if you wanted to save such a footprint-per-pad part into a single KiCad footprint, it would take a bit more effort to get right.
Recreating Schematics and Parts
After redrawing the schematics, I focused on getting the part footprints sorted out. I did them methodically one by one. The process went as follows for each part:
- Start with the equivalent footprint from a KiCad library
- Duplicate it into a local project library
- Add the text SAO to the footprint name to avoid confusion.
- Position and align the part on the PCB atop the imported footprint
- Note and adjust for any differences — pad size and/or shape, etc.
- Update the part in the project library
- Attach it to the schematic symbols in the usual manner.
- Delete the imported original footprint (can be tricky to select)
Some parts were more interesting than others. For example, the six SAO connectors are placed at various non-obvious angles around the perimeter. I see that [Voja] slipped up once — the angle between connectors 4 and 5 is at a definitely non-oddball angle of 60 degrees.
SAO Angle Difference
#1 326 102 6->1
#2 8 42 1->2
#3 61 53 2->3
#4 118 57 3->4
#5 178 60 4->5
#6 224 46 5->6
With all this complete, the PCB artwork consists of all new footprints but uses the original traces. I needed to tweak a few traces here and there, but hopefully without detracting too much from [Voja]’s style. Speaking of style, for those interested in giving that free-hand look to hand-routed tracks in KiCad, check the options in the Interactive Router Settings
menu. Choose the Highlight collisions / Free angle mode
and set the PCB grid to a very small value. Free sketch away.
Glitches
I used two photos of the actual board to check when something wasn’t clear. One such puzzle was the 3-pad SMT solder ball jumper. This was shown on the schematic and on the fully assembled PCB, but it was not in the Circuit Maker design files. I assumed that the schematics and photos were the truth, and the PCB artwork was a previous revision. There is a chance that I got it backwards, but it’s an easy to fix if so. Adding the missing jumper took a bit of guesswork regarding the new and adjusted traces, because they were hard to see and/or underneath parts in the photo. This redrawn design may differ slightly in appearance but not in functionality.
DRC checks took a little more iterating than usual, and at one point I did something to break the edge cuts layer. The irregular features on this PCB didn’t help matters, but I eventually got everything cleaned up.
I had some trouble sometimes assigning nets to the traces. If I was lucky, putting the KiCad footprint on top of the traces assigned them their net names. Other times, I had traces which I had to manually assign to a net. This operation seemed to work sporatically, and I couldn’t figure out why. I was missing a mode that I remember from another decade in a PCB tool, maybe PCAD?, where you would first click on a net. Then you just clicked on any number of other items to stitch them into the net. In KiCad it is not that simple, but understandable given the less-frequent need for this functionality.
You may notice the thru hole leads on the 3D render are way too long. Manufacturers provide 3D files describing the part as they are shipped, which reasonably includes the long leads. They are only trimmed at installation. The virtual technician inside KiCad’s 3D viewer works at inhuman speeds, but has had limited training. She can install or remove all through hold or SMT parts on the board, in the blink of an eye. She can reposition eight lamps and change the background color in mere seconds. These are tasks that would occupy a human technician for hours. But she doesn’t know how to trim the leads off of thru hole parts. Maybe that will come in future versions.
Project Libraries
I like to extract all symbols, part footprints, and 3D files into separate project libraries when the design wraps up. KiCad experts will point out that for several versions now this is not necessary. All (or most) of this information is now stored in the design files, alghouth with one exception — the 3D files. Even so, I still feel safer making these project libraries, probably because I understand the process.
KiCad can now do this with a built-in function. See the Export -> Symbols to New Library
and Export -> Footprints to New Library
in the schematic and PCB editors, respectively. These actions give you the option to additionally change all references in the design to use this new library. This didn’t work completely for me, for reasons unclear. Eventually I just manually edited the sch and pcb file and fixed the library names with a search and replace operation.
Hint: When configuring project libraries in KiCad, I always give them a nickname that begins with a dot. For example,
.badge24
or.stumbler
. This always puts project libraries at the top of the long list of libraries, and it makes it easier to do manual search and replaces in the design files if needed.
What about 3D files, you say? That isn’t built into KiCad, but have no fear. [Mitja Nemec] has you covered with the Archive 3D Models KiCad plugin. It was trivial to activate and use in KiCad’s Plugin and Content Manager
.
All Done
In the end, the design passed all DRCs, and I could run Update PCB from Schematic...
without errors. I went out on a limb and immediately placed an order for five PCBs, hoping I hadn’t overlooked something. But it’s only US$9.00 risk. They are on the way from China as I type this.
All the files can be found in this GitHub repo. If you find any errors, raise an issue there. I have not done this procedure for any of the SAO petals, but when I do, I will place a link in the repository.
Page Break, Please?
Nah, just use a computer to view the page.
nice write-up. may i suggest a screendump of the directory hierarchy to show what the importer did. after several re-readings i still cannot visualize it.
Hmm. The circuit maker file was off in a completely different repo, the one I cloned from the Hackaday badge design GitHub. I created an independent project directory and repo for the redrawn schematic.
After making a new blank KiCad project in the new repo, I imported the circuit maker file. What KiCad did behind the scenes was create a whole new KiCad project over in the Hackaday repo, in the same directory as the circuit maker file I was importing. But it wasn’t obvious to me that I was now working in the wrong place. Once I figured out what was going on, I just copy / pasted the whole PCB from the errant KiCad project into the new one.
Oh, my, it’s refreshing to see a schematic that actually shows connections and logical flow between components. The modern fetish of creating little dismembered circuit blocks connected only by net names is… unhelpful when trying to understand how a circuit works.
Yeah, this always made me think about the ‘graphical design of circuit diagrams’ fetish: if your circuit diagram is just a bunch of disconnected blocks, why even bother with the graphical symbols? They are actually less useful than a textual, declarative schematic description, where at least the netlist connectivity is made explicit, e.g.
U1-rp2040.pin1 : VCC3.3
U1-rp2040.pin2 : R1.2 : J1.1
U1-rp2040.GND : GND
R1.2 : GND
Those disconnected circuit diagrams can’t even be used without a computer, because a search is required to determine connectivity.
Paul, I forgot to link last year’s article. Here is it. There is a discussion there about this topic — schematic styles.
https://hackaday.com/2023/11/13/vectorscope-kicad-redrawing-project/
I suppose the skill is using function blocks in a clear and readable way.
Using function blocks semi randomly spread out doesn’t help. Oth having a spider web of wires isn’t usefull either. A combination surely could win, at the cost of effort and space?
In general, I use labels for power, which is easy to keep track of (just a couple of voltages and maybe two grounds). If a chip has many inputs (I am working with something that requires five different wires to the MCU), I use labels between that and the MCU, but you can see the flow between the sensor, the op amps, etc.
Something I am not completely happy with is how to handle decoupling capacitors for a specific op amp. Right now they live in their own island.
KiCad has:
Schematic Editor / Place / Add Image and this is quite useful. I have used it to import a .JPG file from a hand drawn schematic into the schematic editor. Then you can scale it to approximately the KiCad size, and draw real symbols and wires over it. This is useful in speeding up schematic entry, and lowering the error rate.
If the original schematic is badly drawn, then it is of course less useful. First going to a pixel program, and shoving some blocks around may help in that case, depending of course on how badly it was drawn.
Looking at the official Supercon badge, that three-position jumper you mention isn’t in the final version. It looks like all the SAO ports are on the switched power supply, as they de-energize when the switch is turned off.
That jumper was a bit of a hassle, and got removed in the final revision.
It was a cool feature, but it added complexity, and I think that you can get the same functionality out of the power pins that were also broken out. (But then you have to be sure that you’re not charging the batteries…)