Podręcznik użytkownika
Prawa autorskie
Copyright © 2010-2015. Ten dokument jest chroniony prawem autorskim. Lista autorów znajduje się poniżej. Możesz go rozpowszechniać oraz modyfikować na zasadach określonych w General Public License (http://www.gnu.org/licenses/gpl.html), wersja 3 lub późniejsza, albo określonych w Creative Commons Attribution
Wszystkie znaki towarowe użyte w tym dokumencie należą do ich właścicieli.
Współtwórcy
Jean-Pierre Charras, Fabrizio Tappero.
Tłumaczenie
Kerusey Karyu <keruseykaryu@o2.pl>, 2014-2015.
Kontakt
Wszelkie komentarze lub sugestie dotyczące tego dokumentu prosimy kierować na listę dyskusyjną deweloperów programu KiCad https://launchpad.net/~kicad-developers
Data publikacji i wersja oprogramowania
17 marca 2014.
1. Wprowadzenie
1.1. Kluczowe właściwości
Pcbnew is a powerful printed circuit board software tool available for the Linux, Microsoft Windows and Apple OS X operating systems. Pcbnew is used in association with the schematic capture program Eeschema to create printed circuit boards.
Pcbnew manages libraries of footprints. Each footprint is a drawing of the physical component including its land pattern (the layout of pads on the circuit board). The required footprints are automatically loaded during the reading of the Netlist. Any changes to footprint selection or annotation can be changed in the schematic and updated in pcbnew by regenerating the netlist and reading it in pcbnew again.
Pcbnew provides a design rules check (DRC) tool which prevents track and pad clearance issues as well as preventing nets from being connected that aren’t connected in the netlist/schematic. When using the interactive router it continuously runs the design rules check and will help automatically route individual traces.
Pcbnew provides a rats nest display, a hairline connecting the pads of footprints which are connected on the schematic. These connections move dynamically as track and footprint movements are made.
Pcbnew has a simple but effective autorouter to assist in the production of the circuit board. An Export/Import in SPECCTRA dsn format allows the use of more advanced auto-routers.
Pcbnew provides options specifically provided for the production of ultra high frequency microwave circuits (such as pads of trapezoidal and complex form, automatic layout of coils on the printed circuit, etc).
1.2. Główne cechy projektu
The smallest unit in pcbnew is 1 nanometer. All dimensions are stored as integer nanometers.
Pcbnew can generate up to 32 layers of copper, 14 technical layers (silk screen, solder mask, component adhesive, solder paste and edge cuts) plus 4 auxiliary layers (drawings and comments) and manages in real time the hairline indication (rats nest) of missing tracks.
The display of the PCB elements (tracks, pads, text, drawings…) is customizable:
-
Przez wyświetlanie w trybie pełnym lub trybie uproszczonym.
-
Wyświetlanie lub nie prześwitów na ścieżkach.
For complex circuits, the display of layers, zones, and components can be hidden in a selective way for clarity on screen. Nets of traces can be highlighted to provide high contrast as well.
Footprints can be rotated to any angle, with a resolution of 0.1 degree.
Pcbnew includes a Footprint Editor that allows editing of individual footprints that have been on a pcb or editing a footprint in a library.
The Footprint Editor provides many time saving tools such as:
-
Fast pad numbering by simply dragging the mouse over pads in the order you want them numbered.
-
Easy generation of rectangular and circular arrays of pads for LGA/BGA or circular footprints.
-
Semi-automatic aligning of rows or columns of pads.
Footprint pads have a variety of properties that can be adjusted. The pads can be round, rectangular, oval or trapezoidal. For through-hole parts drills can be offset inside the pad and be round or a slot. Individual pads can also be rotated and have unique soldermask, net, or paste clearance. Pads can also have a solid connection or a thermal relief connection for easier manufacturing. Any combination of unique pads can be placed within a footprint.
Pcbnew easily generates all the documents necessary for production:
-
Pliki produkcyjne:
-
Pliki dla fotoploterów w formacie GERBER RS274X.
-
Pliki wierceń w formacie EXCELLON.
-
-
Pliki dla ploterów w formatach HPGL, SVG oraz DXF.
-
Mapy rysunków i wierceń w formacie POSTSCRIPT.
-
Pliki dla wydruków lokalnych.
1.3. Ważne informacje
Due to the degree of control necessary it is highly suggested to use a 3-button mouse with pcbnew. Many features such as panning and zooming require a 3-button mouse.
In the new release of KiCad, pcbnew has seen wide sweeping changes from developers at CERN. This includes features such as a new renderer (OpenGL and Cairo view modes), an interative push and shove router, differential and meander trace routing and tuning, a reworked Footprint Editor, and many other features. Please note that most of these new features only exist in the new OpenGL and Cairo view modes.
2. Instalacja
2.1. Instalacja i konfiguracja
Procedura instalacji została opisana w dokumentacji programu KiCad Manager.
2.2. Modyfikacja domyślnej konfiguracji
Domyślny plik konfiguracji: kicad.pro jest dostarczany w katalogu kicad/share/template. Jest on używany jako początkowa konfiguracja dla wszystkich nowych projektów.
This configuration file can be modified to change the libraries to be loaded.
Aby wykonać modyfikację tego pliku:
-
Należy uruchomić Pcbnew używając programu zarządzającego KiCad lub bezpośrednio z linii poleceń. W systemie Windows na przykład wydając polecenie c:\kicad\bin\pcbnew.exe. W systemie Linux: uruchamiając /usr/local/kicad/bin/kicad lub /usr/local/kicad/bin/pcbnew jeśli pliki binarne znajdują się w /usr/local/kicad/bin.
-
Wybrać Ustawienia → Biblioteka.
-
Dokonać edycji.
-
Zapisać zmodyfikowaną konfigurację (Zapisz ustawienia) z powrotem do kicad/share/template/kicad.pro.
2.3. Zarządzanie bibliotekami footprintów - Pliki starszego typu
You can have access to the library list initialization from the Preferences menu:
Poniższy rysunek ukazuje okno dialogowe pozwalające na ustawienie listy aktywnych bibliotek:
You can use this to add all the libraries that contain the footprints required for your project. You should also remove unused libraries from new projects to prevent footprint name clashes. Please note, there is an issue with the footprint library list when duplicate footprint names exist in more than one library. When this occurs, the footprint will be loaded from the first library found in the list. If this is an issue (you cannot load the footprint you want), either change the library list order using the "Up" and "Down" buttons in the dialog above or give the footprint a unique name using the footprint editor.
2.4. Tabele footprintów - Zarządzanie bibliotekami .pretty
As of release 4.0, Pcbnew uses the new footprint library table implementation to manage footprint libraries. The information in the previous section is no longer valid. The library table manager is accessible by:
The image below shows the footprint library table editing dialog which can be opened by invoking the "Library Tables" entry from the "Preferences" menu.
The footprint library table is used to map a footprint library of any supported library type to a library nickname. This nickname is used to look up footprints instead of the previous method which depended on library search path ordering. This allows Pcbnew to access footprints with the same name in different libraries by ensuring that the correct footprint is loaded from the appropriate library. It also allows Pcbnew to support loading libraries from different PCB editors such as Eagle and gEDA.
2.4.1. Globalna tabela bibliotek footprintów
The global footprint library table contains the list of libraries that are always available regardless of the currently loaded project file. The table is saved in the file fp-lib-table in the user’s home folder. The location of this folder is dependent on the operating system.
2.4.2. Lokalna tabela bibliotek footprintów zależna od projektu
Lokalna tabela bibliotek footprintów zależna od projektu zawiera listę bibliotek, które są dostępne wyłącznie w obecnie wczytanym projekcie. Lokalna tabela może być modyfikowana tylko wtedy, gdy zostanie ona załadowana razem z listą sieci tego projektu. Gdy projekt nie został załadowany lub gdy taka lokalna tabela nie istnieje, tworzona jest pusta tabela, którą będzie można wypełnić i później zapisać razem z plikiem przypisań footprintów (z rozszerzeniem .cmp).
2.4.3. Konfiguracja początkowa
Gdy Pcbnew lub CvPcb zostanie uruchomiony i globalna tabela bibliotek fp-lib-table nie zostanie znaleziona w katalogu domowym użytkownika, Pcbnew będzie próbował skopiować domyślną tabelę bibliotek fp_global_table zapisaną w folderze template do pliku fp-lib-table w katalogu domowym użytkownika. Jeśli plik fp_global_table nie został znaleziony, to zamiast operacji kopiowania zostanie utworzona pusta tabela. Gdyby taka sytuacja miała miejsce użytkownik ma też możliwość skopiowania fp_global_table samodzielnie lub "ręczne" skonfigurowania tabeli. Domyślna tabela bibliotek zawiera wszystkie standardowe biblioteki jakie zostały zainstalowane razem z programem KiCad EDA Suite.
2.4.4. Dodawanie nowych wpisów w tabeli
In order to use a footprint library, it must first be added to either the global table or the project specific table. The project specific table is only applicable when a board file is open. Each library entry must have a unique nickname. This does not have to be related in any way to the actual library file name or path. The colon : character cannot be used anywhere in the nickname. Each library entry must have a valid path and/or file name depending on the type of library. Paths can be defined as absolute, relative, or by environment variable substitution. The appropriate plug in type must be selected in order for the library to be properly read. Pcbnew currently supports reading KiCad legacy, KiCad Pretty, Eagle, and gEDA footprint libraries. There is also a description field to add a description of the library entry. The option field is not used at this time so adding options will have no effect when loading libraries. Please note that you cannot have duplicate library nicknames in the same table. However, you can have duplicate library nicknames in both the global and project specific footprint library table. The project specific table entry will take precedence over the global table entry when duplicated names occur. When entries are defined in the project specific table, an fp-lib-table file containing the entries will be written into the folder of the currently open netlist.
2.4.5. Pobieranie wartości ze zmiennych systemowych
Jednym z największych zalet tabeli bibliotek footprintów jest możliwość używania odnośników do zmiennych systemowych. Pozwala to na zdefiniowanie własnych ścieżek do bibliotek w zmiennych systemowych i używanie ich w projektach. Odnośniki do zmiennych systemowych można wplatać w treść pól zawierających ścieżkę do pliku używając powszechnie znanego formatu ${nazwa_zmiennej}. Domyślnie Pcbnew definiuje zmienną środowiskową KISYSMOD. Wskazuje ona na miejsce, gdzie zainstalowane zostały biblioteki instalowane razem z programem KiCad EDA Suite. Można ją re-definiować samodzielnie, co pozwala na zastąpienie standardowych bibliotek ich własnymi odpowiednikami. Gdy wczytana zostanie lista sieci, Pcbnew automatycznie definiuje również zmienną KIPRJMOD. Pozwala to na tworzenie bibliotek w miejscu wskazywanym przez projekt bez konieczności definiowania bezwzględnej ścieżki do biblioteki w lokalnej tabeli footprintów projektu.
2.4.6. Używanie wtyczki GitHub
The GitHub plugin is a special plugin that provides an interface for read-only access to a remote GitHub repository consisting of pretty (Pretty is name of the KiCad footprint file format) footprints and optionally provides "Copy-On-Write" (COW) support for editing footprints read from the GitHub repo and saving them locally. Therefore the "GitHub" plugin is for read-only for accessing remote pretty footprint libraries at https://github.com. To add a GitHub entry to the footprint library table the "Library Path" in the footprint library table entry must be set to a valid GitHub URL.
Przykładowo:
https://github.com/liftoff-sr/pretty_footprints
Typically GitHub URLs take the form:
https://github.com/user_name/repo_name
The "Plugin Type" must be set to "Github". To enable the "Copy-On-Write" feature the option allow_pretty_writing_to_this_dir must be added to the "Options" setting of the footprint library table entry. This option is the "Library Path" for local storage of modified copies of footprints read from the GitHub repo. The footprints saved to this path are combined with the read-only part of the GitHub repository to create the footprint library. If this option is missing, then the GitHub library is read-only. If the option is present for a GitHub library, then any writes to this hybrid library will go to the local *.pretty directory. Note that the github.com resident portion of this hybrid COW library is always read-only, meaning you cannot delete anything or modify any footprint in the specified GitHub repository directly. The aggregate library type remains "Github" in all further discussions, but it consists of both the local read/write portion and the remote read-only portion.
Poniższa tabela pokazuje wpis z tabeli bibliotek, której nie została przypisana opcja allow_pretty_writing_to_this_dir:
Nazwa skrótowa | Ścieżka | Typ wtyczki | Opcje | Opis |
---|---|---|---|---|
github |
Github |
Liftoff’s GH footprints |
Następna tabela pokazuje wpis z tabeli bibliotek z opcją dotyczącą COW. Zmienna ${HOME} jest tylko przykładowa. Folder github.pretty jest umieszczony w folderze do którego prowadzi ścieżka ${HOME}/pretty/. W każdym przypadku użycia opcji allow_pretty_writing_to_this_dir, wymagane jest samodzielne utworzenie tego folderu i musi on posiadać rozszerzenie .pretty.
Nazwa skrótowa | Ścieżka | Typ wtyczki | Opcje | Opis |
---|---|---|---|---|
github |
Github |
Liftoff’s GH footprints |
Footprint loads will always give precedence to the local footprints found in the path given by the option allow_pretty_writing_to_this_dir. Once you have saved a footprint to the COW library’s local directory by doing a footprint save in the Footprint Editor, no GitHub updates will be seen when loading a footprint with the same name as one for which you’ve saved locally.
Always keep a separate local *.pretty directory for each GitHub library, never combine them by referring to the same directory more than once. Also, do not use the same COW (*.pretty) directory in a footprint library table entry. This would likely create a mess. The value of the option allow_pretty_writing_to_this_dir will expand any environment variable using the ${} notation to create the path in the same way as the "Library Path" setting.
What’s the point of COW? It is to turbo-charge the sharing of footprints. If you periodically email your COW pretty footprint modifications to the GitHub repository maintainer, you can help update the GitHub copy. Simply email the individual *.kicad_mod files you find in your COW directories to the maintainer of the GitHub repository. After you’ve received confirmation that your changes have been committed, you can safely delete your COW file(s) and the updated footprint from the read-only part of GitHub library will flow down. Your goal should be to keep the COW file set as small as possible by contributing frequently to the shared master copies at https://github.com.
Finally, Nginx can be used as a cache to the github server to speed up the loading of footprints. It can be installed locally or on a network server. There is an example configuration in KiCad sources at pcbnew/github/nginx.conf. The most straightforward way to get this working is to overwrite the default nginx.conf with this one and export KIGITHUB=http://my_server:54321/KiCad, where my_server is the IP or domain name of the machine running nginx.
2.4.7. Generalne zalecenia przy używaniu tabeli bibliotek
Biblioteki footprintów mogą być zdefiniowane globalne lub lokalnie dla obecnie wczytanego projektu. Biblioteki umieszczone w globalnej tabeli bibliotek użytkownika są zawsze dostępne i są zapisane w pliku fp-lib-table w katalogu domowym użytkownika. Globalne biblioteki będą dostępne nawet jeśli nie została otwarta lista sieci danego projektu. Inaczej sprawa się ma w przypadku lokalnych bibliotek, które są aktywne wyłącznie dla bieżącej listy sieci. Lokalna tabela bibliotek jest zapisywana w pliku fp-lib-table umieszczonym w tej samej ścieżce co lista sieci.
Nie ma przeszkód co do definiowania odnośników do bibliotek w obu tabelach. Dlatego też nie zostało odgórnie określone w jaki sposób użytkownik będzie wykorzystywał możliwości jakie dają globalne i lokalne tabele. Są jednak zalety i wady każdego z rozwiązań, które należy rozważyć.
-
You can define all of your libraries in the global table which means they will always be available when you need them.
-
The disadvantage of this is that you may have to search through a lot of libraries to find the footprint you are looking for.
-
-
You can define all your libraries on a project specific basis.
-
The advantage of this is that you only need to define the libraries you actually need for the project which cuts down on searching.
-
The disadvantage is that you always have to remember to add each footprint library that you need for every project.
-
-
Można zdefiniować biblioteki w obu tabelach jednocześnie.
Sensowne staje się wtedy wpisanie bibliotek, które są wykorzystywane prawie we wszystkich projektach do tabeli globalnej, a w lokalnych tabelach umieszczać tylko te, które są przydatne tylko w tym konkretnym projekcie. Będzie to rozwiązanie, które będzie posiadało największą elastyczność kosztem zmniejszenia szybkości wyszukiwania.
3. Obsługa programu
3.1. Dostęp do poleceń
In Pcbnew it is possible to execute commands using various means:
-
Text-based menu at the top of the main window.
-
Top toolbar menu.
-
Right toolbar menu.
-
Left toolbar menu.
-
Mouse buttons (menu options). Specifically:
-
The right mouse button reveals a pop-up menu the content of which depends on the element under the mouse arrow.
-
-
Keyboard (Function keys F1, F2, F3, F4, Shift, Delete, +, -, Page Up, Page Down and Space bar). The Escape key generally cancels an operation in progress.
The screenshot below illustrates some of the possible accesses to these operations:
3.2. Polecenia związane z myszą
3.2.1. Podstawowe polecenia
-
Left button
-
Single-click displays the characteristics of the footprint or text under the cursor in the lower status bar.
-
Double-click displays the editor (if the element is editable) of the element under the cursor.
-
-
Centre button/wheel
-
Rapid zoom and some commands in layer manager.
-
Hold down the centre button and draw a rectangle to zoom to the described area. Rotation of the mouse wheel will allow you to zoom in and zoom out.
-
-
Prawy przycisk:
-
Displays a pop-up menu
-
3.2.2. Operacje na blokach
Operations to move, invert (mirror), copy, rotate and delete a block are all available via the pop-up menu. In addition, the view can zoom to the area described by the block.
The framework of the block is traced by moving the mouse while holding down the left mouse button. The operation is executed when the button is released.
By holding down one of the hotkeys Shift or Ctrl, or both keys Shift and Ctrl together, while the block is drawn the operation invert, rotate or delete is automatically selected as shown in the table below:
Action | Effect |
---|---|
Left mouse button held down |
Trace framework to move block |
Shift + Left mouse button held down |
Trace framework for invert block |
Ctrl + Left mouse button held down |
Trace framework for rotating block 90° |
Shift + Ctrl + Left mouse button held down |
Trace framework to delete the block |
Centre mouse button held down |
Trace framework to zoom to block |
Podczas przesuwania bloku:
-
Można przesunąć blok na nową pozycję oraz z pomocą lewego klawisza myszy umieścić go w wybranej pozycji.
-
To cancel the operation use the right mouse button and select Cancel Block from the menu (or press the Esc key).
Alternatywnie jeśli żaden z klawiszy nie jest naciśnięty podczas rysowania bloku, można użyć prawego klawisza myszy by wyświetlić podręczne menu i wybrać żądaną akcję z listy dostępnych.
Dla każdej operacji blokowej okno wyboru pozwala na działania, które będą ograniczać się tylko do niektórych elementów. Każde z powyższych poleceń może zostać anulowane przez to samo menu podręczne lub przez naciśnięcie klawisza Esc.
3.3. Wybór siatki
During element layout the cursor moves on a grid. The grid can be turned on or off using the icon on the left toolbar.
Dowolną predefiniowaną, bądź zdefiniowaną przez użytkownika siatkę można wybrać z listy rozwijanej pod głównym paskiem narzędzi lub z menu podręcznego. Siatkę użytkownika można zdefiniować z poziomu menu w Wymiary → Siatka użytkownika.
3.4. Ustawianie powiększenia - Zoom
The zoom level can be changed using any of the following methods:
-
Open the pop-up window (using the right mouse button) and then select the desired zoom.
-
Use the following function keys:
-
F1: Enlarge (zoom in)
-
F2: Reduce (zoom out)
-
F3: Redraw the display
-
F4: Centre view at the current cursor position
-
-
Rotate the mouse wheel.
-
Hold down the middle mouse button and draw a rectangle to zoom to the described area.
3.5. Wyświetlanie pozycji kursora
Pozycja kursora jest wyświetlana albo w calach (inch lub ``) lub w milimetrach (mm) zgodnie z wyborem wyświetlanych jednostek na lewym pasku opcji.
Niezależnie od wybranych jednostek Pcbnew zawsze pracuje z dokładnością 1 nanometra.
Pasek statusu wyświetlany na dole okna aplikacji zawiera następujące informacje:
-
Bieżące powiększenie.
-
Pozycję absolutną kursora.
-
Pozycję względną kursora. Pozycję bazową (0,0) do której odnosi się pozycja względna można przenosić na dowolną pozycję absolutną za pomocą klawisza spacji. Dodatkowo wyświetlana jest bieżąca odległość do punktu bazowego.
In addition the relative position of the cursor can be displayed using its polar co-ordinates (ray + angle). This can be turned on and off using the icon in the left hand side toolbar.
3.6. Szybki dostęp do poleceń - Skróty klawiszowe
Many commands are accessible directly with the keyboard. Selection can be either upper or lower case. Most hot keys are shown in menus. Some hot keys that do not appear are:
-
Delete: deletes a footprin or a track. (Available only if the Footprint tool or the track tool is active)
-
V: if the track tool is active switches working layer or place via, if a track is in progress.
-
+ and -: select next or previous layer.
-
?: display the list off all hot keys.
-
Space: reset relative coordinates.
3.7. Operation on blocks
Operations to move, invert (mirror), copy, rotate and delete a block are all available from the pop-up menu. In addition, the view can zoom to that described by the block.
The framework of the block is traced by moving the mouse while holding down the left mouse button. The operation is executed when the button is released.
By holding down one of the keys Shift or Ctrl, both Shift and Ctrl together, or Alt, while the block is drawn the operation invert, rotate, delete or copy is automatically selected as shown in the table below:
Action | Effect |
---|---|
Left mouse button held down |
Move block |
Shift + Left mouse button held down |
Invert (mirror) block |
Ctrl + Left mouse button held down |
Rotate block 90° |
Shift + Ctrl + Left mouse button held down |
Delete the block |
Alt + Left mouse button held down |
Copy the block |
Dla każdej operacji blokowej okno wyboru pozwala na działania, które będą ograniczać się tylko do niektórych elementów.
Każde z powyższych poleceń może zostać anulowane przez to samo menu podręczne lub przez naciśnięcie klawisza Esc.
3.8. Jednostki miar używane w oknach dialogowych
Units used to display dimensions values are inch and mm. The desired unit
can be selected by pressing the icon located in left toolbar:
However one can enter the unit used to
define a value, when entering a new value.
Akceptowane jednostki:
1*in* |
(1 cal) |
1 `` |
(1 cal/idem) |
25 th |
(25 thou) |
25 mi |
(25 milsów, to samo co thou) |
6 mm |
(6 mm, jak sama nazwa wskazuje) |
Należy przy tym stosować się do pewnych zasad:
-
Spacje pomiędzy liczbą a jednostką są dopuszczalne.
-
Tylko dwie pierwsze litery są znaczące.
-
W krajach, gdzie używany jest inny znak niż kropka (.) jako separator wartości dziesiętnych, można używać również kropki, zastępując nią właściwy dla danej lokalizacji znak separatora dziesiętnego. Zatem 1,5 oraz 1.5 są tak samo traktowane.
3.9. Główne menu aplikacji
Pasek menu pozwala na dostęp do poleceń związanych z plikami (jak odczyt i zapis), opcjami konfiguracyjnymi, drukowaniem oraz rysowaniem z pomocą ploterów, jak również dostęp do plików pomocy.
3.9.1. Menu Plik
Pozwala na ładowanie i zapisywanie plików z obwodem drukowanym, jak również pozwala na drukowanie bądź rysowanie gotowych obwodów drukowanych. Umożliwia ono też eksport danych o obwodzie drukowanym (w formacie GenCAD 1.4) w celu użycia ich w automatycznych testerach.
3.9.2. Menu Edycja
Pozwala na wykonanie pewnych edycji dotyczących całego projektu obwodu drukowanego:
3.9.3. Menu Widok
Funkcje służące do powiększania i pomniejszania widoku oraz podglądu 3D
3D Viewer
Opens the 3D Viewer. Here is a sample:
Switch canvas
Allows switching canvas.
-
default
-
OpenGL
-
Cairo
3.9.4. Menu Dodaj
Zawiera te same funkcje co prawy pasek narzędzi.
3.9.5. Route menu
Routing function.
3.9.6. Menu Ustawienia
Pozwala na:
-
Selection of the footprint libraries.
-
Hide/Show the Layers manager (colors selection for displaying layers and other elements. Also enables the display of elements to be turned on and off).
-
Zarządzanie głównymi opcjami programu (jednostki, itp.)
-
Zarządzanie pozostałymi opcjami wyświetlania
-
Creation, editing (and re-read) of the hot keys file.
3.9.7. Menu Wymiary
An important menu. Allows adjustment of:
-
Rozmiaru siatki użytkownika.
-
Rozmiaru tekstów oraz szerokości linii podczas rysowania.
-
Rozmiarów oraz charakterystyki pól lutowniczych.
-
Ustawień globalnych związanych z warstwami masek: soldermaski oraz pasty.
3.9.8. Menu Narzędzia
3.9.9. Menu Reguły projektowe
Provides access to 2 dialogs:
-
Setting Design Rules (tracks and vias sizes, clerances).
-
Setting Layers (number, enabled and layers names)
3.9.10. Menu Pomoc
Umożliwia wyświetlenie tego pliku pomocy oraz dostarcza informacji o wersji oprogramowania (O programie).
3.10. Polecenia związane z ikonami na głównym pasku narzędzi
Ten pasek narzędziowy daje bezpośredni dostęp do najważniejszych funkcji programu Pcbnew.
|
Creation of a new printed circuit. |
|
Opening of an old printed circuit. |
|
Save printed circuit. |
|
Selection of the page size and modification of the file properties. |
|
Opens Footprint Editor to edit library or pcb footprint. |
|
Opens Footprint Viewer to display library or pcb footprint. |
|
Undo/Redo last commands (10 levels) |
|
Display print menu. |
|
Display plot menu. |
|
Zoom in and Zoom out (relative to the centre of screen). |
|
Redraw the screen |
|
Fit to page |
|
Find footprint or text. |
|
Netlist operations (selection, reading, testing and compiling). |
|
DRC (Design Rule Check): Automatic check of the tracks. |
|
Selection of the working layer. |
|
Selection of layer pair (for vias) |
|
Footprint mode: when active this enables footprint options in the pop-up window. |
|
Routing mode: when active this enables routing options in the pop-up window |
|
Direct access to the router Freerouter |
|
Show / Hide the Python scripting console |
3.10.1. Panel dodatkowy:
|
Wybiera aktualnie używaną szerokość ścieżki. |
|
Wybiera aktualnie używany rozmiar przelotki. |
|
Automatyczna szerokość ścieżek: jeśli jest aktywna, podczas tworzenia nowej ścieżki rozpoczynającej się na innej ścieżce, szerokość tej ścieżki zostanie ustawiona tak samo jak ścieżka od której się zaczyna. |
|
Wybór aktualnego rozmiaru siatki. |
|
Wybór powiększenia. |
3.11. Polecenia związane z ikonami na prawym panelu
Ten pasek narzędzi daje dostęp do podstawowych narzędzi:
-
Placement of footprints, tracks, zones of copper, texts, etc.
-
Podświetlanie sieci.
-
Tworzenie opisów, elementów graficznych…
-
Usuwanie elementów składowych footprintu.
|
Select the standard mouse mode. |
|
Highlight net selected by clicking on a track or pad. |
|
Display local ratsnest (Pad or Footprint). |
|
Add a footprint from a library. |
|
Placement of tracks and vias. |
|
Placement of zones (copper planes). |
|
Placement of keepout areas ( on copper layers ). |
|
Auto track width: when starting on an existing track use its width otherwise, use current width setting. |
|
Draw Lines on technical layers (i.e. not a copper layer). |
|
Draw Circles on technical layers (i.e. not a copper layer). |
|
Draw Arcs on technical layers (i.e. not a copper layer). |
|
Placement of text. |
|
Draw Dimensions on technical layers (i.e. not the copper layer). |
|
Draw Alignment Marks (appearing on all layers). |
|
Delete element pointed to by the cursor Note: When Deleting, if several superimposed elements are pointed to, priority is given to the smallest (in the decreasing set of priorities tracks, text, footprint). The function "Undelete" of the upper toolbar allows the cancellation of the last item deleted. |
|
Offset adjust for drilling and place files. |
|
Grid origin. (grid offset). Useful mainly for editing and placement of footprints. Can also be set in Dimensions/Grid menu. |
3.12. Polecenia związane z ikonami na lewym panelu
Lewy panel umożliwia szybką zmianę najczęściej używanych opcji.
|
Turns DRC (Design Rule Checking) on/off. Caution: when DRC is off incorrect connections can be made. |
|
Turn grid display on/off Note: a small grid may not be displayed unless zoomed in far enough |
|
Polar display of the relative co-ordinates on the status bar on/off. |
|
Display/entry of coordinates or dimensions in inches or millimeters. |
|
Change cursor display shape. |
|
Display general rats nest (incomplete connections between footprints). |
|
Display footprint rats nest dynamically as it is moved. |
|
Enable/Disable automatic deletion of a track when it is redrawn. |
|
Show filled areas in zones |
|
Do not show filled areas in zones |
|
Show only outlines of filled areas in zones |
|
Display of pads in outline mode on/off. |
|
Display of vias in outline mode on/off. |
|
Display of tracks in outline mode on/off. |
|
High contrast display mode on/off. In this mode the active layer is displayed normally, all the other layers are displayed in gray. Useful for working on multi-layer circuits. |
|
Hide/Show the Layers manager |
|
Access to microwaves tools. Under development |
3.13. Menu podręczne i szybka edycja elementów na PCB
A right-click of the mouse opens a pop-up window. Its contents depends on the element pointed at by the cursor.
Menu to daje natychmiastowy dostęp do:
-
Zmiany wyświetlania obszaru roboczego (centrowanie widoku wokół kursora, przybliżania lub oddalania widoku oraz wyboru powiększenia z listy).
-
Ustawiania rozmiaru siatki.
-
Additionally a right-click on an element enables editing of the most commonly modified element parameters.
The screenshots below show what the pop-up windows looks like.
3.14. Tryby pracy
There are 3 modes when using pop-up menus. In the pop-up menus, these modes add or remove some specific commands.
|
Normal mode |
|
Footprint mode |
|
Tracks mode |
3.14.1. Praca normalna
-
Menu podręczne bez wyboru elementu
-
Menu podręczne przy ścieżce
-
Menu podręczne przy module
3.14.2. Tryb Automatycznego lub ręcznego przesuwanie footprintów
Te samo menu przy włączonym trybie Ręcznego lub Automatycznego przesuwania
footprintów (
aktywna).
-
Menu podręczne bez wyboru elementu
-
Menu podręczne przy ścieżce
-
Menu podręczne przy module
3.14.3. Tryb Ścieżek i autoroutingu
To samo przy trybie Ścieżek i autoroutingu
(
aktywna).
-
Menu podręczne bez wyboru elementu
-
Menu podręczne przy ścieżce
-
Menu podręczne przy module
4. Implementacja schematu na obwodzie drukowanym
4.1. Połączenie schematu z obwodem drukowanym
Generally speaking, a schematic sheet is linked to its printed circuit board by means of the netlist file, which is normally generated by the schematic editor used to make the schematic. Pcbnew accepts netlist files made with Eeschema or Orcad PCB 2. The netlist file, generated from the schematic is usually missing the footprints that correspond to the various components. Consequently an intermediate stage is necessary. During this intermediate process the association of components with footprints is performed. In KiCad, CvPcb is used to create this association and a file named *.cmp is produced. CvPcb also updates the netlist file using this information.
CvPcb can also output a "stuff file" *.stf which can be back annotated into the schematic file as the F2 field for each component, saving the task of re-assigning footprints in each schematic edit pass. In Eeschema copying a component will also copy the footprint assignment and set the reference designator as unassigned for later auto-incremental annotation.
Pcbnew reads the modified netlist file .net and, if it exists, the .cmp file. In the event of a footprint being changed directly in Pcbnew the .cmp file is automatically updated avoiding the requirement to run CvPcb again.
Refer to the figure of "Getting Started in KiCad" manual in the section KiCad Workflow that illustrates the work-flow of KiCad and how intermediate files are obtained and used by the different software tools that comprise KiCad.
4.2. Procedura tworzenia podstaw obwodu drukowanego
Po stworzeniu potrzebnego schematu by rozpocząć pracę nad odwodem drukowanym należy:
-
Stworzyć listę sieci używając Eeschema.
-
Assign each component in your netlist file to the corresponding footprint (often called footprint) used on the printed circuit using Cvpcb.
-
Launch Pcbnew and read the modified Netlist. This will also read the file with the footprint selections.
Pcbnew will then load automatically all the necessary footprints. Footprints can now be placed manually or automatically on the board and tracks can be routed.
4.3. Procedura aktualizacji obwodu drukowanego
Gdy schemat został zmieniony, należy ponownie wykonać następujące kroki:
-
Utworzyć nową listę sieci używając programu Eeschema.
-
If the changes to the schematic involve new components, the corresponding footprints must be assigned using Cvpcb.
-
Launch Pcbnew and re-read the modified netlist (this will also re-read the file with the footprint selections).
Pcbnew will then load automatically any new footprints, add the new connections and remove redundant connections. This process is called forward annotation and is a very common procedure when a PCB is made and updated.
4.4. Odczytywanie listy sieci - Ładowanie footprintów - Opcje
4.4.1. Okno obsługi listy sieci
Okno to jest dostępne za pomocą polecenia ukrytego pod ikoną
4.4.2. Dostępne opcje
Footprint Selection |
Components and corresponding footprints on board link: normal link is Reference (normal option Timestamp can be used after reannotation of schematic, if the previous annotation was destroyed (special option) |
Exchange Footprint: |
If a footprint has changed in the netlist: keep old footprint or change to the new one. |
Unconnected Tracks |
Keep all existing tracks, or delete erroneous tracks |
Extra Footprints |
Remove footprints which are on board but not in the netlist. Footprint with attribute "Locked" will not be removed. |
Single Pad Nets |
Remove single pad nets. |
4.4.3. Ładowanie nowych footprintów
Gdy na liście sieci zostaną odnalezione nowe footprinty, zostaną one automatycznie załadowane:
Domyślnie zostaną one umieszczone na stosie na pozycji 0,0, z którego można je przesunąć w inne miejsca jeden po drugim. Jednak lepszym rozwiązaniem jest ich automatyczne przeniesienie i rozłożenie. W tym celu wymagane będą:
Aktywacja trybu Automatycznego przesuwania footprintów
(
)
Przesunięcie kursora myszy w puste pole na obszarze roboczym i wywołanie podręcznego menu:
-
Automatically Place New Footprints, if there is already a board with existing footprints.
-
Automatically Place All Footprints, for the first time (when creating a board).
Poniżej można zobaczyć przykład działania pierwszego z tych poleceń:
5. Ustawianie i wyświetlanie warstw roboczych
Pcbnew can work on 50 different layers:
-
32 copper layers (for routing of tracks).
-
14 technical layers (includes 1 board outline layer).
-
4 auxiliary layers.
The number of copper layers, and if needed their names and attributes, should be set. Unused technical layers can be disabled.
5.1. Warstwy sygnałowe (miedzi)
5.1.1. Informacje podstawowe
Copper layers are the usual working layers used by the automatic router to place and re-arrange tracks. Layer 1 is the copper (solder) layer. Layer 32 is the component layer. Other layers are the inner layers, from L2 to L31.
5.1.2. Wybór ilości warstw sygnałowych
To enable navigation between layers, it is necessary to select the number of working layers. To do this you can use the menu bar and select Design Rules → Layers Setup.
Then select the number of layers wanted, from 2 to 32.
5.1.3. Warstwy sygnałowe (miedzi)
The name of any copper layer is editable. Copper layers have attributes useful when using the external router Freerouter.
5.2. Warstwy techniczne
Some are associated in pairs, others not. When they appear as a pair this affects the behaviour of footprints. The elements making up a footprint (pads, drawing and text) appearing on a layer (solder or component), appear on the other complementary layer when the footprint is inverted (mirrored).
Warstwy technicze to:
5.2.1. Pary warstw technicznych:
-
The Adhesives layers (Copper and Component):
-
These are used in the application of adhesive to stick SMD components to the circuit board, generally before wave soldering.
-
-
The Solder Paste layers paste SMD (Copper and Component):
-
Used to produce a mask to allow solder paste to be placed on the pads of surface mount components, generally before reflow soldering. Usually only surface mount pads occupy these layers.
-
-
The Silk Screen layers (Copper and Component):
-
They are the layers where the drawings of the components appear.
-
-
The Solder Mask layers (Copper and Component):
-
These define the solder masks. Normally all pads appear on one or the other of these layers (or both for through pads) to prevent the varnish covering the pads.
-
5.2.2. Warstwy dla własnego użytku
-
Cmts.User - Warstwa przeznaczona na komentarze użytkownika
-
Eco1.User - Warstwa przeznaczona na komentarze dla wytwórcy PCB
-
Eco2.User - Warstwa przeznaczona na komentarze dla wytwórcy PCB
-
Dwgs.User - Warstwa przeznaczona na rysunki użytkownika
Warstwy te można używać swobodnie. Można na nich przykładowo umieszczać teksty instrukcji dla montażystów lub z opisem połączeń, albo też rysunki konstrukcyjne.
5.2.3. Warstwy specjalne
-
Edge Cuts layer:
-
This layer is reserved for the drawing of circuit board outline. Any element (graphic, texts…) placed on this layer appears on all the other layers. Use this layer only to draw board outlines.
-
5.3. Wybór aktywnej warstwy
Wybór aktualnie aktywnej warstwy może być przeprowadzony na kilka sposobów:
-
Używając prawego panelu warstw (Menedżer warstw).
-
Używając listy rozwijanej na górnym pasku narzędzi.
-
Używając menu podręcznego (wywoływanego prawym klawiszem myszy).
-
Using the + and - keys (works on copper layers only).
-
Używając klawiszy skrótów.
5.3.1. Wybór z pomocą Menedżera warstw
5.3.2. Wybór z pomocą dodatkowego paska narzędzi
Za pomocą tej listy można bezpośrednio wybrać warstwę roboczą.
Oprócz tego lista ta wyświetla dodatkowo skróty klawiszowe przypisane niektórym warstwom.Hot keys to select the working layer are displayed.
5.3.3. Wybór z menu podręcznego
The Pop-up window opens a menu window which provides a choice for the working layer.
5.4. Wybór warstw dla stawiania przelotek
W przypadku pracy w trybie Ścieżek i autoroutingu, (aktywna jest ikona na głównym pasku narzędzi), menu podręczne dostarcza dodatkowych opcji związanych z wyborem pary warstw, na której stawiane będą przelotki:
Po wybraniu polecenia Wybierz parę warstw, otworzy się dodatkowe okno, gdzie będzie można przypisać wirtualnym warstwom Górnej i Dolnej odpowiednie warstwy sygnałowe, które będą łączone za pomocą przelotek.
Przy umieszczaniu przelotki na warstwie roboczej (aktywnej), warstwa ta zostaje automatycznie przełączona na jej alternatywną warstwę w wybranej wcześniej parze warstw dla przelotek.
Przelotki są również wstawiane automatycznie podczas trasowania ścieżek, gdy nastąpi zmiana warstwy roboczej za pomocą klawiszy skrótów.
5.5. Używanie trybu wysokiego kontrastu
Tryb ten jest włączany za pomocą ikony
(na
lewym panelu opcji).
W trybie tym, aktywna warstwa jest wyświetlana swoim własnym kolorem, natomiast pozostałe warstwy są wyświetlane w odcieniach szarości.
Zwykle taki tryb wyświetlania jest użyteczny w dwóch przypadkach:
5.5.1. Warstwy miedzi w trybie wysokiego kontrastu
When a board uses more than four layers, this option allows the active copper layer to be seen more easily:
Tryb pracy normalnej (aktywna jest warstwa L1):
Tryb pracy z wysokim kontrastem (aktywna jest warstwa L1):
5.5.2. Warstwy techniczne
The other case is when it is necessary to examine solder paste layers and solder mask layers which are usually not displayed.
W trybie wysokiego kontrastu zmienia się wtedy sposób wyświetlania pól lutowniczych:
Tryb normalny (aktywna warstwa soldermaski na stronie górnej):
Tryb wysokiego kontrastu (aktywna warstwa maski cynowania na stronie górnej):
6. Tworzenie i modyfikacja projektu obwodu drukowanego
6.1. Tworzenie płytki
6.1.1. Rysowanie obrysu płytki
It is usually a good idea to define the outline of the board first. The outline is drawn as a sequence of line segments. Select Edges pcb as the active layer and use the Add graphic line or polygon tool to trace the edge, clicking at the position of each vertex and double-clicking to finish the outline. Boards usually have very precise dimensions, so it may be necessary to use the displayed cursor coordinates while tracing the outline. Remember that the relative coordinates can be zeroed at any time using the space bar, and that the display units can also be toggled using Ctrl-U. Relative coordinates enable very precise dimensions to be drawn. It is possible to draw a circular (or arc) outline:
-
Wybrać jedno z dostępnych narzędzi Dodaj okrąg lub Dodaj łuk.
-
Kliknąć w miejscu gdzie ma znaleźć się środek okręgu lub łuku.
-
Poruszając myszą ustawić odpowiedni promień.
-
Zakończyć rysowanie klikając ponownie.
Zapamiętaj
|
The width of the outline can be adjusted in the Parameters menu (recommended width = 150 in 1/10 mils) or via the Options, but this will not be visible unless the graphics are displayed in other than outline mode. |
Przykładowy rezultat może wyglądać tak:
6.1.2. Using a DXF drawing for the board outline
As an alternative to drawing the board outline in Pcbnew directly, an outline can also be imported from a DXF drawing.
Using this feature allows for much more complex board shapes than is possible with the Pcbnew drawing capabilities.
For example a mechanical CAD package can be used to define a board shape that fits a particular enclosure.
Preparing the DXF drawing for import into KiCad
The DXF import capability in KiCad does not support DXF features like POLYLINES and ELLIPSIS and DXF files that use these features require a few conversion steps to prepare them for import.
A software package like LibreCAD can be used for this conversion.
As a first step, any POLYLINES need to be split (Exploded) into their original simpler shapes. In LibreCAD use the following steps:
-
Open a copy of the DXF file.
-
Select the board shape (selected shapes are shown with dashed lines).
-
In the Modify menu, select Explode.
-
Press ENTER.
As a next step, complex curves like ELLIPSIS need to be broken up in small line segments that approximate the required shape. This happens automatically when the DXF file is exported or saved in the older DXF R12 file format (as the R12 format does not support complex curve shapes, CAD applications convert these shapes to line segements. Some CAD applications allow configuration of the number or the length of the line segments used). In LibreCAD the segment length it generally small enough for use in board shapes.
In LibreCAD, use the following steps to export to the DXF R12 file format:
-
In the File menu, use Save As…
-
In the Save Drawing As dialog, there is a Save as type: selection near the bottom of the dialog. Select the option Drawing Exchange DXF R12.
-
Optionally enter a file name in the File name: field.
-
Click Save
Your DXF file is now ready for import into KiCad.
Importing the DXF file into KiCad
The following steps describe the import of the prepared DXF file as a board shape into KiCad. Note that the import bahaviour is slightly different depending on which canvas is used.
Using the "default" canvas mode:
-
In the File menu, select Import and then the DXF File option.
-
In the Import DXF File dialog use Browse to select the prepared DXF file to be imported.
-
In the Place DXF origin (0,0) point: option, select the placement of DXF origin relative to the board coordinates (the KiCad board has (0,0) in the top left corner). For the User defined position enter the coordinates in the X Position and Y Position fields.
-
In the Layer selection, select the board layer for the import. Edge.Cuts is needed for the board outline.
-
Click OK.
Using the "OpenGL" or "Cairo" canvas modes:
-
In the File menu, select Import and then the DXF File option.
-
In the Import DXF File dialog use Browse to select the prepared DXF file to be imported.
-
The Place DXF origin (0,0) point: option setting is ignored in this mode.
-
In the Layer selection, select the board layer for the import. Edge.Cuts is needed for the board outline.
-
Click OK.
-
The shape is now attached to your cursor and it can be moved around the board area.
-
Click to drop the shape on the board.
Example imported DXF shape
Here is an example of an DXF import with a board that had several elliptical segments approximated by a number of short line segments:
6.1.3. Odczytywanie listy sieci stworzonej na podstawie schematu
By wczytać listę sieci należy wybrać ikonę
na głównym pasku
narzędzi. Otworzy się następujące okno dialogowe:
If the name (path) of the netlist in the window title is incorrect, use the Select button to browse to the desired netlist. Then Read the netlist. Any footprints not already loaded will appear, superimposed one upon another (we shall see below how to move them automatically).
If none of the footprints have been placed, all of the footprints will appear on the board in the same place, making them difficult to recognize. It is possible to arrange them automatically (using the command Global Spread and Place accessed via the right mouse button). Here is the result of such automatic arrangement:
Zapamiętaj
|
If a board is modified by replacing an existing footprint with a new one (for example changing a 1/8W resistance to 1/2W) in CvPcb, it will be necessary to delete the existing component before Pcbnew will load the replacement footprint. However, if a footprint is to be replaced by an existing footprint, this is easier to do using the footprint dialog accessed by clicking the right mouse button over the footprint in question. |
6.2. Poprawianie płytki
Bardzo często niezbędne jest poprawienie płytki po dokonaniu zmian na schemacie.
6.2.1. Aby poprawki te przenieść również na płytkę należy:
-
Stworzyć nową listę sieci na podstawie zmodyfikowanego schematu. If new components have been added, link these to their corresponding footprint in CvPcb.
-
Na koniec wczytać nową listę sieci w programie Pcbnew.
6.2.2. Usuwanie nieprawidłowych ścieżek
Pcbnew umożliwia automatyczne skasowanie nieprawidłowych ścieżek, które mogłyby pozostać po zmianach. By taką możliwość włączyć należy w oknie zaznaczyć opcję Usuń w grupie Niepołączone ścieżki:
Można również dokonać modyfikacji tych ścieżek manualnie (funkcja DRC pozwala na zidentyfikowanie takich ścieżek).
6.2.3. Usuwanie nadmiarowych elementów
Pcbnew can delete footprint corresponding to components that have been removed from the schematic. This is optional.
This is necessary because there are often footprints (holes for fixation screws, for instance) that are added to the PCB that never appear in the schematic.
If the "Remove Extra Footprints" option is checked, a footprint corresponding to a component not found in the netlist will be deleted, unless they have the option "Locked" active. It is a good idea to activate this option for "mechanical" footprints:
6.2.4. Modified footprints
If a footprint is modified in the netlist (using CvPcb), but the footprint has already been placed, it will not be modified by Pcbnew, unless the corresponding option of the Exchange Footprint box of the netlist dialog is checked:
Changing a footprint (replacing a resistor with one of a different size, for instance) can be effected directly by editing the footprint.
6.2.5. Opcje zaawansowane - wybór odcisków czasowych zamiast oznaczeń
Sometimes the notation of the schematic is changed, without any material changes in the circuit (this would concern the references - like R5, U4…).The PCB is therefore unchanged (except possibly for the silkscreen markings). Nevertheless, internally, components and footprints are represented by their reference. In this situation, the Timestamp option of the netlist dialog may be selected before re-reading the netlist:
With this option, Pcbnew no longer identifies footprints by their reference, but by their time stamp instead. The time stamp is automatically generated by Eeschema (it is the time and date when the component was placed in the schematic).
Ostrzeżenie
|
Great care should be exercised when using this option (save the file first!). This is because the technique is complicated in the case of components containing multiple parts (e.g. a 7400 has 4 parts and one case). In this situation, the time stamp is not uniquely defined (for the 7400 there would be up to four - one for each part). Nevertheless, the time stamp option usually resolves re-annotation problems. |
6.3. Błyskawiczna zamiana footprintów umieszczonych na płytce
Błyskawiczna zamiana footprintu (lub kilku identycznych footprintów) na nowe footprinty jest często bardzo użyteczna. Cały proces jest bardzo prosty.
-
Należy kliknąć na footprint jaki chcemy zmienić by otworzyć okno z właściwościami footprintu.
-
Activate Change Footprints.
Opcje powiązane z zamianą footprintów:
Przy zmianach footprintów dostępne są dodatkowe opcje:
-
Change Footprint for the current footprint
-
Change same footprints for all footprints like the current footprint.
-
Change same footprint+value for all footprints like the current footprint, restricted to components which have the same value.
Zapamiętaj
|
Zamień wszystkie powoduje ponowne załadowanie wszystkich footprintów na płytce. |
7. Footprint placement
7.1. Wspomaganie rozmieszczania footprintów
Whilst moving footprints the footprint ratsnest (the net connections) can be
displayed to assist the placement. To enable this the icon
of the left toolbar must be activated.
7.2. Rozmieszczanie manualne
Select the footprint with the right mouse button then choose the Move command from the menu. Move the footprint to the required position and place it with the left mouse button. If required the selected footprint can also be rotated, inverted or edited. Select Cancel from the menu (or press the Esc key) to abort.
Here you can see the display of the footprint ratsnest during a move:
The circuit once all the footprints are placed may be as shown:
7.3. General re-orientation of footprints
Initially all footprints inherit the same orientation that they had in the library (normally 0).
If an alternative orientation is required for an individual footprint, or all footprints (for example all vertical) use the menu option AutoPlace/Orient All Footprints. This orientation can be selective (for example to relate only to the footprints whose reference starts with "IC".
7.4. Automatic Footprint Distribution
Generally speaking, footprints can only be moved if they have not been "Fixed". This attribute can be turned on and off from the pop-up window (click right mouse button over footprint) whilst in Footprint Mode, or through the Edit Footprint Menu.
As stated in the last chapter, new footprints loaded during the reading of the netlist appear piled up at a single location on the board. Pcbnew allows an automatic distribution of the footprints to make manual selection and placement easier.
-
Select the option "Footprint Mode" (Icon
on the upper toolbar).
-
W tym trybie podręczne menu będzie wyglądać dwojako:
If there is a footprint under the cursor:
Jeśli pod kursorem nie znajduje się żaden footprint, menu podręczne ulegnie skróceniu:
W obu przypadkach dostępne są następujące polecenia:
-
Spread out All Footprints allows the automatic distribution of all the footprints not Fixed. This is generally used after the first reading of a netlist.
-
Spread out Footprints not Already on Board allows the automatic distribution of the footprints which have not been placed already within the PCB outline. This command requires that an outline of the board has been drawn to determine which footprints can be automatically distributed.
7.5. Automatic placement of footprints
7.5.1. Charakterystyka narzędzia do automatycznego rozmieszczania footprintów
The automatic placement feature allows the placement of footprints onto the 2 faces of the circuit board (however switching a footprint onto the copper layer is not automatic).
It also seeks the best orientation (0, 90, -90, 180 degrees) of the footprint. The placement is made according to an optimization algorithm, which seeks to minimize the length of the ratsnest, and which seeks to create space between the larger footprints with with many pads. The order of placement is optimized to initially place these larger footprints with many pads.
7.5.2. Przygotowanie pola edycji
Pcbnew can thus place the footprints automatically, however it is necessary to guide this placement, because no software can guess what the user wants to achieve.
Przed wykonaniem automatycznego rozmieszczeni footprintów należy:
-
Stworzyć obrys płytki (Może być nawet dość skomplikowany, byle by obrys został zamknięty).
-
Dokonać ręcznego rozmieszczenia kluczowych footprintów bądź elementów (Złącz, otworów montażowych…).
-
Similarly, certain SMD footprints and critical components (large footprints for example) must be on a specific side or position on the board and this must be done manually.
-
Having completed any manual placement these footprints must be "Fixed" to prevent them being moved. With the Footprint Mode icon
selected right click on the footprint and pick "Fix Footprint" on the Pop-up menu. This can also be done through the Edit/Footprint Pop-up menu.
-
Automatic placement can then be carried out. With the Footprint Mode icon selected, right click and select Glob(al) Move and Place - then Autoplace All Footprints.
During automatic placement, if required, Pcbnew can optimize the orientation of the footprints. However rotation will only be attempted if this has been authorized for the footprint (see Edit Footprint Options).
Usually resistors and non-polarized capacitors are authorized for 180 degrees rotation. Some footprints (small transistors for example) can be authorized for +/- 90 and 180 degrees rotation.
For each footprint one slider authorizes 90 degree Rot(ation) and a second slider authorizes 180 degree Rot(ation). A setting of 0 prevents rotation, a setting of 10 authorizes it, and an intermediate value indicates a preference for/against rotation.
The rotation authorization can be done by editing the footprint once it is placed on the board. However it is preferable to set the required options to the footprint in the library as these settings will then be inherited each time the footprint is used.
7.5.3. Interaktywność automatycznego rozmieszczania footprintów
It may be necessary during automatic placement to stop (press Esc key) and manually re-position a footprint. Using the command Autoplace Next Footprint will restart the autoplacement from the point at which it was stopped.
The command Autoplace new footprints allows the automatic placement of the footprints which have not been placed already within the PCB outline. It will not move those within the PCB outline even if they are not "fixed".
The command Autoplace Footprint makes it possible to re-place the footprint pointed to by the mouse, even if its fixed attribute is active.
7.5.4. Uwagi końcowe
Pcbnew automatically determines the possible zone of placement of the footprints by respecting the shape of the board outline, which is not necessarily rectangular (It can be round, or have cutouts, etc).
Jeśli płyta nie jest prostokątna, obrys musi być zamknięty aby Pcbnew mogło określić, co jest w środku i to, co jest poza obrysem. W ten sam sposób, jeśli na płytce występują wewnętrzne wycięcia, ich obrysy będą musiały być również zamknięte.
Pcbnew calculates the possible zone of placement of the footprints using the outline of the board, then passes each footprint in turn over this area in order to determine the optimum position at which to place it.
8. Ustawienia i parametry trasowania ścieżek
8.1. Opcje główne
8.1.1. Dostęp do głównego okna narzędzia
Najważniejsze ustawienia reguł projektowych są dostępne z menu:
i są ustalane w oknie dialogowym wywoływanym poleceniem Reguły projektowe.
8.1.2. Opcje główne
Current settings are displayed in the top toolbar.
8.2. Opcje główne
The General options menu is available via the top toolbar link Preferences → General dialog.
Wywołanie tego polecenia spowoduje wyświetlenie okna z ustawieniami, a w nim szereg opcji (Nas w tej chwili interesują te w grupie Opcje):
Dla ścieżek dostępne są następujące opcje:
-
Ścieżki tylko pod kątem 45 stopni: Pozwala na prowadzenie ścieżek tylko pod kątem 0, 45 lub 90 stopni.
-
Ścieżka z podwójnym segmentem: Podczas tworzenia ścieżek, zostaną wyświetlane dwa jej segmenty (jeśli ścieżka nie jest linią prostą).
-
Automatyczne usuwanie ścieżek: Podczas tworzenia ścieżek, stare trasy nowo prowadzonych ścieżek zostaną automatycznie usunięte.
-
Magnetic Pads: The graphic cursor becomes a pad, centered in the pad area.
-
Magnetic Tracks: The graphic cursor becomes the track axis.
8.3. Klasy połączeń
Pcbnew allows you to define different routing parameters for each net. Parameters are defined by a group of nets.
-
Grupa podobnych sieci jest zwana klasą połączeń.
-
Na liście zawsze musi się znaleźć klasa Default.
-
Użytkownik może zdefiniować inne klasy połączeń.
Dla pojedynczej klasy można zdefiniować:
-
Szerokość ścieżki oraz rozmiar przelotek razem z rozmiarem wierceń.
-
Minimalną odległość (clearance) jaką należy zachować pomiędzy polami lutowniczymi i ścieżkami (lub przelotkami).
-
When routing, Pcbnew automatically selects the netclass corresponding to the net of the track to create or edit, and therefore the routing parameters.
8.3.1. Ustawienia i parametry trasowania ścieżek
The choice is made in the menu: Design Rules → Design Rules.
8.3.2. Edycja klas połączeń
Edytor klas połączeń pozwala na:
-
Dodawanie lub usuwanie klas połączeń.
-
Ustawiania dla poszczególnych klas szczególnych parametrów: odległość, szerokość ścieżek, rozmiar przelotek.
-
Przypisywanie poszczególnych sieci do utworzonej lub domyślnej klasy połączeń.
8.3.3. Edycja reguł globalnych
Oprócz reguł związanych z klasami połączeń dostępne są też reguły globalne. Dotyczą one:
-
Enabling/disabling Blind/buried Vias use.
-
Enabling/disabling Micro Vias use.
-
Minimum Allowed Values for tracks and vias.
Jeśli jakaś wartość jest mniejsza niż minimalna wartość określona tutaj, DRC wygeneruje błąd. Drugi panel, w którym można określić globalne reguły projektowe wygląda następująco:
Okno dialogowe pozwala także manualnie określić rozmiary ścieżek i przelotek wybranych przez użytkownika.
When routing, one can select one of these values to create a track or via, instead of using the netclass’s default value.
System taki jest szczególnie użyteczny, gdy na krótkim odcinku będzie wymagana inna szerokość trasowanej ścieżki (np. w przypadku przeprowadzania ścieżek pomiędzy punktami lutowniczymi).
8.3.4. Parametry minimalne przelotek
Pcbnew obsługuje trzy typy przelotek:
-
Through vias (usual vias).
-
Przelotki ślepe (blind) lub zagrzebane (buried).
-
Mikroprzelotki, podobne do przelotek zagrzebanych ale ograniczone do zewnętrznych warstw i najbliższych im warstw sąsiednich. Są one przeznaczone do łączenia układów montowanych w technologii BGA z najbliższą warstwą wewnętrzną. Rozmiar takich przelotek jest bardzo mały, a otwory są z reguły wykonywane laserowo.
Domyślnie, wszystkie przelotki mają ten sam rozmiar odwiertu.
This dialog specifies the smallest acceptable values for via parameters. On a board, a via smaller than specified here generates a DRC error.
8.3.5. Parametry minimalne ścieżek
Określa minimalną, akceptowalną szerokość ścieżki. Na płytce, mniejsze szerokości ścieżek niż określone tutaj wygenerują błąd DRC.
8.3.6. Własne rozmiary ścieżek
Z pomocą tego panelu można określić własne rozmiary ścieżek i przelotek. Podczas ręcznego trasowania można użyć tych parametrów zamiast tych dziedziczonych z klasy połączeń.
8.4. Przykłady i typowe rozmiary
8.4.1. Szerokości ścieżek
Użyj największej możliwej wartości, zgodnie z minimalnymi rozmiarami podanymi tutaj:
Units | CLASS 1 | CLASS 2 | CLASS 3 | CLASS 4 | CLASS 5 |
---|---|---|---|---|---|
mm |
0.8 |
0.5 |
0.4 |
0.25 |
0.15 |
mils |
31 |
20 |
16 |
10 |
6 |
8.4.2. Prześwit pomiędzy ścieżkami
Units | CLASS 1 | CLASS 2 | CLASS 3 | CLASS 4 | CLASS 5 |
---|---|---|---|---|---|
mm |
0.7 |
0.5 |
0.35 |
0.23 |
0.15 |
mils |
27 |
20 |
14 |
9 |
6 |
Zwykle, minimalny prześwit jest bardzo podobny do minimalnej szerokości ścieżki.
8.5. Przykłady stosowanych reguł projektowych
8.5.1. Prosty - stosowanych w amatorskich PCB
-
Prześwit: 0.35mm (0.0138 cali).
-
Szerokość ścieżki: 0.8mm (0.0315 cali).
-
Rozmiar padu dla układów scalonych i przelotek: 1.91mm (0.0750 cali).
-
Rozmiar padu dla elementów dyskretnych: 2.54mm (0.1 cala).
-
Szerokość ścieżki masy: 2.54mm (0.1 cala).
8.5.2. Standard
-
Prześwit: 0.35mm (0.0138 cali).
-
Szerokość ścieżki: 0.5mm (0.0127 cala).
-
Szerokość pada dla układów scalonych: stosuje się wydłużanie pól lutowniczych by umożliwić prowadzenie ścieżek pomiędzy padami i dać jeszcze wystarczającą ilość miejsca na powierzchnię kleju (1.27x2.54 mm -→0.05x0.1 cala).
-
Przelotki: 1.27mm (0.0500 cala).
8.6. Manualne trasowanie ścieżek
Manual routing is often recommended, because it is the only method offering control over routing priorities. For example, it is preferable to start by routing power tracks, making them wide and short and keeping analog and digital supplies well separated. Later, sensitive signal tracks should be routed. Amongst other problems, automatic routing often requires many vias. However, automatic routing can offer a useful insight into the positioning of footprins. With experience, you will probably find that the automatic router is useful for quickly routing the obvious tracks, but the remaining tracks will best be routed by hand.
8.7. Pomoc w trasowaniu ścieżek
Pcbnew oferuje parę ułatwień przy trasowaniu manualnym. Może na przykład
wyświetlać połączenia wspomagające (ratsnest), jeśli opcja
na lewym
panelu jest aktywna.
The button
allows one to highlight a
net (click to a pad or an existing track to highlight the corresponding
net).
The DRC checks tracks in real time while creating them. One cannot create a track which does not match the DRC rules. It is possible to disable the DRC by clicking on the button. This is, however, not recommended, use it only in specific cases.
8.7.1. Trasowanie ścieżek
A track can be created by clicking on the button
. A new track must start on a pad or on
another track, because Pcbnew must know the net used for the new track (in
order to match the DRC rules).
When creating a new track, Pcbnew shows links to nearest unconnected pads, link number set in option "Max. Links" in General Options.
End the track by double-clicking, by the pop-up menu or by its hot key.
8.7.2. Przesuwanie i przeciąganie ścieżek
When the button
is active, the track
where the cursor is positioned can be moved with the hotkey M. If you
want to drag the track you can use the hotkey G.
8.7.3. Wstawianie przelotek
Przelotki mogą być umieszczane tylko podczas trasowania ścieżek:
-
Z wykorzystaniem opcji Wstaw przelotkę z menu podręcznego.
-
By the hotkey V.
-
Automatycznie, jeśli podczas trasowania zostaje zmieniona warstwa sygnałowa za pomocą odpowiednich klawiszy skrótów.
8.8. Wybór/Edycja szerokości ścieżek oraz rozmiaru przelotek
When clicking on a track or a pad, Pcbnew automatically selects the corresponding Netclass, and the track size and vias dimensions are derived from this netclass.
Jak wcześniej zostało zauważone, Edytor Reguł globalnych posiada narzędzie do wprowadzenia dodatkowych rozmiarów ścieżek i przelotek. Aby móc ich używać podczas trasowania ścieżek można korzystać z:
-
List rozwijanych na górnym pasku narzędzi.
-
Gdy przycisk
jest aktywny, bieżąca szerokość ścieżki może zostać wybrana z menu podręcznego, wybierając podmenu Wybierz szerokość ścieżki.
-
Dlatego użytkownik może korzystać z domyślnych wartości z klas połączeń, lub w razie potrzeby określonej wartości.
8.8.1. Wybór szerokości ścieżek i rozmiaru przelotek z paska narzędzi
|
Track width selection. The symbol * is a mark for default Netclass value selection. |
|
Selecting a specific track width value. The first value in list is always the netclass value. Others values are tracks widths entered from the Global Design Rules editor. |
|
Via size selection. The symbol * is a mark for default Netclass value selection. |
|
Selecting a specific via dimension value. The first value in list is always the netclass value. Others values are vias dimensions entered from the Global Design Rules editor. |
|
When enabled: Automatic track width selection. When starting a track on an existing track, the new track has the same width as the existing track. |
|
Grid size selection. |
|
Zoom selection. |
8.8.2. Używanie menu podręcznego
One can select a new size for routing, or change to a previously created via or track segment:
If you want to change many via (or track) sizes, the best way is to use a specific Netclass for the net(s) that must be edited (see global changes).
8.9. Edycja i korekcja ścieżek
8.9.1. Zmiana trasy ścieżki
W wielu przypadkach zmiana prowadzenia ścieżki jest wystarczająca.
Poniższy rysunek przedstawia ścieżkę w trakcie tworzenia nowej trasy:
Gdy nowa ścieżka zostanie zakończona:
Pcbnew will automatically remove the old track if it is redundant.
8.9.2. Zmiany globalne ścieżek i przelotek
Czasami zachodzi potrzeba, by w zaprojektowanej płytce poprawić niektóre ścieżki lub przelotki. W przypadku dużej ilości zmian, modyfikacja krok po kroku byłaby czasochłonna. Pcbnew umożliwia jednak zautomatyzowanie tego procesu z pomocą polecenia Edycja rozmiarów wszystkich ścieżek i przelotek dostępną z menu podręcznego:
Pojawiające się wtedy okno dialogowe pozwala na zmiany globalne ścieżek i/lub przelotek dla:
-
Bieżącej sieci.
-
Dla całej płytki.
9. Router Interaktywny
The Interactive Router lets you quickly and efficiently route your PCBs by shoving off or walking around items on the PCB that collide with the trace you are currently drawing.
Wspierane tryby są następujące:
-
Podświetlanie kolizji, gdzie następuje podświetlenie wszystkich kolizyjnych obiektów za pomocą jasnozielonego koloru, oraz wskazanie miejsc naruszeń dozwolonego prześwitu pomiędzy nimi.
-
Rozsuwanie, gdzie następuje próba wypchnięcia wszystkich elementów kolidujących z bieżąco trasowaną ścieżką.
-
Omijanie, gdzie następuje próba ominięcia przeszkód poprzez ich otaczanie/omijanie.
9.1. Konfiguracja
Przed użyciem Routera Interaktywnego, należy ustawić dwie rzeczy:
-
Prześwit. By ustawić prześwit należy otworzyć okno dialogowe Reguły Projektowe i sprawdzić czy przynajmniej domyślne wartości prześwitu są poprawne.

-
Włączyć tryb OpenGL poprzez wywołanie polecenia Przełącz na tryb OpenGL z menu Widok lub przez naciśnięcie klawisza F11.

9.2. Trasowanie ścieżek
By aktywować router należy nacisnąć przycisk Router Interaktywny
lub klawisz
X. Kursor zmieni swą postać, a nazwa wybranego narzędzia pojawi się na
pasku statusu.
By rozpocząć ścieżkę należy kliknąć na dowolnym elemencie (polu lutowniczym, ścieżce lub przelotce) lub przez ponowne naciśnięcie klawisza X w czasie gdy kursor myszy znajdować się będzie nad tym elementem. Nowa ścieżka użyje nazwy sieci takiej jak początkowy element. Klikając lub wciskając X w pustym miejscu rozpocznie ścieżkę, ale nie będzie ona posiadać przypisanej nazwy sieci.
Move the mouse to define shape of the track. The router will try to follow the mouse trail, hugging unmovable obstacles (such as pads) and shoving colliding traces/vias, depending on the mode. Retreating the mouse cursor will cause the shoved items to spring back to their former locations.
Klikając na polu/ścieżce/przelotce należącej do tej samej sieci kończy trasowanie. Klikając w pustym miejscu kończy poprzedni segment i rozpoczyna nowy od tego miejsca.
By zatrzymać trasowanie i anulować wszystkie zmiany (rozsunięcie ścieżek, przelotek, itd.), należy nacisnąć Esc.
Naciskając V lub wybierając Wstaw przelotkę na wylot z menu kontekstowego podczas trasowania dołącza przelotkę na końcu prowadzonej ścieżki i pozwala ją przesuwać. Naciskając ponownie V można pozbyć się przelotki na końcu ścieżki. Kliknięcie stawia taką przelotkę w miejscu kliknięcia, a trasowanie jest kontynuowane (ale na innej warstwie).
Naciskając klawisz / lub wybierając Przełącz nachylenie ścieżki z menu kontekstowego zmienia sposób załamania dwóch sąsiadujących ze sobą segmentów gdy punkt początkowy i końcowy prowadzonej ścieżki nie leżą w tej samej linii.
Zapamiętaj
|
Domyślnie router przyciąga ścieżki do centralnych punktów/osi pozostałych obiektów. Przyciąganie można wyłączyć przytrzymując Shift podczas trasowania lub wyboru poszczególnych elementów. |
9.3. Ustawianie szerokości ścieżek i rozmiaru przelotek
Istnieje kilka możliwości wcześniejszego wyboru rozmiaru ścieżki/przelotki lub zmiany tego rozmiaru podczas trasowania:
-
Używając domyślnych skrótów klawiszowych.
-
Naciskając klawisz W lub za pomocą polecenia Własny rozmiar ścieżki z menu kontekstowego i wpisując ten rozmiar.
-
Wybrać z listy wcześniej zdefiniowanych rozmiarów poleceniem Wybierz szerokość ścieżki z menu kontekstowego.
-
Aktywując opcję Użyj początkowej szerokości ścieżki z listy Wybierz szerokość ścieżki w menu, by automatycznie rozpocząć nową ścieżkę o szerokości takiej samej jak połączony z nią element.
9.4. Przeciąganie
Router umożliwia przeciąganie segmentów, załamań ścieżek i przelotek. By przeciągnąć element, należy kliknąć na niego z wciśniętym klawiszem Ctrl, najechać na niego i nacisnąć G lub wybrać polecenie Przeciągnij Ścieżkę/Przelotkę z menu podręcznego. Zakończyć przeciąganie można poprzez ponowne kliknięcie lub użycie klawisza Esc.
9.5. Opcje
Zachowanie routera może być skonfigurowane za pomocą menu kontekstowego wywoływanego przez wciśnięcie klawisza E lub przez wybranie polecenia Opcje routera. Menu to będzie wyglądać następująco:

Dostępne opcje to:
-
Tryb - Wybiera tryb w jaki sposób router ma osługiwać naruszenia DRC (rozpychać, omijać, itd.)
-
Rozsuwaj przelotki - gdy opcja jest wyłączona, przelotki są traktowane jako obiekty zablokowane i będą omijane niżeli rozsuwane.
-
Przeskakuj ponad przeszkodami - gdy opcja jest włączona, router będzie próbował przesuwać kolidujące ścieżki znajdujące się przed trwałymi przeszkodami (np. polami lutowniczymi), niż z powrotem "odzwierciedlać" miejsca kolizji
-
Usuwaj nadmiarowe ścieżki - gdy opcja jest włączona, pętle podczas trasowania (np. gdy nowa ścieżka wygląda na nową drogę połączenia już istniejącego, poprzednie połączenie zostanie usunięte). Usuwanie pętli działa tylko lokalnie (tylko pomiędzy początkiem a końcem bieżąco trasowanej ścieżki).
-
Automatycznie zwężaj - gdy opcja jest włączona, router będzie się starał przechodzić pomiędzy polami/przelotkami w sposób nienaruszający zasad, unikając ostrych kątów i nierównych kącików ścieżek.
-
Wygładzaj przeciągane segmenty - gdy opcja jest włączona, router będzie próbował łączyć niektóre segmenty w ciągłe ścieżki by wyeliminować ich fragmentację (dla łatwego ich przeciągania).
-
Zezwól na łamanie zasad DRC (tylko w trybie Podświetl miejsca kolizji) - pozwala na zestawienie trasowanego połączenia, nawet gdy narusza to zasady DRC.
-
Głębokość optymalizacji - określa ile czasu router może poświęcić na optymalizację trasowanych/rozsuwanych ścieżek. Dłuższy czas pozwala na lepszy routing (lecz wolniejszy), mniejszy czas daje szybsze efekty podczas trasowania, ale pojawiają się nierówne śegmenty.
10. Tworzenie wypełnionych stref
Strefy wypełnień definiowane są za pomocą obrysu (zamkniętego wielokąta) i mogą zawierać przestrzenie niewypełnione (zamknięte wielokąty wewnątrz obrysu). Strefy można umieszczać zarówno na warstwach sygnałowych jak i technicznych.
10.1. Tworzenie wypełnionych stref na warstwach sygnałowych (miedzi)
Pad (and track) connections to filled copper areas are checked by the DRC engine. A zone must be filled (not just created) to connect pads. Pcbnew currently uses track segments or polygons to fill copper areas.
Each option has its advantages and its disadvantages, the main disadvantage being increased screen redraw time on slower machines. The final result is however the same.
For calculation time reasons, the zone filling is not recreated after each change, but only:
-
Wydaniu polecenia wypełnienia strefy.
-
When a DRC test is performed.
Copper zones must be filled or refilled after changes in tracks or pads are made. Copper zones (usually ground and power planes) are usually attached to a net.
Dlatego też, przy tworzeniu strefy należy:
-
Select parameters (net name, layer…). Turning on the layer and highlighting this net is not mandatory but it is good practice.
-
Create the zone limit (If not, the entire board will be filled.).
-
Wypełnić strefę.
Pcbnew tries to fill all zones in one piece, and usually, there will be no unconnected copper blocks. It can happen that some areas remain unfilled. Zones having no net are not cleaned and can have insulated areas.
10.2. Tworzenie stref na warstwach sygnałowych
10.2.1. Tworzenie krawędzi strefy
Aby narysować strefę należy użyć narzędzia ukrytego pod ikoną
. Warstwą aktywną w tym
wypadku musi być jedna z warstw sygnałowych (miedzi). Gdy kliknie się na
obszarze roboczym w miejscu gdzie ma zaczynać się obrys strefy, otworzy się
okno dialogowe z opcjami strefy:
Można tu ustalić parametry dla rysowanej strefy:
-
Net
-
Layer
-
Opcje wypełnienia
-
Opcje otaczania pól lutowniczych
-
priorytet,
Draw the zone limit on this layer. This zone limit is a polygon, created by a left-clicking at each corner. A double-click will end and close the polygon. If the starting point and ending point are not at the same coordinate, Pcbnew will add a segment from the end point to the start point.
Zapamiętaj
|
|
In the following image you can see an example of a zone limit (polygon in thin hatched line):
10.2.2. priorytet,
Czasem mała strefa wypełnienia musi zostać utworzona wewnątrz innej większej strefy wypełnienia.
This is possible if the small zone has a higher priority level than the large zone.
Level setting:
Przykładowo. Na rysunku poniżej znajdują się dwie strefy. Pierwsza z nich - zewnętrzna - ma priorytet ustawiony na wartość 0, druga zaś - wewnętrzna - ma ustawiony priorytet ustawiony na wartość 5:
Po wypełnieniu stref, będą one wyglądać następująco:
10.2.3. Wypełnianie strefy
When filling a zone, Pcbnew removes all unconnected copper islands. To access the zone filling command, right-click on the edge zone.
Z menu podręcznego wybrać polecenie Wypełnij strefę. Poniższy rysunek pokazuje rezultat jaki uzyskamy po wydaniu tego polecenia:
Jak widać wolne obszary wewnątrz obrysu zostały wypełnione jednolitą płaszczyzną. Można jednak zauważyć, że w obrysie strefy znalazły się też pola które nie zostały wypełnione. Dzieje się tak dlatego, że pola te nie mają możliwości połączyć się z resztą strefy:
-
Jedną z przeszkód jest ścieżka przechodząca przez dwie przeciwległe krawędzie.
-
Nie ma też żadnego punktu łączącego ten obszar z pozostałym.
Zapamiętaj
|
W strefie można utworzyć wiele podstref zwanych strefami odciętymi, w których można wkluczyć wypełnienia (cut-outs). Poniżej prosty przykład: |
10.3. Opcje wypełnienia
When you fill an area, you must choose:
-
Wybrać tryb wypełnienia (Wielokąt, Segment).
-
Wybrać prześwit dla strefy i minimalną szerokość wypełnienia.
-
Wybrać tryb łączenia pól lutowniczych ze strefą wewnątrz strefy (Brak, Pełny, Połączenie termiczne).
-
Thermal relief parameters.
10.3.1. Wybrać tryb w jakim pokazywany jest obrys strefy.
Strefy mogą zostać wypełnione za pomocą wielokątów lub segmentów. Rezultat jest ten sam. Jeśli jednak będą problemy z trybem wielokątów (wolne odświeżanie widoku) lepiej użyć trybu z wypełnieniem w postaci segmentów.
10.3.2. Prześwity oraz minimalna grubość miedzi
Dobrym wyborem jest ustawienie prześwitu dla strefy nieco większego niż siatka jaka używana jest przy trasowaniu połączeń. Minimalny szerokość wypełnienia ogranicza możliwość tworzenia zbyt małych płaszczyzn w obrębie strefy.
Ostrzeżenie
|
Jeśli wartość ta jest zbyt duża, małe kształty jak odcinki łącza termicznego mogą nie być rysowane. |
10.3.3. Opcje otaczania pól lutowniczych
Pola lutownicze należące do tej samej sieci co strefa mogą zostać dołączone lub wyłączone ze strefy, albo połączone ze strefą za pomocą łącz termicznych.
-
Jeśli pola zostaną dołączone to można napotkać trudności przy lutowaniu bądź rozlutowywaniu takich pól.
-
If excluded, the connection to the zone will not be very good.
-
The zone can be filled only if tracks exists to connect zones areas.
-
Pads must be connected by tracks.
-
-
A thermal relief is a good compromise.
-
Pad is connected by 4 track segments.
-
The segment width is the current value used for the track width.
-
10.3.4. Parametry łączy termicznych
Te dwie opcje przeznaczone są do określenia szerokości wolnego pola otaczającego pola lutownicze w przypadku łączy termicznych:
10.3.5. Wybór parametrów
The copper width value for thermal reliefs must be bigger than the minimum thickness value for the copper zone. If not, they cannot be drawn.
Additionally, a too large value for this parameter or for antipad size does not allow one to create a thermal relief for small pads (like pad sizes used for SMD components).
10.4. Dodawanie strefy odciętej wewnątrz strefy wypełnionej
Strefa odcięta musi być częścią innej strefy wypełnienia. Jest to warunek obowiązkowy. Zatem przed rozpoczęciem definiowania strefy odciętej musi istnieć już obrys strefy wypełnienia. Dodawanie strefy odciętej jest przeprowadzane podobnie jak dodawanie strefy wypełnienia, z tą różnicą, że stanowić ona będzie obszar niewypełniony:
-
Right-click on an existing edge outline.
-
Następnie wybrać polecenie Strefa odcięta na prawym pasku narzędzi lub z menu podręcznego wybrać polecenie Dodaj obszar odcięty.
-
I dokładnie tak samo jak w przypadku strefy wypełnienia narysować obrys.
10.5. Edycja krawędzi
Jest kilka sposobów by zmodyfikować obrys strefy:
-
Można przesuwać jej narożniki lub krawędzie za pomocą polecenia Przeciągnij narożnik lub Przeciągnij segment obrysu.
-
Można dodawać lub usuwać narożniki za pomocą polecenia Utwórz narożnik lub Usuń narożnik.
-
Można dodać podobną strefę (Dodaj strefę bliźniaczą*) lub strefę odciętą (*Dodaj obszar odcięty).
W przypadku nałożenia się stref na siebie zostaną one odpowiednio połączone razem.
To do that, right-click on a corner or on an edge, then select the proper command.
Poniższy rysunek ukazuje zachowanie obrysu strefy odciętej podczas przeciągania narożnika:
Po zakończeniu polecenia strefa powinna wyglądać tak:
Ponieważ obrysy strefy spotkały się w dwóch miejscach nastąpiło odjęcie obrysu strefy odciętej od strefy wypełnienia.
10.5.1. Powielanie istniejących stref
Istniejące strefy można powielać na inne warstwy. W tym celu należy naprowadzić kursor na krawędź strefy, którą trzeba powielić i z menu podręcznego wybrać polecenie Powiel strefę.
Finalny rezultat:
10.6. Editing zone parameters
When right-clicking on an outline, and using Edit Zone Params the Zone params Dialog box will open. Initial parameters can be inputted . If the zone is already filled, refilling it will be necessary.
10.7. Końcowe wypełnianie strefy
When the board is finished, one must fill or refill all zones. To do this:
-
Aktywować narzędzia związane ze strefami klikając w ikonę
.
-
Right-click to display the pop-up menu.
-
Użyć polecenia Wypełnij strefę.
Ostrzeżenie
|
Calculation can take some time if the filling grid is small. |
10.8. Zmiany nazw sieci w strefie
Przy zmianach na schemacie, lista sieci może również ulec zmianie, a w związku z tym niektóre nazwy sieci także mogą zostać zmienione. Dla przykładu, sieć VCC może stać się siecią o nazwie +5V po zmianach na schemacie.
Gdy zostanie przeprowadzona globalna kontrola DRC, Pcbnew sprawdzi czy nazwa sieci powiązana ze strefą wypełnienia nadal istnieje, a jeśli nie zostanie zgłoszony błąd.
Manually editing the zone parameters will be necessary to change the old name to the new one.
10.9. Tworzenie stref na warstwach technicznych
10.9.1. Tworzenie obrysu strefy
Tworzenie wypełnionych stref na warstwach technicznych jest możliwe, jednak przebiega nieco inaczej niż w przypadku warstw sygnałowych. + Również i tu należy wybrać z prawego paska narzędzi ikonę . Jednak wcześniej należy aktywować wybraną warstwę techniczną.
When clicking to start the zone outline, this dialog box is opened:
Z listy warstw należy wybrać warstwę docelową dla strefy, określić parametry (podobne do poznanych wcześniej) i za pomocą myszy narysować obrys strefy tak samo jak w przypadku stref na warstwach sygnałowych.
Zapamiętaj
|
|
10.10. Tworzenie stref chronionych
Wybierz narzędzie
Aktywną warstwą powinna być jedna ze stref sygnałowych (miedzi).
Przy kliknięciu w miejscu pierwszego narożnika nowej strefy chronionej, otwierany jest następujące okno dialogowe:
Można tu wybrać kilka opcji, z której najważniejsza grupa zawiera wybór elementów, które nie moga znajdować się w obszarze chronionym:
-
Tracks.
-
Vias.
-
Copper pours.
Gdy jakikolwiek element z powyższej listy znajdzie się w strefie chronionej, to zgłoszony zostanie błąd DRC.
For copper zones, the area inside a keepout with no copper pour will be not filled. A keep-out area is a like a zone, so editing its outline is analogous to copper zone editing.
11. Przygotowywanie plików produkcyjnych
Let us see now what are the steps necessary for the creation of the necessary files for the production of your printed circuit board.
All files generated by KiCad are placed in the working directory which is the same directory that contains the xxxx.brd file for the printed circuit board.
11.1. Końcowe przygotowania projektu
Generowanie niezbędnych plików dla produkcji obwodu drukowanego zawiera następujące kroki przygotowawcze:
-
Oznaczenie warstw (np., top lub front i bottom lub back) oraz nazwy projektu przez umieszczenie odpowiednich tekstów na każdej z warstw. W ten sposób zakład produkcyjny będzie wiedział z jaką kliszą ma do czynienia.
-
Wszystkie teksty umieszczone na dolnej warstwie miedzi (czasem zwanej solder lub bottom) muszą być w lustrzanym odbiciu, gdyż będą one normalnie widoczne po obróceniu płytki na drugą stronę.
-
Stworzenie wszystkich planów (np. ground plane) i wypełnień, modyfikując ścieżki jeśli trzeba by ich ciągłość była zapewniona.
-
Umieszczenie znaczników odniesienia (target crosshairs) oraz możliwych rozmiarów obrysu płytki (są one zwykle umieszczane na jednej z warstw dowolnego użytku).
Here is an example showing all of these elements, except ground planes, which have been omitted for better visibility:
Dodatkowo na powyższym obrazku został umieszczony także klucz dla czterech
warstw:
11.2. Końcowy test DRC
Przed wygenerowaniem plików wyjściowych, usilnie zalecane jest przeprowadzenie pełnego testu DRC, gdyż finalne sprawdzenie płytki może ustrzec przed przykrymi niespodziankami już po wyprodukowaniu płytek.
Przy uruchamianiu testu DRC wszystkie strefy są wypełniane lub wypełniane ponownie jeśli wcześniej zostały już wypełnione.
Adjust the parameters accordingly and then press the "Start DRC" button.
Ten test końcowy zapobienie błędom jakie mogłyby się ujawnić już po wyprodukowaniu obwodu drukowanego.
11.3. Ustawienie punktu początkowego osi pomocniczej
Set the coordinates origin for the photo plot and drill files, one must
place the auxiliary axis on this origin. Activate the icon
. Move the auxiliary axis by
right-clicking on the chosen location.
11.4. Generowanie plików dla fotoplotera
Generowaniem plików przeznaczonych dla fotoplotera zajmuje się narzędzie wywoływane za pomocą polecenia Rysuj z menu Plik.
W większości przypadków będą to pliki w formacie GERBER. Jednakże, program daje również możliwość generacji plików w formatach HPGL oraz POSTSCRIPT. Przy wybranej opcji Postscript dla formatu wyjściowego, okno dialogowe będzie wyglądać nieco inaczej:
In these formats, a fine scale adjust can be used to compensate for the plotter accuracy and to have a true scale of 1 for the output:
11.4.1. Format GERBER
For each layer, Pcbnew generates a separate file following the GERBER 274X standard, by default in 3.4 format (each coordinate in the file is represented by 7 digits, of which 3 are before the decimal point and 4 follow it), units in inches, and a scale of 1.
It is normally necessary to create files for all of the copper layers and, depending on the circuit, for the silkscreen, solder mask, and solder paste layers. All of these files can be produced in one step, by selecting the appropriate check boxes.
For example, for a double-sided circuit with silkscreen, solder mask and solder paste (for SMD components), 8 files should be generated (xxxx represents the name of the .brd file).
-
xxxx-B_Cu.pho dla dolnej warstwy miedzi.
-
xxxx-F_Cu.pho dla górnej warstwy miedzi.
-
xxxx-F_SilkS.pho dla warstwy opisowej na stronie elementów.
-
xxxx-B_SilkS.pho dla warstwy opisowej na stronie lutowania.
-
xxxx.soldpcmp.pho for the component-side solder paste.
-
xxxx.soldpcu.pho for the copper-side solder paste.
-
xxxx.maskcmp.pho for the component-side solder mask.
-
xxxx.maskcu.pho for the copper-side solder mask.
Format plików GERBER:
Format GERBER używany przez Pcbnew to: RS274X, Format 3.4, Calowy, Pominięte zera początkowe, Format Abs. Są to najczęściej używane ustawienia.
11.4.2. Format POSTSCRIPT
W przypadku plików Postscript standardowym rozszerzeniem dla plików wyjściowych będzie .ps. Tak samo jak w przypadku plików w formacie HPGL, rysowanie może odbywać się w wybranej skali lub jako lustrzane odbicie. Jeśli opcja Użyj osi pomocniczej jako punktu początkowego nie jest aktywna, punkt początkowy współrzędnych jest brany z punktu centralnego rysunku.
Jeśli zaznaczona jest opcja Rysuj oznaczenia arkusza na wszystkich warstwach, zostanie narysowana również ramka opisowa.
11.4.3. Opcje rysowania
Format Gerber
Formaty pozostałe
Specyficzne opcje związane z formatem GERBER:
Use Protel filename extensions |
Use .gbl .gtl instead of .pho for file name extensions. |
Include extended attributes |
Output extended attributes to file. |
Subtract soldermask from silkscreen |
Remove all Silk from solder paste areas. |
11.4.4. Pozostałe formaty
Standardowe rozszerzenie pliku zależy od typu pliku wyjściowego.
Some options are not available for some formats.
Tak samo jak w przypadku plików w formacie HPGL, rysowanie może odbywać się w wybranej skali lub jako lustrzane odbicie.
Opcja Znaczniki wierceń oferuje możliwość wypełnienia całkowitego pól lutowniczych, pozostawienia pustego pola zgodnego z rozmiarem wiertła lub umieszczenia na nich tylko małego pustego pola naprowadzającego (dla wiercenia ręcznego).
Jeśli zaznaczona jest opcja Rysuj oznaczenia arkusza na wszystkich warstwach, zostanie narysowana również ramka opisowa.
11.5. Globalne ustawienia prześwitu dla warstw maski lutowniczej i maski pasty lutowniczej
Mask clearance values can be set globally for the solder mask layers and the solder paste layers. These clearances can be set at the following levels.
-
Na poziomie pól lutowniczych.
-
Na poziomie footprintów.
-
Globalnie.
Pcbnew w takim przypadku korzysta z priorytetów ustawień i wartość ostateczna jest brana:
-
Z wartości ustalonej dla pól lutowniczych. Jeśli jest zerowa to
-
Z wartości ustalonej dla footprintu. Jeśli jest zerowa to
-
Z wartości ustalonej globalnie.
11.5.1. Dostęp do opcji
Odpowiednie opcje są dostępne za pomocą menu Ustawienia → Prześwit maski pól lutowniczych:
Po wybraniu tego polecenia wyświetlane jest okno dialogowe:
11.5.2. Prześwit maski lutowniczej
A value near to 0.2 mm is usually good. This value is positive because the mask is usually bigger than the pad.
Można ustawić minimalną wartość dla szerokości soldermaski, pomiędzy dwoma polami lutowniczymi.
Gdy wartość jest mniejsza niż wartość minimalna, kształty dwóch masek zostaną połączone.
11.5.3. Prześwit maski pasty lutowniczej
Końcowa wartość prześwitu jest sumą prześwitu dla pasty lutowniczej oraz procentowej wielkości rozmiaru padu.
This value is negative because the mask is usually smaller than the pad.
11.6. Generowanie plik(ów) wierceń
The creation of a drill file xxxx.drl following the EXCELLON standard is always necessary.
Można jednak również opcjonalnie wygenerować plan wierceń, który może być zapisany w formacie HPGL (xxxxxx.plt) lub w formacie POSTSCRIPT (xxxxxx.ps), lub/oraz opcjonalny raport wierceń (jako zwykły plik tekstowy). Jednak jest on użyteczny tylko w niektórych przypadkach, na przykład jako materiał wyjściowy przy dodatkowym sprawdzeniu.
-
The drill map can be plotted using several formats.
-
The drill report is a plain text file.
The generation of these files is controlled via:
-
"Create Drill File" button, or
-
Files/Fabrication Outputs/Drill file menu selection.
Główne okno tego narzędzia wygląda w ten sposób:
By ustawić punkt odniesienia, używane są następujące opcje:
-
_Bezwzględny_ : używane są współrzędne bezwzględne.
-
Auxiliary axis: coordinates are relative to the auxiliary axis, use the icon (right toolbar) to set it.
11.7. Generating wiring documentation
To produce wiring documentation files, the component and copper silkscreen layers can be traced. Usually, just the component-side silkscreen markings are sufficient for wiring a PCB. If the copper-side silkscreen is used, the text it contains should be mirrored in order to be readable.
11.8. Generowanie plików dla automatów montujących Pick and Place
This option is accessed via the Postprocess/Create Cmp file menu option. However, no file will be generated unless at least one footprint has the Normal+Insert attribute activated (see Editing Footprints). One or two files will be produced, depending upon whether insertable components are present on one or both sides of the PCB. A dialogue box will display the names of the file(s) created.
11.9. Opcje zaawansowane
The options described below (part of the Files/Plot dialogue) allow for fine-grained control of the tracing process. They are particularly useful when printing the silkscreen markings for wiring documentation.
Dostępne są następujące opcje:
Use Proper Gerber Extensions |
GERBER format specific. When creating files, use specific extensions foe each file. If disabled the Gerber file extension is .pho. |
Exclude pcb edge layer |
GERBER format specific. Do not plot graphic items on edge layer. |
Print Sheet Ref |
Trace sheet outline and the cartridge. |
Print Pads on Silkscreen |
Enables/disables printing of pad outlines on the silkscreen layers (if the pads have already been declared to appear on these layers). Prevents any pads from being printed in the disabled mode. |
Print Footprint Value |
Enables printing of VALUE text on the silkscreen. |
Print Footprint Reference |
Enables printing of the REFERENCE text on the silkscreen. |
Print other footprint texts |
Enables the printing of other text fields on the silkscreen. |
Force Print Invisible Texts |
Forces printing of fields (reference, value) declared as invisible. In combination with Print Footprint Reference and Print Footprint Value, this option enables production of documents for guiding wiring and repair. These options have proven necessary for circuits using components that are too small (SMD) to allow readable placement of two separate text fields. |
12. Footprint Editor - Managing Libraries
12.1. Overview of Footprint Editor
Pcbnew can simultaneously maintain several libraries. Thus, when a footprint is loaded, all libraries that appear in the library list are searched until the first instance of the footprint is found. In what follows, note that the active library is the library selected within the Footprint Editor, the program will now be described
Footprint Editor enables the creation and the editing of footprints:
-
Dodawanie oraz usuwanie pól lutowniczych.
-
Changing pad properties (shape, layer) for individual pads or globally for all pads of a footprint.
-
Edycja postaci graficznej (linie, tekst).
-
Edycja pól informacyjnych (wartość, odniesienie, …).
-
Edycja dołączonej dokumentacji (opis, słowa kluczowe).
Footprint Editor allows the maintenance of the active library as well by:
-
Listing the footprints in the active library.
-
Deletion of a footprint from the active library.
-
Saving a footprint to the active library.
-
Saving all of the footprints contained by a printed circuit.
Z pomocą ModEdit jest również możliwe tworzenie nowych bibliotek.
Pliki z rozszerzeniem .mod stanowią poszczególne biblioteki.
12.2. Accessing Footprint Editor
The Footprint Editor can be accessed in two different ways:
-
Bezpośrednio, za pomocą ikony
na głównym pasku narzędzi Pcbnew.
-
In the edit dialog for the active footprint (see figure below: accessed via the context menu), there is the button Footprint Editor.
In this case, the active footprint of the board will be loaded automatically in Footprint Editor, enabling immediate editing or archiving.
12.3. Footprint Editor user interface
By calling Footprint Editor the following window will appear:
12.4. Top toolbar in Footprint Editor
Korzystając z tego paska narzędzi dostępne są następujące polecenia:
|
Select the active library. |
|
Save the current footprint to the active library, and write it to disk. |
|
Create a new library and save the current footprint in it. |
|
Open the Footprint Viewer |
|
Access a dialog for deleting a footprint from the active library. |
|
Create a new footprint. |
|
Create a footprint using a wizard |
|
Load a footprint from the active library. |
|
Load (import) a footprint from the printed circuit board. |
|
Export the current footprint to the printed circuit board. when the footprint was previously imported from the current board. It will replace the corresponding footprint on the board (i.e., respecting position and orientation). |
|
Export the current footprint to the printed circuit board. It will be copied on to the printed circuit board at position 0. |
|
Import a footprint from a file created by the Export command. |
|
Export a footprint. This command is essentially identical to that for creating a library, the only difference being that creates a library in the user directory, while creates a library in the standard library directory (usually kicad/modules). |
|
Undo and Redo |
|
Invokes the footprint properties dialog. |
|
Call the print dialog. |
|
Standard zoom commands. |
|
Call the pad editor. |
|
Perform a check of footprint correctness |
12.5. Tworzenie nowej biblioteki
Aby utworzyć nową bibliotekę można użyć jednego z dwóch narzędzi: Nowa
biblioteka
, w przypadku którego plik biblioteki jest domyślnie tworzony w
katalogu z bibliotekami; Eksport
, w przypadku którego
plik biblioteki jest domyślnie tworzony w katalogu roboczym projektu.
A file-choosing dialog allows the name of the library to be specified and its directory to be changed. In both cases, the library will contain the footprint being edited.
Ostrzeżenie
|
Jeśli istnieje już jakaś biblioteka z taką samą nazwą, zostanie ona nadpisana bez ostrzeżenia. |
12.6. Saving a footprint in the active library
The action of saving a footprint (thereby modifying the file of the active
library) is performed using this button
. If a footprint of the same name
already exists, it will be replaced. Since you will depend upon the accuracy
of the library footprints, it is worth double-checking the footprint before
saving.
It is recommended to edit either the reference or value field text to the name of the footprint as identified in the library.
12.7. Transferring a footprint from one library to another
-
Wybrać bibliotekę źródłową
.
-
Load the footprint via the button
.
-
Wybrać bibliotekę docelową
.
-
Save the footprint via the button
You may also wish to delete the source footprint.
-
Wybrać ponownie bibliotekę źródłową
-
Delete the old footprint via the button
12.8. Saving all footprints of your board in the active library
It is possible to copy all of the footprints of a given board design to the active library. These footprints will keep their current library names. This command has two uses:
-
To create an archive or complete a library with the footprints from a board, in the event of the loss of a library.
-
Ułatwia, co ważniejsze, utrzymanie biblioteki włączając w to produkcję dokumentacji bibliotek, jak wyjaśniono poniżej.
12.9. Documentation for library footprints
It is strongly recommended to document the footprints you create, in order to enable rapid and error-free searching.
For example, who is able to remember all of the multiple pin-out variants of a TO92 package? The Footprint Properties dialog offers a simple solution to this problem.
Pozwala ono na wprowadzenie:
-
Jedno-liniowego tekstu z opisem footprintu.
-
Wielu słów kluczowych rozdzielonych spacjami.
The description is displayed with the component list in Cvpcb and, in Pcbnew, it is used in the footprint selection dialogs.
The keywords enable searches to be restricted to those footprints corresponding to particular keywords.
When directly loading a footprint (the icon
of the right-hand Pcbnew toolbar), keywords may be entered in the dialog
box. Thus, entering the text =CONN will cause the display of the list of
footprints whose keyword lists contain the word CONN.
12.10. Documenting libraries - recommended practice
Zaleca się tworzenie bibliotek pośrednio, tworząc jeden lub więcej pomocniczych obwodów, które stanowić będą “źródła” (części) dla biblioteki w następujący sposób: Stworzyć arkusz płytki w formacie A4, w celu jej późniejszego łatwego wydruku (w skali 1:1).
Create the footprints that the library will contain on this circuit board. The library itself will be created with the File/Archive footprints/Create footprint archive command.
The "true source" of the library will thus be the auxiliary circuit board, and it is on this circuit that any subsequent alterations of footprints will be made. Naturally, several circuit boards can be saved in the same library.
It is generally a good idea to make different libraries for different kinds of components (connectors, discretes,…), since Pcbnew is able to search many libraries when loading footprints.
Tutaj znajduje się przykład takiego arkusza “źródłowego”:
Technika ta ma kilka zalet:
-
Układ może być wydrukowany w skali 1:1 i służyć jako papierowa dokumentacja do biblioteki bez zbędnego wysiłku przy jej tworzeniu.
-
Przyszłe zmiany w Pcbnew mogą wymagać ponownego utworzenia bibliotek, coś co można zrobić bardzo szybko, jeśli jako “źródła” były używane obwody drukowane tego typu. Jest to o tyle ważne, że format pliku z obwodem drukowanym jest gwarantowany tak by zapewnić wsteczną kompatybilność, co wcale nie musi być praktykowane w przypadku formatu pliku biblioteki.
12.11. Footprint Libraries Management
The list of footprint libraries in Pcbnew can be edited using the Footprint Libraries Manager. This allows you to add and remove footprint libraries by hand, and also allows you to invoke the Footprint Libraries Wizard by pressing the "Append With Wizard" button.
The Footprint Libraries Wizard can also be invoked through the Preferences menu, and can automatically add a library (detecting its type) from a file or from a Github URL. The URL for the official libraries is: https://github.com/KiCad
More details about footprint library tables and the Manager and Wizard can be found in the CvPcb Reference Manual in the section Footprint Library Tables.
12.12. 3D Shapes Libraries Management
The 3D shape libraries can be downloaded by 3D Shape Libraries Wizard. It can be invoked from the menu Preferences → 3D Shapes Libraries Downloader.
13. Footprint Editor - Creating and Editing Footprints
13.1. Footprint Editor overview
Footprint Editor is used for editing and creating PCB footprints. This includes:
-
Dodawanie oraz usuwanie pól lutowniczych.
-
Changing pad properties (shape, layer), for individual pads or for all the pads in a footprint.
-
Edycja postaci graficznej (linie, tekst).
-
Edycja pól informacyjnych (wartość, odniesienie, itp.).
-
Edycja dołączonej dokumentacji (opis, słowa kluczowe).
13.2. Footprint elements
A footprint is the physical representation (footprint) of the part to be inserted in the PCB and it must be linked to the relative component in your schematic. Each footprint includes three different elements:
-
Pola lutownicze
-
Kontury graficzne oraz tekst swobodny
-
Pola tekstowe
Dodatkowo, w przypadku używania funkcji automatycznego rozmieszczania footprintów czy generowania plików położeń footprintów, wzrasta liczba innych parametrów, które muszą zostać poprawnie określone (np. Pick&Place).
13.2.1. Pola lutownicze (Pady)
Dwa rodzaje właściwości pól lutowniczych są najważniejsze:
-
Geometria padu (kształt, obecność na warstwach, wiercenie).
-
Numer padu, który jest złożony z maksymalnie czterech znaków. Wynika, z tego, że nie tylko następujące numery pól lutowniczych są poprawne : 1, 9999, lecz także AA56 czy ANOD. Numer padu musi być identyczny z odpowiadającym mu numerem pinu w symbolu na schemacie, ponieważ na podstawie tej informacji Pcbnew łączy piny i pola lutownicze w module.
13.2.2. Kontury graficzne
Graphical contours are used to draw the physical shape of the footprint. Several different types of contour are available: lines, circles, arcs, and text. Contours have no electrical significance, they are simply graphical aids.
13.2.3. Pola tekstowe
These are text elements associated with a footprint. Two are obligatory and always present: the reference field and the value field. These are automatically read and updated by Pcbnew when a netlist is read during the loading of footprints into your board. The reference is replaced by the appropriate schematic reference (U1, IC3, etc.). The value is replaced by the value of the corresponding part in the schematic (47K, 74LS02, etc.). Other fields can be added and these will behave like graphical text.
13.3. Starting Footprint Editor and selecting a footprint to edit
Footprint Editor can be started in two ways:
-
Directly via the
icon from the main toolbar of Pcbnew. This allows the creation or modification of a footprint in the library.
-
Double-clicking a footprint will launch the Footprint Properties menu, which offers a Go to Footprint Editor button. If this option is used, the footprint from the board will be loaded into the editor, for modification or for saving.
13.4. Footprint Editor Toolbars
Calling Footprint Editor will launch a new window that looks like this:
13.4.1. Prawy pasek narzędziowy - edycja elementów składowych
Ten pasek narzędzi zawiera narzędzia do tworzenia elementów składowych footprintów:
-
Wstawianie pól lutowniczych.
-
Dodawanie elementów graficznych (obrysy, tekst).
-
Ustawianie punktu zaczepienia footprintu.
-
Usuwanie elementów składowych footprintu.
Poszczególne narzędzia służą do:
|
No tool. |
|
Add pads. |
|
Draw line segments and polygons. |
|
Draw circles. |
|
Draw circular arcs. |
|
Add graphical text (fields are not managed by this tool). |
|
Position the footprint anchor. |
|
Delete elements. |
|
Grid origin. (grid offset). Useful for placement of pads. The grid origin can be put on a given location (the first pad to place), and after the grid size can be set to the pad pitch. Placing pads is therefore very easy |
13.4.2. Lewy pasek narzędziowy - opcje wyświetlania
These tools manage the display options in Footprint Editor:
|
Włącza/Wyłącza wyświetlanie siatki. |
|
Włącza/Wyłącza wyświetlanie współrzędnych względnych jako polarne. |
|
Przełącza pomiędzy używanymi jednostkami miar. |
|
Przełącza rodzaj kursora (mały lub pełnoekranowy). |
|
Włącza wyświetlanie pól lutowniczych jako niewypełniony zarys. |
|
Włącza wyświetlanie tekstów jako niewypełniony zarys. |
|
Włącza wyświetlanie konturów jako niewypełniony zarys. |
|
Przełącza widok w tryb wysokiego kontrastu. |
13.5. Menu podręczne
Prawy klawisz myszy wywołuje podręczne menu, którego zawartość zależna jest od aktualnie wskazywanego elementu przez kursor:
The context menu for editing footprint parameters:
Menu podręczne z możliwością edycji pól lutowniczych.
Menu podręczne z możliwością edycji elementów graficznych.
13.6. Footprint properties dialog
This dialog can be launched when the cursor is over a footprint by clicking on the right mouse button and then selecting Edit Footprint.
The dialog can be used to define the main footprint parameters.
13.7. Creating a new footprint
A new footprint can be created via the button
. The name of the new footprint will
be requested. This will be the name by which the footprint will be
identified in the library.
This text also serves as the footprint value, which is ultimately replaced by the real value (100uF_16V, 100_0.5W, …).
The new footprint will require:
-
Obrys footprintu (i tekst jeśli potrzeba).
-
Pola lutownicze.
-
Pole tekstowe Wartość (zawierające tekst, który będzie zastąpiony przez prawdziwą wartość przypisaną z listy sieci).
Metoda alternatywna:
When a new footprint is similar to an existing footprint in a library or a circuit board, an alternative and quicker method of creating the new footprint is as follows:
-
Load the similar footprint (
,
or
).
-
Modify the "Footprint Name in Library" field in order to generate a new identifier (name).
-
Edit and save the new footprint.
13.8. Dodawanie i edycja pól lutowniczych
Once a footprint has been created, pads can be added, deleted or modified. Modification of pads can be local, affecting only the pad under the cursor, or global, affecting all pads of the footprint.
13.8.1. Dodawanie pola lutowniczego
Dodawanie pól lutowniczych jest aktywowane przez wybranie narzędzie
na prawym pasku
narzędzi. Pola lutownicze można umieszczać w polu roboczym klikając w
miejscu gdzie taki pole lutownicze ma się znaleźć. Ich właściwości można
zdefiniować wcześniej za pomocą menu Właściwości pól lutowniczych.
Należy pamiętać o wprowadzeniu numeru padu.
13.8.2. Ustawianie właściwości pól lutowniczych
Ustawianie właściwości pól lutowniczych może odbywać się na trzy sposoby:
-
Można ustalić parametry pól lutowniczych wcześniej, wybierając narzędzie
z głównego paska narzędzi edytora.
-
Klikając na istniejącym padzie, wybierając polecenie “Edytuj pole”. Można wtedy zmodyfikować ustawienia tego jednego pola lutowniczego.
-
Klikając na istniejącym padzie, wybierając polecenie “Eksportuj ustawienia pola lutowniczego”. W tym jednak przypadku, właściwości geometryczne wybranego padu staną się domyślnymi właściwościami pól lutowniczych.
W przypadku dwóch pierwszych sposobów edycji, wyświetlone zostanie następujące okno dialogowe:
Należy zwrócić szczególną uwagę przy prawidłowym ustawieniu warstw do których należeć będzie pole lutownicze. Choć warstwy miedzi są dość proste do zdefiniowania, to zarządzanie warstwami technicznymi (maski lutowniczej, pasty lutowniczej, itp…) jest równie ważne przy produkcji obwodów elektronicznych i ich dokumentowaniu.
Wybór jednej z opcji dostępnej w grupie Typ pola powoduje automatyczny wybór warstw, która na ogół jest wystarczająca.
Uwaga pierwsza - Elementy SMD
For SMD footprints of the VQFP/PQFP type which have rectangular pads on all four sides (both horizontal and vertical) it is recommended to use just one shape (for example, a horizontal rectangle) and to place it with different orientations (0 for horizontal and 90 degrees for vertical). Global resizing of pads can then be done in a single operation.
Uwaga druga - Stosowanie obrotu
Rotations of -90 or -180 are only required for trapezoidal pads used in microwave footprints.
Uwaga trzecia - Pola lutownicze z opcją Non Plated
Pola lutownicze mogą zostać zdefiniowane jako Non Plated Through Hole (pola lutownicze NPTH).
Te pola lutownicze muszą zostać zdefiniowane na jednym lub wszystkich warstwach miedzi (oczywiście, otwór w padzie będzie występował na wszystkich warstwach miedzi).
Wymóg ten pozwala na zdefiniowanie parametrów prześwitu (na przykład jako prześwit dla śrub montażowych).
Gdy otwór w padzie jest tego samego rozmiaru jak rozmiar padu w polach o kształcie zaokrąglonym lub owalnym, to takie pole lutownicze NIE jest rysowane na warstwach miedzi w plikach GERBER.
Te pola lutownicze mają swoje przeznaczenie mechaniczne, jednak nie jest dopuszczalne stosowanie nazw własnych lub nazw sieci dla takich pól lutowniczych. Łączenie ich z sieciami jest niemożliwe.
Uwaga czwarta - Pola lutownicze na warstwach technicznych
Te pola lutownicze zwykle nie są użyteczne. Opcja ta może być stosowana przy tworzeniu markerów pozycjonujących (przy montażu automatycznym) lub masek na warstwach technicznych.
Parametr: Przesunięcie X (Y)
Pole lutownicze o numerze 3 posiada parametr Przesunięcie Y ustawione na 15mils.
Parametr: Nachylenie pola (pola trapezoidalne)
Pole lutownicze numer 1 posiada parametr Nachylenie ustawiony na 10mils.
13.8.3. Ustawianie prześwitu masek pasty i lutowniczej dla pól lutowniczych
Setting a clearance can be made at 3 levels:
-
Globalnie.
-
Na poziomie footprintów.
-
Na poziomie pól lutowniczych.
Pcbnew uses the following to calculate clearances:
-
Wartości ustalonej dla pól lutowniczych. Jeśli jest zerowa to:
-
Z wartości ustalonej dla footprintu. Jeśli jest zerowa to:
-
Z wartości ustalonej globalnie.
Uwagi
Wartość dla maski lutowniczej jest dodatnia, ponieważ maska lutownicza jest zwykle większa niż pole lutownicze. Wartość dla maski pasty lutowniczej jest ujemna ponieważ maska pasty lutowniczej jest zwykle mniejsza niż pole lutownicze.
Parametry maski pasty lutowniczej
Są dwa parametry:
-
Wartość ustalona.
-
Procent rozmiaru pola lutowniczego.
Wartość realna jest sumą tych dwóch wartości.
Ustawienia na poziomie footprintów
Ustawienia na poziomie pól lutowniczych
13.9. Właściwości pól tekstowych
Każdy footprint posiada minimum dwa pola tekstowe: Oznaczenie i Wartość.
Ich parametry (atrybuty, rozmiar, szerokość) muszą zostać zaktualizowane. Dostęp do właściwości pól tekstowych zapewnia menu podręczne, wywoływane przez podwójne kliknięcie prawym klawiszem na treści pola, albo poprzez okno z właściwościami footprintu.
13.10. Automatic placement of a footprint
If the user wishes to exploit the the full capabilities of the auto-placement functions, it is necessary to define the allowed orientations of the footprint (Footprint Properties dialog).
Zazwyczaj, obrót o 180 stopni jest dozwolony dla rezystorów, niespolaryzowanych kondensatorów i innych elementów symetrycznych.
Some footprints (small transistors, for example) are often permitted to rotate by +/- 90 or 180 degrees. By default, a new footprint will have its rotation permissions set to zero. This can be adjusted according to the following rule:
Może to być dostosowane według następującej zasady: Wartość 0 powoduje że obrót jest niemożliwy, wartość 10 pozwala na pełny obrót, a wszystkie pośrednie wartości, stanowią blokady obrotu. Na przykład, rezystor może mieć zezwolenie na poziomie 10 do obrotu o 180 stopni (nieograniczone) i zgodę na poziomie 5 do obrotu o +/- 90 stopni (dozwolone, ale niezalecane).
13.11. Atrybuty
Sekcja atrybutów jest następująca:
-
Normalny to standardowy atrybut dla elementów przewlekanych.
-
Normal+Insert indicates that the footprint must appear in the automatic insertion file (for automatic insertion machines). This attribute is most useful for surface mount components (SMDs).
-
Virtual indicates that a component is directly formed by the circuit board. Examples would be edge connectors or inductors created by a particular track shape (as sometimes seen in microwave footprints).
13.12. Documenting footprints in a library
It is strongly recommended to document newly created footprints, in order to facilitate their rapid and accurate retrieval. Who is able to recall the multiple pin-out variants of a TO92 footprint?
The Footprint Properties dialog offers a simple and yet powerful means for documentation generation.
Pozwala ono na wprowadzenie:
-
Jednoliniowego tekstu z opisem footprintu;
-
Wielu słów kluczowych rozdzielonych spacjami.
The comment line is displayed with the component list in CvPcb and in the footprint selection menus in Pcbnew. The keywords can be used to restrict searches to those parts possessing the given keywords.
Thus, while using the load footprint command (icon in the right-hand toolbar in Pcbnew), it is possible to type the text =TO220 into the dialog box to have Pcbnew display a list of the footprints possessing the keyword TO220
13.13. Zarządzanie modelami do wizualizacji 3D
A footprint may have been associated with a file containing a three-dimensional representation of itself. In order to associate such a file with a footprint, select the 3D Settings tab. The options panel is the following:
Aby przydzielić footprintowi jego reprezentację 3D należy określić:
-
Plik zawierający model 3D (stworzony przez narzędzie do modelowania 3D Wings3d, w formacie VRML, za pomocą polecenia eksportu do VRML).
-
Domyślną ścieżką dla modeli 3D jest kicad/modules/package3d zawartą w zmiennej systemowej KISYS3DMOD. W tym przykładzie, plik nazywa się discret/to_220horiz.wrl, używający domyślnej ścieżki początkowej).
-
Skalę modelu w trzech osiach : X, Y oraz Z.
-
The offset with respect to the anchor point of the footprint (usually zero).
-
Początkowy obrót modelu 3D w każdej osi (zwykle wartości jest równa zero).
Ustawienie skali modelu pozwala na:
-
To use the same 3D file for footprints which have similar shapes but different sizes (resistors, capacitors, SMD components…)
-
Dla małych (lub bardzo dużych) obudów, lepszym rozwiązaniem jest użycie siatki Wings3D: Skala 1:1 to 0.1cala w Pcbnew i równa się 1 jednostce siatki w Wings3D.
Jeśli plik(i) z modelem zostaną określone, możliwe stanie się przeglądanie komponentów w przestrzeni 3D:
Model 3D automatycznie pojawi się także podczas wizualizacji PCB w trybie 3D.
13.14. Saving a footprint into the active library
Operacja zapisu footprintu (modyfikująca plik aktywnej biblioteki) jest
przeprowadzana za pomocą polecenia Zapisz
.
If a footprint of the same name exists (an older version), it will be overwritten. Because it is important to be able to have confidence in the library footprints, it is worth double-checking the footprint for errors before saving.
Before saving, it is also recommended to change the reference or value of the footprint to be equal to the library name of the footprint.
13.15. Saving a footprint to the board
Jeśli edytowany footprint pochodził z bieżącej płytki, należy go uaktualnić
za pomocą polecenia Uaktualnij footprint
znajdującym się na górnym pasku narzędzi.
14. Zaawansowane narzędzia do rozmieszczania elementów
There are some more advanced editing tools available in Pcbnew and Footprint Editor, which can help you to efficiently lay out components on the canvas.
14.1. Powielanie elementów
Powielanie elementów to metoda polegająca na klonowaniu elementu i wykonaniu dla niego tej samej akcji. Proces ten jest zasadniczo podobny do prostej metody kopiuj-wklej, ale pozwala na łatwiejsze rozmieszczanie komponentów na PCB i umożliwia dokładniejsze, choć nadal ręczne ich ułożenie za pomocą narzędzia Przesuń dokładnie (patrz niżej).
Powielanie jest wykonywane gdy użyje się skrótu klawiszowego (domyślnie jest to Ctrl-D) lub z pomocą poleceń w menu kontekstowym. W zwykłym trybie wyświetlania dostępne są następujące polecenia, w zależności od wybranego elementu:
14.2. Przesuwanie dokładne
Narzędzie Przesuń dokładnie pozwala przenieść element (lub grupę elementów) o podany wektor, który może być wprowadzony za pomocą współrzędnych kartezjańskich lub polarnych i może być wprowadzony w jakichkolwiek obsługiwanych jednostkach. Takie podejście jest bardzo przydatne, w przeciwnym wypadku kłopotliwe byłoby przełączanie się pomiędzy jednostkami lub gdy funkcja wymagałaby rozmieszczania według z góry ustalonej siatki.
To use this tools, select the items you wish to move and then use either the hotkey (defaults to Ctrl-M) or the context menu items to invoke the dialog. You can also invoke the dialog with the hotkey when moving or duplicating items, which can make it easy to repeatedly apply an offset to multiple components.
Zmiana pomiędzy systemem kartezjańskim a polarnym odbywa się przez zaznaczenie pola opcji. Niezależnie jak obecnie są one wprowadzone, zostaną one automatycznie przeliczone w innym systemie.
Następnie należy wprowadzić wektor przesunięcia. Można użyć jednostek wskazanych przez opisy pól (na powyższej ilustracji jest to “mm”) lub określić własne jednostki (np. “1 in” dla cali, “2 rad” dla 2 radianów).
Wciskając OK przesunięcie zostanie zaaplikowane dla obecnego wyboru, zaś przycisk Anuluj spowoduje zaniechanie akcji i elementy nie zostaną przesunięte. Jeśli wciśnięto OK wartości przesunięć zostaną zapamiętane i przy powtórzeniu operacji przesuwania następne elementy zostaną przesunięte o ten sam wektor.
14.3. Tworzenie szyku
Pcbnew and the Footprint Editor both have assistants for creating arrays of features and components, which can be used to easily and accurately lay out repetitive elements on PCBs and in footprints.
14.3.1. Aktywacja narzędzia do utworzenia szyku
Narzędzie do tworzenia szyku operuje na elementach znajdujących się w miejscu kursora, lub, w przypadku trybu GAL, na zaznaczeniu. Dostęp do niego jest możliwy poprzez menu podręczne w przypadku zaznaczenia lub przez skrót klawiszowy (domyślnie Ctrl-N). W widoku normalnym, menu podręczne pozwala na tworzenie szyku dla następujących elementów:
Narzędzie do tworzenia szyku ma swoje okno dialogowe, z zakładkami gdzie można wybrać odpowiedni szyk dla danego zadania. Obecnie są wspierane tylko dwie opcje szyku: szyk kwadratowy oraz szyk opisany po okręgu.
Oba typy szyku mogą zostać w pełni skonfigurowane poprzez własne zakładki. Opcje geometrii (sposób w jaki szyk będzie tworzony) znajduje się po lewej stronie; opcje numeracji zaś (pozwalające ustalić bieg numeracji w szyku) znajduje się po prawej stronie.
14.3.2. Szyk kwadratowy
Szyk kwadratowy stanowi tablicę, w której poszczególne elementy leżą na 2-wymiarowej siatce. Ten rodzaj tablicy może również generować układ liniowy jeśli określono wyłącznie liczbę wierszy lub kolumn.
Ustawienia dla szyku kwadratowego są następujące:
Opcje geometrii
Opcje związane z geometrią szyku są następujące:
-
Licznik X: liczba kolumn w szyku.
-
Licznik Y: liczba rzędów w szyku.
-
Rozstaw X: odległość pomiędzy poszczególnymi elementami w linii poziomej. Jeśli jest ujemny to szyk jest układany od prawej do lewej.
-
Rozstaw Y: odległość pomiędzy poszczególnymi elementami w linii pionowej. Jeśli jest ujemny to szyk jest układany od dołu do góry.
-
x Offset: start each row this distance to the right of the previous one
-
Przesunięcie Y: rozpoczyna każdą kolumnę z takim przesunięciem względem poprzedniego elementu.
-
Przeplot: dodaj przesunięcie do każdej “n”-tej kolumny lub rzędu, z postępem co “1/n”-tą, odnosząc się do pełnego wymiaru:
Opcje numeracji
-
Kierunek numeracji szyku: Określa, czy numeracja ma iść wzdłuż rzędów, a następnie przenosić się do następnego wiersza, lub iść wzdłuż kolumny, a następnie przenosić się w dół do następnej kolumny. Należy zauważyć, że kierunek numeracji jest określony przez znak w polu Rozstaw: ujemny odstęp spowoduje numerowanie od prawej do lewej, albo z dołu do góry.
-
Odwrotna numeracja przy zmianie rzędu/kolumny: Jeśli opcja ta jest zaznaczona, kierunek numeracji (na przykład lewo-na-prawo lub prawo-na-lewo) zmienia się przy zmianie rzędu lub kolumny. Opcja ta jest przydatna w przypadku projektowania obudów typu DIP, gdzie numeracja zwiększa się po jednej stronie, a zmniejsza po przeciwnej.
-
Restart numbering: if laying out using items that already have numbers, reset to the start, otherwise continue if possible from this items number
-
Numbering scheme
-
Continuous: the numbering just continues across a row/column break - if the last item in the first row is numbered "7", the first item in the second row will be "8".
-
Co-ordinate: the numbering uses a two-axis scheme where the number is made up of the row and column index. Which one comes first (row or column) is determined by the numbering direction.
-
-
Axis numberings: what "alphabet" to use to number the axes. Choices are
-
Numerals for normal integer indices
-
Hexadecimal for base-16 indexing
-
Alphabetic, minus IOSQXZ, a common scheme for electronic components, recommended by ASME Y14.35M-1997 sec. 5.2 (previously MIL-STD-100 sec. 406.5) to avoid confusion with numerals.
-
Full alphabet from A-Z.
-
14.3.3. Szyk opisany po okręgu
Szyk opisany po okręgu rozmieszcza elementy wokół tworząc koło. Promień okręgu jest domyślnie określony przez położenie wybranego elementu (lub względem centrum wybranej grupy) a punkt centralny poprzez wprowadzone wartości. Poniżej znajduje się okno dialogowe tego narzędzia:
Opcje geometrii
-
Środek X, Środek Y: Punkt centralny okręgu. Promień zostanie przeliczony automatycznie gdy środek zostanie zmieniony.
-
Angle: The angular difference between two adjacent items in the array. Set this to zero to evenly divide the circle with "count" elements.
-
Ilość: Liczba elementów w szyku (razem z elementem oryginalnym).
-
Obrót: Obrót elementu wobec własnej osi. W przeciwnym wypadku elementy zostaną wyłącznie przesunięte zachowując swój własny obrót (na przykład, prostokątne pole pozostanie zawsze w tej samej orientacji jeśli ta wartość nie zostanie ustawiona).
Opcje numeracji
Szyk opisany po okręgu posiada tylko jeden wymiar i jest prostszy w zastosowaniu niż szyk kwadratowy. Znaczenie poszczególnych opcji jest to samo dla obu typów szyku. Elementy są numerowane zgodnie z ruchem wskazówek zegara - dla numeracji w przeciwnym kierunku należy wpisać wartość ujemną kąta.
15. KiCad Scripting Reference
Scripting allow you to automate tasks within KiCad using the Python language.
Also see the doxygen documentation on Python Scripting Reference.
You can see python module help by typing pydoc pcbnew on your terminal.
Using scripting you can create:
-
Plugins: this type of script is loaded when KiCad starts. Examples:
-
Footprint Wizards: To help you build footprints easily filling in parameters. See the dedicated section Footprint Wizards below.
-
File I/O (planned): To let you write plugins to export/import other filetypes
-
Actions (planned): Associate events to scripting actions or register new menus or toolbar icons.
-
-
Command Line Scripts: scripts that can be used from the command line, load boards or libraries, modify them, and render outputs or new boards.
It shall be noted that the only KiCad applicaiton that supports scripting is Pcbnew. It is also planned for Eeschema in the future.
15.1. KiCad Objects
The scripting API reflects the internal object structure inside KiCad/pcbnew. BOARD is the main object, that has a set of properties and a set of MODULEs, and TRACKs/SEGVIAs, TEXTE_PCB, DIMENSION, DRAWSEGMENT. Then MODULEs have D_PADs, EDGEs, etc.
-
See the BOARD section below.
15.2. Basic API Reference
All the pcbnew API is provided from the "pcbnew" module in Python. GetBoard() method will return the current pcb open at editor, useful for commands written from the integrated scripting shell inside pcbnew or action plugins.
15.3. Loading and Saving a Board
-
LoadBoard(filename): loads a board from file returning a BOARD object, using the file format that matches the filename extension.
-
SaveBoard(filename,board): saves a BOARD object to file, using the file format that matches the filename extension.
-
board.Save(filename): same as above, but it’s a method of BOARD object.
#!/usr/bin/python import sys from pcbnew import * filename=sys.argv[1] pcb = LoadBoard(filename) for module in pcb.GetModules(): print "* Module: %s"%module.GetReference() module.GetValueObj().SetVisible(False) # set Value as Hidden module.GetReferenceObj().SetVisible(True) # set Reference as Visible pcb.Save("mod_"+filename)
15.4. Listing and Loading Libraries
#!/usr/bin/python from pcbnew import * libpath = "/usr/share/kicad/modules/sockets.mod" lst = FootprintEnumerate(libpath) for name in lst: m = FootprintLoad(libpath,name) print name,"->",m.GetLibRef(), m.GetReference() for p in m.GetPads(): print "\t",p.GetPadName(),p.GetPosition(),p.GetPos0(), p.GetOffset()
15.5. BOARD
Board is the basic object in KiCad pcbnew, it’s the document.
BOARD contains a set of object lists that can be accessed using the following methods, they will return iterable lists that can be iterated using "for obj in list:"
-
board.GetModules(): This method returns a list of MODULE objects, all the modules available in the board will be exposed here.
-
board.GetDrawings(): Returns the list of BOARD_ITEMS that belong to the board drawings
-
board.GetTracks(): This method returns a list of TRACKs an SEGVIAs inside a BOARD
-
board.GetSegZones(): Returns a list of SEGZONEs
-
board.GetFullRatnest(): Returns the list of ratsnets (connections still not routed)
-
board.GetLocalRatsnest(): Returns the list of ratsnest of a moving footprint (as it’s dragged)
-
board.GetNetClasses(): Returns the list of net classes
-
board.GetCurrentNetClassName(): Returns the current net class
-
board.GetViasDimensionsList(): Returns the list of Via dimensions available to the board.
-
board.GetTrackWidthList(): Returns the list of Track Widths available to the board.
#!/usr/bin/python import sys from pcbnew import * filename=sys.argv[1] pcb = LoadBoard(filename) ToUnits=ToMils FromUnits=FromMils print "LISTING VIAS:" for item in pcb.GetTracks(): if type(item) is SEGVIA: pos = item.GetPosition() drill = item.GetDrillValue() width = item.GetWidth() print " * Via: %s - %f/%f "%(ToUnits(pos),ToUnits(drill),ToUnits(width)) elif type(item) is TRACK: start = item.GetStart() end = item.GetEnd() width = item.GetWidth() print " * Track: %s to %s, width %f" % (ToUnits(start),ToUnits(end),ToUnits(width)) else: print "Unknown type %s" % type(item) print "" print "LISTING DRAWINGS:" for item in pcb.GetDrawings(): if type(item) is TEXTE_PCB: print "* Text: '%s' at %s"%(item.GetText(),item.GetPosition()) elif type(item) is DRAWSEGMENT: print "* Drawing: %s"%item.GetShapeStr() # dir(item) else: print type(item) print "" print "LIST MODULES:" for module in pcb.GetModules(): print "* Module: %s at %s"%(module.GetReference(),ToUnits(module.GetPosition())) print "" print "LIST ZONES:" for zone in pcb.GetSegZones(): print zone print "" print "RATSNEST:",len(pcb.GetFullRatsnest())
15.6. Przykłady stosowanych reguł projektowych
15.6.1. Change a component pins paste mask margin
b = pcbnew.GetBoard() u304 = b.FindModuleByReference('U304') pads = u304.GetPads() for p in pads: print p.GetPadName(), pcbnew.ToMM(p.GetLocalSolderPasteMargin()) id = int(p.GetPadName()) if id<15: p.SetLocalSolderPasteMargin(0)
15.7. Footprint Wizards
The footprint wizards are a collection of python scripts that can be access via from the Footprint Editor. If you invoke the footprint dialog you select a given wizard that allows you to see the footprint rendered, and you have some parameters you can edit.
If the plugins are not properly distributed to your system package, you can find the latest versions in the KiCad source tree at launchpad.
They should be located in for example C:\Program Files\KiCad\bin\scripting\plugins.
On linux you can also keep your user plugins in $HOME/.kicad_plugins.
#!/usr/bin/python from pcbnew import * class FPCFootprintWizard(FootprintWizardPlugin): def __init__(self): FootprintWizardPlugin.__init__(self) self.name = "FPC" self.description = "FPC Footprint Wizard" self.parameters = { "Pads": {"*n":40, # not internal units preceded by "*" "pitch": FromMM(0.5), "width": FromMM(0.25), "height": FromMM(1.6)}, "Shield": {"shield_to_pad": FromMM(1.6), "from_top": FromMM(1.3), "width": FromMM(1.5), "height": FromMM(2)} } self.ClearErrors() # build a rectangular pad def smdRectPad(self,module,size,pos,name): pad = D_PAD(module) pad.SetSize(size) pad.SetShape(PAD_RECT) pad.SetAttribute(PAD_SMD) pad.SetLayerMask(PAD_SMD_DEFAULT_LAYERS) pad.SetPos0(pos) pad.SetPosition(pos) pad.SetPadName(name) return pad # This method checks the parameters provided to wizard and set errors def CheckParameters(self): p = self.parameters pads = p["Pads"]["*n"] errors = "" if (pads<1): self.parameter_errors["Pads"]["n"]="Must be positive" errors +="Pads/n has wrong value, " p["Pads"]["n"] = int(pads) # make sure it stays as int (default is float) pad_width = p["Pads"]["width"] pad_height = p["Pads"]["height"] pad_pitch = p["Pads"]["pitch"] shl_width = p["Shield"]["width"] shl_height = p["Shield"]["height"] shl_to_pad = p["Shield"]["shield_to_pad"] shl_from_top = p["Shield"]["from_top"] return errors # build the footprint from parameters def BuildFootprint(self): print "parameters:",self.parameters #self.ClearErrors() #print "errors:",self.parameter_errors module = MODULE(None) # create a new module self.module = module p = self.parameters pads = int(p["Pads"]["*n"]) pad_width = p["Pads"]["width"] pad_height = p["Pads"]["height"] pad_pitch = p["Pads"]["pitch"] shl_width = p["Shield"]["width"] shl_height = p["Shield"]["height"] shl_to_pad = p["Shield"]["shield_to_pad"] shl_from_top = p["Shield"]["from_top"] size_pad = wxSize(pad_width,pad_height) size_shld = wxSize(shl_width,shl_height) module.SetReference("FPC"+str(pads)) # give it a reference name module.m_Reference.SetPos0(wxPointMM(-1,-2)) module.m_Reference.SetPosition(wxPointMM(-1,-2)) # create a pad array and add it to the module for n in range (0,pads): pad = self.smdRectPad(module,size_pad,wxPoint(pad_pitch*n,0),str(n+1)) module.Add(pad) pad_s0 = self.smdRectPad(module, size_shld, wxPoint(-shl_to_pad,shl_from_top), "0") pad_s1 = self.smdRectPad(module, size_shld, wxPoint((pads-1)*pad_pitch+shl_to_pad,shl_from_top), "0") module.Add(pad_s0) module.Add(pad_s1) e = EDGE_MODULE(module) e.SetStartEnd(wxPointMM(-1,0),wxPointMM(0,0)) e.SetWidth(FromMM(0.2)) e.SetLayer(EDGE_LAYER) e.SetShape(S_SEGMENT) module.Add(e) module.SetLibRef("FPC"+str(pads)) # create our footprint wizard fpc_wizard = FPCFootprintWizard() # register it into pcbnew fpc_wizard.register()