When a first condition that a time in which magnitude of a first detection force detected by a force detection unit is larger than a first force threshold value continued for a time longer than zero and shorter than a first time threshold value is satisfied in teaching, a movable unit is moved in a predetermined amount in a direction according to a direction of the first detection force. When a second condition that magnitude of a second detection force detected by the force detection unit is larger than a second force threshold value that is larger than the first force threshold value is satisfied during movement of an end effector, the movable unit is decelerated or stopped.