Ask a robot arm to move its hand in a slow, straight line while the arm is almost fully stretched, and a joint may have to spin faster than its motor can turn. The hand leaves the line, or the robot stops with a fault. Next to a person, the same poses can turn a small motor torque into a hard push. One matrix, the Jacobian, explains both. It converts joint speeds into the velocity of the hand and hand forces into joint torques, and it shows the poses where the arm loses a direction of motion. #robotics #jacobian #velocity-kinematics
Learning Objectives
By the end of this lesson, you will be able to:
Derive the Jacobian matrix for serial robot manipulators
Compute forward and inverse velocity mappings between joint space and task space
Detect singularities and interpret their physical meaning
Visualize manipulability ellipsoids using singular value decomposition
Apply the pseudoinverse method for redundant manipulators
Map end-effector forces to joint torques using the Jacobian transpose
Real-World Engineering Challenge: Collaborative Robot with Force-Limited Operation
A collaborative robot works beside people with no safety cage. On a production line, one must hand parts to a human worker. The technical specification ISO/TS 15066 gives the largest force a robot may put on each part of the human body. In this lesson we take one limit for the whole task: 150 N at the end-effector, the tool at the end of the arm.
The motors act at the joints, but the limit is at the hand. The controller must know, at every moment, how joint speeds and joint torques appear at the hand, and in which poses a small torque gives a large force.
System Challenge: Safe Velocity and Force Control
Critical Engineering Questions:
Why the Jacobian Is Essential for Collaborative Robots
A robot inside a cage can make a sudden move and hurt nobody. Beside a person, a sudden move or an unexpected force is a danger at once.
Collaborative Robot Design Challenge
Design Goal: Control the velocity and the force of a collaborative robot with the Jacobian. The robot is a planar 2R arm: two links in one plane, joined by two revolute (turning) joints.
Key Requirements:
Velocity Mapping: Find the velocity of the end-effector from the joint speeds
Trajectory Tracking: Find the joint speeds for a straight path of the end-effector
Singularity Monitoring: Detect the poses where the arm loses a direction of motion
Force Safety: Keep the force at the end-effector below 150 N
Fundamental Theory
What is the Jacobian?
Turn one joint of an arm a little, and the hand moves a little. How far, and in which direction, depends on the pose of the arm. The Jacobian is the table that holds these answers: one column for each joint, and in it the motion of the hand for one unit of motion of that joint.
Bicycle Gear Ratio
On a bicycle, the gear ratio tells you how fast the wheel turns for a given speed of the pedals. The Jacobian does the same work for a robot: it tells you how fast the hand moves for given speeds of the joints.
Where the Comparison Stops
A gear ratio is one fixed number. The Jacobian is a table of numbers, because there are several joints and the hand moves in several directions. And it is not fixed: every entry changes as the arm changes its pose. In some poses a whole direction of motion disappears.
Mathematical Definition
Write the joint angles (radians) as a list , and the position of the end-effector as a list of coordinates (metres). Forward kinematics is the rule . The symbol means “the change of the first coordinate for a small change of joint 2, with the other joints held still”. The Jacobian collects all such rates:
A dot over a symbol means its rate of change with time. So is the list of joint speeds, in rad/s, and is the velocity of the end-effector, in m/s. Each joint adds its own share to the motion of the hand, and the shares add:
In words: the velocity of the hand is the Jacobian times the joint speeds. The writing is a reminder that the entries of depend on the pose.
Body vs Spatial Jacobian: Two Ways to Express Velocity
For later work in 3D: the velocity of the tool can be written in the frame of the robot base (the spatial Jacobian) or of the tool (the body Jacobian). Mixing them causes sign errors. In the planar examples here the choice makes no difference.
Full Derivation: 2-Link Planar Robot (2R)
Now build the Jacobian for a planar 2R arm with link lengths and (metres) and joint angles and .
Here is measured counterclockwise from the axis, and is the turn of link 2 away from the direction of link 1.
Step 2: Compute Partial Derivatives
The Jacobian needs four rates of change: each of and , for a small change of each of and . Use the rules that the derivative of is and the derivative of is .
Partial derivatives of :
Partial derivatives of :
Detailed differentiation walkthrough
Take . For a change of : the first term gives , and the second gives , because is inside . For a change of : the first term has no in it and gives zero, and the second gives . The equation follows the same way.
Step 3: Assemble the Jacobian Matrix
Combining all four partial derivatives into matrix form:
To write less, let , , and :
The velocity of the end-effector is then:
Column 1 is the velocity of the hand when joint 1 alone turns at 1 rad/s: the whole arm swings about the base. Column 2 is the velocity of the hand when joint 2 alone turns at 1 rad/s: only link 2 swings, about the elbow. The real velocity is column 1 times plus column 2 times .
Problem: The joint speeds and are known. Find the velocity of the end-effector.
Method: Multiply.
This always has an answer, in every pose.
When to use: To find the real velocity of the end-effector from the joint speeds that the encoders (the angle sensors on the joints) measure. A collaborative robot uses it to check that the hand is not moving too fast near a person.
Problem: The wanted velocity of the end-effector is known. Find the joint speeds and that give it.
Method: Undo the multiplication with the inverse matrix .
For the 2R arm, the inverse of the Jacobian is:
Here is the determinant of , one number made from its four entries: the product of the two entries on the main diagonal minus the product of the other two.
When to use: To follow a path. You give the path of the hand (a straight line, for example), and at each time step this gives the joint speeds to command.
Numerical Example
Take a 2R arm with m and m, in the pose , . The joints turn at rad/s and rad/s.
Compute trigonometric values:
, so ,
, so ,
Build the Jacobian:
Forward velocity mapping:
The end-effector speed is m/s.
Compute the determinant:
The exact value follows from the closed form . The four-digit entries above give ; the difference is rounding only.
Since , the robot is not at a singularity and the inverse velocity mapping is well-defined.
Inverse velocity example: Suppose we want m/s, m/s (pure horizontal motion). Then:
Singularity Analysis
Stretch your own arm out fully and try to move your fingertip further away: you cannot, however hard your shoulder and elbow work. A singularity of a robot is the same thing: a pose in which the two columns of point along one line, so the joints can move the hand along that line only. The other direction is lost, at any joint speed.
Determinant of the Jacobian
The determinant measures how far the two columns are from lying on one line, and it is zero when they do. For the 2R arm:
Multiplying out, the terms with cancel and a sine identity leaves one short result (the steps follow below):
Only the elbow angle appears. Turning joint 1 turns the whole arm and does not change how close it is to a singularity.
Step-by-step determinant simplification
Starting from the expanded determinant:
The terms cancel:
Now apply the subtraction formula:
With and :
Therefore:
Singular Configurations
The singularity condition occurs when , which means or .
Configuration: The two links lie on one straight line and point the same way.
Physical meaning: The end-effector is at the largest reach, . Each joint can only swing it sideways, across the arm. It cannot move along the arm, toward the base or away from it.
Consequence for collaborative robots: Near this pose, even a slow motion of the hand along the arm needs very high joint speeds. The controller must slow the motion or change the path before the arm is straight.
Configuration: Link 2 is folded back along link 1, so the end-effector is at the smallest reach, .
Physical meaning: As in the stretched pose, the hand cannot move along the arm. If , the hand lies on the base, and joint 1 cannot move it at all.
Consequence for collaborative robots: An arm that leaves a folded pose can accelerate suddenly.
Practical Singularity Thresholds
The value of depends on the link lengths, so a threshold for one robot does not fit a larger one. A measure with no units is the condition number: the speed of the hand in its easiest direction divided by its speed in the hardest direction (defined in the next part). A rule of thumb, to be tuned for each robot:
: the hand moves well in every direction
: one direction is clearly slower. Begin to add damping.
: near a singularity. Use damped least squares.
: singular in practice. Reduce speed or plan another path.
Manipulability Ellipsoids
One picture shows what the hand can do in a pose. Give the joints a fixed budget of speed: every pair of joint speeds with . Mark every hand velocity this budget can give. The marks fill an ellipse (in 3D, an ellipsoid), long in the directions where the hand moves easily and thin where it does not. It is called the manipulability ellipsoid.
The axes of the ellipse come from the singular value decomposition (SVD) of the Jacobian, which splits any matrix into a turn, a stretch along fixed axes, and another turn:
The matrix holds the stretch factors , called the singular values, largest first.
Key properties:
The half-lengths of the axes are the singular values, and their directions are the columns of
The manipulability index is for a square Jacobian. It is proportional to the area of the ellipse.
The condition number compares the long axis to the short one. is a circle: every direction is equally easy (isotropic).
In the numerical example, and . Their product is ✅, and . The hand moves nine times more easily in its best direction than in its worst.
Interpreting the Manipulability Ellipsoid
Large and round: the hand moves equally well in all directions. This is the best pose for work beside a person.
Long and thin: arrange the task so that its motion lies along the long axis.
Flat: the arm is near a singularity. Avoid this pose.
Pseudoinverse for Redundant Robots
Put a fingertip on the table and keep it there. You can still move your elbow. Your arm has more joints than the task needs, and a robot of that kind is called redundant. The simplest example is a planar arm with three joints (3R) that controls only the position . It has many possible sets of joint speeds for one hand velocity, and is not square, so it has no ordinary inverse.
The Moore-Penrose pseudoinverse chooses the set with the smallest joint speeds overall. With the transpose of (rows and columns exchanged):
The other sets of joint speeds differ from this one by motions that leave the hand still, like the elbow in the fingertip example. These motions are called the null space of . All solutions of are:
Here is the identity matrix and is any list of joint speeds you would like to have. The factor keeps only the part of that does not move the hand.
3-Link Planar Robot Example:
For a 3R robot with link lengths and joint angles :
The Jacobian is :
where and .
The arm has joints and the task has coordinates, so free motion is left: the arm can change its shape in one way while the end-effector stays still. Through its choice of , the controller uses this freedom for a second aim: to stay away from singularities, from joint limits or from an obstacle.
An example for joint limits: give each joint a cost that grows with its distance from the middle of its range, . The slope (gradient) of points toward higher cost, so the program uses the opposite direction as :
defjoint_limit_gradient(q, q_min, q_max):
"""Gradient of the quadratic centering cost."""
center = (q_min + q_max) /2
span = (q_max - q_min) /2
return2* (q - center) / span**2
defredundant_ik_velocity(J, dx_desired, q, q_min, q_max, k_sec=1.0):
"""Primary: track dx_desired. Secondary: center joints in their limits."""
J_pinv = np.linalg.pinv(J)
z =-k_sec *joint_limit_gradient(q, q_min, q_max)
null = (np.eye(len(q)) - J_pinv @ J) @ z
return J_pinv @ dx_desired + null
The end-effector velocity does not change, because the second term contains only motions that leave the hand still. Keep the gain small, so that this second aim does not use most of the joint speed.
Force and Torque Mapping
The same matrix connects forces. Suppose the arm is still and the end-effector pushes on something with a force , in newtons. Each motor must hold a torque, and is the list of these joint torques, in N·m. The rule comes from power: torque times joint speed at the joints equals force times velocity at the hand, if friction is ignored. With this gives:
Velocity goes from the joints to the hand through . Force goes from the hand back to the joints through the transpose .
Force Mapping for Collaborative Safety
Keeping below the force limit:
To find the force at the hand from measured joint torques, invert the rule. With the largest allowed force N, the controller must keep:
Here is the inverse of , and the double bars mean the size of the force. Near a singularity, a small joint torque can give a large force in the direction the arm cannot move. A straight leg works the same way: with the knee locked it holds your weight with almost no effort from the muscles.
Python Code: Jacobian Computation and Velocity Mapping
The first program repeats the numerical example. It prints the same Jacobian, a hand velocity of (-2.187, 1.621) m/s with a speed of 2.722 m/s, , and joint speeds of 0.259 and -1.143 rad/s for the horizontal motion.
import numpy as np
defjacobian_2r(theta1, theta2, L1, L2):
"""
Compute the Jacobian matrix for a 2R planar robot.
print(f"Verification: dx = {dx_check[0]:.3f}, dy = {dx_check[1]:.3f}")
Python Code: Singularity Detection Across Configurations
The second program colours every pair of joint angles by . The picture is made of horizontal bands, because depends only on . The largest value, , is at .
import numpy as np
import matplotlib.pyplot as plt
defsingularity_map(L1, L2, resolution=200):
"""
Compute and visualize the singularity measure (determinant of J)
(0, 170), # near singularity (theta2 close to 180)
]
plot_manipulability(L1, L2, configs,scale=0.3)
Python Code: Straight-Line Motion Using the Jacobian
The fourth program moves the hand along a straight line from (1.2, 0.5) m to (0.4, 1.0) m in 2 seconds. At each time step it finds the joint speeds with the inverse Jacobian, then moves the joints by speed times time step (resolved-rate control). The hand speeds up at the start and slows down at the end.
Two points help when you read it:
It prints a “tracking error” of about 77 mm at most. That number compares the hand with a point that moves along the line at constant speed, so nearly all of it is a difference in timing. The hand stays within about 1.3 mm of the line.
The option elbow_down=True in ik_2r selects . For the start point this puts the elbow below the line from base to hand, which is the elbow-down pose.
print(f"Minimum |det(J)| during motion: {np.min(np.abs(det_hist)):.4f}")
System Application: Collaborative Robot Force Limiting
The collaborative robot must follow the path of the handover and keep the force at the end-effector below 150 N. This loop runs in the robot’s own controller, many times each second.
Force-Limited Trajectory Execution
At each time step the controller does this:
Measure the joint angles with the encoders and the joint torques with the torque sensors.
Compute the Jacobian for the present pose.
Estimate the force at the end-effector with . If its size is above , reduce all joint torques by the same factor.
Check for a singularity with . If it is below the threshold, change to damped least squares and reduce speed.
Compute the joint speeds for the wanted hand velocity: (the pseudoinverse for a redundant robot).
Limit the joint speeds to what the motors and the safety rules allow.
Send the limited joint speeds to the motor drives.
Force Monitoring Example
Take the 2R arm in the pose of the numerical example (, ), with measured joint torques N·m and N·m. The force at the end-effector is:
Take the inverse Jacobian from the numerical example and exchange its rows and columns:
Row by row:
The size of the force is N, far below the 150 N limit in this pose ✅
Design Guidelines
Jacobian Computation
Derive the Jacobian as a formula, then program it. Check the program against small test moves of each joint. Compute it again in every control cycle (typically 1 kHz for collaborative robots).
Singularity Management
Watch or the smallest singular value. Near a singularity, use damped least squares ( to ) and reduce speed.
Redundancy Exploitation
Use the null space for a second aim: joint limits, singularities or obstacles. The motion of the end-effector always comes first.
Force Safety
Use to turn the force limit into joint torque limits, and update them in every control cycle, because changes with the pose.
Practical Checklist
Derive the Jacobian for your robot and check it with small test moves.
Find the singular poses in your workspace and keep planned paths away from them.
Set singularity thresholds from the speed and force your task needs.
Add damped least squares for poses near a singularity.
Test the force mapping in several poses, most of all near the edge of the workspace.
Summary
Key Concepts Covered
The Jacobian matrix turns joint speeds into the velocity of the end-effector: . Each column is the motion of the hand for one joint alone.
Forward velocity mapping is a multiplication and works in every pose
Inverse velocity mapping needs or and fails at singularities
Singularities are the poses with . For the 2R arm, : the arm is singular when straight or fully folded.
Manipulability ellipsoids show in which directions the hand moves easily
The pseudoinverse gives a redundant robot the smallest joint speeds, and the null space leaves freedom for a second aim
Force mapping uses the transpose: . Where the hand is fast it is weak.
Safety beside people needs the force at the hand checked in every control cycle
A two-link arm is stretched fully straight. In which direction can the tip not move at that instant, whatever the two joints do?
See it: what the joints can do to the tip
θ₁θ₂1 m/s
Tip velocity for the joint speeds you set
Joint 1 alone, at 1 rad/s (column 1 of J)
Joint 2 alone, at 1 rad/s (column 2 of J)
Every tip velocity the joints can give at unit joint speed
J =
det J = L₁·L₂·sin θ₂
Tip velocity (vx, vy), m/s
Tip speed
Ellipse half-axes
The arm is the lesson's example: 1.0 m and 0.8 m links at 45° and 30°. The two thin arrows are the two columns of J. Each one is the tip velocity when one joint turns at 1 rad/s and the other is still. The tip velocity is the first arrow times the first joint speed plus the second arrow times the second joint speed. The ellipse holds every tip velocity the joints can give together at unit speed. Move θ₂ toward 0° or 180°. The two thin arrows turn to lie on one line, the ellipse becomes flat, and det J goes to zero. The tip can then move only across the arm.
Check yourself
Three questions. Each wrong choice is a mistake people really make, so read the note after you answer.
1. The arm (1.0 m and 0.8 m links) is fully straight, so it is singular. Joint 1 turns at 1 rad/s and joint 2 is held still. How fast does the tip move?
2. At θ₁ = 45° and θ₂ = 30° the lesson's arm has det J = 0.40. You turn joint 1 to θ₁ = 90° and leave joint 2 where it is. What is det J now?
3. With θ₁ = 0° and the elbow at θ₂ = 90°, moving the tip straight away from the base at 0.1 m/s needs joint 1 at 0.06 rad/s and joint 2 at 0.16 rad/s, turning the other way. What does the same slow tip motion need when the arm is almost straight, at θ₂ = 5°?
Comments