This project proposes a novel optimization algorithm to control the ultrasonic vibration of piezo-transducer in microelectronics packaging. The control of resonant frequency tracking to piezo-transducer is significant to the bonding quality. A conventional PID controller is applied to track the resonant frequency of piezo-transducer dynamically; however, there are shortcomings, such as tedious parameter tuning and uncertain optimal parameters. This project proposes the particle swarm optimization (PSO) to search the PID parameters intelligently. The MATLAB-Simulink model of PSO-PID is established to analyze the phase and frequency response of the piezo-transducer by a closed loop, where the optimal control parameters are determined by the PSO search. To solve the conventional abrupt ultrasonic power, an editable voltage trajectory with analytical geometry is proposed to provide various driving voltage trajectories. Finally, the control experiments with the proposed optimization are carried out in ultrasonic wire bonder. The results validate that the PSO-PID and editing trajectory optimizations can attain competitive bonding quality, stability, and robustness.