A
nail gun, comprising: a housing (270, 370, 470), an
electric motor (130, 230, 330, 430), an
impact assembly (150, 250, 350), a trigger switch capable of generating a trigger
signal, a position detection unit (110, 210, 310, 410) capable of generating a first preset position
signal indicating that a moving member has reached a first preset position, and a control module, which comprises a
signal receiving unit and a drive
control unit, wherein the signal receiving unit is configured to receive the trigger signal and the first preset position signal, and the drive
control unit is configured to control the operation of the
electric motor; when the control module receives the trigger signal, the drive
control unit drives the
electric motor to operate, and when the control module receives the first preset position signal, the drive control unit controls the electric motor to
brake; in an operation stage of the electric motor, the signal receiving unit receives the trigger signal again, and the drive control unit controls the electric motor to continue operating and ignores the received first preset position signal; and / or, in a braking stage, the signal receiving unit receives the trigger signal again, and the drive control unit controls the electric motor to transition from the braking stage to the operation stage.