© 2021 Elsevier B.V.This paper presents a collision avoidance algorithm for stabilized gun turrets and its real-time implementation. With the help of new collision avoidance algorithm, all types of turrets can be driven more efficiently and safely according to the specified speed, acceleration and jerk limits. Even in situations such as avoiding obstacles, deceleration/acceleration, if the user issues new commands which does not cause a collision, the algorithm starts to apply the new commands providing flexibility to the user. Since all possible worst scenarios are examined one by one, it is guaranteed that the algorithm provides collision free motion in both simulations and real-time tests. A configuration space where worst scenarios can occur is created for the performance measurement of the algorithm, and the same space is used in all tests. By giving different speed commands in the specified configuration space, the performance of the algorithm at different speeds is observed on the stabilized gun turret. For the measurement of the performance under the noisy speed commands, a custom noisy speed command of about 1000s is created and both simulation and real-time tests are performed. As a result of these tests, it is shown that there is no collision. Finally, by adding cascade position control loop, the departure from the starting point to the desired target point is achieved without any collision. The most important feature that distinguishes this algorithm from others is both speed and position can be controlled and during transition phase, the target point can be changed instantly. In addition, no target position is required for the system to move collision-free, only axis speed commands are sufficient. Since the algorithm does not intervene in the speed and torque loops in contrast to potential field-based methods, it can be added to ready-to-use systems by manipulating only the speed references.