This repository is dedicated to develop functions for automatic computations for designing robotic manipulators.
- Jacobian formulation for planar and spatial manipulators around a given end-effector point. (This is useful in performing optimisation of Jacobian-based performance parameters of any non-redundant robot directly from its robot-topology matrix)
- Statement of need: Jacobian formulation is highly used in dimensional synthesis of robotic manipulators, which deals with optimal design of robot's dimensional parameters (link-lengths and joint-orientations). For a given topological structure, formulating Jacobian around a given end-effector point for designing optimal dimensional parameters would require only the topological information, as every other step can be automated. Formulating Jacobian for serial manipulators is easy but for parallel manipulators and serial-parallel hybrid manipulators it is more complicated and often tedious. ACRoD automates this task of formulating Jacobian for a given end-effector point by running all the required steps in the background. The targetted audience includes researchers and engineers working on performing dimensional synthesis of manipulators (especially for multiple manipultors in bulk for comparison) to compute optimal dimensions for operation around a single end-effector point, and those needing to verify the DOF of a topological structure (especially for those special cases of kinematic mechanisms where Chebychev–Grübler–Kutzbach criterion fails to accurately determine the DOF) by analysing the Jacobian. Even though this does not include scripts for implementing optimisation or computing performance metrics for dimensional synthesis or for computing the validity of DOF, it does include scripts for computation of Jacobian which is an essential part for these analyses.
The package can be installed from PyPI by using the following command via terminal.
pip install acrod
The topological information of a robot is to be specified by using its robot-topology matrix, as defined here. For a planar 2R serial manipulator (as shown in the above figure), the robot topology matrix is given by
The corresponding Jacobian function can be formulated as follows.
Firstly, the required functions are imported as shown below.
from acrod.jacobian import Jacobian
from numpy import array
The robot-topology matrix for 3R planar serial manipulator is defined and jacobian information is processed via the imported jacobian class as follows.
M = array(
[[9, 1, 0],
[1, 9, 1],
[0, 1, 9]]
)
jac = Jacobian(M, robot_type = 'planar')
Jacobian function is generated as shown below.
jacobian_function = jac.get_jacobian_function()
In the process of generating the above jacobian function, other attributes of the jacobian object also are updated. Symbolic Jacobian matrices can be extracted from the attributes. Since this is a serial robot, the matrix Ja
attribute of the jacobian object as follows.
symbolic_jacobian = jac.Ja
symbolic_jacobian
In an ipynb file of JupyterLab, the above code would produce the following output.
The above Jacobian is based on the notations defined and described here.
Active joint velocities, in the corresponding order, can be viewed by running the following lines.
active_joint_velocities = jac.active_joint_velocities_symbolic
active_joint_velocities
In an ipynb file of JupyterLab, the above code would produce the following output.
Robot dimensional parameters can be viewed by running the below line.
robot_dimensional_parameters = jac.parameters_symbolic
robot_dimensional_parameters
In an ipynb file of JupyterLab, the above code would produce the following output.
Robot end-effector parameters can be viewed by running the below line.
robot_endeffector_parameters = jac.endeffector_variables_symbolic
robot_endeffector_parameters
In an ipynb file of JupyterLab, the above code would produce the following output.
- End-effector point:
$\textbf{a}=\hat{i}+2\hat{j}$ - Locations of joints:
$\textbf{r}_{(1,2)}=3\hat{i}+4\hat{j}$ and$\textbf{r}_{(2,3)}=5\hat{i}+6\hat{j}$
For the given set of dimensional parameters of the robot, the numerical Jacobian can be computed as follows. Firstly, we need to gather the configuration parameters in Python list format, in a particular order. The robot dimensional parameters from jac.parameters_symbolic
are found (as shown earlier) to be in the order of
end_effector_point = [1,2]
configuration_parameters = [3,4,5,6]
jacobian_at_the_given_configuration = jacobian_function(end_effector_point, configuration_parameters)
jacobian_at_the_given_configuration
The output produced by running the above code, is shown below.
array([[ 2, 4],
[-2, -4],
[ 1, 1]])
Mathematical concepts behind formulating the Jacobian can be found here.
For dimensional synthesis, at least a performance parameter is required. One commonly used performance parameter in dimensional synthesis is the condition number. From the above Jacobian function, the condition number can be found by computing the ratio of maximum singular value and minimum singular value. This condition number has the bounds
from numpy.linalg import svd
def condition_number_func(jacobian_matrix):
_, singular_values, _ = svd(jacobian_matrix)
condition_number = singular_values.max()/singular_values.min()
return condition_number
For reference if we take the joint at the fixed link to be at the origin, the dimensional synthesis for optimal performance around the end-effector point
from scipy.optimize import minimize
from numpy import hstack, ones
end_effector_point = [1,2]
base_reference_point = [0,0]
r12 = base_reference_point
jac_fun = lambda y: jacobian_function(end_effector_point, hstack((base_reference_point,y)))
condition_number = lambda z: condition_number_func(jac_fun(z))
initial_guess = ones(len(jac.parameters)-len(base_reference_point))
res = minimize(condition_number, initial_guess)
r23 = res.x
The link lengths
from numpy.linalg import norm
l2 = norm(r23-r12)
l3 = norm(r23-end_effector_point)
print(l2,l3,res.fun)
Output:
3.4641016153289317 2.236067976155377 1.0000000007904777
The above output shows that for
Some examples (along with their mathematical derivations) can be found here.
For full documentation, visit the documentation page here.
- For contribution to the software:
- In order to contribute to the software, please consider using the pull request feature of GitHub.
- For reporting issues with the software:
- For reporting issues or problems, please use issues.
- For support:
- For any further support (including installation, usage, etc.), feel free to contact via suneeshjacob-at-gmail-dot-com.