# Determine the transfer function of a movement equation

The problem is the following. I have to control a spaceship (assuming no gravity, no mass, no friction / no external forces). In other words, the first equation in this question leads to $$0 = 0$$. My goal is to reach a position for a given acceleration (i.e. throttle).

The movement equation (assuming a constant acceleration) is the following: $$x(t) = 0.5 * a * t^2 + v0 * t + x0$$ where $$v0$$ is the initial velocity and $$x0$$ the initial position ($$x0 = 0$$). Finally, I get $$a = (goal - t*V0) / t^2$$ where $$goal= target - traveled_distance$$

I put this equation in my system. There is a sensor to measure the velocity. Each time the velocity is measure, I can send a new acceleration command.

I got the following plots (the first one is the acceleration, the second one the velocity, and the last one the trajectory)

On the last plot, we can clearly identify the response of a second order system. I also observed that increasing $$t$$ reduces the overshoot (so I guess that $$t$$ is acting like a proportional gain).

My question is what would be the corresponding transfer function? I tried to identify it with a second order differential equation but did not get any convincing results.

Ignoring your acceleration control rule (which I would not do this way) your transferfunction looks like this: $$H(s) = \frac{1}{s^2}$$ where the input is the acceleration, the output is the position. Since you measure the velocity, the transferfunction changes to $$H(s) = \frac{1}{s}$$ As for your control goal, you assume the acceleration is constant, however the plot shows otherwise. Other than that, its based upon the logic that within some time interval $$t$$, assuming constant velocity, the error changes to something. Increasing this $$t$$ allows it to respond less aggressive, thus less overshoot. I on the other hand advice to simply close the loop and use a PD controller to control the system: $$T(s) = \frac{\frac{P+Ds}{s^2}}{1+\frac{P+Ds}{s^2}} = \frac{P+Ds}{s^2+P+Ds}$$ Where the error equals $$Goal - x \approx Goal -(x_{prev} + v \cdot Ts)$$ where $$v$$ is the measured velocity, $$Ts$$ the sampling rate and $$x_{prev}$$ the sum of all earlier measured $$v\cdot Ts$$ and $$x0$$. Do note that using an discrete integration like this might result in large offsets due to integrating noise (introducing drift).