I think the debate is a bit off topic. To me, the question is about why is the inverse kinematics wrong when applied to a forward kinematics solution computed for joint angles $\ge$ 90 deg.
To explore this I built a model using my Robotics Toolbox for MATLAB
>> r = SerialLink([0 133 0 -pi/2; 0 0 98 0; 0 0 220 0])
r =
noname:: 3 axis, RRR, stdDH, fastRNE
+---+-----------+-----------+-----------+-----------+-----------+
| j | theta | d | a | alpha | offset |
+---+-----------+-----------+-----------+-----------+-----------+
| 1| q1| 133| 0| -1.5708| 0|
| 2| q2| 0| 98| 0| 0|
| 3| q3| 0| 220| 0| 0|
+---+-----------+-----------+-----------+-----------+-----------+
then I computed the forward kinematics for the first and last joint configurations in @B.Antony's question:
>> r.fkine([0 0 0])
ans =
1 0 0 318
0 0 1 0
0 -1 0 133
0 0 0 1
>> T = r.fkine([90 90 90], 'deg')
T =
0 0 -1 0
-1 0 0 -220
0 1 0 35
0 0 0 1
and the answers match what's in the graphs provided. So far, so good.
Ignoring the debate about analytical versus numerical solutions I'm going to use a numerical solution since it's general and I have it to hand:
>> q = r.ikine(T, 'mask', [1 1 1 0 0 0])
q =
-1.5708 -0.7327 1.5708
where mask
indicates that we only care about solving for the first 3 elements of the Cartesian pose (x,y,z).
We see this solution is different to what was input to the forward kinematics and it has flipped $\theta_1$ around, but we can easily verify that the solution is correct
>> r.fkine(q)
ans =
0 0 1 0
-0.6689 0.7434 0 -220
-0.7434 -0.6689 0 35
0 0 0 1
Note: the translation part is correct, the rotation part is different but we don't have enough DoF to independently control that.
We can try and find a solution with a positive $\theta_1$ by setting the initial joint angles for the IK
>> r.ikine(T, 'mask', [1 1 1 0 0 0], 'q0', [pi/2 0 0])
ans =
1.5708 1.5708 1.5708
which is the set of joint angles we started with, so this is another valid solution, the blue line in the graph.
I don't think the red solution shown in the graph of $\theta$ values is correct
>> r.fkine([90 -90 90], 'deg')
ans =
0 0 -1 0
1 0 0 220
0 -1 0 231
0 0 0 1
is far from the initial pose shown above.
Conclusion the IK equations implemented are not correct. There should be at least 4 solutions: 2 for q1 (you have only 1), and 2 for q2 (which you have). Maybe another set of 4 where $\theta_2$ and $\theta_3$ are offset by 180deg.
I can automatically generate an analytic solution (you need the MATLAB Symbolic Math Toolbox to do this bit)
>> q = r.ikine_sym(3)
----- solving for joint 1
subs sin/cos q1 for S/C
----- solving for joint 2
lets square and add 1 2
subs sin/cos q2 for S/C
----- solving for joint 3
subs sin/cos q3 for S/C
**final simplification pass
q =
1×3 cell array
{1×2 sym} {1×2 sym} {1×2 sym}
Looking at the solution for $\theta_1$
>> q{1}
ans =
[ atan2(-ty, -tx), atan2(ty, tx)]
we can see the two solutions.