# Parameterization and Design of Telepresence Robot to Avoid Obstacles
## 3 System Design and Implementation
### Speed Control
First, the encoder position value is differentiated to obtain the robot's speed. A PT\({}_{1}\) element then smooths this value with the time constant \(\tau_{P}\) to reduce noise. This smoothed value is the actual speed \(y_{\omega(t)}\) at the setpoint/actual value comparison. A PID controller with anti-wind-up feedback is used as the controller. The manipulated variable limitation in the controller should correspond to the manipulated variable limitation of the motor driver so that the anti-wind-up feedback can work optimally. It should be mentioned that angular velocities \(\omega\) and angular distances \(\varphi\) are processed in the controller model. However, these are proportional to the linear speed and distance of the robot. Only the constant of proportionality still has to be determined in an experiment that will be carried out later. To adjust the control loop, a model of the drive train that is as precise as possible is first required. As already mentioned, the drive is modeled by a PT\({}_{2}\) element and subsequent integrator. The parameters are determined by analyzing the robot's step response. The distance covered is recorded by the robot via the step response function. This recording can then be transferred to a personal computer (PC) for evaluation. However, since the speed step response is sought, the values obtained must be differentiated numerically once. The step response shown in Figure 4 was carried out with two \"TruckPuller3 12V\" drive motors with a battery voltage of 7.2 V and without a mounted PC. The blue characteristic shows the measured values. The quantization by the rotary encoder can be seen very well with them. The characteristic red curve describes an ideal PT\({}_{2}\) element with a gain of \(K_{S}\) = 1350, and the time constants \(\tau_{\text{S1}}\) = 0.1 s and \(\tau_{\text{S2}}\) = 0.4 s. This element represents a fairly good approximation of the real system. All variables are now known to set the control loop. For the time being, the PT\({}_{1}\) element is bypassed in the feedback to make the controller design easier. The PID controller is only used as a PI controller. It avoids erratic behavior of the control loop, which would be problematic anyway due to the limitation of the manipulated variable. All time constants are represented as poles and zeros in the following derivations:  
\[p_{x}=-\frac{1}{\tau_{x}},\ n_{x}=-\frac{1}{\tau_{x}} \tag{3}\]  
Figure 4: Step response speed of the robot. The drivetrain part relevant to the cruise control is the PT\({}_{2}\) element. Its mathematical description is:  
\[G_{S}(s)=K_{S}.\frac{p_{S1}\cdot p_{S2}}{(s-p_{S1})\cdot(s-p_{S2})} \tag{4}\]  
The PI controller lets itself through:  
\[G_{R}(s)=K_{P}+\frac{K_{i}}{s}=K_{P}\frac{s+\frac{K_{i}}{K_{P}}}{s}=K_{P}.\frac{ s-n_{R}}{s} \tag{5}\]  
with the zero:  
\[n_{R}=-\frac{K_{i}}{K_{P}} \tag{6}\]  
For completeness, the transfer function \(G_{P}(s)\) of the PT\({}_{1}\) element in the feedback is:  
\[G_{P}(s)=K_{S}.\frac{\frac{1}{T_{P}}}{s+\frac{1}{T_{P}}}=-\frac{P_{P}}{S-P_{P}} \tag{7}\]  
All quantizers and manipulated variable limitations are not considered when parameterizing the controller. As a result, the integrator of the encoder and the subsequent differentiator cancel each other out. This means that only the PT\({}_{1}\) element is left in the feedback path. First, the transfer function of the open loop is determined. The amplification factor \(K_{M}\) of the motor-driver must also be considered. \[G_{o}(s)=G_{R}(s)\cdot G_{S}(s)=K_{P}.\frac{s-n_{R}}{s}.K_{M}\cdot K_{S}.\frac {p_{S1}\cdot p_{S2}}{(s-p_{S1})\cdot(s-p_{S2})}. \tag{8}\]  
\[G_{o}(s)=K_{P}.\frac{K_{M}\cdot K_{S}\cdot p_{S1}\cdot p_{S2}.(s-n_{R})}{s\cdot (s-p_{S1})\cdot(s-p_{S2})} \tag{9}\]  
Now the controller's zero point \(n_{R}\) is selected so that the slowest pole point is compensated. This simplifies the controller function to:  
Figure 3:0  
with:  
Figure 3:1  
Since the feedback is bridged, it is sufficient to determine the transfer function of the open loop for the root locus.