Hah. Couldn't stop thinking about it so I did the math. You may have some trouble with the speed of the controller, because the coordinate transformation takes some heavy lifting as far as the math goes.
You have three input variables: the three angles of the elbow joints, Aa, Ab, Ac. You have three outputs: x,y,z. We need to go the opposite direction.
There are ten givens.
The three base vectors. These are the offsets between the origin and the centre of the horizontal shoulder joint.
Ba = <xa,ya,za>
Bb = <xb,yb,zb>
Bc = <xc,yc,zc>
The horizontal offset between the horizontal shoulder joint and the vertical shoulder joint; positive if the vertical joint is more central than the horizontal one, negative otherwise.
sx
The length between the nozzle's central axis and the attachment point of the arm.
nx
The height of each arm's nozzle bearing above the nozzle.
nva,nvb,nvc
The scalar lengths of the two arm segments
l1, l2
Note that I am assuming that Ba,Bb,Bc are at the centre of the horizontal shoulder joint's axis, but at the height of the vertical shoulder joint's axis. With that out of the way, here's the math:
Let P be the position vector of the nozzle. P = <x,y,z>
Let Ha,Hb,Hc be the vector between each Bx and the nozzle.
Ha = P-Ba
Hb = P-Bb
Hc = P-Bc
(9 subtractions)
Let ra,rb,rc be the cylindrical, radial distance from each, respective shoulder joint's horizontal axis to the nozzle
ra = sqrt(Ha_x^2 + Ha_y^2)
rb = sqrt(Hb_x^2 + Hb_y^2)
rc = sqrt(Hc_x^2 + Hc_y^2)
(6 multiply, 3 add, 3 sqrt)
Where Ha_x is the x-component of Ha, Ha_y is the y-component of Ha, etc.
Let la,lb,lc be the length of each, respective arm from the vertical shoulder to the wrist joint.
la = sqrt( (ra-sx-nx)^2 + (Ha_z + nva)^2 )
lb = sqrt( (rb-sx-nx)^2 + (Hb_z + nvb)^2 )
lc = sqrt( (rc-sx-nx)^2 + (Hc_z + nvc)^2 )
(6 multiply, 6 add, 3 subtract)
Calculate the angle of the elbow, based on the wrist-to-shoulder length
Aa = arccos((l1^2 + l2^2 - la^2)/(2*l1*l2))
Ab = arccos((l1^2 + l2^2 - lb^2)/(2*l1*l2))
Ac = arccos((l1^2 + l2^2 - lc^2)/(2*l1*l2))
(3 subtract, 3 divide, 3 arccos)
(There's an optimization here in not taking the square root in the previous step, and not squaring the same variable in this step)
The overall complexity of a single position calculation is:
24 add/sub
12 multiplies
3 divisions
3 sqrt
3 arccos
If you're clever, you can probably reduce the divisions to bit shifts. You can't do much about the rest.
You have three input variables: the three angles of the elbow joints, Aa, Ab, Ac. You have three outputs: x,y,z. We need to go the opposite direction.
There are ten givens.
The three base vectors. These are the offsets between the origin and the centre of the horizontal shoulder joint.
Ba = <xa,ya,za>
Bb = <xb,yb,zb>
Bc = <xc,yc,zc>
The horizontal offset between the horizontal shoulder joint and the vertical shoulder joint; positive if the vertical joint is more central than the horizontal one, negative otherwise.
sx
The length between the nozzle's central axis and the attachment point of the arm.
nx
The height of each arm's nozzle bearing above the nozzle.
nva,nvb,nvc
The scalar lengths of the two arm segments
l1, l2
Note that I am assuming that Ba,Bb,Bc are at the centre of the horizontal shoulder joint's axis, but at the height of the vertical shoulder joint's axis. With that out of the way, here's the math:
Let P be the position vector of the nozzle. P = <x,y,z>
Let Ha,Hb,Hc be the vector between each Bx and the nozzle.
Ha = P-Ba
Hb = P-Bb
Hc = P-Bc
(9 subtractions)
Let ra,rb,rc be the cylindrical, radial distance from each, respective shoulder joint's horizontal axis to the nozzle
ra = sqrt(Ha_x^2 + Ha_y^2)
rb = sqrt(Hb_x^2 + Hb_y^2)
rc = sqrt(Hc_x^2 + Hc_y^2)
(6 multiply, 3 add, 3 sqrt)
Where Ha_x is the x-component of Ha, Ha_y is the y-component of Ha, etc.
Let la,lb,lc be the length of each, respective arm from the vertical shoulder to the wrist joint.
la = sqrt( (ra-sx-nx)^2 + (Ha_z + nva)^2 )
lb = sqrt( (rb-sx-nx)^2 + (Hb_z + nvb)^2 )
lc = sqrt( (rc-sx-nx)^2 + (Hc_z + nvc)^2 )
(6 multiply, 6 add, 3 subtract)
Calculate the angle of the elbow, based on the wrist-to-shoulder length
Aa = arccos((l1^2 + l2^2 - la^2)/(2*l1*l2))
Ab = arccos((l1^2 + l2^2 - lb^2)/(2*l1*l2))
Ac = arccos((l1^2 + l2^2 - lc^2)/(2*l1*l2))
(3 subtract, 3 divide, 3 arccos)
(There's an optimization here in not taking the square root in the previous step, and not squaring the same variable in this step)
The overall complexity of a single position calculation is:
24 add/sub
12 multiplies
3 divisions
3 sqrt
3 arccos
If you're clever, you can probably reduce the divisions to bit shifts. You can't do much about the rest.