Research on the Speed ​​Control System of AC Servo Motor Based on Single Chip Microcomputer

Publisher:自在堂Latest update time:2013-02-20 Source: dzsc Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
    Servo motors are control motors, which are divided into DC servo motors and AC servo motors. Due to the advantages of AC servo motors such as small size, light weight, large torque output, low inertia and good control performance, they have been widely used in automatic control systems and automatic detection systems as actuators to convert control electrical signals into mechanical rotation of the shaft. Due to the high positioning accuracy of servo motors, modern position control systems have increasingly adopted position control systems with AC servo motors as the main components. The design here also achieves the purpose of controlling the pulse width by controlling the closing and opening of the relay, and controls the displacement of the sliding magnetic block of the non-standard AC servo motor through closed-loop control, and uses the change of the magnetic field to achieve the purpose of controlling the motor speed.

  1 AC servo motor control system design

  The AC servo motor used in the system is a three-phase AC motor; the driver controls the U/V/W three-phase electricity to form an electromagnetic field; the rotor rotates under the action of this magnetic field, and the motor feeds back the speed signal to the driver through the proximity sensor; the driver compares the feedback value with the target value and adjusts the angle of rotation of the rotor. The servo motor, also known as the actuator motor, is used as an actuator in the automatic control system to convert the received electrical signal into the angular displacement or angular velocity output on the motor shaft.

  2 System Hardware Design

  This project essentially uses the STC89C52RC single-chip microcomputer to build a minimum system to achieve pulse width adjustable output to control two relays, realize the forward and reverse intelligent control of the motor, and thus achieve precise displacement control of the servo motor. The control system composition is shown in Figure 1.


  The required speed value of the motor is input by pressing the button and compared with the motor speed fed back by the speed sensor. The PID algorithm is used and converted into a corresponding pulse signal after being processed by the single-chip microcomputer. The opening of the relay is then adjusted by the photoelectric coupler. By adjusting the pulse width of the relay, pulse width modulation is achieved, thereby controlling the positive and negative displacement of the magnetic block on the servo motor to make the motor reach a given speed value. At the same time, the single-chip microcomputer receives the feedback pulse signal generated by the speed sensor fixed on the servo motor shaft as the motor rotates, and displays the actual speed of the motor on the LED in real time.

  2.1 Hardware Design of MCU Controller

  A motion controller software system is developed here. The hardware structure of the system is developed based on a single-chip microcomputer, and the functions used are external interrupts, timer interrupts, sensor pulse signal detection, and input/output. The P0.0, P0.1, and P0.2 ports of STC89C52RC are used as input ports for the SET key, the MOVE key, and the UP key respectively. The pulse transmission frequency is controlled by the timer interrupt of the STC89C52 timer T0, thereby controlling the speed of the motor. The system schematic diagram is shown in Figure 2.


  2.2 Hardware design of driving circuit

  Since the microcontroller is a TTL circuit (the levels of logic 1 and 0 are 2.4 V and 0.4 V respectively), the switch control signal level output by its I/O port cannot directly drive the motor, so a drive circuit needs to be added to the output end of the P2.6 port to control the speed increase signal; similarly, the drive circuit is also applied to the speed reduction output end of the P2.7 port. The system uses optocouplers and transistors as drivers, and the output channel of the optocoupler is transmitted to the control motor, so it has a strong ability to suppress noise interference, plays an isolation role, and can prevent strong electromagnetic interference; the transistor mainly plays a power amplification role. The motor drive circuit is shown in Figure 3. [page]


  3 System Software Design

  The software of the controller mainly completes the LED display, accepts keyboard input, realizes the servo motor uniform speed operation and relay control functions, including the 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 the microcontroller is to generate a pulse sequence, which is sent through the P3.2 port of the STC89C52RC. The system software uses the timer timing interrupt to generate a periodic pulse sequence, does not use software delay, and does not occupy the CPU. The CPU can process other events during the non-interrupt time, and only when the interrupt time comes, it will drive the servo motor to rotate one step. The system program flow chart is shown in Figure 4.


  3.1 Key preset subroutine

  There are 3 keys on the panel related to this subroutine, they are SET, MOVE and UP, their functions are: SET is used to determine the setting position, there are 4 positions, including ones, tens, hundreds and thousands; MOVE is used to select that position; UP controls the increase of the controlled position, each increase, cycle between 0 and 9. When the user confirms his input, he can press the SET key, and the program will determine the given speed of the servo motor when it is working according to the input value. Finally, the set value is stored in the corresponding variable. The key subroutine flow is shown in Figure 5.

[page]


  3.2 Timer interrupt service subroutine

  The microcontroller interrupts once every time the motor rotates. The motor speed can be calculated by detecting the time interval between two interrupts, that is, by counting the timer. In order to realize the speed detection, the speed interrupt needs to be configured as the highest interrupt priority INTO. The flowchart of the interrupt counting program is shown in Figure 6.

  3.3 PID control algorithm of speed

  As a product of the combination of fuzzy control and PID control, fuzzy adaptive PID control has the advantages of wide speed regulation range, fast adjustment speed and no need to master the precise mathematical model of the controlled object, as well as simple structure and easy implementation. According to the law of linear motor position motion, the basic idea of ​​fuzzy adaptive PID control is: when the error is large, it is necessary to increase the weight of the error control effect to quickly eliminate the error and improve the system response speed; when the error is small, it is necessary to increase the weight of the error change control effect to avoid overshoot and make the system enter a steady state as soon as possible. According to the above rules, a fuzzy reasoning rule table for the fuzzy adaptive PID control system can be designed. Table 1 gives an example of the fuzzy adjustment rule of KP. Among them, e(k) and △e(k) are the position error and its change, respectively. The form of fuzzy reasoning rules is:


  The principle of fuzzy adaptive PID control is shown in Figure 7.


  The parameter adjustment value of fuzzy PID is:


  In the formula: j is the number of rule conditional statements, j=1, 2,…, n; ukxy(Cx) is the membership degree of Kx in each rule statement; Cx is the central value of the fuzzy domain of the fuzzy subset obtained by the parameter x.

  After the real-time detection of the motor speed is realized, the closed-loop control can be used to adjust the motor speed. The speed control block diagram is shown in Figure 8.
Its calculation is shown in formula (2):




  Where: Nr is the speed set by the button; N is the actual speed output value. The PI controller is programmed by the STC89C52RC microcontroller to achieve the control deviation △N between the actual speed and the set speed.

  4 Conclusion

  This system studies the use of a single-chip microcomputer as a controller to control non-standard AC servo motors, effectively utilizes the internal resources of the single-chip microcomputer, and has a detailed understanding of the operating characteristics of the corresponding motor motion control system. In the actual application of supporting devices for the production of speed-regulating motors, the system cost is reduced and the system performance is improved.

References:

[1]. STC89C52RC datasheet http://www.dzsc.com/datasheet/STC89C52RC_.html.
[2]. TTL datasheet http://www.dzsc.com/datasheet/TTL_1174409.html.

Reference address:Research on the Speed ​​Control System of AC Servo Motor Based on Single Chip Microcomputer

Previous article:Development of high-precision weighing system based on single-chip microcomputer
Next article:Design of wireless data transmission system based on single chip microcomputer

Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号