EEVblog Electronics Community Forum

Electronics => PCB/EDA/CAD => KiCad => Topic started by: salfter on August 15, 2018, 05:40:04 pm

Title: Rotating footprints to enable pick-and-place
Post by: salfter on August 15, 2018, 05:40:04 pm
I did some reading recently on design for manufacture (in particular, https://rheingoldheavy.com/design-assembly-kicad/), and one of the things that came up was that you should have your component footprints oriented the same way as they’re loaded into the tape that gets loaded into the pick-and-place machine. Many KiCad footprints (including those that ship with KiCad) aren’t oriented this way, and even in the new KiCad 5, I don’t see an easy way to rotate an entire footprint. You can rotate a footprint inside a PCB design, but unless I’m missing something, there’s no option within the footprint editor to take all the elements within and rotate them (let alone an option to rotate an individual element, as far as I can see).

I’ve come up with this:

https://gitlab.com/salfter/kicad-footprint-rotator/

It's a sed script that takes a KiCad footprint and rotates it 90° counterclockwise by transforming coordinates, dimensions, and rotation angles within. If you need to rotate 180°, run your footprint through the script twice. To rotate 90° clockwise, run it through three times.

Some screenshots of a footprint that has been processed through the script are up on my blog:

https://alfter.us/wp/2018/08/15/how-to-rotate-kicad-footprints/
Title: Re: Rotating footprints to enable pick-and-place
Post by: hermit on August 15, 2018, 06:37:58 pm
You may want to do a 'pull request'? here.
https://github.com/xesscorp/kicad-3rd-party-tools

You may want to discuss the topic further here.  I know the subject has come up before but not an area that I have any interest in at the moment so I can't really tell you more specifics.
https://forum.kicad.info/
Title: Re: Rotating footprints to enable pick-and-place
Post by: mikeselectricstuff on August 15, 2018, 06:51:44 pm
The absolute orientation will vary between P&P machines, what is important is that the orientation is consistent with respect to the taping. i.e. zero degrees corresponds to a specific tape orientation with respect to the PCB.
That way any machine-specific rotation can be done globally.
Title: Re: Rotating footprints to enable pick-and-place
Post by: salfter on August 15, 2018, 07:38:03 pm
Quote
You may want to do a 'pull request'? here.
https://github.com/xesscorp/kicad-3rd-party-tools

Done. :)
Title: Re: Rotating footprints to enable pick-and-place
Post by: jonroger on December 02, 2019, 12:18:00 am
My advice is to not touch the correct footprints.   Write a program to fix the XY pos file based on the footprints for each part.
Title: Re: Rotating footprints to enable pick-and-place
Post by: poeschlr on December 02, 2019, 12:14:44 pm
The zero orientation is defined in different (contradicting) industry standards. The official library uses IPC-7351 zero orientation A. (Simplified: pin 1 is on top left corner)
If all your footprints follow that standard then you can simply tell the pick and place programmer that this zero orientation is used.

The Pick and place operator can then derive what the orientation must be from the way a part is in the reel and from the side the reel is placed (There are machines that can feed from multiple sides to increase the number of parts possible with the same machine footprint). You as the circuit board designer can not really do anything about that. (You do not have the knowledge which machine is used and which slot will have a particular part in it)

It seems to me that your contractor tries to offload part of this work onto you. I personally would tell them that this is not going to happen as i would not be prepared to lock myself into one contractor. (Modifying your footprint libs just to fit one contractors special needs gets you into a spot where you can easily fall pray to the sunk cost fallacy.)
Title: Re: Rotating footprints to enable pick-and-place
Post by: Pitrsek on December 20, 2019, 08:06:48 am
+1 for post from poeschlr
Keep your library clean, in defined standard.
If you need to mess with orientation for cheap assembly houses, do the rotation at the level of BOM file.