Institut de Robòtica i Informàtica Industrial
KRD Group

The CuikSuite Project

DoubleButterfly.world File Reference

The Double Butterfly linkage: simple formulation. More...

Go to the source code of this file.


Detailed Description

[Introduction][Position Analysis]

Introduction

Simple formulation of the Double Butterfly linkage refering to some of the points defining in the links to define the joints. The advantage is that we can re-define the link sizes and get a different double-butterfly without modifying the world file. The inconvenient is that joints can only be defined in particular points of the links.

To refer to the points on the triangular links, we assume that the triangles are defined in the following way

  • They are defined in the XY plane.
  • One of the sides of the triangle is on the X axis.
  • Points are given counter-clockwise and numbered from 0 to 2.

In this example we use an incremental way to define rotation axes for revolute joints: instead of defining the rotation axes using two points we give a vector to be added to the point given before.

Finally, note that the length of the rotation axes is irrelevant.

Please, see DoubleButterfly_explicit for an alternative formulation of the same linkage (i.e., a formulation giving all the coordinates in the world file instead of re-using those in the body definitions).

In the following we assume that you have the CuikSuite configured and properly compiled. All commands are executed from the CuikSuite main directory.

Position Analysis

Getting the Equations

You can get the set of equations from the world description executing

This will generate a file

including the kinematic related equations (those arising from the loops in the linkage). In general other cuik files are generated with the obstacle avoidance related information if obstacle avoidance settings are included in the world file

Simplifying the Equations

The kinematic cuiksystem includes all the variables and equations generated for all links joints, and loop equations in the problem. However, in a quick inspection of the file you will see that many variables (and the corresponding equations) can trivially eliminated. This is automatically done executing

This prints the input cuiksystem plus a simplified version of the input cuiksystem. For this particular case, the the output is the complete simplification of the input problem. However, in general the output system is only partially simplified. Strong simplifications (such as a full Gaussian elimination) are avoided not to introduce numerical perturbations in the output cuiksystem that, in some cases, can create/eliminate solutions from the problem.

The cuiksimplify application is only given for you to get an idea of the real complexity of the cuiksystem actually solved since the simplification step is always automatically executed when solving a problem.

Solving the Problem

The position analysis of the Double Butterfly linkage can be solved executing

  • cuik examples/DoubleButterfly/DoubleButterfly_kin

To execute cuik you need a parameter file with the same name as the cuik file (i.e., DoubleButterfly_kin.param). In this case, you can copy the DoubleButterfly.param file.

For large cuiksystems it is advisable to use the parallel version of cuik. It is executed via rmpicuik and requires access to a properly configured cluster of computers. See Wheelie10, for a detailed example of how to use rmpicuik.

This will generate a solution file

The sol file includes all the information about the solving process. Namelly, it includes

  • The CuikSuite configuration flags used in the last CuikSuite compilation.
  • The full set of parameters resulting from the default parameters with some values overriden by the problem specific parameter set.
  • A copy of the input cuiksystem .
  • The input cuiksystem after parsing it. In some cases, parsing the cuiksystem simplify the equations (it adds the monomials with the same set of variables).
  • The simplified version of the input cuiksystem. Before the simplified system, we print the simplifications applied to convert the input cuiksystem into the simplified one. The simplifications applied are always of the form
    x = a * y + b
    where x is the variable removed from the system, y is the variable that replaces x, a is a constant scale factor, and b is a constant offset. Both a and b can be zero.
  • The list of solutions. For each solution we have
    • The solution number.
    • The maximum absolute error in the equations when using the center of the box as a solution point.
    • One range for each variable, bounding the solution. Note that we give ranges for all the variables in the original system and not only for the variables simplified system. Thus, the simplification step is transpared for the user.
  • Some statistics about the solving process
    • Volume of the search space, computed from the given variable ranges.
    • Volume of the solution space,computed as the sum of the volume of the solution boxes.
    • Volume ration, ratio between the ouput and the input volumes.
    • Max solution diagonal, maximum diagonal for all solution boxes.
    • Number of processors, number of processors used in the solving process.
    • User time in process, total time to solve the process. In single processor executions this is the CPU time used in the process. In multiprocessor executions this is number of seconds from the start to the end of the process.
    • N processed boxes, the number of boxes explored in the process.
    • N empty boxes, the number of empty boxes (i.e., boxes with no solution) encountered in the process.
    • N bisected boxes, number of boxes bisected all along the solving process.
    • N lost boxes, in a multiprocessor execution boxes send to slaves can get lost (for instance, because one of the slaves switches off during the execution).
    • Box Reductions, number of box reductions executed all along the solving process.
    • N Errors, number of boxes where the simplex algorith trigered an error, in general, due to numerical inestabilities.

Processing the Solutions

We can execute

  • cuiksort examples/DoubleButterfly/DoubleButterfly_kin

to separate the different connected components of the solution space. For this particular problem this command generates the files

plus an empty file with the isolate solutions (examples/DoubleButterfly/DoubleButterfly_kin_isol.sol)
The boxes in each one of these files are sorted so that for one dimensional solution they the produce, in general, smooth animations.

To generate an animation just execute

  • cuikanimate examples/DoubleButterfly/DoubleButterfly examples/DoubleButterfly/DoubleButterfly_kin_1 0 examples/DoubleButterfly/DoubleButterfly_kin_1

the output file examples/DoubleButterfly/DoubleButterfly_kin_1.gcl can be browsed using

  • geomview examples/DoubleButterfly/DoubleButterfly_kin_1.gcl

The same procediment can be done for the other 3 connected components of the solution space.

However, the animation gives ony partial information about the structure of the solution space. To get a global view of this struture, it is better to use cuikplot3d. This utility generates 3d projections of the configuration space. For instance executing

  • cuikplot3d examples/DoubleButterfly/DoubleButterfly_kin.sol 7 15 21 0 examples/DoubleButterfly/DoubleButterfly_kin.gcl

generates a projection of the configuration space on variables number

  • 7 (t3_u_x)
  • 15 (t4_u_z)
  • 21 (b1_u_z)

With a little bit of attention you will be able to see the four separated components that constitute the configuration space of the Double Butterfly linkage under analysis.

The same procedure can be applied to the 4 solution files with one connected component each. In this way we will generate 4 different geomview objects whose properties can be easily modified. For instance we can generate a projection of the configuration space with a different color for each connected component.

Definition in file DoubleButterfly.world.