sparkfunX / Desktop-PickAndPlace-CHMT36VA

Tools and conversion scripts for the CHM-T36VA Desktop Pick and Place from SparkFun
GNU General Public License v3.0
66 stars 32 forks source link

Some components swapped and placed wrong #15

Closed THX2112 closed 6 years ago

THX2112 commented 6 years ago

Weird issue where 2K resistors are placed where 22K resistors should be. I think that "2K" is being matched in the alias for 22K. No other components are doing this, but I don't have 3K and 33K or 1K and 11K components.

Relevant feeders.csv:

8mm | 7 | 2K-R0805 | 0 | 0 | 0.5 | 0 | 1 | 0 | 4 | Y | Y | N | 0 | 0 | 2K-R0805
8mm | 10 | 22k-R0805 | 0 | 0 | 0.5 | 0 | 1 | 0 | 4 | Y | Y | N | 0 | 0 | 22K-R0805

Workaround is to remove 2K components and use 2.2K instead (which we're doing anyway).

nseidle commented 6 years ago

Oh, that's bad! I agree with your supposition.

Why do you have an alias that is identical to your component name? The component name is hard matched (string compared) against the component name from the board. If it matches it uses it. If it doesn't match then the ULP will try the aliases. Remove your 2K-R0805 alias and it should avoid this particular issue in the future. But there's a bigger issue here...

Aliases are meant for the odd-ball names that sometimes sneak in when different libraries use different naming conventions. But they can lead to false positives, as you've experienced...

Here's a few ideas to fix the problem:

We could scan all the component names and if there's not a match, try again with aliases...

or

We could tighten the check so that aliases must be a one to one match, but allow partial matches on the NoMount line (it's better to get a false positive on the NoMount than swapping 2K where a 22K should be).

nseidle commented 6 years ago

Slight correction, the ULP checks to see if the component name from the feeder sheet is contained inside the component name. This leads to your "2K" is inside "22K" problem.

nseidle commented 6 years ago

Ok, I re-wrote the getFeederId() function to do the following priorities:

I believe this latest version will prevent your "2K is inside 22K" issue. Please give it a try.