A controller for a motor, the motor being configured to turn a steered wheel and including a first stator coil and a second stator coil insulated from each other, the controller being configured to operate a first drive circuit connectable to the first stator coil and a second drive circuit connectable to the second stator coil, the controller comprising a first processing circuit and a second processing circuit configured to communicate with each other, the first processing circuit being configured to execute a first operation amount calculation process, an operation process, and an output process, the first operation amount calculation process being a process of calculating a first operation amount including a feedback operation amount calculation process such that a convertible angle that is based on a detection value from a first angle sensor is fed back to a target angle, the convertible angle being an angle convertible into a steered angle of the steered wheel, the operation process being a process of operating the first drive circuit based on the first operation amount, the output process being a process of outputting the first operation amount to the second processing circuit, the second processing circuit being configured to execute a second operation amount calculation process, a first use operation process, a second use operation process, and an elimination process, the second operation amount calculation process being a process of calculating a second operation amount such that a convertible angle that is based on a detection value from a second angle sensor is fed back to the target angle, the second operation amount calculation process including a process of calculating the second operation amount based on an output of an integral element depending on a difference between the convertible angle and the target angle, the first use operation process being a process of operating the second drive circuit based on the first operation amount, the second use operation process being a process of operating the second drive circuit based on the second operation amount, characterized in that the elimination process being a process of eliminating, along with switching from the first use operation process to the second use operation process, an effect of the integral element on the second use operation process before the switching from the second operation amount. the motor being configured to turn a steered wheel and including a first stator coil and a second stator coil insulated from each other, the controller being configured to operate a first drive circuit connectable to the first stator coil and a second drive circuit connectable to the second stator coil, the controller comprising a first processing circuit and a second processing circuit configured to communicate with each other, the first processing circuit being configured to execute a first operation amount calculation process, an operation process, and an output process, the first operation amount calculation process being a process of calculating a first operation amount including a feedback operation amount calculation process such that a convertible angle that is based on a detection value from a first angle sensor is fed back to a target angle, the convertible angle being an angle convertible into a steered angle of the steered wheel, the operation process being a process of operating the first drive circuit based on the first operation amount, the output process being a process of outputting the first operation amount to the second processing circuit, the second processing circuit being configured to execute a second operation amount calculation process, a first use operation process, a second use operation process, and an elimination process, the second operation amount calculation process being a process of calculating a second operation amount such that a convertible angle that is based on a detection value from a second angle sensor is fed back to the target angle, the second operation amount calculation process including a process of calculating the second operation amount based on an output of an integral element depending on a difference between the convertible angle and the target angle, the first use operation process being a process of operating the second drive circuit based on the first operation amount, the second use operation process being a process of operating the second drive circuit based on the second operation amount, characterized in that the elimination process being a process of eliminating, along with switching from the first use operation process to the second use operation process, an effect of the integral element on the second use operation process before the switching from the second operation amount.