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.
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
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- What medium is used to start the pins when they are all low level?
- Is ADI technology still here?
- Hot topic: 2019 College Entrance Examination: What impact will the arrival of the 5G era have on the college entrance examination and universities?
- 12/06 @Shanghai World Peace Group ADAS-NXP S32V in-depth technical seminar invites you to participate!
- Showing off my products + the boards I have played with over the years + DIY boards
- EEWORLD University Hall----Live Replay: The coming is coming, typical applications in the era of the Internet of Things: Maxim's easy-to-understand low-power MCU
- Free trial: ST dual-core wireless MCU STM32WB55 development board
- Find high frequency load resistor data
- EEWORLD University Hall----Engineering Application of Random Signal Analysis
- On the last day of 2019, make a New Year’s wish for 2020!