# Navigation Path Extraction and Experimental Research of Pusher Robot Based on Binocular Vision
## 2 Materials and Methods
### Motion Modeling and Control
#### 2.2.2 Motion Control  
The lateral deviation and angular deviation of the robot was obtained through the fitting of the cowshed fence, the extraction of the operation route and the determination of the robot's pose state [19]. The motion deviation of the pusher robot is shown in Figure 3. During the working process of the pusher robot, the linear speed was related to the angle deviation. When there was no angular deviation, the actual line speed moved according to the set line speed; when there was an angular deviation, within a certain range, the larger the angle deviation, the smaller the actual line speed should be, so as to avoid the robot deviating further and further away. The actual angular velocity was related to lateral deviation and heading deviation [20]. When there was lateral deviation or angular deviation, the mobile robot would generate a corresponding angular velocity to eliminate the deviation; when both the lateral deviation and the angular deviation were zero, the actual angular velocity of the mobile robot was zero. Figure 3: Motion deviation of the pusher robot. As shown in Figure 4, the PID control algorithm is usually composed of three units, namely a proportional control unit, integral control unit and differential control unit. The \(e(t)\) is the deviation between the actual value and the given value, and it is also the input value of the PID control algorithm. The expression of \(e(t)\) is shown in Equation (8). \[e(t)\ =\ t(t)-y(t) \tag{8}\]  
where, \(\mathbf{r}(t)\) is the actual value transmitted to the system; \(y(t)\) is the actual control value of the system; and \(e(t)\) is the deviation between the actual value and the expected value of the system. After the linear combination, \(u(t)\) is output as the output value, and it is used as the input value of the control object. Therefore, the expression of the PID control algorithm is shown in Equation (9). \[u(t)\ =\ k_{p}\bigg{[}e(t)+\frac{1}{k_{i}}\int_{0}^{t}e(t)d(t)+k_{d}\frac{de}{dt} \bigg{]} \tag{9}\]  
where, \(t\) is the sampling time; \(k_{\text{p}}\) is the proportional coefficient of the controller; \(k_{\text{i}}\) is the integral coefficient of the controller; and \(k_{\text{d}}\) is the differential coefficient of the controller. The transfer function of Equation (9) is of the form:  
\[G(s)\ =\ k_{p}\bigg{(}1+\frac{1}{k_{i}s}+k_{d}s\bigg{)} \tag{10}\]  
The fuzzy control algorithm can adjust the PID parameters according to the difference of the system [21; 22]. However, the initial PID parameters need to be adjusted. This makes it difficult to make the system perform optimally. Therefore, particle swarm optimization is used to optimize the parameters of the PID and find the optimal parameters. This makes the system balanced and more responsive. The particle swarm optimization algorithm is a random search algorithm with group collaboration as the core [23]. As shown in Figure 4, in this algorithm, the particles in the search space represent the solution to the problem, and these particles form a population. The direction and distance a particle flies is determined by its velocity. The particle flies in the solution space along the optimal solution, and when a certain number of iterations is reached, the optimal position vector of the particle is the optimal approximate solution of the problem. The particle swarm optimization has the advantages of simple iteration and fast convergence, and is suitable for parameter optimization of control systems. The process of optimizing the fuzzy PID controller with the particle swarm optimization algorithm is shown in Figure 5. Assuming that K particles are initialized in the D-dimensional solution space, each particle has its own spatial position \(X_{m}\) = (\(X_{m1}\), \(X_{m2}\),..., \(X_{mD}\)) and its own flying speed \(V_{m}\) = (\(V_{m1}\), \(V_{m2}\),..., \(V_{mD}\)), where \(m\) = 1, 2, 3,..., \(K\). Each time the particle iterates in the solution space, it optimizes its  
Figure 4: PID Control Schematic.