Rotation Direction Flipped for Bottom Side Component Placement

55 views
Skip to first unread message

Hayato Kato

unread,
Jul 1, 2024, 9:23:26 PM (2 days ago) Jul 1
to OpenPnP
Hello,

I am currently debugging a PnP machine using OpenPnP at my work and we came across an issue when placing components on the bottom side of the PCB. 

Issue: When placing components on the top side, we didn't encounter any issues of components being placed in the wrong orientation. However, when testing component placement on the bottom side, we noticed that the SOT23-3 package components are placed in the wrong orientation ONLY when the original component asks for a 0 or 180 degree orientation. This issue does not occur for SOT23-3 package components that are placed at 90 or 270 degree orientations. 

Observations:
- I am currently using a strip feeder that has the SOT23-3 components placed in such a way so that when the tape holes are aligned to the top, the two pads are aligned to the bottom
- Following instructions found in this page, I set my "Rotation in Tape" value to 90 degrees, since within our library we have our 2 pads aligned to the left side
- When exporting the PnP files from our PCB CAD, the origin is located at the bottom-left corner of the rectangular PCB with all positions & rotations are defined relative to that origin from the top-side view.
- All SOT23-3 components already completed the top side placement flawlessly, so we highly doubt that there is anything wrong with the feeder setup, unless there is a hidden setting that changes its behavior specifically for bottom side components
- From our observations, we believe that the machine is acting this way because the machine does not realize that the rotations get flipped when dealing with bottom side components, hence the component rotation is messed up only when it is +/-90 degrees offset from the rotation placed in the feeder (90 degree is fine since the components in the feeder is already at 90 degrees hence no rotation after pickup, and 270 degrees is also fine since the component needs to rotate 180 degrees and the direction does not matter)
- I suspected an issue with how the PnP file was exported, but as explained here the board location and orientations should remain the same from the operator's perspective, but internally OpenPnP should understand that the X coordinates get flipped and the rotation of the components also get flipped. This does not seem to be the case.
- Similar issues are observed for other packages as well, but the phenomenon is most noticeable for asymmetric components or components with polarity (I believe the chip resistors are also being placed at 180 degree offset orientations, but there are no consequences due to their non-polarity)

Has anyone else also encountered this issue when using the Bottom side of a PCB for assembly? I personally find it pretty baffling to think that no one else has come across this issue if it is indeed a bug with how the bottom side assembly is handled, but equally I cannot find any settings or parameters within OpenPnP that might resolve this behavior. I tried skimming the forum as well to see if anyone else was reporting a similar issue but I was ultimately unsuccessful.

Thanks, any help is appreciated. Also please advise on what other information we should provide to help with the debugging.

Hayato

tonyl...@gmail.com

unread,
Jul 1, 2024, 10:45:59 PM (2 days ago) Jul 1
to OpenPnP
Please read the Preliminaries section of Understanding Board Locations to see how OpenPnP defines positive rotations for both top and bottom placements. Note that different CAD packages define positive rotations in different ways, so it is the job of the board importers to convert from the CAD's rotation system to that used by OpenPnP. What CAD package are you using and how did you import the board into OpenPnP?

Tony

Hayato Kato

unread,
Jul 2, 2024, 2:29:15 PM (19 hours ago) Jul 2
to OpenPnP
Thanks for the reply,

I am currently using Altium Designer 24.6.1 and was using their "Files > Assembly Outputs > Generates Pick and Place Files" to create a CSV file containing all of the required data. I select the following data to be included in the CSV file: 
- Designator

- Comment

- Layer

- Footprint

- Rotation

- Height(mm)

- Ref-X(mm)

- Ref-Y(mm)

As far as I can discern, the only options I have within Altium to update its exporting behavior are these options shown below (prompted when I generate the pick and place files). Note that I have tested checking the "Y-flip Bottom Side Components" checkbox, but it ended up merely flipping the sign for the Y axis coordinates and it made no change in rotation value, so I doubt that that is what I need to do. Mind you, I also use these pick and place files generated to have PCB manufacturers assemble our boards without issue.Screenshot 2024-07-02 110327.png

Within OpenPnP, I simply select "File > Import Board > Named CSV" to import the CSV file that I generated.

I have read through the preliminaries section of the link you posted and I now see what you mean when referring to "positive placement rotations", where the rotation angle of the component is not flipped when looking at the board from the bottom view. I personally find the way OpenPnP handles this to be very odd, since that means the way the position and rotation of these components are defined within the CSV file needs to be different based on whether the component is located on the top or bottom side, despite using the same origin. Intuitively I agree with how Altium exports their PnP files, where it defines all of its components, regardless of top or bottom, based on the coordinate system from the top side view. 

Do other CAD software have the capability to flip the rotation angle based on the side of the board when exporting the CSV file? I would also assume that flipping this behavior should be something that OpenPnP can handle itself when importing, has no one else encountered this issue?

Hayato

tonyl...@gmail.com

unread,
Jul 2, 2024, 5:35:00 PM (16 hours ago) Jul 2
to OpenPnP
As I said previously, not all CAD packages export using the same coordinate and angle conventions, so OpenPnP had to pick one. Therefore, OpenPnP chose a convention where all placement rotations are positive in the counterclockwise direction regardless of which side of the board is facing up. This is consistent with the right-handed rule about the machine's positive Z-axis. That said, why are you not using the Altium csv importer? It should take care of the necessary angle conversions. Perhaps you need to upgrade to the latest Test version of OpenPnP. Alternatively, you could pull the exported csv file into Excel and change the rotation angles for the bottom components only using the formula: OpenPnP_Bottom_Angle = 180 - Altum_Bottom_Angle before importing it into OpenPnP.

menu.png

Hayato Kato

unread,
Jul 2, 2024, 7:51:24 PM (14 hours ago) Jul 2
to OpenPnP
As you have suspected, I am currently using version 2.0 and was unaware of the additional importers available in the test branch. If the Altium .csv importer takes care of the angle conversions then this is exactly the feature that I was looking for. I will give it a try and report back if I succeed. I will say that I did end up resorting to manually editing the CSV file in excel prior to your answer so I did manage to work around the issue; it was mostly just curiosity of how other users were circumventing this issue since I am sure there are enthusiasts out there who also use Altium Designer and OpenPnP. Thank you for the assistance. 

Hayato
Reply all
Reply to author
Forward
0 new messages