Length matched traces

Asked by Krishna Teja

Hello, greetings to Kicad dev group! are there plans to facilitate length-matched traces in Kicad (PCBNew)? Any such mechanism will be a great help to us who are designing boards with memory and high speed peripherals!

Question information

Language:
English Edit question
Status:
Solved
For:
KiCad Edit question
Assignee:
No assignee Edit question
Solved by:
Opendous Inc.
Solved:
Last query:
Last reply:
Revision history for this message
Best Opendous Inc. (opendous) said :
#1

Trial-and-Error and the trace length information from the net highlighter are your simplest bet. You can also hack proper-looking matched-length traces by using the Microwave tools. Open the Microwave Toolbar and select "Create line of specified length for microwave applications". Drag a rectangle and input the length of the accordion trace you wish to create. Give the module a reference name such as MLT1 and set its value to the length (this will help you later when calculating total trace length).

What will be created is a module (footprint) with a copper-layer graphic of the specified length and pads at the ends. Line width equals the current trace width and internal distance is twice the current clearance. The created module has a module/footprint of MuSelf (itself). The copper-layer graphic does not interact with traces and pads so you will need to be careful with other elements around it as DRC will not work.

You must then go into your schematic and add a MLT symbol in-line with the trace you are length-matching. Set its reference and value to the values you used earlier. Update the netlist and open and save the updated netlist in CvPCB. Edit the Module Comparison file (.cmp) in a text editor (not in CvPCB) by changing all the MLT traces to module type MuSelf. Change all the appropriate IdModule = MuSelf

When you highlight a net you will need to manually add the MLT lengths to come up with the total trace length.

There already exists a bug for how matched length traces would work:
https://bugs.launchpad.net/bugs/594089

The idea is for any trace segment to be extended to its maximum length with a right-click menu item. I have made several attempts to implement such functionality but it is very difficult to automate adding traces outside of the drawing paradigm. If someone more familiar with PCBnew knows how to add arbitrary traces (start_point, end_point, net_name) please contact me. I could really use some help.

It is also possible to alter the Microwave tool for arbitrary length and width by asking for bounding box details. Code for an earlier revision is included below.

Here is a MLT schematic symbol library (MLT.lib):

EESchema-LIBRARY Version 12/2/2009 11:48:39 PM
#
#
# MLT
#
DEF ~MLT MLT 0 40 Y N 1 F N
F0 "MLT" 0 52 30 H V C CNN
F1 "MLT" 0 52 30 H I C CNN
$FPLIST
 MuSelf
$ENDFPLIST
DRAW
A -36 -13 12 -1799 -1 0 1 0 N -48 -13 -23 -13
P 3 0 1 0 -48 0 -50 0 -50 0 N
P 3 0 1 0 -24 -13 -24 12 -24 12 N
P 4 0 1 0 48 11 48 0 50 0 50 0 N
P 3 0 1 0 -48 0 -48 -12 -48 -12 N
A 36 11 12 1 1799 0 1 0 N 48 11 23 11
A 12 -15 12 -1799 -1 0 1 0 N 0 -15 25 -15
A -12 11 12 1 1799 0 1 0 N 0 11 -25 11
P 3 0 1 0 0 -14 0 11 0 11 N
P 3 0 1 0 24 -14 24 11 24 11 N
X 2 2 100 0 50 L 25 25 1 1 B
X 1 1 -100 0 50 R 25 25 1 1 B
ENDDRAW
ENDDEF
#
#EndLibrary

Changes to allow arbitrary Microwave tool bounding box, circa BZR2100, starting at Line 256 of muonde.cpp:

   /* Enter the desired bounding length of the inductor. */
   if( !g_UnitMetric )
   {
       fcoeff = 10000.0;
       msg.Printf( wxT( "%1.4f" ), Mself.m_Size.y / fcoeff );
       abort = Get_Message( _( "Bounding Length (inch):" ), _("Length" ), msg, this );
   }
   else
   {
       fcoeff = 10000.0 / 25.4;
       msg.Printf( wxT( "%2.3f" ), Mself.m_Size.y / fcoeff );
       abort = Get_Message( _( "Bounding Length (mm):" ), _( "Length"), msg, this );
   }
   if( abort )
       return NULL;

   if( !msg.ToDouble( &fval ) )
   {
       DisplayError( this, _( "Incorrect Bounding Length Value; aborting" ) );
       return NULL;
   }
   Mself.m_Size.y = wxRound( fval * fcoeff );

   /* Adjust end point location to account for longer bounding length */
   if (Mself.m_Size.y > abs(Mself.m_End.x - Mself.m_Start.x))
   {
       if( Mself.orient == 0 )
       {
           Mself.m_End.x = Mself.m_Start.x + Mself.m_Size.y;
       }
       else
       {
           Mself.m_End.y = Mself.m_Start.y + Mself.m_Size.y;
       }
   }

   /* Enter the desired bounding width of the inductor. */
   if( !g_UnitMetric )
   {
       fcoeff = 10000.0;
       msg.Printf( wxT( "%1.4f" ), Mself.m_Size.x / fcoeff );
       abort = Get_Message( _( "Bounding Width (inch):" ), _( "Width"), msg, this );
   }
   else
   {
       fcoeff = 10000.0 / 25.4;
       msg.Printf( wxT( "%2.3f" ), Mself.m_Size.x / fcoeff );
       abort = Get_Message( _( "Bounding Width (mm):" ), _( "Width"), msg, this );
   }
   if( abort )
       return NULL;

   if( !msg.ToDouble( &fval ) )
   {
       DisplayError( this, _( "Incorrect Bounding Width Value; aborting" ) );
       return NULL;
   }
   Mself.m_Size.x = wxRound( fval * fcoeff );

Revision history for this message
Krishna Teja (krishna-teja-m) said :
#2

Thanks Opendous Inc., that solved my question.

Revision history for this message
Krishna Teja (krishna-teja-m) said :
#3

Dear Opendous,

Thanks for such a patient and detailed answer!! I wish I could also contribute to Kicad, will sure do when I get the time. BTW, how's your Propendous project going??

Best regards,
Krishna Teja M.

Revision history for this message
Opendous Inc. (opendous) said :
#4

>how's your Propendous project going?

  I've been so busy I forgot to update the project status but have
done so now at www.PROpendous.org

On Mon, May 16, 2011 at 5:15 AM, Krishna Teja
<email address hidden> wrote:
> Question #156973 on KiCad changed:
> https://answers.launchpad.net/kicad/+question/156973
>
> Krishna Teja posted a new comment:
> Dear Opendous,
>
> Thanks for such a patient and detailed answer!! I wish I could also
> contribute to Kicad, will sure do when I get the time. BTW, how's your
> Propendous project going??
>
>
>
> Best regards,
> Krishna Teja M.
>
> --
> You received this question notification because you are a direct
> subscriber of the question.
>