With the massive popularization of distributed generators, optimal economic dispatch has been a key optimization problem to maintain stable and efficient work of the whole system. In this paper, a new smooth reconstruction penalty function with continuous and piecewise linear differential is designed to deal with generation power constraints, which promotes to obtain a better suboptimal solution compared with the existing smooth penalty methods. A distributed predefined-time optimal economic dispatch strategy is presented by utilizing a time-based function. By employing the proposed strategy, the minimization of the generation cost with transmission loss under the power balance constraint and generation minimum/maximum constraints can be realized within a predefined settling time. The performance of the proposed optimization strategy is evaluated by simulations and hardware-in-the-loop experiments in terms of validity verification, robustness to load change and topology reconfiguration, plug-and-play functionality, and comparison with the existing results to illustrate the advantages of fast convergence and near optimal results.