Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Add SMD chip resistors #15
Generated with LibrePCB/librepcb-parts-generator#29.
I'll try to do that, although it requires manually patching the UUID cache file.
Easy fix, thanks for spotting.
Oops, I missed that one.
Regarding density levels, I found heel/toe/side guidelines in IPC and started implementing them. However, I don't think we can implement density level C in generic (manufacturer-independent) packages. The level C has very little tolerances, so it needs to match the part perfectly. (Remember, IPC specifies protrusion, not size.)
The thing is that we don't know the size of the coated leads of the chip resistors. The sizes are standardized, but not the length of the leads. So if we can't know the length of the lead, we can't really do well-matched footprints.
What about implementing footprint variants "Density Level A (Hand Soldering)" and "Density Level B (Reflow Soldering)" and leaving Density Level C to manufacturer specific libraries?
PR is updated.
Some parts are not currently generated that were previously available as R-XXXX packages. I believe some of them are actually duplicates of others, but with metric name instead of imperial:
Two of them seem to be rare imperial variants:
(For comparison, there are 9'373 1206-resistors and 12'569 0805-resistors, so those definitely seem to be niche.)
What do we do with those? I'd suggest deprecating (or deleting?) the duplicates and the two rare variants.
But then it might make sense to specify the lead length in our resistor packages (choosing the most commonly used lead length). Then we can add a density level C footprint, and these packages can be used for real devices if the lead length matches. In future we could also add more packages with different lead lengths.
We can't move only one footprint to a manufacturer specific library, we would have to create a completely new package with density levels A and B specified again.
I noticed that you added packages with heights in 0.05mm interval. I think this is a far too small interval, it would lead to a huge amount of resistor packages. I would rather use an interval of at least 0.2mm. Then probably we only need one height per size to cover 90% of the available real resistors ;)
Now I just found this sentence in the German Wikipedia:
So maybe it would make sense to even ignore the different heights completely (adding only one package per size, without specifying a height)? This would simplify things a lot, and for the 3D model a height error of e.g. 0.2mm doesn't matter IMHO...
Oh f*ck, I didn't realize that (I imported them from a Eagle library)
I would suggest to add the R-1218 and R-4527 as metrical variants 3246 resp. 11470 (or 11570?). But I'm not sure about the duplicate packages. I tend to remove them, although normally we shouldn't remove packages... We can just hope that nobody uses them already ;)
Yes, but the different variants could then exactly match the manufacturer recommendations.
I'm not sure about the lead length, we'd have to add 2-3 different variants for every resistor, and then that would still be only an approximation, where the density level C wouldn't fit perfectly.
But I also agree that ending up with the same resistor package in 10 different manufacturer-specific libraries isn't great either...
I used Digikey to find common heights. I only added them for variants which actually exist for thousands of different resistors, I didn't generate all possible combinations. (For example, the 1005 resistor only has 1 height variant. Only 3 variants (2012, 3216 and 3225 have 3 different heights.) Do you think the current amount of resistor packages is too much?
Generating 3D models later for different heights is trivial, I would prefer it if the max height would actually match the part (for when you do very thin, space-constrained designs). And when considering mechanical constraints, then the height is important (much more so than the color).
I can do that, won't hurt much.
Since the parts are copied to the project, it won't break anything, right? And they can be trivially replaced.
Ok, branch updated.
I added 3246 (1218) footprints:
I did not add the 11470 (4527) footprint. These are packages that look different from other chip resistors, they have J-style leads and are quite rare. Here's an example:
I don't think these should be generated with the same generator (I'd have to add quite a few conditionals because the leads are less wide than the package). I'd actually vote for removal of the package, I think the current one has pads that are too wide anyways.
OK, another idea: Probably most users (especially hobby users) will use "generic" resistor devices anyway (called e.g. "R-0805") because they don't care about which exact resistor will be assembled, and because it would take a lot of time to add all of the (thousands?) available (manufacturer-specific) resistors to our libraries. Thus maybe the best option is to make the corresponding packages for these devices also that generic that there is only one package per size, i.e. using only one specific lead length and one specific height (or even not specifying the height at all), without density level C footprint. So basically what you did now, but removing the packages with different heights.
In addition to these generic resistor packages and devices, specific packages and devices can be added step by step, with lead lengths and heights according the datasheets and so on. These are completely independent of the generic packages/devices, and thus out of scope of this PR.
So, a hobby user typically just uses the generic "R-0805" device with its generic "RESC2012 (0805)" package and assembles the random 0805 resistor he found in his resistor set. He doesn't care at all about lead length and package height, as long as he can hand-solder it and the 3D view looks nice.
On the other hand, a professional which might want to do a design with density level C and needs an accurate 3D export chooses the specific device of the exact resistor he evaluated, which has the corresponding package assigned, with exact lead length and package height, so it comes with density level C footprint and exact 3D model.
I think this would be a good compromise and suits both workflows very well. What do you think @dbrgn?
Removing packages wouldn't break existing projects, but it would break existing devices. Meaning that you get an error when placing such a device on a board because the package can't be found.
Ok, branch updated. To summarize:
This is how the footprints look like:
Generator script: LibrePCB/librepcb-parts-generator#29
The nightly build shows clearance warnings between pads and placement layer
I'm not sure if that's a good idea. This is something between a generic and a specific package, what devices would we need to create to use these two packages? And which device/package would a user choose which don't know what height his resistors have?
IMHO we should clearly distinguish between generic and specific packages, and generic packages should not specify the height at all, not even a maximum height (what is the "max. height" useful for if the corresponding device is generic, i.e. doesn't specify the height at all?). So I would remove the package's name and description...
Maybe it would make sense to add some kind of "warning" to the package's description, to make clear these are meant to be used as "generic" or "general purpose" resistors, and thus the height and lead length is not specified, but just "best guess"?
You also need to remove the corresponding devices as they are no longer valid ;)
That's a float rounding issue. The silkscreen ends at X 2.15 and the pad starts at X 2.3. The difference (2.3 - 2.15) is 0.14999999999, so your tool complains.
I'll file a bug report (maybe I can also fix it).
You're right, I changed it. The max height was primarily meant for the 3D model, where we need to choose some height. I left in the parameters in the source file, but won't render it.
I also added a note to the description that the packages are generic.
Looks very good now
The only thing which would be nice, is to see the actual lead size in the documentation layer, so the pad protrusion gets visually visible (at least the outer dimension, as the lead length of the generic packages aren't specified). Actually on the master branch this is already the case, but your change removes that "feature"
Would it be possible that add this again? (the glue rect in the center might also be nice, but let's ignore that for the moment)
I noticed that even the density level A pads are much smaller that the pads imported from Eagle, I wonder if they are not too small now for hand soldering
That's being done on the documentation layer, right?
It shows the outline of the package, which is the only thing we can know for sure in a generic package.
Ah that's glue... I could add that if you want, shouldn't be much work.
Yes, that's because it is just a manufacturing density level, and not a hand soldering package
We could take the density level A footprint and simply extend the toe and sides by 0.5mm and call it "Hand Soldering".
Only two things now (sorry
And the RESC2012 has very small leads, are you sure this is really intended? The leads are even narrower than those of RESC1608, which doesn't make sense to me. I checked a few datasheets, and they all have wider leads.
I mostly used this datasheet:
2012 has a gap (B) of 1.4mm, 1608 has a gap of 0.8mm. That results in the mentioned difference.
So yes, it's intended. We could reduce the gap a bit (to be able to deal with a wider range of sizes) even though it feels a bit arbitrary.
I'll adjust the doc layer line thickness.