Let’s talk about the Dynamic Movement Primitive (DMP) for robots learning from demonstration. In this article, we make an assumption that you readers all have the background of control theory and robotics. (Updating…)
The Basics about DMP
Dynamic movement primitives (DMPs) are a method of trajectory control / planning. It was motivated by the desire to find a way to represent complex motor actions that can be flexibly adjusted without manual parameter tuning or having to worry about instability.
To begin with, we take some time to discuss 2nd order dynamic system as follows:
For the sake of simplicity, we take . Then the equations above reduces to a time-invariant linear system which has been deeply studied in linear control theory. The only equilibrium of the system above is . Here we take as the goal position, are constant parameters to be chosen such that the system is strictly damping (e.g. ). This is why the DMP is always stable at the goal position — the dynamics of the system is always dominated by a stable linear system.
To make the DMP fit any trajectory, it is necessary to add some terms in the equations above without any effects on its stability:
where is a constant parameter of the dynamics of that is also called a cannonical system. As we can see, will inevitably reduces to zero with time elapsing. If is smooth and satisfies , the stability of the DMP would not be damaged by the added term . We can define the nonlinear function (also called ‘forceing function’) as:
where
is a weighting for a given basis function . You may recognize that the equation above defines a Gaussian centered at , where is the variance. So our forcing function is a set of Gaussians that are ‘activated’ as the canonical system converges to its target.
The paramter can be used as a temporal scaling term. To slow the system down you set greater than 1 while set it between 0 and 1 to speed the dynamics up.
To examplify the basic DMP, we show a diagram when :
Learn a DMP: LWR
Now we have a forcing term that can make the system take a weird trajectory as it converges to a target point, and temporal and spatial scalability. How do we set up the system to follow a trajectory that we specify? If we are given a trajectory: , And we know that the forcing term is comprised of a weighted summation of basis functions which are activated through time, so we can use an optimization technique like locally weighted regression to choose the weights over our basis functions such that the forcing function matches the desired trajectory . In locally weighted regression sets up to minimize:
where Let
and Then, in a compact form: that can be solved as
The performance is illustrated by the following diagrams: ( is the desired trajectory, is generated by DMP)
That’s for exactly following a given trajectory, which is often not the case. The strength of the DMP framework is that the trajectory is a dynamical system. This lets us do simple things to get really neat performance, like scale the trajectory spatially on the fly simply by changing the goal, rather than rescaling the entire trajectory
Thanks
- https://studywolf.wordpress.com/2013/11/16/dynamic-movement-primitives-part-1-the-basics/
- Ijspeert A J, Nakanishi J, Hoffmann H, et al. Dynamical movement primitives: learning attractor models for motor behaviors[J]. Neural computation, 2013, 25(2): 328-373.
- Schaal S, Mohajerian P, Ijspeert A. Dynamics systems vs. optimal control—a unifying view[J]. Progress in brain research, 2007, 165: 425-445.