# Why with the pseudo-inverse it is possible to invert the Jacobian matrix even in a singular configuration?

Consider the following situation:

I have a robotic arm manipulator with all revolute joints, for example consider a 2R planar manipulator. We know that if we compute the direct kinematics of it, anf the from the direct kinematics we derive the Jacobian matrix (for example only the linear part), we have that:

$$\dot{p}=J(q)\dot{q}$$

and if we want to do the inverse differential kinematics and obtain the joint velocities we just need to do the following:

$$\dot{q}=J^{-1}(q)\dot{p}$$

which is only possible if the Jacobian matrix is invertible, so if the robot is not in a singular configuration.

Now, consider the case where the robot is in a singular configuration. We have that we cannot do anymore what we have done before, because the Jacobian is not invertible.

So, studying I have seen that we can use a trick for inverting the jacobian and so finding the joint velocity anyway, and this is done by using the pseudoinverse:

$$\dot{q}=J^{*}(q)\dot{p}$$

where I have used $$*$$ to imply the pesudoinverse (sorry but I don't know why it does not let me use #).

I have seen that by using the pesudoinverse it is minimized the leaast square error and so the motion is possible to realize also from a singular configuration, but I have not understood this concept.

This should me the minimum norm solution.

Can someone please explain to me this concept?

The pseudoinverse gives a “least squared error, minimum-norm” solution: Out of all $$\dot{q}$$ vectors at your current $$q$$, the vector
$$\dot{q}_{s} = J^{+}(q)\dot{p}_{\text{in}}$$
1. Least squared error: There is no $$\dot{q}$$ vector which will get closer to $$\dot{p}$$ when passed through $$J(q)$$. (I.e. for $$\dot{p}_{s} = J(q)\dot{q}_{s}$$, the normed difference $$\lvert \dot{p}_{\text{in}}-\dot{p}_{s} \rvert$$ is smaller than any other $$\lvert \dot{p}_{\text{in}} - \dot{p} \rvert$$.
2. Minimum-norm: Out of all $$\dot{q}$$ that satisfy the first condition, $$\dot{q}_{s}$$ is the smallest of those vectors. (I.e. $$\lvert \dot{q_{s}}\rvert$$ is smaller than $$\lvert \dot{q} \rvert$$ for all $$\dot{q}$$ that minimize error in $$\dot{p}$$.
At the singularity, the set of achievable velocities loses one dimension (so that there are $$\dot{p}$$ that cannot be exactly produced by a $$\dot{q}$$), but for any $$\dot{p}_{\text{in}}$$ there is a set of $$\dot{q}$$ that all come equally close to producing $$\dot{p}_{\text{in}}$$, and the pseudoinverse picks the smallest (in $$\dot{q}$$-space) of these vectors.