How to create a circle FCu on PCB with hole?


#1

How to create a circle FCu on PCB with hole?

Thanks my friends


How to create a circle keepout area
#2

You can not place circles or arcs on copper layers using the drawing tools in KiCAD.

You can not draw an arc or circle on another layer, and move it to a copper layer using the “Edit” dialog. (That’s a useful trick for placing things onto layers that don’t permit them to be drawn directly - but it won’t work for your case.)

It may be possible to place the circle on some other layer (such as Silkscreen, Comments, ECO, etc), then manually edit the *.kicad_pcb file with a text editor to define the circle on a copper layer.

(Even if this works today, it may not work in the future. Future versions of KiCAD may recognize the circle on a copper layer as not permitted, and either move it to a layer where it is permitted, or remove it entirely from the saved file.)

Dale


#3

Actually, if you run the development version of KiCAD it will allow you to do it but pop up a warning. I think the main reason it does this is because the DRC will not take it into account.


#4

The “Development Version” must be different from the “Nightly Builds”.

Dale


#5

…hmm… interesting-- How to


#6

No, I did mean the nightlies from the Ubuntu PPA (ppa:js-reynaud/ppa-kicad): 201701131332+7455~57~ubuntu14.04.1.


#7

Create a KiCAD project. Open PCBNew and start a board.

Select a convenient layer that accepts graphic elements (e.g., " .SilkS " (top or bottom silkscreen), "ECO.User" (ECO1 or ECO2 layers), “Margin”, “Dwgs.User”, etc). Make this layer visible, and make it the active drawing layer.

Draw the circle or arc you want. Use the “Circle Properties” menu to set location, size, and line thickness. (The “Circle Properties” menu also lets you specify the layer where the circle is drawn . . . but none of the copper layers is on the list of choices.) It may be helpful to record the values you set for location and size, expressed in millimeters.

Save the board layout file and close PCBNew. The file should be in the project directory, with the extension " *.kicad_pcb ". The project directory will also include a " *.kicad_pcb-bak " file but you may want to create your very own backup file “just in case . . .”.

Open the board layout file in your favorite plain-text editor. I use “Notepad++” ( https://notepad-plus-plus.org/ ) but you may prefer “ConTEXT”, “EMACS”, “MS-DOS Edit”, etc, etc.

Search for a line containing the string “gr_circle”. Something like this:

Change the " (layer F.SilkS) " parameter to the copper layer where you want the circle, e.g. " (layer F.Cu) ", etc.

Save the file. Re-open PCBNew. The circle should now show on the desired copper layer.

If you find more than one line containing the string “gr_circle” you can use the circle’s location to verify that you are editing the circle you intend to edit. Remember that KiCAD records the locations in millimeters regardless of the units you select for your display. (My circle at (X,Y) = (2.519", 1.862") is listed in the *.kicad_pcb file as (center 63.9826 47.2948) )

Dale


#8

I installed the latest Windows nightly build { Version: (2017-01-09 revision c2fb336)-makepkg, release build } .

When I try to place an arc or circle on a copper layer, I get the error message shown here, and the shape is NOT placed.

Dale


#9

Dale, you are editing the board.

Kasbah was talking about the footprint editor. With the footprint editor you can trace a circle (or a polygon) in a technical layer and move it to a copper layer. Kicad warns you.

This feature is also available in version stable 4.0.5. It was even available twelve years ago.

Then, the recently created footprint is used as any other footprint, but no pad attached to it.

An even easier way to do this footprint is adding a circular pad with big diameter and big hole.

Pedro.


#10

@dchisholm wow, great explanation :smiley: And thanks to all


#11

I do this by writing a short script to create a filled zone, then copy the results to the PCB file. Unfortunately the code seems to recognize that the shape is a circle and it insists on creating an approximation with 16 line segments (or 32 line segments if I specify that I want 32). So the beautiful circle with a maximum deviation of 0.1mm becomes an ugly 32-sided polygon. If you can tolerate such errors (electrical connections won’t be broken due to the bad approximation and you don’t mind the ugliness) then you can use this technique.

My working code looks something like this:

// print vertices for a circle centered on X,Y and with a radius R
void MakeCircle( double X, double Y, double R )
{
// vertex list: (xy 30 30) (xy 50 30) (xy 60 40) (xy 20 40)
double a0 = acos( 1 - E/R );
int N = (int)( M_PI / a0 ) + 1;
double a1 = M_PI / N;
N *= 2;
printf( " " );
int i;

for( i = 0; i < N; ++i )
{
    double a2 = a1 * (double)i;
    double x = X + R * cos( a2 );
    double y = Y - R * sin( a2 );

    printf( " (xy %0.3f %0.3f)", x, y );

    if( i % 8 == 7 )
        printf( "\n       " );
}

if( i % 8 )
    printf( "\n" );

return;

}

void MakeZone( const char* netInfo, int keepout, double X, double Y, double R )
{
// netinfo: (net 1) (net_name “GND”) (layer In2.Cu)
printf( " (zone %s (tstamp 0) (hatch edge 0.5)\n", netInfo );
printf( " (connect_pads (clearance 0.4))\n" );
printf( " (min_thickness 0.2)\n" );
if( 0 != keepout )
printf( " (keepout (tracks not_allowed) (vias allowed) (copperpour not_allowed))\n" );
printf( " (fill (arc_segments 32) (thermal_gap 0.4) (thermal_bridge_width 0.6))\n" );
printf( " (polygon\n" );
printf( " (pts\n" );
MakeCircle( X, Y, R );
printf( " )\n" );
printf( " )\n" );
printf( " )\n" );

return;

}

A description of a filled zone can then be made by a line like this:

MakeZone( "(net 2) (net_name \"+3V3\") (layer F.Cu)", 0, 105, 105, 89.5 );

#12

I’ve wondered why this strange limitation ?
I can understand selecting a smallish number can speed up some operations, but once you let users choose values, why then limit to 16 or 32.
Surely the code is already there to vary the count & handle varying counts ?

Why not default to 16, but allow special cases of even (say) 256 ?


#13

There was some code that needed changing for this, which wasn’t trivial and needs time & grunt… at least as far as I remember from the last time this came up (I was querying) :wink:


#14

I’d guess i’s some poor code in the code base which makes a trivial thing very complex. My personal preference is to use an even number of segments in a circle and vary the count in order to meet a mechanical tolerance. Maybe one day we’ll have this. :slight_smile: