Pcbnew Footprint Wizard - QFN troubles - Page 1
Forum section: electronics / general

author: thinkfat
author_rank: Unknown
timestamp: April 16, 2019, 08:49:42 am
content: Hiho,I'm trying to make a footprint for an IS31FL3736 QFN40 LED driver. None of the footprints from the Kicad library really fit, the land pattern in the datasheet requests 0.22mm wide pads of 0,715mm length and a center pad with 3.4mm length. Package is 5mm square, pad pitch is 0.4mm. When I enter these numbers into the QFN wizard, I get an unusable footprint. The corner pads are always touching and are way too close to the center pad. Can someone help me out finding the right values to enter?Best regardsMatthias

author: Doctorandus_P
author_rank: Super Contributor
timestamp: April 16, 2019, 12:12:27 pm
content: In KiCad's default libraries (V5.1) there is a:Package_DFN_QFN / QFN-40-1EP_5x5mm_P0.4mm_EP3.6x3.6mmand this seems to be quite near to your dimensions.I had a peek at:http://www.issi.com/WW/pdf/31FL3736.pdfBut that datasheet does not have much info on package size and land patterns, and I do not feel much for hunting for a datasheet with a land pattern of your specifications.Then I punched in your numbers in the Footprint Wizard and understood better wat you meant, I also got overlapping pads in the corners.The Footprint wizard for QFN uses the center of the pad for it's calculations, and if the pads are "too long" then you get overlap in the center.So I started playing a bit with the settings of the Footprint Wizard, which is very easy, because every time you enter a value you get live feetback of the generated footprint.In the end, instead of making the outside of the package 5*5mm, I generated the footprint for a package of 5.6mm * 5.6mm. This shifts all the pads 0.3mm to the outside, and they do not overlap anymore.Note that there are 3 sets of parameters you can enter. On the left of the screenshot there are:"Pads", for dimension of te pads themself."EPad", for the center pad."Package", for the dimensions of the package itself.

author: Doctorandus_P
author_rank: Super Contributor
timestamp: April 16, 2019, 12:37:02 pm
content: I experimented a bit more, and there seems to be an error in the generation of the pads in the Footprint Wizard for QFN.I made it generate another QFN40, with very narrow pads this time, and after generating it you see that (again) the pads overlap in the corners.I used your length for the pad length (0.715mm), but when I measure the actual pad length it is more than a mm long.I experimented a bit more, and discovered that the value for "fillet" is added to the length of the pads."Fillet" is a setting for the corner radius of rectangular pads and this is new in KiCad V5. It seems that the Footprint Wizard has not been updated properly to work with these pads.The Footprint wizards are also only a start for generating custom packages. Once a footprint is generated, you can edit everything in the Footprint Editor. It's for example easy to move a row of pads an exact distance by first draggig a box around your row of pads, then click the right mouse button for the context menu and select "Move Exactly... [Ctrl +M]" from the context menu and punch in some numbers for the distance you want to move your selected block.A small note about library management:KiCads libraries are normally Read only, and you should not change that. If you want to use custom footprints, then first make a library for your own, and put your custom symbols in your custom library.

author: Doctorandus_P
author_rank: Super Contributor
timestamp: April 16, 2019, 01:31:12 pm
content: Me Again.I wanted to know if the pad size errors also occured in other footprints, so I experimented a bit more with other footprints wizards, and the QFN seems the only affected.You can also use the QFP wizard to generate your QFN package. For the QFP wizard pad sizes and locations are handled as separate parameters.

author: thinkfat
author_rank: Unknown
timestamp: April 16, 2019, 05:51:44 pm
content: I experimented a bit as well and I think I understand fillet and length now. Length and fillet join at the package border, so the full pad length is fillet + length, and length is just what is inside the package outline. I can now calculate these values and generate a correct footprint that matches the land pattern in the data sheet, without messing with the package dimensions.I will update the thread when I get back to the PC.Gesendet von meinem Nokia 6.1 mit Tapatalk

author: Doctorandus_P
author_rank: Super Contributor
timestamp: April 16, 2019, 06:07:38 pm
content: There was a change in the way pads are defined between KiCad V4 and V5.The fillets for rounded corners of pads have been added in V5 and it seems that the footprint wizards have not been updated for this change.You can see that the QFN library parts have rounded corners, but you can not draw these with the QFN Library Wizard.I will look into writing a bug report for this.

author: thinkfat
author_rank: Unknown
timestamp: April 16, 2019, 08:07:22 pm
content: "Fillet" is not corner rounding. The wizard doesn't allow specifying that at all. The "solder fillet" is basically the alloy forming the joint between the contact and pad. I'm assuming that the QFN wizard allows specifying a separate parameter for the part of the pad outside of the package perimeter, to achieve an acceptable solder fillet between pad and contact. This is notoriously hard to achieve with QFN especially for fine pitch components <= 0.5mm.I've attached the land pattern for the IS31FL3736, the calculation for pad length and fillet parameters, for 5mm package size:length = (5-4.1)/2fillet = 0,715 - lengthlength = 0,45fillet = 0,265These parameters reproduce the land pattern from the data sheet.

author: Doctorandus_P
author_rank: Super Contributor
timestamp: April 17, 2019, 01:54:30 pm
content: It's 2 different kind of "fillets""Fillet" is also used for the roundings formerd by the soldifiie-ing solder.This depends for a lagre part on the stencil thickness and the amount of solder, and KiCad has no knowledge of these parameters.In technical drawings the term "fillet" is used for rounded corners. I just had a look at the Footprint Editor in Kicad, and there rounded pads are apparently defined still differently. ("Corner size" as a persentage of the pad widht).But it does not matter much.The more important thing is that I dropped a message yesterday on the KiCad forum, and apparently a pull request for a fix is available on github.https://github.com/KiCad/kicad-source-mirror/commit/68e6308066a3bd0a4fcbf6aae8c4869d075aae3eOn my PC the Python code for the wizard is in:/usr/share/kicad/scripting/plugins/qfn_wizard.pyI'm a total noob with Python, but I was curious, so I modified the python script by hand (guided by the patch suggestion), then compiled it with info I found on:https://askubuntu.com/questions/324871/how-to-compile-a-python-fileand I copied the output to:/usr/share/kicad/scripting/plugins/__pycache__/qfn_wizard.cpython-37.pycThen I started KiCad, and "fillet" has indeed been renamed to "offset", and pad length seems correct and offset moves the pas more to the outside.It was pretty easy to do, even for a total Python Noob such as me. I do not know however how long it takes before the change is available in the official KiCad release.I am very impressed by the quick response of the KiCad developers. I've seen it before that small fixes like this get fixed within a few days.Some notes:I always get confused by Python 2 and Python 3, and I may have compiled it wrongly...Those scripts are in a readonly directory, which makes it a bit harder to modify. (Rightly so).Make backups of the original files before changing anything. I like to prepend the original file with a date in ISO6801 format:> cp qfn_wizard.py 2019-04-17_qfn_wizard.pyThe official Footprints for QFN packages have rounded corners. These are also generated from scripts, but they use a different script then the Footprint Wizards.

author: thinkfat
author_rank: Unknown
timestamp: April 17, 2019, 02:08:51 pm
content: Hey, that looks really quite interesting. I'll have to try that patch and see what difference it makes.Thanks a lot for taking the time to help me!

author: thinkfat
author_rank: Unknown
timestamp: April 17, 2019, 02:39:08 pm
content: Alright, checked the patch, but I'm not happy with it. The offset parameter is applied incorrectly, it actually moves the pads outwards by "offset/2", which is just ... un-intuitive?It'd be much better to compute it like this:h_pitch = h_pitch / 2 - pad_length + pad_length/2 + pad_offsetv_pitch = v_pitch / 2 - pad_length + pad_length/2 + pad_offsetThe patch you mentioned went into the master branch 8 hours ago, so it will be part of one of the next releases, I guess. I'll comment on it so that it possibly gets fixed. Like this, it's just as convoluted as before.

author: Doctorandus_P
author_rank: Super Contributor
timestamp: April 17, 2019, 03:22:29 pm
content: Your solution does indeed look more logical to me.The most important thing is though that with this patch you can move the pads without hacking the component outline as I suggested earlier. It's also good to know that such Wizard scripts can be easily edited if you want a custom Wizard for some reason, without having to do much with the rest of KiCad. Understanding 150 lines of Python (without the comment, empty lines) is pretty doable, (but still an unwanted distraction when your goald is just to have a footprint).A better solution is probably to start with having a look at the scripts that generate the official KiCad's libraries.I am thinking along the lines of splitting such scripts in 2. One of the scripts could then double as the "Footprint Wizard", while the other script has some tables for number of pads and sizes and does the file handling to generate the library files.Something like that would require more effort.I might dive into this myself, I've always been a bit curious about Python, and I noticed that protocol decoders for Sigrok / Pulseview are also written in Python.

author: thinkfat
author_rank: Unknown
timestamp: April 29, 2019, 12:31:50 pm
content: Looks like the suggested fix went into the repository 12 days ago