User:Loeb

boat's heading: $$ \psi_b $$

direction of trajectory: $$ \mu_r $$

rudder angle: $$ \delta $$

perturbative torque: $$ r_b $$

perturbative current: $$ d_y $$


 * Model*

Yaw $$ \dot{r} = -\frac{1}{T} r + \frac{K}{T} \delta + \frac{1}{T} r_b $$

Heading $$ \dot{\psi}_b = r $$

Cross track error $$ \dot{y} = u \sin(\psi_b - \mu_r) + \alpha r \cos(\psi_b - \mu_r) + dy $$

sway (traversal velocity) : $$\alpha$$

---+ Trajectory without sway

$$ \dot{x} = u \sin \left( \int r dt \right) $$

$$ \dot{y} = u \cos\left( \int r dt \right) $$

---+ Trajectory with sway

$$ \dot{x} = u \sin \left( \int r dt \right) + \alpha r \cos \left( \int r dt \right) $$

$$ \dot{y} = u \cos\left( \int r dt \right) - \alpha r \sin \left( \int r dt \right) $$

$$ \alpha $$ minimizes sum of errors

$$ E = \sum_{i=1}^N (x_{obs} - x_{calc} )^2 + (y_{obs}-y_{calc})^2 $$

$$ \delta = K_p ( \psi_r - \psi_b) - K_d \dot{\psi}_b + K_i \int_0^t (\psi_r - \psi_b) d\tau $$

limit $$ \psi_r$$ to $$\pm\pi/2$$

$$ \psi_r = -\arctan \left\{ K_1 \left( y+ \frac{1}{T} \int_0^t y d\tau \right) \right\} $$