This article was kindly sponsored by PCBWay. This tutorial deals with making more than one PCB design on one board, divided by a V-groove, so you can break the boards into different parts. I'll also show you how to make a faceplate for your module.
I'll take the most popular project on my website as an example, the AS3340 VCO and hopefully teach you how to make the PCB's and front panel inside KiCad 9 without the need for any wiring up of potmeters or sockets. So we're going to make a board for all the controls and in- and outputs and one for the actual circuit. I'll also show you how to order the boards on the PCBWay website. I'll have a link for a cool plugin for KiCad that you can download for free and it'll order the boards with just one click of the mouse, right within KiCad itself. More on that further down the article.
Before we continue I want to mention that the method I use here was my own, it's not the only way to do it and I'm not claiming it's the best way to do it. But it worked for me so it'll work for you.
To follow this tutorial you need to be able to draw schematics and make PCB's inside KiCad so you need to have read and mastered the previous tutorial I wrote. We follow on from there.
DRAWING A SCHEMATIC with HIERARCHICAL SHEETS and GLOBAL LABELS
In order to make two PCB's in one go and have them connect together with pinheaders we need to draw each segment of our design separately.
We will make several schematic pages for this. The first will be the Root Page which is sort of the folder that holds all the other drawings. This is the page that normally opens when we click on the schematic symbol. When that page is open you click on the Hierarchical Sheets button which is the 15th button from the top on the right side or you can type 'S' on the keyboard.
Once you selected this tool you left-click on the root page (let go of the mouse button) and drag the mouse diagonally down to make a square and click again. This square represents a new page, you'll see it indicated underneath the Root page on the left. We're going to use this to draw in the main circuit of the VCO. When you click a second time, to finished the square, the Sheet Properties dialog will open.
Under 'Sheet Name' Fill in a name for your schematic, in this case Main Circuit, Underneath sheet name is the 'Sheet File' box. For this, fill in a name under which your schematic will be saved in the project file. I had a bit of trouble in the beginning understanding what I had to fill in here but I now use a name with a page number for this. In this case the project uses the 3340 chip so all my sheet files are named: 3340-1, 3340-2 etc.
Draw an other square on the Root page for the controls and in-/outputs for our VCO and I later added a Triangle to Sinewave converter to this design so I drew a 3rd square for that. The size of these squares doesn't matter. This is what my Root page looked like:
USING GLOBAL LABELS.
You can click on each of these squares and that will open the respective schematic page that square represents.
We're going to start with the main circuit of our VCO. Draw the schematic but leave out any control potmeters, switches and in- or output sockets. Instead of drawing those in we're going to attach a 'Global Label' to represent that specific in- or output or potmeter/switch.
To do this you select the 'Place Global Labels' icon or click CTRL+L
Select it and place a label in your schematic. Now double click on it and the Options pop-up will appear where you can name your label and select whether it's an in- or an output or bi-directional. Always check in your mind how the current flows in your circuit and imagine if the electrons flow out of the circuit or into the circuit. For instance if you attach a label that represents the wiper of a level potmeter, the electrons will flow out of the wiper into the circuit so it's an input.
IMPORTANT: In order to connect elements from different schematic pages together on the PCB, you must always use labels with the exact same name.Also make sure that two differently labelled sections are not in direct contact with eachother otherwise KiCad will select one of the labels to represent the complete net and it won't use the other, which will create problems.
Here is an example of the 3340 VCO main circuit schematic page:
Everything is there except the potmeters, switch, and in- and output socket connections. They all have a Global Label attached to them.
You have to draw in a little section representing the power input, as we learned in the previous tutorial. It doesn't matter on which schematic page you draw it.
In the next schematic page I drew in all the controls, like the potmeters and the octave ground switch and the in- and output sockets and gave them the same labels I used in the main circuit. Here's what my controls schematic page looked like:
When you finished drawing all the controls; the potmeters and sockets and labelled all the connections then you can count how many different labels you have so you know how many pinheaders you will need to connect the two PCB's together. Don't forget you also need to have pins for the power connections from one PCB to the other and for ground.
For the Global Labels that connect to the pinheaders it doesn't really matter if you specify them as inputs or outputs as long as they have the same name as in the main schematic so they will all connect on the PCB.
I put all the different types of controls into their own box which you can draw in with the 'Draw Rectangles' tool and I used the Text tool to give each box a name. This is just to make it look neat and tidy.
PINHEADERS:
Now, you can see in the lower left I drew in two pinheaders to connect the PCB with all the potmeters and sockets to the PCB with the main circuit on it. I had 16 labels in total, representing connections to the main circuit so I choose two 10 pin connectors from the symbols library and I made custom footprints for them with 10 solderpads each at 2.54mm distance from eachother. I choose one male and one female row of pinheaders and drew the lines to connect them together and then I drew in the vertical lines to connect the Global Labels to each if the pins. Before adding the labels I copied and pasted it so I had two of these pinheader arrangements, One for the left side of the PCB and one for the right side giving me 20 connection points.
I also added extra ground connection pinheaders which you can see in the lower right box. I added these for two reasons: to make sure the ground connections were solid and as structural reinforcement for the PCB connections. You need to check where on your PCB any force is applied by pushing in connectors or with a screwdriver when tuning the VCO and these points must have some pinheaders underneath them so they don't bend when you apply force to put in a power cable or tune the VCO. One 3 pin pinheader in each of the four corners would be the perfect solution but I didn't have space for that. But my extra pinheaders worked out fine.
You can also put the labels straight to the pinheaders without drawing lines between them but I thought this would be a bit more logical to follow for beginners. Remember, I'm a beginner too at this and this was the first time I made a multi board design in KiCad. So we're learning together how to do this.
Professional multi layered schematics look much more streamlined but also more complicated so I present it to you as I learned it myself. We will become better at this with experience.
Before continuing, run the Electrical Rules Checker and make sure you get two green zero's showing all is good with your schematics.
DESIGNING THE PCB's.
Now that all schematics are drawn and properly labelled, we can go on to making the PCB designs.
I won't go into the details because I covered all that in the first tutorial so you should know how to lay tracks and make ground planes etc.
Proceed to draw two squares in the Edge Cuts layer and double click on them. This will open a dialog box where you can type in the exact dimensions of the PCB's. I wanted the VCO to be 14hp wide in eurorack terms. So this means 14 x 5.08mm = 71.12mm.
But beware! That is the width of the Faceplate so I made my circuitboards 4mm less wide at 67mm with a length of 105mm. The faceplate length of a Eurorack panel is always 128.5mm so this will create enough overlap at the top and bottom of the module to fit it into a eurorack case.
Now you have two PCB outlines you can import the components with the 'Update PCB from Schematic' button. Start placing the components using the left PCB for all the potmeter controls and in- and outputs and the right PCB for the main circuit of the VCO. Place the pinheaders and draw in the tracks etc and finish the PCB's.
Beware that the DRC check tool won't work properly when your making more then one PCB at once. So you must be very thorough with checking for mistakes and making sure all the groundplanes actually connect to ground. You can run the checker and see which mistake is due to it being on two PCB's and which mistakes are real mistakes. After some training it becomes easy to see which are the real mistakes that need attention. You will be left with many thin blue lines indicating connections that according to the software are not made but you'll see they run from one board to the other so they'll be represented by the pinheaders. HOWEVER, do check all the mistakes listed in the DRC checker and make sure.
Here's what my final design looked like after I put them together. I will explain how to do that, next.
PUTTING MULTIPLE PCB's TOGETHER WITH A V-GROOVE IN BETWEEN.
When you finished your PCB layouts, making sure the pinheaders are aligned so they will fit together, you can start connecting them.
To do that select the F.Fab layer and draw a line with a width of 2mm from top to bottom at the right side of the left PCB. You can set the width of a line by double clicking on it.
Drag the line against the edge of the 'Fill Zone' (ground plane) of the PCB if it has one. See image below. Now drag and select the right PCB and drag it next to the line as is shown below:
Delete the individual Edge Cut lines that were drawn around each of the PCB's and draw a new Edge Cut rectangle around the two PCB's together.
In the F.Fab layer, use the 'Draw Leaders' tool to draw an arrow at the top and name it 'V-score' to make it extra clear to the PCB factory that you want a V-groove at the position of the line.
The draw leaders tool is the 4th from the bottom. You'll have to click on the 'Draw Orthogonal Dimensions' button and keep the mouse button pressed in and then select the right most icon. That's the draw leaders tool.
Draw Leaders button.
GERBERS and ORDERING from PCBWay.
Now you can save your project and make the Gerber files for it. Make sure you check on the F.Fab layer when making the Gerber files to include the V-score information. You'll end up with 15 files instead of the normal 14 files in your Gerber folder. Turn them into a ZIP file. Now you can upload them to a website like
PCBWay to have them made.
In the upload page of the PCBWay website, under 'Board type' choose the 'Panel by Customer' option to indicate we have more than one PCB design in one file.
Next click 'accept' for the 'X-out allowance in panel' option. If one PCB in your multiple PCB panel tests as being faulty, they will mark it with an X in white.
Finally under 'Different design in panel' select the number of different PCB designs that your Gerber file contains. In this case it's 2.
Here's what that looks like on the PCBWay website:
Scroll down the rest of the page and make sure everything is as you want it. At the bottom there's a text field where you can type in anything that you feel the PCB producers need to know so in this field you can type that this is a PCB design with a V-groove in the middle. Just to be sure.
When all is as you want it to be, you can press 'Save to Cart' and proceed to checkout after you get confirmation your designs are approved. The PCB's are usually approved within 10 minutes if everything is okay and if not they will contact you by email pretty quickly. The service of PCBWay is really good.
If you order from them the first time, make an account on the website and make sure you enter your shipping details like name and address etc.
Here's a special little extra for readers of this website. It's a free plugin for KiCad that makes the ordering proces a lot easier. You just click the link and everything will be explained:
MAKING A FACEPLATE.
Now we need to make a faceplate for our project.
For this we don't have to use the schematic section of KiCad at all, just the PCB Editor.
To make a panel, make a new project in KiCad and name it the same as the PCB project with the term PANEL behind the name. At least, that's how I always name them.
Now close that panel project and go back to the previous PCB project and open the PCB editor.
Click and drag over your PCB design to select it and copy it. (CRTL + C)
Close that project and open the Panel project you just made and select the PCB editor.
Now Paste the PCB design into the PCB editor by clicking CTRL + V
Now your PCB design appears in your panel project. What good is that, you may ask. Well, we're going to use the PCB design, or more precisely that part of it that has the potmeters and sockets on it, as a template for our Panel design, to make sure all the holes are in the right position.
Drag the PCB design a bit to the right to make room for the panel design. Also make sure you place it vertically in the middle so you have some faceplate overlap at the top and bottom. This should be obvious. (see PCB-Editor screenshot below)
In the Edge Cuts layer, choose the Draw Rectangles tool and draw a rectangle. Put your mouse cursor on one of the lines of the rectangle and double click on it. Now a dialog box opens where you can enter the Rectangle Properties. Choose the 'By Corner and Size' option and under 'Size' enter the dimensions, in this case 71.12mm by 128.5mm for an 14hp faceplate. Click OK to finish.
One hp in Eurorack is 5.08mm so 14hp is 5.08 x 14 = 71.12mm
Now select the 'User Drawings' layer and with the line tool start making horizontal lines from the exact middle of your potmeters on the PCB to the left, over the panel square. Do this for everything that needs a hole in the faceplate.
Here's an image of what that looks like. It's not accurate because I made it after I finished the Panel design so the lines are not in the right place anymore but it's to give you an idea of what I mean:
When you've done that you need to use the X/Y coördinates to determin the distance from side of the panel to the middle of the hole in the panel, for each of the controls and sockets. Remember to add 2mm to your results because the overlap of the panel over the PCB's is 2mm on each side!
Before starting to draw in the holes, go to the Footprint Editor and draw a custom footprint for each of the different size holes you'll need. I made custom footprints for potmeter holes, socket holes and also a stretched circular one for the screwholes at the top and bottom of the panel. I made a new library for this named 'Panel Elements' and put them all in there. The Screwholes must have an inner diameter of 3.2mm. I left a little copper edge around the holes because it reinforces the hole and it looks cool.
Using these footprints will make it so much easier to place the holes accurately on the panel because they will snap in place over the position crosses you've drawn in the User Drawings layer.
To place the screw hole footprints, draw a horizontal line 3mm under the top and 3mm above the bottom of the panel outline. To determin where to place the vertical line that will make up the placement cross for the screwholes you must do a calculation:
Take 7.5mm and add to it 5.08mm and keep adding 5.08 until you're as close as can be to where you want the screwholes to be placed. The minimum distance from the left side is always 7.5mm.
In the case of a 14hp panel with 4 screwholes I placed them at 12.58mm (7.5+5.08) and 58.3mm (7.5+(10x5.08)) from the left edge of the panel.
After placing all the holes in the correct place, turn off the User Drawings layer and drag-select the PCB we used as a template and while it's selected drag it overtop of your panel and see if all the holes line up with the locations on the PCB. This will instantly show if something is wrong. After that you can delete the PCB template, we no longer need it. You can also delete the lines in the User Drawings layer now.
DECORATING YOUR FRONT-PANEL DESIGN.
You can use the line tool and other drawing tools to decorate your panel with copper lines and you can also download images, change them into footprints and use them on your panel design.
We make most designs inside the F.Cu layer the front copper layer which, in production, will get a solder layer attached to it so it comes out nice and shiny silver coloured.
You can add Text and other elements in the F.Silkscreen layer too if you wish. They will come out in white on the end product.
To add text to your panel use the text tool. You can select any font you want and type the text you want to add. Then you must duplicate the text layer and double click on it to open the text dialog box.
Now change the layer from F.Cu to F.Mask.
ANYTHING THAT MUST NOT BE COVERED BY THE SOLDERMASK MUST BE REPRESENTED IN THE F.MASK LAYER!
In this image I've moved the text copper layer to reveal the text mask layer in blue underneath. Normally they must of course be placed one on top of the other.
To add lines or circles to your design is a bit easier than text. Draw the lines with the line tool and then double click on it. Now check the box at the bottom that says Soldermask. Now your line won't be covered by the soldermask. To stop the cursor from sticking to certain angles and grid lines, and to move freely, keep the SHIFT and CTRL buttons on your keyboard pushed down while you drag with the mouse.
To use an image or design you downloaded from the internet, first use the cursor coördinates to measure the space your design must fill up. Make a note of it.
Now go to the start menu of KiCad and open the 'Image Converter'.
Load in your image and enter the size you want it to be. Make sure to choose the F.Cu layer for the footprint. Also decide whether you want the image to be in negative or normal. Sometimes negative makes it show up better but that's up to you. Select the correct contrast level.
Now click 'Export to Clipboard'. Go to the Footprint Editor and click 'Make a new footprint' in your custom panel designs library. If you don't have one, make one.
Click 'make a new footprint' and paste the image into the footprint editor.
Now click on your footprint design and in the dialog that pops up check the 'Solder mask' check box.
You must do this for every unconnected element in your footprint design. You'll see the bezier lines light up white when you click on one. After that is done you can save it.
Now you can go to your panel design in the PCB editor and use the 'Place Footprints' tool to import your design and place it on the panel. It's a shame you can not scale images this way so if it doesn't fit you have to import it again into the Image Converter and enter an other size.
In the image above you can see a custom made scale decal around one potmeter hole which I custom made. I made a circle first in the User Drawings layer and then I used the 'Draw Arcs' tool to mark the degrees on the decal scale with grey lines. Then I drew them in on the F.Cu layer with the line tool, holding down the Shift and CTRL button to make sure I could move the line in any direction I wanted. I then double clicked on every line I drew in and checked the Soldermask box.
When I had my design finished I drew in a ground plane for the back side on the B.Cu layer. I always do this to provide a copper shield for the circuit. I will later connect it to ground via a socket and it provides shielding against radio waves and other unwanted signals.
My final Front Panel design for the AS3340 (Digisound-80) VCO. It's 14hp wide.
3D viewer version:
Everything you see in yellow and orange will come out in silver on the panel. You can see my panel doesn't have any Silkscreen (white ink) on it so when I make my Gerber files I can switch the F.Silkscreen and B.Silkscreen layers off. This is important otherwise PCBWay will message you to say 'The silkscreen layer is switched on but there is no silkscreen present. Do you want silkscreen?' This will delay the start of production so beware of this.
END RESULT:
And here's how the final product came back from PCBWay. Shipping with the Global Shipping option took 10 days to The Netherlands which is good going by todays standards.
They look amazing! The quality is really good. There are no imperfections on the faceplate which I did have with other manufacturers:
The PCB's with the V-groove. It's executed just like I wanted it to.
The V-groove is applied from both sides. The PCB's can be very easily broken appart and they break very cleanly, leaving just a slightly rough edge. Just a light sanding down would do to make it smooth. I'm really pleased with the result.
Look how nicely the potmeter fit into the footprint:
I started building the project early afternoon and by 19:00h I had it finished except for the sockets, but it was good enough to test it and it all worked straight away! I have included a new version of the triangle to sinewave converter on this board too and look at what a wonderful sinewave it produces:
(Go to
Project 3 and scroll down to see the updated Triangle to Sinewave converter schematics)
THE FINISHED PRODUCT.
It's awesome. Everything worked out as I planned it and I'm glad I sat on the design for a full week, checking for errors, before sending it of because I did find some ground point that were not connected and other small mistakes but I got them all out luckily. However I did come across an error once I got the boards back. I had the wiring of the Octaves grounding switch the wrong way around and that caused a short circuit every time I turned the potmeter fully to one side with the switch in the ground position. I fried two potmeters before I discovered the mistake and I had to cut the tracks and re-wire that switch. An easy fix though.
The moral of the story is that mistakes are very difficult to rule out completely but you must take your time to do the best you can. It would be a shame to have to bin the PCB's you made.
I just finished tuning this VCO and it gave me the best result I ever had with a VCO. In tune over 6 octaves within a few cents over the complete range. Rock solid results.
Finally I would like to leave you with the YouTube video that showed me how to make faceplates for modules in KiCad. I learned it all from this video, I can really recommend watching this:
I would like to thank PCBWay for sponsoring this article. Please check out their website and the free plug-in for KiCad.
No comments:
Post a Comment
Note: comments are moderated and do not appear straightaway. Your first comment is not allowed to contain any links.