# Uniform vs. Lognormal Kinematics in Robots: Perceptual Preferences for Robotic Movements
## 3 Robotic Arm Modelling
### Generating Human Movements  
There are many theories and models that have tried to describe human movement. Among these, the kinematic theory of rapid human movements and its Sigma-Lognormal model has been used to explain most of the basic phenomena reported in classical studies on human motor control and to study various factors involved in fine motor skills. The model herein proposes that a simple motion has a speed profile defined by a lognormal curve and that complex motions, such as signatures, can be decomposed into a sum of lognormals. In industrial robots, there are no standard movement commands based on a lognormalprofile. To implement this profile on the robot, the lognormal curve and its parameters must be used:  
\[v(t)=\Lambda(t;\mu,\sigma)=\frac{1}{\sigma t\sqrt{2\pi}}exp\left(-\frac{\left(ln( t)-\mu\right)^{2}}{2\sigma^{2}}\right)\ \ \forall t>0 \tag{12}\]  
The lognormal distribution is a statistical distribution which implies that  
\[\int_{0}^{\infty}\Lambda(t;\mu,\sigma)dt=1\ \ \forall t>0 \tag{13}\]  
Therefore, if the speed has a lognormal distribution given by Equation (12), the final distance traveled will be the unit. If a scaling factor and a time lag are added to this distribution, the following equation results:  
\[v(t)=D\Lambda(t;t_{0},\mu,\sigma)=\frac{D}{\sigma(t-t_{0})\sqrt{2\pi}}exp\left( -\frac{\left(ln(t-t_{0})-\mu\right)^{2}}{2\sigma^{2}}\right)\ \ \forall t>t_{0} \tag{14}\]  
In this equation, \(t\) represents time, \(t_{0}\) is the time in which the movement is activated, \(\mu\) is the stroke time delay, \(\sigma\) is the stroke response time and \(D\) is a scaling factor. The parameters \(\mu\), \(\sigma\), \(D\) and \(t_{0}\) are calculated so that the speed profile has the desired temporal distribution. With Equation (14), the lognormal speed profile can be modeled, or in cases of having a human speed profile, characterize it with such a curve. To this end, the integral of the lognormal function given by its cumulative distribution function is used. This distribution is given by:  
\[r(t)=\frac{1}{2}\left(1+erf\left(\frac{ln(t-t_{0})-\mu}{\sigma \sqrt{2}}\right)\right)\ \ \forall t>t_{0}\] \[r(t)=0\ \ \forall t\leq t_{0} \tag{15}\]  
where the erf function is the statistical error function. We will assume that the trajectory that defines the end of the robot is a straight line from point \(\mathbf{p_{s}}\) to point \(\mathbf{p_{e}}\). Firstly, it will be necessary to define a lognormal curve that complies with the temporal parameters of speed and position, that is, to obtain the parameters of said curve. Considering that the cumulative distribution function starts from zero at time \(t_{0}\) and reaches one at a time determined by the parameters \(\mu\) and \(\sigma\), the x-component of the trajectory is given by:  
\[p_{x}(t)=p_{sx}+\frac{p_{ex}-p_{sx}}{2}\left(1+erf\left(\frac{ln(t-t_{0})-\mu }{\sigma\sqrt{2}}\right)\right)\ \ \forall t>t_{0} \tag{16}\]  
Operating analogously with the other components, the trajectories followed by \(p_{y}\) and \(p_{z}\) are obtained. Therefore, the procedure for the robot to follow a straight line with a lognormal speed distribution is as follows:  
1. Define the starting \(\mathbf{p_{s}}\) and ending point \(\mathbf{p_{e}}\) of the trajectory and the time used to perform the movement \(t_{e}\). 2. With the above parameters, define the parameters of a lognormal curve that meet the above requirements. It should be noted that there are infinite curves as a function of \(\mu\) and of \(\sigma\). Analyzing the behavior of both parameters, it was observed that the one with the greatest effect on the shape of the curve was \(\sigma\) and so a value of \(\mu=ln(1)\) was set. Therefore, \(\sigma\) must be calculated to have the time of the movement as \(t_{e}\). This is shown in Figure 5.  
The blue curve shows the lognormal speed profile, in which \(t_{0}=0\) and \(\mu=\ln(1)\). The red curve is the integral given by Equation (15), whose range is between zero, for \(t=0\) and one, for \(t=\infty\).