Problems with joint movement during palletizing (UR10 CB3)

Been trying to depalletize in a machine trending setup but have problems getting the robot to move correctly during program execution.

The best way (for me at least) to explain the problem is that the robot is positioned in an awkward position while picking the parts from the pallet.

Think of trying to scratch yourself in your armpit and it will give you a pretty good picture of the pose. The gripper is parallell to the pallet and fairly close to it when picking the part.

Picking parts between corners 1 & 2 is no problem, but when closing in on corners 3 & 4 the robot wants to flip wrist 1 which sends the robot down into the pallet,ending up with a protective stop. Pallet size is about 600x900mm and im trying to pick 9x21 parts. The issues start occurring about half way down the pallet.

From what i can see im not that close to any joint limits and have tried an pre-approach position directly above the first part on the 21st row but it still flips.

Seems illogical to me why the robot would want to flip the wrist to reach the pick pose when it is a much longer way there than just “doing it the right way”.

I figure joint limits and security planes are out of the question since they wont affect the way the robot moves, just trigger protective stops if it tries to move beyond those limits/planes.

Any of you guys have any input on what i can do to get around this problem?

Thanks