| FreePCB User Guide | Version 1.2

PREV | Table of Contents | NEXT

5. PCB Layout (continued)

5.13 Nets, Ratlines and Routing

5.131 Nets

A net is a set of pins which will be connected together on the PCB. Each net must have a unique name. These names may be descriptive (such as "GND" or "video_in") or merely distinctive (such as "N06744"). In FreePCB, net names are limited to 40 characters in length, and may contain special characters. Each pin in a net is identified by a string consisting of the reference designator of the part containing the pin, the character ".", and the pin name.

Nets are usually read from a netlist file, which also includes a list of parts in the design (see Section 5.14: Importing Netlist Files). Two examples of nets are shown below.

Name: N00834
Pins: U2.4 JP1.9

Name: GND
Pins: U2.7 C2.2 U3.3 C1.2 U1.19 Y1.4 JP5.3 JP4.10
JP4.4 R2.2 C4.2 JP1.10 JP1.5 R1.2 C3.2 U1.8
JP6.2 JP3.3 JP2.3 JP3.10 JP3.4 JP3.6 JP3.8 JP2.10
JP2.8 JP2.2 JP2.4 JP2.6 JP3.2

5.132 The Netlist

In FreePCB, all of the information about nets is stored in a data structure called the netlist. It can be viewed and modified by selecting Nets from the Project menu. This pops up the View/Edit Netlist dialog.

This dialog contains a list of all of the nets in the project. The name, number of pins and the default trace width, via width and via hole diameter are shown for each net.

The checkbox next to each name determines the visibility of the net. If the visibility box is unchecked, then ratlines for that net will NOT be displayed in the layout window. This is useful when you are working with a particular net and do not wish to be distracted with other ratlines. The Make all visible/invisible button checks or unchecks all of the boxes.

In the example above, the trace and via widths are set to zero for most of the nets. This indicates that the project defaults are to be used. The widths for the VCC and GND nets have been set to non-zero values which will be used for traces in those nets. Widths can be changed by selecting one or more nets, and clicking on the Change widths button. This pops up the following dialog, which allows setting the new widths.

You can perform more extensive editing of a single net by selecting it and clicking the Edit selection button, which pops up:

From here you can change the name, visibility and widths of a net, and add or delete pins.

5.133 Connections and Ratlines

Like most PCB editors, FreePCB assumes that nets will be routed as a series of connections, where each connection is between 2 pins. For any net containing more than 2 pins, there will be multiple possible sets of connections. For example, a net consisting of pins U1.1, U2.2 and U3.3 could be routed as:

- (U1.1 to U2.2) and (U2.2 to U3.3) OR
- (U1.1 to U3.3) and (U2.2 to U3.3) OR
- (U1.1 to U3.3) and (U1.1 to U2.2)

For each net, FreePCB automatically generates a set of connections which attempts to minimize the total distance between the connected pins. These connections are shown as ratlines between pins. An example of two nets connecting three parts is shown below.

After most editing operations, FreePCB recalculates the ratlines for each affected net. This is most obvious when you are moving parts or adding copper areas. For example, moving D1 to the right causes the connections to change, as shown below.

If you are designing a PCB "on-the-fly" without a netlist, you can use stub traces instead of adding connections and routing them. See the note in Section 5.137: Stub Traces for details.

5.134 Modifying Ratlines

Most of the time, you will use the ratlines which FreePCB calculates. However, there may be situations when you would like more control over the ratlines. FreePCB provides several editing options for ratlines:

- A ratline can be locked by selecting it and pressing F3 ("Lock Connect"). The appearance of the ratline doesn't change, but "(L)" will appear in its description on the status bar to indicate that it is locked. A locked connection will NOT be removed when FreePCB recalculates ratlines. A locked connection may be unlocked by selecting it and pressing F3 ("Unlock Connect").
- A connection may be added to a net by selecting the pad for the starting pin of the connection, and pressing F4 ("Connect Pin"). You can then draw a ratline to another pin on the same net. Normally, you should lock the ratline after adding it, otherwise it will probably be removed by FreePCB the next time the ratlines are recalculated. You can also make a connection to an unassigned pin, in which case the new pin will be added to the net.
- A ratline may be removed from a net by selecting it and pressing F7 ("Delete Connect"). If the ratline is locked, you will be prompted to unlock it. If you remove a ratline and don't replace it by adding and locking another one, it will probably reappear the next time the ratlines are recalculated.
- The ratlines for each net are usually recalculated after each editing operation which affects the net. The exceptions are those operations which directly modify the ratlines, such as the ones described above. To force FreePCB to regenerate ratlines, press F8 ("Recalc. Ratlines"). The scope of this command depends on which item was selected when you pressed F8:
  - If nothing was selected, ratlines will be regenerated for every net in the project.
  - If a part was selected, ratlines will be regenerated for each net attached to the part.
  - If a pin, ratline, or trace was selected, ratlines will be regenerated for the net attached to that pin, ratline or trace.

5.135 Routing

Routing is the process of converting ratlines to copper traces. Traces consist of one or more straight-line segments, connected together with vertices at their connection points. If two adjacent segments are on different layers, a via will be placed at the vertex between them.

To begin routing, select a ratline by clicking on it. It will change to the selection color to indicate that it has been selected. Then press F4 ("Route Segment"). You will find yourself dragging a trace segment from the pin of the connection that was closest to the cursor when you pressed F4. The image below shows a segment being routed from pin 1 of JP6.

Note that the segment is on the top copper layer because that was the active layer when we started routing. You can change the active layer by pressing one of the numeric keys "1" through "8", which represent the available layers in top-to-bottom order. For example, for a four-layer board, "1" would select the top copper layer, "2" would select the inner 1 layer, "3" would select the inner 2 layer, and "4" would select the bottom copper layer. If you change layers while routing a segment, it will immediately switch to the new active layer.

Left-clicking will place a vertex at the cursor position, end the first segment at the vertex, and initiate routing a second segment from the vertex, as shown in the next image. We have also switched layers by pressing the numeric key "4", so that the new segment is being drawn on the bottom copper layer.

Left-click again to place the next vertex and start routing the next segment. In this way you can draw a trace consisting of multiple connected segments on multiple layers. The image below shows our trace nearing completion with several segments on different layers, with 2 vias.

To finish the trace, press F4 ("Complete Segment") while routing the last segment. The segment will automatically be extended to the end-pin of the trace. Alternatively, you can place the cursor over the end-pin and left-click. Our final trace is shown below.

While routing a trace, you can right-click to stop routing before the trace is completed. The unrouted portion of the connection will be shown as a ratline between the last vertex and the end-pin. You can finish the trace later by selecting the ratline and routing it from either end. A trace can even have multiple unrouted portions, as shown below.

While a segment is being dragged, the Routing Grid will be in effect. If the starting point for the segment is on the routing grid, then the Snap Angle will also be in effect.

5.136 Changing and Swapping Pins

You can change the end-pin of a partially-routed trace by selecting the ratline to the pin and pressing F5 ("Change Pin"), then drawing a new ratline to a different pin.

You can swap pins in a part by selecting one of them, holding down the "s" key and clicking on the other pin. You will be prompted to swap the connections to the pins.

5.137 Stub Traces

Besides traces based on connections between pins, FreePCB supports stub traces. These are traces that start at a pin, but do not end at a pin. Instead, they end blindly, usually with a via. Stub traces are mainly used to connect SMT pins to copper areas, which will be described in Section 5.14: Copper Areas. To create a stub trace, select the starting pin. Press F3 ("Start Stub") to start dragging a trace segment from the pin. The segment will be on the currently active layer, unless the pin is a SMT pin, in which case the active layer will change to the layer of the pin. Left-click to place a vertex. If you want more than one segment, add additional vertices. Then terminate the stub trace by right-clicking. The trace will end at the last vertex that you placed, and a via will be added at the vertex. If you don't want the via, select it and press F3 ("Delete Via"). If the via passes through a copper area on the same net as the starting pin, a thermal relief will be placed to connect the via to the copper area. An example of a stub trace connecting a pin to a copper area is shown below. The thermal relief is represented by the "X" drawn on the via in the ratline color.

Important Note: A stub trace can be converted to a regular pin-to-pin trace by routing it to a pad. When you place the end-point of a segment anywhere on a pad that is connected to the same net (or not connected to any net) the stub trace will automatically connect and terminate. This can be very useful if you are designing a PCB "on-the-fly", without a netlist.

5.138 Modifying Traces

Traces can be modified by selecting segments, vertices or ratlines and using function-key commands. You can select an entire trace by clicking on a segment or vertex while holding down the "t" key. You can select an entire net by clicking on a segment, vertex or pin while holding down the "n" key.

Here are descriptions of the function-key commands:

- With a ratline selected:
  - F1 (Set Width) - pop up the Set Trace and Via Widths dialog, which is described below.
  - F3 (Lock/Unlock Connect) - lock or unlock the ratline. A locked ratline cannot be eliminated by the "Recalc. Ratlines" operation.
  - F4 (Route Segment) - start dragging the endpoint of a routed segment to replace the ratline.
  - F5 (Change Pin) - this is only available if you have the selected a ratline connecting a partially-routed trace to a pin. It allows you to change the pin that the ratline connects to.
  - F7 (Delete Connect) - remove the connection from the net.
  - F8 (Recalc. Ratlines) - recalculate ratlines for the net to minimize their length.

- While routing a segment:
  - F4 (Complete Segment) - extend the segment to the endpoint of the ratline, and stop routing

- With a copper segment selected:
  - F1 (Set Width) - pop up the Set Trace and Via Widths dialog, which is described below
  - F2 (Change Layer) - pop up a dialog that lets you change the layer of the segment, trace or net
  - F5 (Unroute Segment) - unroute the segment, converting it to a ratline
  - F6 (Unroute Trace) - unroute the entire trace, converting it to a ratline
  - F7 (Delete Connect) - remove the connection from the net
  - F8 (Recalc. Ratlines) - recalculate ratlines for the net to minimize their length

- With a vertex selected:
  - F1 (Set Position) - pop up a dialog that allows you to edit the X and Y coordinates of the vertex explicitly
  - F4 (Move Vertex) - start dragging the vertex to move it
  - F5 (Delete Vertex) - remove vertex, unrouting the adjacent segments into a ratline
  - F6 (Unroute Trace) - unroute the entire trace, converting it to a ratline
  - F7 (Delete Connect) - remove the connection from the net
  - F8 (Recalc. Ratlines) - recalculate ratlines for the net to minimize their length

- With the end-vertex of a stub trace selected:
  - F1 (Set Position) - pop up a dialog that allows you to edit the X and Y coordinates of the vertex explicitly
  - F2 (Add Segment) - start dragging a new segment from the vertex
  - F3 (Add/Delete Via) - add a via, or delete one that is already present
  - F4 (Move Vertex) - start dragging the vertex to move it
  - F5 (Delete Vertex) - remove vertex, unrouting the adjacent segments into a ratline
  - F7 (Delete Connect) - remove the entire stub trace
  - F8 (Recalc. Ratlines) - recalculate ratlines for the net to minimize their length

- With an entire trace trace selected:
  - F1 (Set Width) - pop up the Set Trace and Via Widths dialog, which is described below
  - F2 (Change Layer) - pop up a dialog that lets you change the layer of the trace or net
  - F6 (Unroute Trace) - unroute the entire trace, converting it to a ratline
  - F7 (Delete Connect) - remove the connection from the net
  - F8 (Recalc. Ratlines) - recalculate ratlines for the net to minimize their length
- With an entire net selected:
  - F1 (Set Width) - pop up the Set Trace and Via Widths dialog, which is described below
  - F2 (Change Layer) - pop up a dialog that lets you change the layer of the net
  - F3 (Edit Net) - add a via, or delete one that is already present
  - F8 (Recalc. Ratlines) - recalculate ratlines for the net to minimize their length

The Set Trace and Via Widths dialog, which is invoked by pressing F1 with a net, trace, segment or vertex selected, is shown below.

This dialog allows you to modify the trace and via widths for a segment, trace, or net. You can also set the net default to the new widths, so that they will be used for any future routing of the net.

PREV | Table of Contents | NEXT