Stepping motor control system based on Fuzzy-PID
By combining fuzzy control and PID control, the Fuzzy-PID system solves the problem of high-precision control of stepper motors in nonlinear environments, achieving stable speed and precise control of the system under different environments, and reducing system costs.
Patent Information
- Application Number
- CN202423229421.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Utility models(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-26
- Publication Date
- 2026-01-02
- Estimated Expiration
- 2034-12-26
AI Technical Summary
Existing stepper motor control systems struggle to achieve high-precision control when the environment changes, and conventional PID control methods are ineffective in nonlinear and time-varying environments.
A fuzzy-PID-based control system is adopted, which combines fuzzy control and PID control. By adjusting the parameters KP, KI, and KD online, precise control of the stepper motor is achieved.
High-precision stepper motor control was achieved in nonlinear environments, reducing system costs, and parameter adjustment was realized in different environments through simple human-machine interaction.
Smart Images

Figure CN223758197U_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The utility model relates to a kind of stepping motor control system based on Fuzzy-PID. BACKGROUND
[0002] Stepping motor automatic control system is widely used in machinery, steel, mine, metallurgy, chemical industry, petroleum, textile, military industry and other industries.Effective control motor, improve its operating performance, it has very important practical significance to national economy.The conventional classic PID control method is mainly for linear process with exact model, but the speed regulation system formed by many motors actually has nonlinear, time-varying, disturbance and other characteristics, with the change of environment, the parameters of object or even structure can change, and it is difficult to achieve ideal control effect using the originally set PID parameters to implement control. SUMMARY
[0003] The stepping motor control system based on Fuzzy-PID provided by the utility model overcomes the nonlinearity of parameters caused by environmental changes, so that the control system can better control the number of steps in a nonlinear environment, and fuzzy PID control is used to meet different control requirements, and high-precision control can be achieved when fuzzy PID control is used.The utility model has the characteristics that some important parameters are input through keyboard to meet different requirements, the number of chips used is small, and the entire control volume is small, so as to overcome the defects of prior art.
[0004] The utility model patent adopts the following technical solutions to solve the technical problems:
[0005] The utility model patent has the characteristics that the stepping motor control system based on Fuzzy-PID comprises a processor module, a display module, a key circuit module, a motor drive module, a photoelectric sensor feedback circuit, fuzzy gain adjustment PID control, a photoelectric sensor and a stepping motor.
[0006] The processor module is composed of an ATC89C52 single-chip microcomputer, a reset circuit and an oscillation circuit; the AT89C52 single-chip microcomputer generates a digital control signal; the reset circuit is used for initializing the ATC89C52 single-chip microcomputer; and the clock circuit is used for generating a clock signal of the ATC89C52 single-chip microcomputer.
[0007] The display module is composed of an LCD1602 and is used for real-time display of data.
[0008] The motor driving module is mainly composed of seven pull-up resistors, a driver ULN2003A and a five-step four-phase stepping motor; the driver ULN2003A is a seven-way inverter circuit, that is, when the input end is high level, the output end of the driver ULN2003A is low level; when the input end is low level, the output end of the driver ULN2003A is high level; the pulse signal is transmitted to the stepping motor through the driver, and the angular displacement is controlled by controlling the number of pulse signals, so that the acceleration and speed of the stepping motor are accurately controlled.
[0009] The photoelectric sensor feedback circuit converts the speed change of the stepping motor into the change of the optical signal by the photoelectric sensor, then converts the optical signal into a digital signal recognizable by the ATC89C52 single-chip microcomputer by the photoelectric element, and transmits the digital signal to the ATC89C52 single-chip microcomputer for control.
[0010] The key circuit module is mainly composed of four keys K1, K2, K3 and K4, wherein K1 is an acceleration key, K2 is a deceleration key, K3 is a start key, and K4 is a stop key.
[0011] The Fuzzy-PID control is mainly the combination of PID control and fuzzy control, the parameters of the PID are adjusted on line by using fuzzy rules and reasoning, and the parameters are K P , K L and K D , which are proportional gain, integral gain and differential gain in the PID, so that the local performance is improved, and the purpose of accurate speed control is achieved.
[0012] The stepping motor control system based on Fuzzy-PID has the characteristics that:
[0013] The ATC89C52 single-chip microcomputer is connected with the left port of the driver ULN2003A through P0.0-P0.6, connected with the D0-D7 pins of the LCD1602 through the P1 port, connected with the keys K1, K2, K3 and K4 through P2.4, P2.5, P2.6 and P2.7, and connected with the photoelectric feedback circuit through P3.6.
[0014] The right end C1-C4 of the driver ULN2003A is connected with the stepping motor; the pulse signal is transmitted to the stepping motor through the four pins.
[0015] Compared with the prior art, the utility model patent has the beneficial effects that:
[0016] The utility model patent takes Fuzzy-PID control as the core technology, first can overcome the nonlinearity of parameter caused due to environmental change, and the control system can better control the step number under the nonlinear environment.
[0017] The utility model patent adopts simple man-machine exchange some important parameters through the keyboard input, which can not only realize high-precision positioning but also can carry out parameter control according to different deviation requirements.
[0018] The utility model patent is based on the minimum system of singlechip and greatly reduces the cost of system. BRIEF DESCRIPTION OF DRAWINGS
[0019] Figure 1 It is the system principle diagram of the stepping motor control system based on Fuzzy-PID in the utility model patent.
[0020] Figure 2 It is the processor module circuit diagram.
[0021] Figure 3 It is the motor drive module circuit diagram.
[0022] Figure 4 It is the photoelectric sensor feedback circuit diagram.
[0023] Figure 5 It is the display module circuit diagram.
[0024] Figure 6 It is the key circuit module circuit diagram.
[0025] Figure 7 It is the adaptive PID control principle diagram in the utility model patent.
[0026] Figure 8 It is the fuzzy controller structure diagram in the utility model patent.
[0027] Fig. 9 is the membership function curve diagram of input E and Ec and output KP, KI, KD.
[0028] Figure 10 It is the rule base diagram of fuzzy control in the utility model patent.
[0029] Figure 11 It is the Mamdani reasoning process diagram.
[0030] Figure 12 It is the PID fuzzy control flow chart.
[0031] Figure 13 It is the stepping motor speed and time curve diagram. DETAILED DESCRIPTION
[0032] The utility model is further described below in combination with the drawings and specific embodiments.
[0033] Embodiments
[0034] Referring to Figure 1 In this embodiment, a Fuzzy-PID-based stepping motor control system comprises a processor module, a display module, a key circuit module, a motor drive module, an optoelectronic sensor feedback circuit module, an optoelectronic sensor, and a stepping motor.
[0035] Referring to Figure 2 The processor module is a minimum system composed of an ATC89C52 single-chip microcomputer, a reset circuit, and a clock circuit. The reset circuit initializes the registers in the single-chip microcomputer to preset values. The oscillation circuit is used to generate a clock signal. In a specific implementation, a capacitor is connected to VCC at the reset pin RST, and a resistor is connected to GND in parallel with the key. When the key is pressed, the capacitor is discharged rapidly, and the voltage difference between the two sides is considered to be zero. After the key is released, a voltage difference is generated across the capacitor to charge it. This process will have a long enough signal to reset the single-chip microcomputer. The typical values of the resistor and the capacitor are 1k and 1μF, respectively. The oscillation circuit is composed of a crystal oscillator and two 30pf components, which are used as the clock signal of the single-chip microcomputer.
[0036] Referring to Figure 3 The ATC89C52 single-chip microcomputer is connected to the left port of the driver ULN2003A through P0.0-P0.6, and the right end C1-C4 of the driver ULN2003A is connected to the stepping motor. The pulse signal is transmitted to the stepping motor through the four pins.
[0037] Referring to Figure 4 The P1 port is connected to the D0-D7 pins of the LCD1602 to transmit the electrical signal to the LCD1602.
[0038] Referring to Figure 5 P2.4, P2.5, P2.6, and P2.7 are connected to the keys K1, K2, K3, and K4, respectively. K1 is an acceleration key, K2 is a deceleration key, K3 is a start key, and K4 is a stop key.
[0039] Referring to Figure 6 P3.6 is connected to the optoelectronic sensor feedback circuit. The optoelectronic sensor first converts the change in the rotational speed of the stepping motor being measured into a change in the optical signal, and then further converts the optical signal into an electrical signal with the aid of the optoelectronic element. The electrical signal is then input into the single-chip microcomputer through the P3.6 port of the single-chip microcomputer for control.
[0040] Referring to Figure 7In the process of exploring fuzzy gain adjustment PID control, we are actually trying to integrate the advantages of fuzzy control and PID control to achieve a complementary effect. This combination aims to make the control system not only flexible to deal with changing nonlinear environment, but also to achieve more accurate control effect. Fuzzy rules and fuzzy reasoning are used to adjust PID parameters online, where the adjustment parameters are K p , K i , K d , which are the proportional gain, integral gain, and derivative gain in PID control, respectively. Since this is a single-input single-output, only the deviation e is controlled and adjusted.
[0041] The PID algorithm applied here is the incremental PID algorithm, whose formula is as follows:
[0042]
[0043] Referring to Figure 8 , the fuzzy controller structure diagram, where E is the speed error, and E c is the speed error rate of change. The domain of speed error E and speed error rate of change is defined as [-3 -2 -1 0 1 2 3], and the fuzzy set is [NB NS ZO PS PD]. The domain of the three outputs is [-3 -2 -1 0 1 2 3], and the output fuzzy set is [NB NS ZO PS PD].
[0044] Referring to Fig. 9, the fuzzification of input and output is realized according to the membership function of input and output. Here, a triangular membership function is used.
[0045] Referring to Figure 10 , the rule base is established according to expert experience, and the rules are as follows:
[0046] (1) When the error |e| is large, in order to make the system have good fast tracking performance, regardless of the trend of error change, a larger K p , a smaller K d , and a smaller integral action should be taken to avoid large overshoot in system response.
[0047] (2) When the error |e| is medium, in order to make the system response have smaller overshoot, K p should be smaller, and K i and K d should be moderate in size. The value of K d has a greater impact on system response.
[0048] (3) When the error |e| is small, in order to ensure that the system has good steady-state performance, Kp and K i Should be taken more, while to avoid the system in the set value around the emergence of oscillation, and consider the anti-interference performance of the system, when | ec | is small, K d Can be taken more; when | ec | is large, K d Should be taken small.
[0049] According to the principle as above, the form of "IF A and B THEN C and D and E" is determined.
[0050] Referring to Figure 11 , the reasoning result obtained by using Mamdain reasoning is that when e =-1.14, ec =-1.29, it is the value formed by fuzzifying the difference between the given value and the measured value c(t) and the difference between the last several step loss numbers. It corresponds to the value K p =0.0268, K i =-0.0142, K d =-0.613 that the PID parameters need to take.
[0051] Referring to Figure 12 , the PID fuzzy control flow chart, the actual program is written by using Keil software.
[0052] Referring to Figure 13 , the step motor is controlled by using adaptive fuzzy PID control, and through a series of software debugging, the system is basically stable. Here, we set the stable rated speed of the step motor to 90, and the time and actual speed curve diagram of the system after starting is obtained. Our observation time is 70 seconds to observe the speed, and the relationship between the speed of the step motor and the time can be obtained from the curve diagram. It can be easily seen that when the motor starts, the speed reaches 92 after about 20 seconds, and the overshoot appears in the subsequent time. With the continuation of time, the system is slowly stabilized under the regulation of the system.
[0053] The above described embodiments are only part of the embodiments of the present application, not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor belong to the scope of protection of the present application.
Claims
1. A Fuzzy-PID based stepper motor control system, characterized in that, Include: Processor module, display module, key circuit module, motor drive module, photoelectric sensor feedback circuit, fuzzy gain adjustment PID control, photoelectric sensor, stepping motor; The processor module is composed of ATC89C52 single-chip microcomputer, reset circuit and clock circuit; the AT89C52 single-chip microcomputer generates digital control signal; the reset circuit is used for initializing the ATC89C52 single-chip microcomputer; the oscillation circuit is used for generating the clock signal of the ATC89C52 single-chip microcomputer; The display module is composed of LCD1602 and is used for real-time display of data; The motor drive module is mainly composed of seven pull-up resistors, driver ULN2003A and a five-step four-phase stepping motor; the driver ULN2003A is a 7-way inverter circuit, that is, when the input end is high level, the output end of the driver ULN2003A is low level; when the input end is low level, the output end of the driver ULN2003A is high level; the pulse signal is transmitted to the stepping motor through the driver, and the angular displacement is controlled by controlling the number of pulse signals, so as to accurately control the acceleration and speed of the stepping motor; The photoelectric sensor feedback circuit is used for converting the speed change of the stepping motor into the change of the optical signal, and then converting the optical signal into a digital signal recognizable by the ATC89C52 single-chip microcomputer by means of the photoelectric element, and transmitting to the ATC89C52 single-chip microcomputer for control; The key circuit module is mainly composed of four keys K1, K2, K3 and K4, wherein K1 is an acceleration key, K2 is a deceleration key, K3 is a start key, and K4 is a stop key; The fuzzy gain adjustment PID control is mainly the combination of PID control and fuzzy control, and the parameters of PID are adjusted on line by using fuzzy rules and reasoning, and the parameters are K P , K L , K D , which are the proportional gain, integral gain and differential gain in PID, and the local performance is improved to achieve the purpose of precise control speed.
2. The Fuzzy-PID based stepper motor control system according to claim 1, characterized in that: The ATC89C52 single-chip microcomputer is connected with the left port of the driver ULN2003A through P0.0-P0.6; connected with the D0-D7 pins of the LCD1602 through the P1 port; connected with the keys K1, K2, K3 and K4 through P2.4, P2.5, P2.6 and P2.7; connected with the photoelectric feedback circuit through P3.
6.
3. The Fuzzy-PID based stepper motor control system according to claim 1, wherein: The right end C1-C4 of the driver ULN2003A is connected with the stepping motor; the pulse signal is transmitted to the stepping motor through the four pins.