a Python script that can generate the Jacobian matrix of any robot that is built with planar configuration of the joints. This means that axis of actuation (linear or revolute) should be same for all joints. For other configurations, this script should not be utilized.
This script defines the number of links in the robot from user input, and then creates the transformation matrices for each link using rotation and translation matrices.
For all robots, script also asks for the type of the joints as a string. For example, given 4 link robot can have RRRR or RPRR configurations. User should define the type for each link.
It first computes the transformation matrix from the base frame to the end-effector frame, and defines the end-effector position and orientation using this matrix.
The Jacobian matrix is then computed using the end-effector position, orientation, and link lengths, and is printed to the console.
You can modify the code to suit your specific needs and to compute the Jacobian matrix for different values of the joint angles and velocities.
Obtained jacobian matrix can be used to analyze robot kinematics. It can be used to compute:
- Joint velocities Given the desired end effector velocity v_ee and the Jacobian matrix J, the joint velocities dq can be computed as:
dq = J^(-1) * v_ee
- End-effector velocity Given the joint velocities dq and the Jacobian matrix J, the end effector velocity v_ee can be computed as:
v_ee = J * dq
- Stability analysis The stability of the robot at a specific configuration can be analyzed by computing the condition number of the Jacobian matrix. The condition number is a measure of the "condition" of the matrix and can be used to determine the numerical stability of the robot. A large condition number indicates that the robot is numerically unstable and small changes in the joint positions can result in large changes in the end effector position.
cond(J) = ||J|| * ||J^(-1)||
- Singularity analysis A singularity occurs when the Jacobian matrix is not invertible, i.e. when its determinant is zero. The singularities of the robot can be found by computing the determinant of the Jacobian matrix and finding the configurations where it is zero.
det(J) = 0
- Workspace analysis
- Design motion control algorithms
- Visualization and simulation
- Equation of motion The equation of motion can be written in terms of the Jacobian matrix J as follows:
M(q) * J^T * dv + C(q, dq/dt) + G(q) = Tau
where dv is the end effector velocity and J is the Jacobian matrix relating the joint velocities dq/dt to the end effector velocity dv.