This paper investigates the utility of nonlinear optimal feedback control for a rotary pendulum based on deep learning. The neural network trained with supervised learning using solutions of the minimum-time optimal control problem provides the feedback controller, which generates control variables by current state variables. The utility of the proposed idea is verified by the numerical simulation and experiment considering the pendulum angular velocity constraint. Results demonstrate the feasibility of commanding the rotary pendulum with the proposed nonlinear feedback controller.