← Back to team overview

kicad-developers team mailing list archive

Placing real components out of a database instead of: "Automatic assignment of footprint with a database"

 

Hello!

This is related to the previous thread: "Automatic assignment of footprint with a database"

I would generally prefer assemble real components on a real PCB right from the beginning instead of first placing generic components and then assign footprints + manufacturers + types + x manually. This seems extra work for each component which could possibly be avoided.

So, regarding on the Kicad codebase, I would very likely not recomment to embed a full component management / database system, since this might vary from site to site and even from project/assembly house to project/house. But it would be great to be able to have an interface to grab a component out of a database and Kicad grabs all desired / a selection of individual columns out of the database as needed.
This might include the actual footprints stored in the database as well.


Regards, Clemens


-----
Just FYI - my workflow:

To automate as much as possible, the Library in my PCB Tools (Mentor PADS, Kicad, and since a couple of weeks: Eagle *omph*) contain real parts only.

I am maintaining a MariaDB Database with all my different components (2000+) containing a lot of information, possibly worth more than a commercial design software license.
Let me show you the table structure (below) for your information and discussion to hopefully get the big picture of the complexity of component management.

There are still some missing features and advanced usecases:
- Allow some components get replaced with successors in a life-cycle-management / obsoloete-part-management sense - on a per project basis.
- Use unique components+versions and store the used components for all manufactured boards in a database.
- For conformal coating: Add columns if a component must not be coated, Add columns on a project basis if a component should be coated or not.
- Depending on different assembly houses: Generate footprints with small rounded rectancles for reflow processes, or with wider pads for wave-soldering and update the PCB atomatically!
- Search for a obsoloete component in selected projects and replace it with a different one. Since the new one has an updated footprint, layouts need to be updated too in X places!

Here is an  (still incomplete) database schema, I am using for years now - with a lot more SQL magic and M4 scripts around it to get it in and out of the different design tools:

CREATE TABLE `main` (
	`mfg` VARCHAR(45) NULL DEFAULT '' COMMENT 'mfg name' COLLATE 'utf8_general_ci',
	`mfgname` VARCHAR(45) NULL DEFAULT '' COMMENT 'mfg partname' COLLATE 'utf8_general_ci',
	`description` VARCHAR(255) NULL DEFAULT '' COMMENT 'functional specification' COLLATE 'utf8_general_ci',
	`lycomment` VARCHAR(255) NULL DEFAULT '' COMMENT 'comment regarding part usage' COLLATE 'utf8_general_ci',
	`partname` VARCHAR(45) NULL DEFAULT '' COMMENT 'KEY: partname_metric' COLLATE 'utf8_general_ci',
	`partname_old` VARCHAR(45) NULL DEFAULT '' COMMENT 'KEY: partname_imperial (obsolete)' COLLATE 'utf8_general_ci',
	`caedecal` VARCHAR(45) NULL DEFAULT '' COMMENT 'cae decal name' COLLATE 'utf8_general_ci',
	`pincount` SMALLINT(5) UNSIGNED NULL DEFAULT '0' COMMENT 'no of package pins including e-pad, excluding drills',
	`value` VARCHAR(20) NULL DEFAULT '' COMMENT 'ATTRIBUTE: primary component value in design tool ' COLLATE 'utf8_general_ci',
	`pcbdecal` VARCHAR(45) NULL DEFAULT '' COMMENT 'pcb decal name ' COLLATE 'utf8_general_ci',
	`mfgpkg` VARCHAR(45) NULL DEFAULT '' COMMENT 'mfg package specification' COLLATE 'utf8_general_ci',
	`mfgpkg_iec` VARCHAR(45) NULL DEFAULT '' COMMENT 'mfg package specification IEC' COLLATE 'utf8_general_ci',
	`mfgpkg_jeita` VARCHAR(45) NULL DEFAULT '' COMMENT 'mfg package specification JEITA' COLLATE 'utf8_general_ci',
	`mfgpkg_jedec` VARCHAR(45) NULL DEFAULT '' COMMENT 'mfg package specification JEDEC' COLLATE 'utf8_general_ci',
	`power` DECIMAL(7,3) UNSIGNED NULL DEFAULT '0.000' COMMENT 'power rating',
	`voltage` DECIMAL(7,3) UNSIGNED NULL DEFAULT '0.000' COMMENT 'voltage rating',
	`current` DECIMAL(7,3) UNSIGNED NULL DEFAULT '0.000' COMMENT 'current rating',
	`temp_min` SMALLINT(5) NULL DEFAULT '0' COMMENT 'min operating temperature',
	`temp_max` SMALLINT(5) NULL DEFAULT '0' COMMENT 'max operating temperature',
	`pitch` DECIMAL(7,3) UNSIGNED NULL DEFAULT '0.000' COMMENT 'footprint minimum pitch',
	`length` DECIMAL(7,3) UNSIGNED NULL DEFAULT '0.000' COMMENT 'length of part',
	`width` DECIMAL(7,3) UNSIGNED NULL DEFAULT '0.000' COMMENT 'width of part',
	`height` DECIMAL(7,3) UNSIGNED NULL DEFAULT '0.000' COMMENT 'height of part',
	`rohs` VARCHAR(10) NULL DEFAULT '' COMMENT 'rohs conformity' COLLATE 'utf8_general_ci',
	`dista` VARCHAR(255) NULL DEFAULT '' COMMENT 'primary distributor' COLLATE 'utf8_general_ci',
	`ordernoa` VARCHAR(255) NULL DEFAULT '' COMMENT 'orderno of primary distributor' COLLATE 'utf8_general_ci',
	`minordera` INT(10) UNSIGNED NULL DEFAULT '0' COMMENT 'minimum order qty of primary distributor',
	`currency` ENUM('EUR','USD','CAD') NOT NULL DEFAULT 'EUR' COMMENT 'currency for all prices in this row' COLLATE 'utf8_general_ci',
	`pricea1` DECIMAL(10,5) NULL DEFAULT '0.00000' COMMENT 'price at one',
	`pricea2` DECIMAL(10,5) NULL DEFAULT '0.00000' COMMENT 'price at many',
	`qtya2` INT(10) UNSIGNED NULL DEFAULT '0' COMMENT 'package size many',
	`status` VARCHAR(10) NULL DEFAULT '' COMMENT 'general status if part is usable' COLLATE 'utf8_general_ci',
	`available` VARCHAR(10) NULL DEFAULT '' COMMENT 'general status about part availability' COLLATE 'utf8_general_ci',
	`stockqty` INT(10) NOT NULL DEFAULT '0' COMMENT 'in-house stock qty',
	`stockplace` VARCHAR(10) NULL DEFAULT '' COMMENT 'stock place' COLLATE 'utf8_general_ci',
	`stockcomment` VARCHAR(100) NULL DEFAULT '' COMMENT 'stock comment' COLLATE 'utf8_general_ci',
	`mfgcomment` VARCHAR(100) NULL DEFAULT '' COMMENT 'comment for assembly' COLLATE 'utf8_general_ci',
	`tstamp` TIMESTAMP NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() COMMENT 'timestamp of last update',
	`grp` VARCHAR(45) NULL DEFAULT '' COMMENT 'part group' COLLATE 'utf8_general_ci',
	`mfgsap0` VARCHAR(45) NULL DEFAULT '' COMMENT 'mfg sap number 1' COLLATE 'utf8_general_ci',
	`mfgmat0` VARCHAR(100) NULL DEFAULT '' COMMENT 'mfg mat name 1' COLLATE 'utf8_general_ci',
	`mfgsap1` VARCHAR(45) NULL DEFAULT '' COMMENT 'mfg sap number 2' COLLATE 'utf8_general_ci',
	`mfgmat1` VARCHAR(100) NULL DEFAULT '' COMMENT 'mfg mat name 2' COLLATE 'utf8_general_ci',
	`mfgsap2` VARCHAR(45) NULL DEFAULT '' COMMENT 'mfg sap number 3' COLLATE 'utf8_general_ci',
	`mfgmat2` VARCHAR(100) NULL DEFAULT '' COMMENT 'mfg mat name 3' COLLATE 'utf8_general_ci',
	`idx` INT(10) NOT NULL AUTO_INCREMENT COMMENT 'unique index',
	UNIQUE INDEX `idx` (`idx`) USING BTREE
)
COLLATE='utf8_general_ci'
ENGINE=InnoDB
AUTO_INCREMENT=2938
;

--


Follow ups