# Optimal control: non-zero target control

1. Aug 28, 2013

### diminho

Dear all,

I am building an arm with 2 joints(elbow, shoulder) and want to optimally control it to a particular position(wirst). The examples I saw so far(e.g. acrobot) have a target control signal $u(t_f)$ which becomes zero when reaching the target $x_{target}$ in the final time step $t_f$.
In my case, the target control signal is not zero when reaching the target which can be any point in the horizontal plane within the range of the wrist(the arm is hanging down). My idea was to specify the target control as well as the target position which should be reached. So, the cost function
$$J=\frac{1}{2}x(t_f)^TS_fx(t_f)+\frac{1}{2}\int^{t_f}_{t_0}(x(t)^TQx(t)+u(t)^TRu(t))dt$$
becomes
$$J=\frac{1}{2}(x(t_f)-x_{target}^T)S_f(x(t_f)-x_{target})+\frac{1}{2}\int^{t_f}_{t_0}((x(t)-x_{target})^TQ(x(t)-x_{target})+(u(t)-u_{target})^TR(u(t)-u_{target}))dt$$
(see scholarpedia->optimal control for notation)
As I am building a real system with friction the target control $u_{target}$ does not always lead to the same position. The position where the wrist ends up depends in which state the arm was before the target control is applied.
So, although the wrist is at the correct position it gets penalized for not having the "correct" controls.

Does anyone of you have an idea how to formulate this problem?

PS: x contains the angles of the joints and the angle velocities.

2. Aug 29, 2013

### diminho

Does noone have any idea? I really need helkp here:/

3. Sep 4, 2013

### skeptic2

Have you identified the reason the target control signal is not zero when the target is reached. Is it too little or too much?

How are you implementing this control. How is X(t) measured? How is U(tf) generated? Are you using a microcomputer to solve the function? Could you be getting digitization errors?

4. Sep 5, 2013

### diminho

The reason why there is nearly for all positions non-zero target control is that the arm is currently hanging down. I also put it in the horizontal plane, but the tendons pull the arm for some positions, too.

x(t)=[elbow, shoulder, elbowVelocity, shouldervelocity] is measured using rel. encoder with 333 steps/degree-> very precise. The control is generated using artificial muscles. I am using a Simulink and a PCI card to generate the signals. There might be some delay between setting the control and the generation of the torque using the muscles.

5. Sep 5, 2013

### skeptic2

I'm sorry but I do not understand your expressions. Would you be able to go through one or the other and explain each term and how you arrived at it?

Thanks.