Position/placement file not lining up with Gerbers in JLCPCB "Review Parts Placement"

I have created a design, and trying to get the component position file to line up with the gerbers.

If I press space over the Drill/Plot origin, then move to C1, the location (dx, dy) is 70.65, -8.4mm.
If I export the gerbers and check “Use drill/place file origin”. Then open the gerbers with gerbview, C1 is at location 70.65, 8.4, seems good.

However if I export the position file (which has no option to select the origin, seems like it uses the drill/plot origin), is specifies the location as 70.65, 8.4 (note the positive Y value instead of negative).

Is this a bug that I should file an issue on Gitlab for? How can I make the component position file match the location of the gerbers?

Note I placed the drill/file origin at a specific place due to alignment when importtng and the step file into FreeCAD.

This is not a bug. Things just work this way.

Graphics commonly have 0,0 in the top left.

Why do gerbers then not “just work this way”? Why would the position file be inverted compared to the gerber file so the components don’t line up?

I have spent hours trying to get components to line up with gerbers, and can’t figure it out. I have tried various permatations with the preferences to invert Y direction, and different origin/file locations, checking and unchecking the “Use drill/place file origin” option, all to no avail. The JLCPCB “Review Parts Placement” always show them not aligned (position, not talking about rotation), or not even on the board).

Can you post a screen shot of the Gerber generation config.

I make Gerbers for Jlc with no problems.

A component “location” is the center of the component.

When you look at the Jlc what is wrong with the image you see? Does it not correlate with the design?

I don’t understand your problem at all. Gerbers and the position file correlate, both have the same coordinates. So what’s the problem?

I stoped replying cause it was 4:00 in the morning and I eventually waved the white flag and went to bed. I am comfortable with 0,0 being top left, e.g. the web works like that.

However 0,0 bottom left is how gerbers are defined (correct me if I am wrong, but I have been reading https://www.bosco.co.za/DownloadDocs/The_Gerber_Format_Specification.pdf to try understand it). Since one is creating gerber artwork, why not follow the axis one is going to output to?

However my issue is not were co-ordinate is, but that it is applied consistently. I am starting to thing the issue lies in the Gerber Viewer of KiCAD that is inversing the Y cordinate, without telling one, to make it match the PCB editor. Unfortunately this obfuscation confuses the issue. When I open the gerbers in another gerber viewer, the Y-axis is flipped compared to KiCADs Gerber viewer. Which one is correct? I am guessing not the KiCAD one because of its history with the Y-Axis

Sure, however its the position file aligning with the gerbers (not the gerbers themselves), that is the issue.

Yes the centers to not correlate. They are all positioned correctly relative to each other, but not relative to the board. The offsets depends on the check “Use drill/place file origin”, and where I place the drill/file origin, and whether to use positive Y-Axis. Sometimes they are close, sometimes far, but never aligned.

This is the closest I have manage to get. It looks like an issue of component center vs component top left. But I confirmed with JLCPCB that the position of the component must be center, center, as are my footprints (centered on the origin).

PS the big white block is some IC’s which have the incorrect rotation, I will fix the rotation after getting the placement right, but didnt want to open another can of worms.

I have never looked into that files.
From your picture it looks for me like they are not ‘positioned correctly relative to each other’.
C11 has different offset than C9.
That suggests that there is scale problem to be solved. Then see if 0,0 problem still exists.

Correct me if I’m wrong, but the view in the screenshot seems to be something else than KiCad. Maybe JLCPCB preview? It’s not guaranteed at all that their view is correct even when the files are and their manufacturing process is. Their web view is independent from their other software.

Like Piotr said, there seems to be a scaling problem.

Have you followed the instructions in https://support.jlcpcb.com/article/84-how-to-generate-the-bom-and-centroid-file-from-kicad?

Well spotted! I did not pick that up. Thank you! There is a scaling problem, here one can see the increasing X offset:

I checked the gerber scaling output and it is set to default 1:1 (and grayed out for edit). The position file does not have a scaling option, so I don’t know where it is coming from.

I change the drill/file origin to the center of C10 which is about the center of the PCB, shown by the yellow cross hair below. My thinking was scaling issue should show offsets radiating out from the origin, but it got even more whacky. Don’t know how to solve it.

Yes you are correct, it is the JLCPCB web “Review Parts Placement”. From other threads I have read here, some people have their parts aligned, so I don’t know why I can’t figure out how to get it aligned too.

Even though they can fix it on their side, I would like to get to the root cause of the error, so that in future the position file is exported 100% right.

I repeat the question because you didn’t answer: did you follow their instructions exactly? Scaling problem may refer to some kind of mm vs. inch problem. Gerbers use mm but you can choose the units for the pos file. It has to be mm, too.

It seems to be so. I don’t think it’s possible to change the actual coordinate system of the gerber files, but KiCad does that for viewing because the viewer is integrated to work with pcbnew. That’s outdated now anyways in v5.99 because it’s possible to change the visual coordinates in pcbnew. Time to file an issue…

I have read that and followed it (I have read a lot of their documentation trying to figure it out before posting here). Besides, if it was a mm vs inch problem I would think the scaling would be much more off. I matched their settings exactly (there not many settings to check). I used mm through out all the files.

I see you raised
#8674
, I actually had already raised #8672, great minds think alike!

PS I think you explained the issue better though.

In the end I could not get the placement file to line up in a way that worked with them. They had to correct it on their side.

you may have a look at:


and