# Optimization-Based Input-Shaping Swing Control of Overhead Cranes
## 3 Design of Input Shaper
### Optimization of Shaper Based on PSO Algorithm
\right..\) The velocity and displacement information of the trolley can be obtained via the integral operations on \(r_{a}(t)\), as shown in Figure 3.  
Figure 3: Acceleration, velocity, and displacement curves. Figure 4 is the response result of applying the acceleration \(r_{a}(t)\) to the swing system in the nominal case. It can be seen from Figure 4 that the ZVD shaper has a strong positive effect on the swing angle of the payload. The swing angle of the payload converges from the maximum 0.1 rad to 0 at 3.4 s.  
Figure 5 is the response result of applying the acceleration \(r_{a}(t)\) to the swing system in the case of disturbance added in the control input channel. This disturbance with an amplitude of 0.03 acts at 2.5 s and lasts for 0.3 s (used to simulate the modeling error caused by the uneven friction between the gears of the driving device). It can be seen from Figure 5 that the optimized ZVD shaper is better than the unoptimized one in terms of swing angle elimination, while the PSO with improved weight is better than the PSO with fixed weight in eliminating residual vibration. The reason for this is that the PSO with improved weight can compromise both global and local search capabilities. It can be concluded that time-varying weight can improve the performance of the PSO algorithm. Figure 4: Swing angle response curves with and without ZVD shaper. Figure 5: Swing angle response curves under ZVD shaper obtained using different techniques. **Remark 2**. : _After extending the simulation time, it can be seen that PSO-ZVD takes approximately 26 s, while ZVD takes approximately 36 s, and their vibration suppression effect is the same as that of IWCPSO-ZVD._  
Figure 6 shows the curves of the pulse amplitudes of the shapers. IWCPSO-ZVD is faster than PSO-ZVD in terms of amplitude convergence speed, which is due to the fact that the weight \(\omega\) of the PSO always maintains a large value and makes its local search ability poor. It is precisely this reason that makes the pulse time convergence processes of the shapers very different, and the steady-state values are also slightly different, as shown in Figure 7. Different values lead to different swing angle suppression, as shown in Figure 5. Table 1 shows the steady-state values of these parameters calculated with PSO and IWCPSO, which more accurately illustrates the differences between these two algorithms. At the same time, the IWCPSO particle fitness function converges faster, and  
**Remark 3**. : _The IWCPSO algorithm can effectively solve the problem of the shaper parameters being unsuitable in practice due to modeling errors. However, the PSO and IWCPSO algorithms used in this work only use the feedback information IAE written in (17), which can only reflect the overall swing angle performance of the whole system motion. Therefore, these two algorithms can only be used to deal with fixed disturbance that does not change with the motion process, belonging to offline optimization [3]. Thus, it is necessary to introduce other techniques to improve the system's robustness against real-time disturbances._