# KICAD PCB coil design related

My almost completed pcb design in KICAD requires a coil which needs to be accurate in dimension (coil is optimized using a optimization calculation algorithm developed in our lab which needs to be realized as is). If I draw using gui tools in KICAD, it is hard to make it accurate in terms of coordinates even with lowest possible grid size. I am looking for something similar to Allegro PCB editor where we can draw traces using instructions in KICAD. I believe it is possible since, I saw a python console in Pcbnew tool. Can somebody help with any information or tips that can at least draw lines with coordinates provided in instructions?

• How accurate do the coil dimensions need to be? – Andy aka Jul 5 '17 at 18:53
• variation of 0.001 mm is acceptable. If I use coordinates to draw the line, trace segment length will be accurate and calculation of length, width would be much easier. That is why I need to know if it is possible to draw using commands or instructions KiCad – sbz Jul 5 '17 at 19:04
• How will you control PCB thickness, warping and copper thickness variations. What about PCB dielectric unknowns and triboelectric effects? What about proximity to other components affecting things? I mean if you need an accuracy of 0.001 mm, other variations are going to make a mockery of it. – Andy aka Jul 5 '17 at 19:07
• I need to make it dimensionwise accurate. Calculation of inductance is of not that important since it is a prototype. clearance between the traces, length of the traces and width of the traces is important at this point. If you know any commands or instruction that can help draw the traces based on coordinates will help. That is why I name the variation in terms of mm (unit of dimension). – sbz Jul 5 '17 at 19:13
• Good luck getting a board made with anything like that accuracy, 0.1mm track and gap is about as small as is cheap, 0.05 or so is pretty much state of the art, 1um (a few wavelengths at typical PCB photo lithography wavelengths) is fiction. Remember also that traces are not rectangular in section, being more trapezoidal, this is inherent in the process. You can draw it but good luck finding someone who can make the thing. – Dan Mills Jul 5 '17 at 20:28

You can use the Python console like this:

import pcbnew
from pcbnew import wxPointMM
board = pcbnew.GetBoard()
tracks = board.GetTracks()
new_track = pcbnew.TRACK(board)
new_track.SetStart(wxPointMM(STARTX,STARTY))
new_track.SetEnd(wxPointMM(ENDX,ENDY))
tracks.Append(new_track)


Alternatively, you can click on a track in pcbnew and type 'E' (or right-click and select Properties)

This will bring up the Track and Via Properties window where you can choose the start/end positions to finer than the user grid.

• I will try the Python code in the console. But I already tried the alternative way you mentioned. Selecting trace and pressing 'E' is for changing the trace width. May be my hot keys are not like yours. But, I believe Python Code should work – sbz Jul 5 '17 at 21:23
• If you are in the "Legacy Canvas" mode, the 'E' hotkey will change track width. You can select the OpenGL canvas (where all new development is happening) by going to "View" -> "OpenGL Canvas". This will allow you to edit the track properties as I show above. – Seth Jul 6 '17 at 14:58