All polarized capacitors from the footprint library have two centers?!

I hereby certify that I am not simply asking someone else to design a footprint for me.

This is an auto-generated message that is in place on the “footprints” section of the KiCad.info forum. If I remove it and ask for a footprint to be designed anyway, I understand that I will be subject to forum members telling me to go design my own footprint or referring me to a 3rd party footprint site.

First time poster here. Quick question: do I need to remove the above messages? And I’m sorry in advance for the lack of images. I am a new user. Now to the topic in hand…

I was using some THT capacitors, specifically the Capacitor_THT:CP_Radial_D8.0mm_P3.50mm but this does seem to propagate to all footprints from the Capacitor_THT library. The problem I see with this kind of footprints is that when they are placed in PCBNew and you rotate them, you will definitely notice that they do not rotate in place. What I mean is that there are two centers!

How did I find this? Upon placing two capacitors, one rotated 180º, and trying to align them to the vertical center, they were totally not aligned. Note that I had silkscreen layers hidden. I just hid the silkscreen since this footprint is made with tons of vertical lines instead of using two polygons and this produces way too many alignment points that are unnecessary for my tests. What a waste of lines!

What seems to be the culprit? Analyzing the footprint it seems that from front courtyard is as expected, producing a center point at 4.250 mm at X:1.750 mm Y:0.000 mm.

On the other hand, if we analyze the total width from the outermost graphical elements, we see that the leftmost element is the horizontal silkscreen line which extends past the front courtyard. This makes the width of the capacitor’s footprint 8.660 mm + 0.060 mm which , producing a second center at 4.330 mm, but this point does not align with the observed second center at X:1.653mm from the origin. But could this plus sign be the culprit?

Removing the silkscreen’s indicator for the positive leg + (plus) seems to have solved the double center points. Now the two capacitors, one rotated 180º, are not properly aligned. What gives?

KiCad Version

Application: KiCad Footprint Editor x64 on x64

Version: 8.0.0-rc2-114-gbfbf000f60, release build

Libraries:
	wxWidgets 3.2.4
	FreeType 2.12.1
	HarfBuzz 8.3.0
	FontConfig 2.14.2

Platform: Windows 11 (compilación 22631), edición de 64 bits, 64 bit, Little endian, wxMSW

	wxWidgets: 3.2.4 (wchar_t,wx containers)
	Boost: 1.83.0
	OCC: 7.7.1
	Curl: 8.5.0-DEV
	ngspice: 42
	Compiler: Visual C++ 1936 without C++ ABI

Build settings:

You only have to examine the footprint of the part in question in the footprint editor to discover where the origin is; it’s shown by the crosshair. For THT capacitors, and indeed other THT parts, the origin is pin 1. Thus rotation will be around pin 1. This is a nuisance as rotating the footprint usually needs a move afterwards.

On the other hand most (all?) SM parts have the origin at the centre of the part.

I agree that the center of all footprints is usually pin 1, but this is not fully related to only the Footprint Editor, but PCBNew. I’m sure the footprints follow the KiCAD Library Conventions perfectly, but the problem is that the footprint generated by the scripts KiCAD uses to make these parts did not take into consideration the issue at hand. My observation is that the generated footprint makes rotating the part around the geometric center of the part erroneous, since PCBNew believes the center point is offset from the true center point that should lie between the two pins. I also believe that this is caused by the silkscreen plus sign, since after removing it, the footprint of the THT Radial Polarized Capacitors now rotates around the true centerpoint of the capacitor, the radial axis of symmetry.

Since it would be counterproductive to just complain, I have found a solution that I request the maintainers of the Capacitor_THT scripts should do: move the plus sign at 45º from the origin.


Example provided for the smallest diameter capacitor in the library.

This essentially solves this minute problem, since from my experimentation, PCBNew now makes the axis of rotation around the center of the part.

2 Likes

The libraries should be considered recommendations. Always verify a symbol and footprint before using it. Save it off to a personal library and work from that. But yeah, the default could be better.

1 Like

all my footprints are centre of rotation = centre of the part
There’s good reason for this. A productivity reason. (yes I know I keep harping on about productivity)
example :
If you place a part where you want it , but it is ‘reverse’ of what you need,
If the centre of rotation is the centre of the part, then you just need a couple of keypresses to rotate the way you need it.
But if the centre of rotation is not the centre of the part, you need both rotation keypresses PLUS you need a move which is extra mouse clicks / keystrokes

IE a saving of about 3:1 on keystrokes/mousing.
Multiply that by 500 parts and you have sigificant effort and time saving.

I am using KiCAD 8.00rc2, so this is not a problem for me. I don’t know how or when the center of footprints began working like I’m experiencing, but I do find it a nice feature. I think it also helps with 3D models if parts are aligned at pin 1.

If remember well I recently (V7.0.10) positioned USB-C 3D model at its footprint. Then I changed footprint reference (0,0) point and 3D model offset was automatically corrected.
Can’t check it now as don’t have KiCad here.
I think having reference at pin 1 is not important for 3D models.
I also have in my footprints reference in their center and not pin 1 (except for a few exceptions).

all caps have two centers …

No and yes …
Every footprint has exactly one anchor point defined in the library (footprint editor).
But: Kicad pcb editor (pcbnew) allows to grab and manipulate (move, rotate, copy) a footprint by additional grabbing points, so it looks like the FP has multiple centers:

  1. the original defined anchor point
  2. the exact geometric point of the footprint (calculation seems to include the silkscreen according to your description)
  3. all pads can act as grabbing points

For non-symmetric footprints the grabbing points 1+2 are different, so it looks like there are more centre points defined. Personally I don’t find this “centre” grabbing point useful (quite contrary it’s often distracting), and we got some threads about this in the past weeks. But thats the current behaviour (at least for the last 2…3 years).

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.