Description Electromagnetic Clutch for Motor Technical Field of the Invention The invention relates to a clutch, in particular to an electromagnetic clutch for a motor. Background of the Invention For motors using electromagnetic clutches in the prior art, an electromagnetic clutch is generally provided in a cavity formed by the casing and end cover of an electromagnetic motor. As the structure of the motor is complex, the motor rotor will be easily damaged if the clutch action of an electromagnetic clutch device directly acts on it, resulting in shortened service life of the motor; on the other hand, as the coil winding of the motor rotor is close to the coil of the electromagnetic clutch, mutual influence between the motor rotor and the electromagnetic clutch device may be easily caused, which may result in failure of the electromagnetic clutch device, so that the clutch performance of the electromagnetic clutch device is unreliable. Summary of the Invention The purpose of the invention is to provide an electromagnetic clutch for a motor, which is simple in structure, conducive to prolong the service life of the motor, convenient for assembling and reliable in clutch performance. The above technical purpose of the invention is solved by the technical solution as follows. An electromagnetic clutch for a motor is provided, comprising: a casing, and an input transmission component and an output shaft, which are coaxially arranged. An electromagnetic brake coil and an electromagnetic clutch coil, which are fixed in an axial direction, are provided at two ends inside the casing, respectively, and the electromagnetic brake coil is fixed with the casing. The input transmission component is rotatably 1 supported on the casing and one end of the input transmission component extends into the casing. The electromagnetic clutch coil is fixedly arranged on an inner end of the input transmission component. An output shaft is supported on the casing to be movable in the axial direction, an inner end of the output shaft extends between the electromagnetic brake coil and the electromagnetic clutch coil, and a flywheel is fixedly arranged at the inner end of the output shaft. When in use, the electromagnetic clutch is provided between a reduction gear box and a motor output shaft, the output shaft of the motor is fitted with the input transmission component while the output shaft is fitted with an input end of the reduction box, the electromagnetic brake coil and the electromagnetic clutch coil control a controller via lead wires, respectively, the electromagnetic clutch coil generates magnetism when powered on, the magnetism causes the output shaft to move in the axial direction and the flywheel to be adsorbed by an iron core of the electromagnetic clutch coil, so that a moment output by the motor can be transmitted to the output shaft through the input transmission component and further transmitted to the reduction gear box through the output shaft. The electromagnetic brake coil generates magnetism when powered on, the magnetism causes the output shaft to reversely move in the axial direction to be adsorbed with the iron core of the electromagnetic brake coil and separated from the input transmission component, thereby braking, the counter force generated by braking does not act on the motor output shaft, thus preventing the motor output shaft and the motor rotor from being damaged, and prolonging the service life of the motor. Preferably, a brake lining is arranged on an end of the electromagnetic brake coil approaching to the flywheel, and a clutch lining is arranged on an end of the electromagnetic clutch coil approaching to the flywheel. The brake lining can enhance the friction force between the iron core of the electromagnetic brake coil and the flywheel during absorbing, thereby improving the brake performance; and the clutch lining can enhance the friction force between the iron core of the electromagnetic clutch coil and the 2 flywheel during absorbing, thereby improving the transmission performance. Preferably, the casing consists of a left end and a right end fitted with each other, and the left end and the right end are connected through screws. Preferably, the input end of the input transmission component is of a hollow structure, and an inner wall of the hollow structure is provided with a transmission tooth groove or a key groove. Therefore, the invention is characterized in simple structure and reliable clutch performance, and is conducive to prolong the service life of the motor and convenient for assembling. Brief Description of the Drawings Fig. 1 is a structure diagram of the invention. Detailed Description of the Invention The technical solutions of the invention will be further described in details as below by specific embodiments with reference to drawings. Embodiment 1 As shown in Fig. 1, a casing consists of a left end 1 and a right end 1 fitted with each other, and the left end 1 and the right end 1 are connected through screws. An electromagnetic brake coil 4 and an electromagnetic clutch coil 5, which are fixed in an axial direction, are arranged at two ends inside the casing, respectively. The electromagnetic brake coil 4 is provided with an iron core 6 in the center and fixed with the casing. An output shaft 7 and an input transmission component 8 are coaxially arranged. The iron core 6 is provided with a through hole in the center for the output shaft 7 to pass through. The electromagnetic clutch coil 5 is provided with an iron core 10 in the center. The input transmission component 8 is rotatably supported on the casing and one end of the input transmission component extends into the casing. The input end of the input transmission component 8 is in a hollow structure, and the inner wall of the hollow structure is provided with a transmission tooth groove 3 13. The electromagnetic clutch coil 5 is fixedly arranged on an inner end of the input transmission component 8. The output shaft 7 is supported on the casing and capable of moving in the axial direction. An outer end of the output shaft is provided with a key groove 14 fitted with a gear box. An inner end of the output shaft 7 passes through the central through hole of the iron core 6 and extends between the electromagnetic brake coil 4 and the electromagnetic clutch coil 5; and a flywheel 9 is fixed at the inner end of the output shaft. A brake lining 11 is arranged on an end of the electromagnetic brake coil 4 approaching to the flywheel 9, and a clutch lining 12 is arranged on an end of the electromagnetic clutch coil 5 approaching to the flywheel 9. 4