A control device (control unit (4)) to be used for controlling a scanning electromagnet (31) that is used for scanning irradiation, which includes: a command-value processing line (a memory (42), an arithmetic circuit (43), an interface (46)) that generates a command value for driving the scanning electromagnet (31) on the basis of a treatment plan, and outputs the generated command value in synchronization with an accelerator (10) and a comparator unit (45) that detects an error in the processing line wherein a circuit (for example, the arithmetic circuit (43)) that constitutes at least a part of the processing line is made redundant, and the comparator unit (45) detects occurrence of the error in the processing line when outputs from the circuit made redundant are unmatched to each other.