Загрузка страницы

Kicad Trace Length Plugin

Kicad Plugin: Get the Length of Traces on PCB

Click the Cog in Play Window for Speed Controls
Code is in the Video

UPDATE: Sept 9, 2022. Added Code for both Inductance and Resistance (code below)

How To Do It:
- What You Will Need:
• Knowledge from this Link: https://dev-docs.kicad.org/en/python/pcbnew/

• A Text Editor or Python/other Code Software (many are Free. I use IDLE )

Note's:
• Python is Verrrry Picky about Indentation, Spacing and Tabs. The Code works great so, if you have trouble, methodically check your coding (Python = Trouble... I have nothing good to say about Python)
• The " i " in the code is not needed but, if wanting a Counter (to count the Traces Changed)... You know what to do...
• Here's a Code Change to display Track Length (4 decimal places) and the Number of Measured Tracks and Track Resistance (just Copy & Paste it (replacing the previous code):
----------------------------------------------------------------------
def Run(self):
board = GetBoard() # This is to load the board inside kicad python console
tracks = board.GetTracks()
i = 0
total = 0
Xtotal = 0
each = 0
h = 0.035/25.4 # to inches
w = 0.0
imp = 0
ARG1 = 0
ARG2 = 0

for track in board.GetTracks():
if track.IsSelected():
each = track.GetLength()
total = each/1000000 + total # to mm
w = track.GetWidth()/1000000 / 25.4 # M to mm to inches
i = i + 1

Xtotal = total/25.4 # to inches

ARG1 = (2 * Xtotal)/(w + h)
ARG2 = 0.2235 * (w + h) / Xtotal
imp = 0.00508 * Xtotal * (math.log(ARG1) + 0.5 + ARG2)
# 'Log' defaults to Natural Log. Log10 is base 10 log

wx.MessageBox('Track(s) Length = %.4f' % total + ' mm' + '\n' + '\n' + str(i) + ' Track(s) Measured'+'\n'+ '\n'+'Inductance = %.5f' % (imp) + ' uH', 'Info', wx.OK | wx.ICON_INFORMATION)
------------------------------------------------------------------------

The Basic Scheme Of Doing It:
• Learn where to put the .py code and Icon file (use the Kicad Forum)
• Type the Code shown in Video and Save as .py
• Boot up Kicad and set your Plugins to display the Plugins of interest

If you properly placed the Files, Set Plugin for visibility and No Errors in Code, the Icon will display in the PCB's Top Bar

Видео Kicad Trace Length Plugin канала Bruce T
Показать
Комментарии отсутствуют
Введите заголовок:

Введите адрес ссылки:

Введите адрес видео с YouTube:

Зарегистрируйтесь или войдите с
Информация о видео
19 февраля 2022 г. 1:30:34
00:00:57
Яндекс.Метрика