This paper proposes an algorithm capable of regenerating gait patterns online. The algorithm is designed using the Model Predictive Control (MPC) framework, with the Linear Inverted Pendulum Model as the basis of the predictive model. For bipedal robot walking, it divides ZMP (Zero Moment Point) constraints into single-leg support, double-leg support, and start-end phases, reformulating them into a complete quadratic programming problem. This approach allows for adjustments to both the foot placement and the timing of steps to maintain dynamic stability during walking. To address the limited contact force sensing capability between the robot and the ground in the gait generator, pressure sensors on both feet of the robot are used to monitor pressure distribution, adjusting the allocation of pressure between the feet accordingly. Finally, simulation and experimental results demonstrate the performance of the proposed method. The controller maintains dynamic stability for the bipedal robot when walking on either soft artificial grass or hard wooden boards.