I have a nonlinear system of
$f = m \ddot{x} + b \dot{x} + c \sin{x} , \tag{1}$
for which I want to design a model based PD controller or as I have seen on other references using computed torque control or feedback linearization.
I can define error as:
$e = x - x_d , \tag{2}$
where $x_d$ is the desired value. Following this presentation the computed torque control law is:
$f = m \left( \ddot{x}_d - u \right) + N , \tag{3}$
where $u$ is
$u = -k_d \dot{e} -k_p e , \tag{4}$
and $N$ is
$N = b \dot{x} + c \sin{x} . \tag{5}$
Combining the above equations I get
$\ddot{e} - k_d \dot{e} - k_p e = 0 , \tag{6}$
which in addition to contradicting the above reference, is very confusing. I would appreciate if you could help me know if my calculations are correct or I'm making a mistake here? Thanks for your support in advance.
P.S. reading this paper it seems that $u$ should actually be defined as
$u = k_d \dot{e} + k_p e , \tag{7}$
which leads to
$\ddot{e} + k_d \dot{e} + k_p e = 0 , \tag{6}$
We want the error dynamics $\ddot{e}+k_\text{D}\dot{e}+k_\text{P}e=0$. The error is given by $e=x_\text{d}-x$, which results in
$$\ddot{x}_\text{d}+k_\text{D}\dot{x}_\text{d}+k_\text{P}x_\text{d}=\ddot{x}+k_\text{D}\dot{x}+k_\text{P}x.$$
But we have $\ddot{x}=-b/m\dot{x}-c/m\sin x - f/m$. This results in
$$\ddot{x}_\text{d}+k_\text{D}\dot{x}_\text{d}+k_\text{P}x_\text{d}=-b/m\dot{x}-c/m\sin x - f/m+k_\text{D}\dot{x}+k_\text{P}x.$$
Solving for $f$ will give us the desired input $f$.
$$f/m=-\ddot{x}_\text{d}-k_\text{D}\dot{x}_\text{d}-k_\text{P}x_\text{d}-b/m\dot{x}-c/m\sin x +k_\text{D}\dot{x}+k_\text{P}x.$$ $$f =-m\ddot{x}_\text{d}-mk_\text{D}\dot{x}_\text{d}-mk_\text{P}x_\text{d}-b\dot{x}-c\sin x +mk_\text{D}\dot{x}+mk_\text{P}x.$$
This only works if we can measure $x$, $\dot{x}$ and if your desired trajectory $x_\text{d}$ is at least twice continuously differentiable.