The mobile robot is a system that can work in various environments. This means that the robot must be able to navigate without delay and avoid any obstacles placed within the boundaries of its movement. Designing mobile robots that can be intelligently managed and operate autonomously when traveling from one place to another requires at least two steps. To start with, path planning is required to prevent motion collisions. Tracking the robot's trajectory is a crucial second task. The primary goal of this study is to find the quickest and safest path between the two positions. In this work, we investigated the path planning of a mobile robot with dynamic, and dynamic obstacles with moving goal environments using RRT, BiRRT, and HA* algorithms. These algorithms are easy, computationally inexpensive, and simple to use. They have been chosen for numerous real-time path-planning applications. The DDMR's kinematic model has been utilized in this paper to control path tracking, and a PID controller has been proposed to reduce tracking deviations between the robot's actual route and the reference trajectory. This work introduced the PSO, FPA, CSA, SSA, BWOA, and proposed HBPO optimization techniques for obtaining PID parameters (k_p,k_i,k_d) for improved mobile robot trajectory tracking. The simulation results have been examined using three trajectory shapes: step, circular, and infinite. The simulation findings reveal that HA* outperforms the other algorithms by generating collision-free pathways that are smoother and shorter than their RRT and BiRRT equivalents. On the other hand, the proposed HBPO outperforms the other methods. The HBPO method converges quicker than the other proposed algorithms.