Introduction
To use model based (non-linear) control, you need a dynamic model of the robot. You can derive robot dynamics from the Lagrange equation of motion, which uses the energies of the mechanical system. The model is the base of Computed Torque Control.
Lagrange equation
The Lagrangian is kinetic energy minus potential energy:
| Symbol | Meaning |
|---|---|
| Lagrangian | |
| kinetic energy | |
| potential energy | |
| joint position (joint angle, or joint length for a prismatic joint) | |
| joint input (torque for a revolute joint, force for a prismatic joint) |
This is Newton's law, , written with energies.
Single link robot
The mass is at the end of a link of length .

| Symbol | Meaning |
|---|---|
| mass at the end of the link | |
| length of the link | |
| speed of the mass | |
| acceleration due to gravity | |
| height of the mass, |
This is non-linear. The moment of inertia is , and there is a gravity torque from the load.
Two link polar robot
Joint 1 is revolute () and joint 2 is prismatic (). The mass is at the end of the link.

With and , the Lagrange equation gives:
In vector form:
General form
For a robot with degrees of freedom:
where:
- is the vector of joint positions, and is the vector of joint inputs
- is the manipulator mass matrix. It is always symmetric and positive definite, so it is always invertible
- has all the terms that depend on joint velocity. A term like comes from centrifugal force (square of one joint velocity). A term like comes from Coriolis force (product of two different joint velocities)
- has all the terms with the gravity constant
Two link planar robot
Each robot has a different model. For a two link planar robot (both joints revolute), with , , :

| Symbol | Meaning |
|---|---|
| , | masses of link 1 and link 2 |
| , | lengths of link 1 and link 2 |
| , | angles of joint 1 and joint 2 |
| , | and |