Kicad eda

Содержание:

Введение

Kicad — это программа для разработки электронных устройств, которая приобретает все большую популярность. Это не программа, с помощью которой мы можем создать материнскую плату или телевизионный декодер, но, тем не менее, вы можете сделать в ней много полезного.

Имея некоторый неприятный опыт работы с Eagle, я могу с полной уверенностью сказать, что Kicad более удобен. Он определенно более интуитивно понятен в использовании, что повышает производительность и скорость  работы. Есть много различных комбинаций клавиш, чтобы получить максимальную отдачу от ваших кликов и добиться того, чего вы хотите.

Kicad — это проект с открытым исходным кодом. Имея желание и соответствующие навыки программирования, вы можете добавить свой собственный инструмент в программу или изменить существующие. Также нет проблем с запуском Kicada в Linux.

Компоненты пакета:

  • eeschema — редактор схем,
  • pcbnew — редактор печатных плат (до 16 слоев),
  • gerbview — просмотрщик файлов Gerber ,
  • cvpcb — приложение для назначения корпусов электронных компонентов,
  • bitmap2component — приложение для создания графических элементов на плитках,
  • kicad — приложение для управления проектами

Приложение для управления проектами — KiCad — позволяет запускать другие приложения пакета и сохраняет все файлы проекта

Development Analysis Tools

KiCad can be compiled with support for several features to aid in the catching and debugging of runtime memory issues

Valgrind support

The KICAD_USE_VALGRIND option is used to enable Valgrind’s stack annotation feature in the tool framework. This provides the ability for Valgrind to trace memory allocations and accesses in the tool framework and reduce the number of false positives reported. This option is disabled by default.

C++ standard library debugging

KiCad provides two options to enable debugging assertions contained in the GCC C++ standard library: KICAD_STDLIB_DEBUG and KICAD_STDLIB_LIGHT_DEBUG. Both these options are disabled by default, and only one should be turned on at a time with KICAD_STDLIB_DEBUG taking precedence.

The KICAD_STDLIB_LIGHT_DEBUG option enables the light-weight standard library assertions by passing into CXXFLAGS. This enables things such as bounds checking on strings, arrays and vectors, as well as null pointer checks for smart pointers.

The KICAD_STDLIB_DEBUG option enables the full set of standard library assertions by passing into CXXFLAGS. This enables full debugging support for the standard library.

Address Sanitizer support

The KICAD_SANITIZE option enables Address Sanitizer support to trace memory allocations and accesses to identify problems. This option is disabled by default. The Address Sanitizer contains several runtime options to tailor its behavior that are described in more detail in its documentation.

This option is not supported on all build systems, and is known to have problems when using mingw.

SWIG Simplified Wrapper and Interface Generator

SWIG is used to generate the Python scripting language extensions for KiCad. SWIG is not required if you are not going to build the KiCad scripting extension.

Library Dependencies

This section includes a list of library dependencies required to build KiCad. It does not include any dependencies of the libraries. Please consult the library’s documentation for any additional dependencies. Some of these libraries are optional depending on you build configuration. This is not a guide on how to install the library dependencies using you systems package management tools or how to build the library from source. Consult the appropriate documentation to perform these tasks.

Building using MSYS2

The following commands assume you are building for 64-bit Windows, and that you already have the KiCad source code in a folder called in your home directory. See below for changes if you need to build for 32-bit instead. Run from the MSYS2 install path. At the command prompt run the the following commands:

pacman -S base-devel \
          git \
          mingw-w64-x86_64-cmake \
          mingw-w64-x86_64-doxygen \
          mingw-w64-x86_64-gcc \
          mingw-w64-x86_64-python2 \
          mingw-w64-x86_64-pkg-config \
          mingw-w64-x86_64-swig \
          mingw-w64-x86_64-boost \
          mingw-w64-x86_64-cairo \
          mingw-w64-x86_64-glew \
          mingw-w64-x86_64-curl \
          mingw-w64-x86_64-wxPython \
          mingw-w64-x86_64-wxWidgets \
          mingw-w64-x86_64-toolchain \
          mingw-w64-x86_64-glm \
          mingw-w64-x86_64-oce \
          mingw-w64-x86_64-ngspice \
          mingw-w64-x86_64-zlib
cd kicad-source
mkdir -p build/release
mkdir build/debug               # Optional for debug build.
cd build/release
cmake -DCMAKE_BUILD_TYPE=Release \
      -G "MSYS Makefiles" \
      -DCMAKE_PREFIX_PATH=/mingw64 \
      -DCMAKE_INSTALL_PREFIX=/mingw64 \
      -DDEFAULT_INSTALL_PATH=/mingw64 \
      ../../
make install

For 32-bit builds, run and change to in the package names and change the paths in the cmake configuration from to .

For debug builds, run the cmake command with from the folder.

KiCad Config Directory

The default KiCad configuration directory is . On Linux this is located at , on MSW, this is and on MacOS, this is . If the installation package would like to, it may specify an alternate configuration name instead of . This may be useful for versioning the configuration parameters and allowing the use of, e.g. and concurrently without losing configuration data.

This is set by specifying the KICAD_CONFIG_DIR string at compile time.

Getting the KiCad Source Code

There are several ways to get the KiCad source. If you want to build the stable version you can down load the source archive from the GitLab repository. Use tar or some other archive program to extract the source on your system. If you are using tar, use the following command:

tar -xaf kicad_src_archive.tar.xz

If you are contributing directly to the KiCad project on GitLab, you can create a local copy on your machine by using the following command:

git clone https://gitlab.com/kicad/code/kicad.git

Here is a list of source links:

Stable release archives: https://kicad-pcb.org/download/source/

Development branch: https://gitlab.com/kicad/code/kicad/tree/master

GitHub mirror: https://github.com/KiCad/kicad-source-mirror

Building KiCad on Linux

To perform a full build on Linux, run the following commands:

cd <your kicad source mirror>
mkdir -p build/release
mkdir build/debug               # Optional for debug build.
cd build/release
cmake -DCMAKE_BUILD_TYPE=Release \
      ../../
make
sudo make install

If the CMake configuration fails, determine the missing dependencies and install them on your system. By default, CMake sets the install path on Linux to /usr/local. Use the CMAKE_INSTALL_PREFIX option to specify a different install path.

Building KiCad on Windows

The preferred Windows build environment is MSYS2. The MinGW build environment is still supported but it is not recommended because the developer is responsible for building all of the dependencies from source which is a huge and frustrating undertaking. The MSYS2 project provides packages for all of the require dependencies to build KiCad. To setup the MSYS2 build environment, depending on your system download and run either the MSYS2 32-bit Installer or the MSYS2 64-bit Installer. After the installer is finished, update to the latest package versions by running the file located in the MSYS2 install path and running the command . If the msys2-runtime package is updated, close the shell and run .

Specific System Requirements

KiCad supports major operating systems that remain supported by their developers. After the
operating systems’ respective organizations stop releasing updates for the system, KiCad will
not be specifically tested with the unsupported system. Unsupported operating systems may
continue to work with KiCad beyond this time but bugs must be reproduced on a supported operating
system before they will be addressed by KiCad.

Windows

The software prerequisites for installing KiCad on a Windows system are as follows:

Operating System Support Status

Windows 7

Unsupported, will most likely still function

Windows 8

Unsupported, will most likely still function

Windows 8.1

10-Jan-2023

Windows Server 2012

10-Oct-2023

Windows Server 2016

10-Oct-2027

Windows Server 2019

09-Jan-2029

Windows 10

09-Jan-2029

Apple — macOS

The software prerequisites for installing on a macOS system are as follows:

Operating System End of Support

macOS 10.12

Unsupported

macOS 10.13

Unsupported

macOS 10.14

1-Aug-2021

macOS 10.15

1-Aug-2022

GNU/Linux

The following Linux distributions have been tested and are known to be working with
KiCad version 5.1.
Issues or bugs that occur on an unsupported platform must be reproduced on an officially
supported distribution and window manager before they will be addressed by KiCad.

Note: Development versions of the next KiCad release (version 6) may not function
on some of the older distributions listed below.

Ubuntu

Operating System End of Support

Ubuntu 16.04 (LTS)

Unsupported, will most likely still function

Ubuntu 18.04 (LTS)

1-Apr-2021

Ubuntu 18.10

Unsupported, will most likely still function

Ubuntu 19.04

Unsupported, will most likely still function

Ubuntu 19.10

Unsupported, will most likely still function

Ubuntu 20.04 (LTS)

approx May 2023

Long Term Support (LTS) releases of Ubuntu will be supported for 1 year after the next
LTS version is released (for a total of 3 years of support).

Non-LTS releases of Ubuntu will be supported while the version
is under standard support from Ubuntu.

Fedora

Operating System End of Support

Fedora 29

Unsupported, will most likely still function

Fedora 30

Unsupported, will most likely still function

Fedora 31

approx November 2020

Fedora 32

approx May 2021

Fedora releases will be supported for as long as they are supported by the Fedora Project
(usually for 1 year after release).

Debian

Operating System End of Support

Debian 9 (Stretch)

approx 2020

Debian 10 (Buster)

approx 2022

Debian releases will be supported for as long as they are
by Debian.

Additional Linux Considerations

Linux allows users to select their preferred window manager. There are many esoteric window
managers available for Linux and some may have unexpected behavior. KiCad officially supports
the following window managers:

  • Metacity (used by GNOME 2 and GNOME flashback)

  • Mutter (GNOME 3)

  • KWin (KDE)

  • Xfwm (used by XFCE)

  • i3 (Arch Linux)

  • Unity (Ubuntu prior to 18.04)

Graphical Windowing Backend

Regardless of the window manager, KiCad officially only supports the X11 backend. Users who
choose to use Wayland will have to run KiCad in the compatibility layer
XWayland.

Issues or bugs encountered while using XWayland must be reproduced under X11 before they
will be addressed by KiCad. Bugs that cannot be reproduced on X11 should be reported to
the Wayland bug tracker.

Other systems (notably Unix *BSD) may be fully functional but are not officially supported.

Upgrade from any version before 4.0 (also known as «old-stable»)

Issues are fixed in 5.1.1

Note that the issues referenced below are resolved by the upcoming KiCad version 5.1.1. Layer names will be translated to the standard English names on opening and will be written out as English when the file is saved.

Layernames are translated

There is a known issue when migrating designs from the old stable, revision around bzr revision 4022, where layer names were translated, which they should never have been. This issue arises if you used KiCad localized for Italian, French or Polish.

To resolve this issue, you will to edit all files with a text editor (notepad, …​) and change the layer names from Italian/French/Polish to their English counterparts. Below is the correspondance of the layer names. Caution: there are more instances to replace than just the layer list. Be sure that you don’t miss any.

New English names

(layers
  (32 B.Adhes user)
  (33 F.Adhes user)
  (34 B.Paste user)
  (35 F.Paste user)
  (36 B.SilkS user)
  (37 F.SilkS user)
  (38 B.Mask user)
  (39 F.Mask user)
  (40 Dwgs.User user)
  (41 Cmts.User user)
  (42 Eco1.User user)
  (43 Eco2.User user)
  (44 Edge.Cuts user)
)

Obsolete Italian names

(layers
  (16 Adesivo.Retro user)
  (17 Adesivo.Fronte user)
  (18 Pasta.Retro user)
  (19 Pasta.Fronte user)
  (20 Serigrafia.Retro user)
  (21 Serigrafia.Fronte user)
  (22 Maschera.Retro user)
  (23 Maschera.Fronte user)
  (24 Grafica user)
  (25 Commenti user)
  (26 Eco1 user)
  (27 Eco2 user)
  (28 Contorno.scheda user)
)

Obsolete French names

(layers
  (16 Dessous.Adhes user)
  (17 Dessus.Adhes user)
  (18 Dessous.Pate user)
  (19 Dessus.Pate user)
  (20 Dessous.SilkS user)
  (21 Dessus.SilkS user)
  (22 Dessous.Masque user)
  (23 Dessus.Masque user)
  (24 Dessin.User user)
  (25 Cmts.User user)
  (26 Eco1.User user)
  (27 Eco2.User user)
  (28 Contours.Ci user)
)

Obsolete Polish names

(layers
  (16 Kleju_Dolna user)
  (17 Kleju_Gorna user)
  (18 Pasty_Dolna user)
  (19 Pasty_Gorna user)
  (20 Opisowa_Dolna user)
  (21 Opisowa_Gorna user)
  (22 Maski_Dolna user)
  (23 Maski_Gorna user)
  (24 Rysunkowa user)
  (25 Komentarzy user)
  (26 ECO1 user)
  (27 ECO2 user)
  (28 Krawedziowa user)
)

Be aware that the schematic libries has gotten an overhaul (still in
progress), which means that it will easily break your schematics,
because the bundled libs takes precedence over the cache lib. What you
can do to recover is to remove the libs used in the project and rename
the cache lib file, and include that instead. Chris Pavlina has
recently made a wizard to help with this issue, this has been merged
in the product branch now.

Руководство по созданию скриптов в KiCad

Применение скриптов позволяет автоматизировать действия, выполняемые в
KiCad, с помощью языка программирования Python.

Дополнительно можете изучить doxygen-документацию на сайте
Python Scripting
Reference.

Можете просмотреть документацию на python-модули, набрав в
своём терминале.

С помощью скриптов можно создавать:

  • Плагины: это особый тип скрипта, который загружается при запуске KiCad.
    Например:

    • Мастер посадочных мест: помогает создавать посадочные места простым
      заполнением параметров. Смотрите соответствующий раздел
      ниже.

    • Считывание/сохранение файлов ‘(планируется)’: позволят пользователям
      создавать плагины для экспорта/импорта файлов прочих форматов.

    • Действия ‘(тестируется)’: позволят связывать события с запуском скрипта,
      добавлять новые элементы меню или панелей инструментов.

  • Скрипты командной строки: скрипты, которые можно выполнять в командной
    строке, загружать платы или библиотеки, изменять их и формировать
    изображения или новые платы.

В командной строке будет показано предупреждение, что из всех приложений
пакета KiCad, скрипты поддерживаются только в Pcbnew. В будущем также
планируется поддержка скриптов и в Eeschema.

Объекты KiCad

API (аппаратно-программный интерфейс) скриптов отражает внутреннюю структуру
кода Pcbnew. Главным объектом является BOARD (печатная плата), который
содержит набор свойств, а также MODULE (посадочные места), TRACK/VIA
(дорожки/переходные отверстия), TEXTE_PCB (надписи), DIMENSION (размеры),
DRAWSEGMENT (графические линии). В свою очередь, объект MODULE содержит
объекты D_PAD (контактные площадки), EDGE (контуры) и т.д.

Обзор основного API

Всё API из Pcbnew содержится в модуле «pcbnew», написанного на языке
Python. Функция GetBoard() возвращает объект печатной платы, открытой в
данный момент в редакторе. Полезна при выполнении команд из интегрированной
командной оболочки Pcbnew или для плагинов, выполняющих различные действия.

Загрузка и сохранение платы

  • LoadBoard(filename):
    загружает плату из указанного файла и возвращает объект типа BOARD, формат файла определяется по расширению.

  • SaveBoard(filename,board):
    сохраняет объект типа BOARD в файл, по расширению файла определяется формат записи.

  • board.Save(filename):
    то же что и предыдущее, но вызывается метод из самого объекта типа BOARD.

В приведённом примере загружается плата, скрываются все значения, а обозначения отображаются

BOARD

Далее приведено описание объекта BOARD, основного объекта в pcbnew KiCad.

BOARD содержит набор списков объектов, к которым можно получить доступ с
помощью следующих методов. Они возвращают перечисляемые списки, их
содержимое можно перебирать используя синтаксис «for obj in list:»

  • board.GetModules(): возвращает список объектов типа MODULE — все доступные посадочные места, найденные на печатной плате.

  • board.GetDrawings(): возвращает список объектов типа BOARD_ITEMS — графические элементы печатной платы

  • board.GetTracks(): возвращает список объектов типа TRACK и VIA — дорожки и переходные отверстия

  • board.GetFullRatsnest(): возвращает список связей, не завершенных соединений

  • board.GetNetClasses(): возвращает список классов цепей

  • board.GetCurrentNetClassName(): возвращает текущий класс цепей

  • board.GetViasDimensionsList(): возвращает список размеров переходных отверстий, доступных для платы

  • board.GetTrackWidthList(): возвращает список значений ширины дорожек, доступных для платы

Пример проверки платы

#!/usr/bin/env python2.7
import sys
from pcbnew import *

filename=sys.argv
pcb = LoadBoard(filename)

wxWidgets Cross Platform GUI Library

wxWidgets is the graphical user interface (GUI) library used by KiCad. The current minimum version is 3.0.0. However, 3.0.2 should be used whenever possible as there are some known bugs in prior versions that can cause problems on some platforms. Please note that there are also some platform specific patches that must be applied before building wxWidgets from source. These patches can be found in the patches folder in the KiCad source. These patches are named by the wxWidgets version and platform name they should be applied against. wxWidgets must be built with the –with-opengl option. If you installed the packaged version of wxWidgets on your system, verify that it was built with this option.

KiCad Build Version

The KiCad version string is defined by the output of when git is available or the version string defined in CMakeModules/KiCadVersion.cmake with the value of KICAD_VERSION_EXTRA appended to the former. If the KICAD_VERSION_EXTRA variable is not defined, it is not appended to the version string. If the KICAD_VERSION_EXTRA variable is defined it is appended along with a leading ‘-‘ to the full version string as follows:

(KICAD_VERSION)

The build script automatically creates the version string information from the git repository information as follows:

(5.0.0-rc2-dev-100-g5a33f0960)
 |
 output of `git describe --dirty` if git is available.

KiCad — редактор печатных плат

После построения схемы, ее проверки с помощью теста ERC, составления списка сетей и присвоения оболочек элементов их символам, пришло время выполнить проектирование печатной платы (PCB). В KiCad за это отвечает подпрограмма PCBNEW , это третий значок слева в менеджере проектов . Как видите, создатели программы последовательно разделяют отдельные этапы, планируя повторять их циклически в каждом последующем проекте.

После запуска мы видим рабочую среду, в которой мы начнем создавать нашу плату. Сразу же бросается в глаза пустое окно, несмотря на то, что мы уже проделали большую работу. Мы ничего не видим, потому что файл списка сетей должен быть импортирован в данную рабочую среду:

Если мы подготовили такой файл заранее (name.net), все элементы должны появиться на, однако, может быть и такое:

Этот набросок — не что иное, как все корпуса элементов были размещены друг над другом в нулевой позиции системы координат листа. Однако, поскольку мы уже знаем, что все работает, мы должны расположить наши элементы рядом друг с другом (все еще в случайном порядке). Сначала включите значок ручного режима и автоматического перемещения и установки footprint. Затем щелкните правой кнопкой мыши на черном фоне и выберите параметры « Глобальное распространение» и «Макет» в контекстном меню — разделите все элементы footprint . Теперь на нашем экране отображает что-то вроде:

И давайте теперь выключим ручной и автоматический режим перемещения и установки foorprint.

Таким образом, мы видим размещение элементов, их имена, значения и соединительные линии, указывающие на логические связи. Мы можем начать проектные работы.

По моему опыту, весь процесс проектирования плитки более просто с включением дюймовой сетки (калиброванной в мил). По умолчанию для сетки задано значение 50 миль (1,27 мм), это значение основано на наиболее распространенных растровых экранах для различных элементов. Однако контур плитки будет выгоднее рисовать на метрической сетке с сеткой 1 мм. После его настройки выберите (вверху) слой Egde.Cuts и инструмент « Добавить линию или многоугольник» (значок справа), нарисуйте прямоугольник (завершите двойным щелчком мыши). Затем, логическим образом мы упорядочиваем элементы на нашей плате в последовательности, используя сочетания клавиш , и . После окончания этого этапа мы должны получить более или менее похожую картину:

Далее мы начинаем рисовать пути. Для простоты мы предполагаем, что в нашем проекте все элементы размещены на верхнем слое ( F.Cu ). Переключение между слоями путей F.Cu / B.Cu выполняется клавишей . Клавиша переносит вас в верхний слой, а — в нижний слой . Выберите верхний слой и нарисуйте первый путь (клавиша ). Конец пути отмечен двойным щелчком. Когда закончите, нажмите клавишу , и у нас будет обзор нашей печатной платы.

Мы можем отключить отображение некоторых слоев, чтобы оценить внешний вид интересующих нас элементов.

Часто выполняемое действие — «выливание» массы на всю плитку или какую-то ее область. Здесь мы реализуем это с помощью зеленого значка Add zone на правой панели инструментов, определяем, к какому слою относится область (в нашем случае это верхний слой путей), выбираем сигнал, с которым мы его соединяем (в данном случае с GND), и рисуем область, которая будет поверхностью массы. Мы получаем дополнительный прямоугольник с прикрепленными внутренними диагональными линиями. Вы также можете нажать или выберите опцию Fill Zone из контекстного меню. Если ERC не сообщает об ошибках, мы получаем следующую картину:

Если мы хотим отменить заполнение зоны, мы нажимаем последовательность — .

После окончательной редакции печатной платы, в программе реализована возможность предварительного 3D просмотра детали. Выбираем меню View — 3D Browser и спустя некоторое время наблюдаем за 3D моделью вашей платы.

Использование шаблонов

Определения

Шаблон — это каталог с файлами, который включает каталог метаданных.

Системное имя шаблона (SYSNAME) — это имя каталога, в котором хранятся файлы
шаблона. Каталог метаданных (METADIR) содержит готовые файлы с информацией о
шаблоне.

При создании проекта из шаблона все файлы и каталоги в шаблоне копируются в
путь нового проекта, за исключением METADIR.

Во всех именах файлов и каталогов, которые начинаются с SYSNAME, SYSNAME
будет заменено на имя нового проекта (расширения файлов не учитываются).

Шаблоны

Шаблоны облегчают создание проектов, имеющих общие свойства, например
габариты платы, расположение разъёмов, электрические элементы, правила
разработки и т. д.

Обязательные файлы:

meta/info.html

Содержит информацию о шаблоне в формате html, по которой пользователь может
понять подходит ли он для нового проекта. В теге <title> задаётся реальное
имя шаблона, которое показывается пользователю при выборе шаблона.

Использование html позволяет вставить в этот документ изображения.

При создании этого документа используйте только основной набор тегов языка
HTML.

Необязательные файлы:

meta/icon.png

Файл значка 64 x 64 пикселя в формате PNG, который используется как
нажимаемый значок в окне выбора шаблона.

Пример:

Вот пример шаблона для платы raspberrypi-gpio:

И метаданные:

Файл brd.png является необязательным.

Вот пример файла info.html:

Эксплуатация

В меню KiCad «Файл» «Новый проект» есть два пункта:

  • Новый проект Создаёт пустой проект, копируется только
    template/kicad.pro в текущий каталог.

  • Новый проект из шаблона Открывает окно выбора шаблона.
    Оно предоставляет собой список значков и окно отображения.
    Однократным щелчком по значку шаблона происходит загрузка файла
    info.html метаданных шаблона и показ его в окне отображения. Щелчком
    по кнопке «OK» запускается процесс создания нового проекта. Шаблон
    будет скопирован в расположение нового проекта (за исключением METADIR,
    как упоминалось ранее) и все файлы, подпадающие под правила замены,
    будут переименованы в соответствии с новым именем проекта.

После выбора шаблона:

Местонахождение шаблонов:

Список доступных шаблонов формируется из следующих источников:

  • Системные шаблоны: <kicad bin dir>/../share/template/

  • Пользовательские шаблоны:

    • в Unix:
      ~/kicad/templates/

    • в Windows:
      C:\Documents and Settings\username\My Documents\kicad\templates

    • в Mac:
      ~/Documents/kicad/templates/

  • Если установлена переменная окружения KICAD_PTEMPLATES, то появляется третья
    вкладка — «Переносимые шаблоны», которая содержит список шаблонов, найденных
    в пути KICAD_PTEMPLATES.

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *