A control device which controls a driving device that moves a moving body, comprising: an acquisition part that acquires a position of each of actual obstacles which may obstruct movement of the moving body along a target trajectory; and a model prediction control part that moves the moving body along the target trajectory by calculating a control input and supplying the control input to the driving device based on a prediction model, determines presence/absence of the actual obstacle to be avoided according to information from the acquisition part, and uses a baseline cost function, containing a weight coefficient Q indicating a weight of the state amount in a stage cost function and a weight coefficient R indicating a weight of the control input, as the stage cost function when there is no actual obstacle to be avoided, wherein the control input minimizes a value of an evaluation function comprising a sum of stage cost function in a predicted trajectory of a prescribed time width, and the prediction model is used for predicting a position of the moving body from the control input to the driving device, and the control device being characterized in that the model prediction control part comprises an obstacle avoidance control unit that operates when there are a plurality of the actual obstacles to be avoided, decides a position of an additional obstacle from the positions of the plurality of actual obstacles acquired by the acquisition part so as to be positioned between the plurality of actual obstacles, and calculates the control input that minimizes the evaluation function by using, as the stage cost function, an addition result of the baseline cost function and an additional obstacle evaluation term for which a prescribed function, which uses, as parameters, at least the position of the additional obstacle and the position of the moving body, is multiplied by an additional obstacle weight, when there are two or three actual obstacles to be avoided, the obstacle avoidance control unit decides the position of the additional obstacle to a position which is equidistant from the two or three actual obstacles and has the shortest distance to each of the actual obstacles. an acquisition part that acquires a position of each of actual obstacles which may obstruct movement of the moving body along a target trajectory; and a model prediction control part that moves the moving body along the target trajectory by calculating a control input and supplying the control input to the driving device based on a prediction model, determines presence/absence of the actual obstacle to be avoided according to information from the acquisition part, and uses a baseline cost function, containing a weight coefficient Q indicating a weight of the state amount in a stage cost function and a weight coefficient R indicating a weight of the control input, as the stage cost function when there is no actual obstacle to be avoided, wherein the control input minimizes a value of an evaluation function comprising a sum of stage cost function in a predicted trajectory of a prescribed time width, and the prediction model is used for predicting a position of the moving body from the control input to the driving device, and the control device being characterized in that the model prediction control part comprises an obstacle avoidance control unit that operates when there are a plurality of the actual obstacles to be avoided, decides a position of an additional obstacle from the positions of the plurality of actual obstacles acquired by the acquisition part so as to be positioned between the plurality of actual obstacles, and calculates the control input that minimizes the evaluation function by using, as the stage cost function, an addition result of the baseline cost function and an additional obstacle evaluation term for which a prescribed function, which uses, as parameters, at least the position of the additional obstacle and the position of the moving body, is multiplied by an additional obstacle weight, when there are two or three actual obstacles to be avoided, the obstacle avoidance control unit decides the position of the additional obstacle to a position which is equidistant from the two or three actual obstacles and has the shortest distance to each of the actual obstacles.