← Back to team overview

kicad-lib-committers team mailing list archive

Re: Library style and organization work RFC

 

Hello,

In my opinion, we should discuss and agree on a set of rule and style
before start working. It should be well documented with clear version
number just like in .lib and .mod specification. This will help users
whether they should upgrade their library or not in case of major changes
in the specification. I would like to propose my idea how the new library
would be restructured and recreated here and will summarize it in detail as
a blueprint (and a odt document) after the discussion.

0. Definitions
    0.1 Directory structure - the directory consists of symbol, footprint,
model, document and probably readme, changelog, etc files.

    library ------
                 |---- symbol             ---> symbol libraries
                 |---- footprint            ---> footprint libraries
                 |---- model               ---> 3d models
                        |----source
                 |---- document         ---> datasheet, application note,
pictures, etc.

    0.2 Grid unit (GU) - 25 mil

1. Symbol library and symbol naming scheme
    1.1 Library naming - as the symbols are put in library files, this is
the way symbols are categorized.Therefore, I think, the way libraries are
named should reflect its category as much as possible. Here is the scheme I
proposed:

    {main-category}-{manufacturer, standard}-{other fields separated by
"-"}.lib

    the main category and manufacturer fields are required. The other
fields can be added to describe the lib. For example, "device-en60617.lib",
"connector-molex.lib", "microcontroller-microchip.lib", etc. "generic"
should be used in {manufacturer} field for any standard components. The
file name should be in lower case.

    1.2 For symbol naming, I proposed:

    {name}-{other fields separated by "-"}-{footprint}-{pin quantity}

    Only {name} is required here. For examples, "MCP73832-SOT-5,
2N2222-A-TO92", etc. For fundamental devices, there should be a set of name
to be derived from such as "RESISTOR, CAPACITOR", etc. All other libraries
of fundamental devices should use this name set. I'm not sure whether lower
or upper case is suitable.

2. Line style - the style proposed by Vesa can be used. But the DU unit and
other line weight should be specified. This line style will be used in both
symbol and footprint drawing. The line weight should be chosen based on
physical print quality (especially, on PCB silkscreen layer).

3. Symbol drawing style
    3.1 Block model - all symbols will be drawn as blocks
        3.1.1 Fundamental symbols - devices such as resistor, capacitor,
logic, etc, will be separated into 2 types
            3.1.1.1 Symbol - this block is 16x16GU. It is used in schematic
as a normal symbol. Drawing and all interface pins should fit inside this
block.
            3.1.1.2 Building block - this block is 8x8GU. There is no
assigned pin as it is used to build the other block symbols.

        3.1.2 Block Symbol is a blank block or block built from building
block with assigned pins. A specific width and height ratio should be used
(except the square block). I propose the golden ratio (1.618). The closest
even number from multiplication/division of width/height will be used.

        3.1.3 Orientation - For fundamental symbols, should they be placed
horizontally? For block symbol, see pin position and orientation.

3.2 Name and designator
        3.2.1 Designator - what standard should be used? or should it be
redefined (based on available standards) especially for kicad?
        3.2.2 Position - Designator will be placed at the middle-top and
name at the middle-bottom of the symbol. At least 1GU space to any nearby
line or pin should be added.

    3.3 Pin
        3.3.1 length for block symbols - 12GU (300 mil, current pin length
used by kicad)
        3.3.2 Pin to pin space - 4GU (100 mil)
        3.3.3 Pin to corner space - 4GU (100 mil)
        3.3.4 Position and orientation
            3.3.4.1 Positioned by its function - group the same function
together
                3.3.4.1.1 Input pin - start from top-left of the block,
counter-clockwise
                3.3.4.1.2 Output and Bidirectional pin - start with output
pin from top-right, clockwise
                3.3.4.1.3 Power input - Distributed at the center of top
                3.3.4.1.4 Power output - Distributed at the center of bottom

            3.3.4.2 Positioned by its footprint - the 1st pin is placed at
top-left of the block

        3.3.5 Pin naming and numbering
            3.3.5.1 Left,top = 1, right,bottom = 2
            3.3.5.2 Anode = 1, Cathode = 2
            3.3.5.3 Control = 1, input = 2, output = 3
            3.3.5.4 GND = 1, input = 2, output = 3
            3.3.5.5 BCE = 123
            3.3.5.6 GDS = 123
            3.3.5.6 Pin name should be exactly the same as noted in the
datasheet

    3.4 Symbol property
        3.4.1 For symbol with multiple units, the power unit should be
created explicitly.
        3.4.2 Symbol description - The value should be put in all fields,
especially keyword. See below
            3.4.2.1 Keyword - this field should be changed to "Tag" and
will be used for the search tool. It is probably used for footprint lookup.
            3.4.2.2 DocFileName - should refer to a file in the document
directory or a download link
        3.4.3 Alias is obsolete, do not use it.
        3.4.4 Footprint filter - I'm sure how this works but if possible
the words put here will be used to search in the module keyword.

    3.5 Symbol field property
        3.5.1 Symbol with {footprint} in its name should be mapped to the
exact footprint in the footprint library.
        3.5.2 Datasheet should referred to a file in the document directory
or a link to download website. (DocFileName

4. Footprint creation
    4.1 Naming scheme
        4.1.1 Consider the IPC7351B, I once implemented it in my local
library. It was good for machine, but not for human, It was very difficult
to understand. I had to look through the footprint list to find the one I
wanted. However, it is still possible to implement using footprint filter
and/or keywords. To be discussed.
        4.1.2 For file naming scheme, see the symbol scheme above. JEDEC
name can be use as the {main-category}.

    4.2 Pin number identification - for a footprint without pin number, put
the component faced-up on the floor, the most pin count side on the left.
The top-left is the 1st pin and count around the component
counter-clockwise.

    4.3 Footprint orientation depends on the first pin of the footprint.
The first pin should be at top-left position. The footprint should be
aligned horizontally first. If the 1st pin is not at top-left, align it
vertically.

    4.4 Silkscreen drawing - to be discussed

 5. Model
    5.1 Model name should be the same as footprint name.
    5.2 Each available footprint should have a model assigned to it.

 6. Library organisation - I have been thinking about this for quite a
while, how the new library should be organized. Open as kicadlib.org or
well organized and verified by set of maintainers. To me, the only problem
of kicad is it library consistency. I wouldn't use kicad for a large or
commercial project even the main components are ready. I would proposed
that kicad-lib-maintainer should be responsible for organizing and
verifying all submit libraries to maintain its quality.

 That is all I can think about. Please hit me back with your critic and
opinion :)

 Tony

Follow ups

References