This paper introduces an intelligent system based on single chip microprocessor for motor speed control, which can control the operation of servo motor. The design scheme has been proved well in the application of motor speed control, and the overall control process is very stable and has an ideal positioning accuracy, which can meet the control requirements of the actual system.
Servo motor can be divided into DC servo motor and AC servo motor. Because AC servo motor has the advantages of small size, light weight, large torque output, low inertia and good control performance, it is widely used as an actuator in automatic control system and automatic detection system, and converts control signal into mechanical rotation of the rotating shaft. Because of the high positioning accuracy of servo motors, more and more position control systems with AC servo motors as their main components are used in modern position control systems.
The design of this paper is also used in the speed control system of motors. The system uses AC servo motor as three-phase AC motor. The UN/W three-phase electric field controlled by driver forms electromagnetic field. The rotor rotates under the action of this magnetic field. At the same time, the motor feedback the speed signal to the driver by the proximity sensor. The driver adjusts the rotation angle of the rotor according to the comparison between the feedback value and the target value. Servo motor is also called executive motor. In the automatic control system, it is used as an executive component to convert the received electrical signal into the angular displacement or angular velocity output of the motor shaft. STC89C52 single chip computer is used to construct a minimal system, which realizes two relays with adjustable pulse width output control and intelligent control of forward and backward motor, so as to achieve precise displacement control of servo motor.
By comparing the speed of the motor with the speed of the motor fed back by the speed sensor, the PID algorithm is adopted and the pulse signal is transformed into the corresponding pulse signal through the photoelectric coupler to adjust the opening of the relay. By adjusting the pulse width of the relay, the modulation of the pulse width can be achieved, so as to control the positive and negative displacement of the magnetic block on the servo motor, so that the motor can achieve the given speed.
At the same time, the MCU receives the feedback pulse signal generated by the speed sensor fixed on the axis of the servo motor as the motor rotates, and displays the actual speed of the motor in real time on the LED. The hardware structure of the system is based on single-chip computer. The functions of the system are external interrupt, timing interrupt, sensor pulse signal detection, input and output, etc. STC89C52’s ports of P 0.0, P 0.1 and P 0.2 are used as input of key SET, MO’dE and UP respectively. Pulse transmission frequency is controlled by timing interruption of timer T 0 of STC89C52, and then motor speed 121 is controlled. Because SCM belongs to TFL circuit (the level of logic 1 “and 0” is 2.4V and 0.4V and 0.4V), its I/0 port output switch control signal level can not directly drive the motor, so it needs to add a driving circuit to control the fan signal output terminal at P2.
6 port; the same applies to the speed-down output terminal of P2.7 port. The system is driven by optocoupler and triode, and controlled by the output channel of optocoupler, so it has a strong ability of noise suppression and isolation, and can prevent strong electromagnetic interference.
The software of the controller mainly completes the functions of LED display, accepting keyboard input, uniform operation of servo motor and relay control, including main program, key interrupt service program, timer T0 interrupt service program and LED display subroutine. In the AC servo motor control system, the main function of single chip computer is to generate pulse sequence, which is transmitted through the 33.2 port of STC89C52. The system software is programmed with timer timing interruption to generate periodic pulse sequence without software delay and CPU occupation. CPU can handle other events in non-interrupt time, only when the interrupt time is reached, the servo motor can be driven to rotate one step. The flow chart of the system program is shown in Figure 1. There are three keys on the panel and SET, MOVE and UP related to this subroutine. Their functions are divided into grJ, which is SET used to determine settings.
There are four bits, ten bits, hundred bits and thousand bits. MOVE is used to select which one. UP controls the increase of the controlled position, each increase, circulating between 0 and 9.
When the user determines its input, he can press SET. The program determines the given speed of the servo motor according to the input value. Finally, the set value is stored in the corresponding variables. The single-chip computer interrupts once every turn of the motor.
By detecting the time interval between two interruptions and counting the timer, we can calculate the speed of the motor.
In order to realize speed detection, speed interruption should be configured as the highest interruption priority INTO. The block diagram of interrupt counting is shown in Figure 2 below. In general, PI regulation is easy to achieve. If the system performance requirements are not high, only PI control is needed. In the formula, e(k) and e(k-1) are deviated inputs of the K and k-1 beats, c(K) and c(k-1) are the values of the K and k-1 beats of the output of the proportional integration algorithm, T is the operation step, kn is the proportion coefficient of PI operation, and TN is the integral time constant. After realizing the real-time detection of motor speed, we can use closed-loop control to adjust the motor speed. The control block diagram of the speed is shown in Figure 3.
Among them, Nr is the speed set by the key, thermostatic element and N is the actual speed output value. This system studies the realization process of speed control of AC servo motor based on MCU. In the practical application of the matching device for producing speed control motor, it reduces the cost of system design and greatly improves the overall performance index of the system.