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
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
Показать
Комментарии отсутствуют
Информация о видео
Другие видео канала
![DSC Digital Setting Circle For Telescope](https://i.ytimg.com/vi/BdSfx6Pw-qg/default.jpg)
![3018 Pro Mill CNC Testing & Info](https://i.ytimg.com/vi/XRTuF2lpZDE/default.jpg)
![Custom PCB for Use in Fritzing](https://i.ytimg.com/vi/nkpjnoourL8/default.jpg)
![#1: Tutorial - Making a PCB With Cutouts, For Fritzing](https://i.ytimg.com/vi/HBicT7snPoA/default.jpg)
![Making Electronic Tubes, Bulbs, LED's... etc](https://i.ytimg.com/vi/P64K1tcBPeA/default.jpg)
![Tinning Solution - Homemade Tinning Solution for PCB's](https://i.ytimg.com/vi/qa225K9-osg/default.jpg)
![Kicad and BreadBoard Usage](https://i.ytimg.com/vi/j06vDN3KJtE/default.jpg)
![3D-STEP File Coloring](https://i.ytimg.com/vi/42trhzxvVVs/default.jpg)
![#5 Tutorial: FreeCAD To KiCad - Detailed](https://i.ytimg.com/vi/Gq_e0nhu13Y/default.jpg)
![FreeCAD PCB Milling Tutorial - NEW](https://i.ytimg.com/vi/QCE1POF4v6c/default.jpg)
![Continuation - Making a Hole in the Box...](https://i.ytimg.com/vi/JLXoHMsJbVw/default.jpg)
![Thermal Camera Using Teensy Arduino](https://i.ytimg.com/vi/v5V6r8rhEYA/default.jpg)
![FreeCad - Kicad Capacitor Modeling](https://i.ytimg.com/vi/_TtMCWSrf_w/default.jpg)
![Digital Setting Circles for Telescope](https://i.ytimg.com/vi/SezbbfoszEI/default.jpg)
![#1 Tutorial: Making A Ribbon Cable](https://i.ytimg.com/vi/oxPRGyvBuTU/default.jpg)
![CNC Milling A PCB](https://i.ytimg.com/vi/zfEAqhq_Evw/default.jpg)
![FreeCad To Kicad PCBShape - Simplified](https://i.ytimg.com/vi/aP5XTjfg_Bg/default.jpg)
![FreeCAD For Kicad PCB Shapes And Cutouts](https://i.ytimg.com/vi/tXuMqS_x6Yo/default.jpg)
![PCB Box For Kicad-PCB's](https://i.ytimg.com/vi/_GG6fanPFOc/default.jpg)
![Making A KiCad Edge Card Footprint](https://i.ytimg.com/vi/RaL1dSwhrwY/default.jpg)