The goal in this portion of the project was to find a simple dynamic model of a prehensile tail. Not only should it be reasonably accurate, but it should also be easily and quickly simulated, as the goal in the next section will be to find controllers via search techniques.In terms of models, the most accurate would be those which mimic the tendons in actual tails. One such model would be to have cables hooked to the midpoints of a number of links connected by joints. This model is the closest to reality. Another technique would be to have cables threaded through notches in disks (and connected to some), with the disks connected by stiff springs. By changing the length of various cables connected to various disks, the tails could be moved into almost any position. This model benefits both from its accuracy, and the fact that it would likely produce very smooth motion because of the springs.
However, both of the first model is difficult to build (since the cable must run along the length of the tail for it to look right) and the second is very hard to model, as a result of the stiff springs (among other things).
The model that was struck upon, while not strictly identical to actual tail dynamics, is still fairly good. The tail was modelled as a six link manipulator, where each link is connected to the previous one by a two degree of freedom joint, with one end of the manipulator fixed. The dynamics of such a setup have been long explored in the robotics literature. The benefits of such a system is that not only is it reasonably accurate, but it also it fairly easy to build, with each joint being a torque motor. A diagram of a three link version follows.
Note that the angle of each link is measured from the previous link. These coordinates will help simplify our mathematical model.
In general, the dynamics of such a system are described as: [1]
where I is the moment of inertia matrix, C is the Coriolis force matrix, and tau, gamma and delta are the torques due to external motors, gravity and dissipation, respectively. Theta is simply the vector of relative link angles.
This model is complete, but it is also fairly slow. While there are a great number of techniques designed to allow calculation of there dynamics in real time [2], this is still too slow for our purposes, since we wish to be able to run through a large number of iterations fairly quickly during our search.
Therefore, the model was simplified as follows. First, we dropped one degree of freedom, and made the tail a planar manipulator. Since most of the important tail motions can be considered to take place either in the plane of gravity or with gravity going directly into the page, there is little to be gained from the added difficulty of the third dimension. Secondly, we ignored the Coriolis force term. Made necessary by the relative coordinates, this is one of the more time consuming parts of the simulation, and will provide relatively little effect for the effort. This approximation was taken from [3]. Dissipation was modelled as being proportional to angular velocity. This is a reasonable assumption, and proper model of torque motor frictions would be a project in and of itself.
Our final approximation is the most important. Using a modification of the composite-rigid-body technique [2], we assume that all of the links in the manipulator after a given pivot moves as a fixed body, and all of the links before the pivot is fixed. This results in the diagonalization of the inertia matrix (since we have relative coordinates), and make calculations very, very fast. Some justification of this method is necessary, though. The portion of the manipulator does not actually move as a rigid body, and the proper technique uses off-diagonal terms to take this into account. We assume that the motor frictions are great enough that they not move under (small) torques. This may or may not be accurate, as there was not enough time to explore the actual properties of the motors that could be used in a physical instantiation. This is an area for future work. Since the links before the pivot is eventually fixed at the first segment, that is obviously a reasonable assumption. Note that one major drawback of this method is that each pivot must have an actuator on it, otherwise it will only ever be torqued by gravity (if that) and the system will effectively degenerate into one with less links.
Other methods are possible. Those with access to more computer time and interested in greater accuracy can use the full models. Simulators such as SD/FAST are specifically designed for such tasks. Also, starting from those models, it is possible to train arbitrarily accurate (depending on time and inputs) neural networks to compute the dynamics in real time. This has the added benefit of providing an analytically differentiable controller, which makes searching far easier. A number of difficulties are attendant in this technique, the reader is directed to [4] for their resolution. The comparison of our model to more complete one would be of great value.
As a final point on the model, it is worth mentioning that though we chose a six link manipulator for a tail in this case, more links can be added almost trivially and this algorithm is linear in time for the number of links.
Given a model, we still need to do the algebra to be able to implement it. We use the following variables:
We first consider the moment of inertia. Using the parallel axis theorem, we see that the moment of inertial of all of the links after the ith pivot is simply the sum of the moments of inertia of each individual link about that pivot. This leads us to:
where :
with those calculations following directly from the geometry and first principles, respectively.
The torques are known inputs and the dissipation is trivial, so the only thing left to consider is the gravitational torques. We see that each link will feel a gravity torque on it from each following link, equal to the mass of that link and the horizontal distance between them. Therefore, this is a simple modification of the moment of inertia calculation, giving:
So we are pretty much ready to go with a simulation, though the astute reader will note that we have not given values for any of the variables. That is because they were found through playing with the simulation, which is one of its greatest uses. All of this is described in the next section, simulation.