A Fuzzy Control Method Based on Arctangent Function for Velocity Programming
By using a fuzzy control method based on speed planning using the arctangent function, the oscillation problem of stepper motors in high-precision control is solved, achieving smooth operation in mechanisms with gaps or backlashes. This method also requires less computation and is suitable for stepper motor control with various transmission methods.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- INST OF OPTICS & ELECTRONICS CHINESE ACAD OF SCI
- Filing Date
- 2023-12-14
- Publication Date
- 2026-07-17
AI Technical Summary
Existing stepper motor motion control methods suffer from oscillation and convergence problems in high-precision control applications, and existing step-count-based acceleration methods are not applicable when there are gaps or backlashes.
A fuzzy control method based on arctangent function is adopted to calculate the running speed of the next cycle through position error, and to control the operation of the stepper motor by combining the maximum speed and acceleration.
It achieves smooth operation without oscillation under high-precision control, is suitable for transmission mechanisms with backlash or idling, has low computational load and strong versatility.
Smart Images

Figure CN117674653B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of stepper motor control technology, specifically relating to a speed planning fuzzy control method based on the arctangent function, which can be used for stepper motor acceleration and deceleration control. Background Technology
[0002] Currently, most methods for stepper motor motion control use trapezoidal control. This method is simple to use, but when used in high-precision control applications, the sudden change in jerk during closed-loop control leads to oscillation and convergence.
[0003] Currently, some scholars have proposed using sine acceleration and parabolic acceleration for stepper motor control. These two methods are more in line with the torque-frequency characteristics of stepper motors. The speed is planned by the number of running steps, and there are no sudden changes in jerk, resulting in smooth operation. However, these two methods are based on the number of steps. When the mechanical structure contains gaps or backlashes, the size of the gaps and the number of running steps are unknown, so these two step-based planning methods are not applicable. A speed planning method based on position error is needed. Summary of the Invention
[0004] To address the aforementioned technical problems, this invention provides a fuzzy control method based on the arctangent function to plan velocity through position error. This method can be used for nonlinear controlled objects and solves the problems of oscillation and low positioning accuracy during trapezoidal control convergence.
[0005] To achieve the above objectives, the technical solution adopted by the present invention is as follows:
[0006] A fuzzy control method for velocity planning based on the arctangent function, characterized in that:
[0007] The controlled object of the method is a motor that can be controlled by pulse width modulation waveform, and the motor drives the mechanism to run;
[0008] The method uses the operating position error, operating speed, maximum speed, maximum acceleration, and maximum position error of the mechanism in the current cycle to infer and calculate the operating speed of the mechanism in the next cycle, thereby controlling the operation of the mechanism;
[0009] The method specifically includes the following steps:
[0010] Step 1: Calculate the position deceleration zone value θ slow The position deceleration zone refers to the zone where the position error of the mechanism in the current cycle is less than θ. slow The area where deceleration begins;
[0011] Step 2: Based on the aforementioned position deceleration zone value and maximum speed value v max Maximum acceleration value a maxThe operating speed value v(k) and operating position error of the current cycle are used to calculate the operating direction and operating speed v(k+1) of the mechanism in the next cycle and are used for control.
[0012] Furthermore, in step 1, the position deceleration zone value θ slow Based on the maximum speed value v of the current cycle of the mechanism max Maximum acceleration a max The specific calculation formula is as follows:
[0013]
[0014] Furthermore, step 2 includes the following steps:
[0015] Let the operating speed of the mechanism in the current cycle be v(k), the operating speed in the next cycle be v(k+1), and the desired position be θ. exp The current position value is θ cur The running position error is θ error , where θ error =θ exp -θ cur θ threshold The positioning threshold, i.e., the maximum permissible positioning error value, is used to determine the running direction and speed v(k+1) of the mechanism in the next cycle based on the calculation results of the following formula:
[0016]
[0017]
[0018] in, arctan(x) is the arctangent function, π = 3.14159… is pi, T is the control period, and sign indicates the direction of the mechanism's running speed, with -1 indicating the negative direction and 1 indicating the positive direction.
[0019] Furthermore, the controlled object is a stepper motor.
[0020] The specific control rules are as follows:
[0021] Rule 1: If the position error θ error If the value is greater than 0, then the direction of the motor-driven mechanism is positive, i.e., sign(v(k+1)) = 1.
[0022] Rule 2: If the position error θ error If the value is less than 0, then the direction of the motor-driven mechanism is negative, i.e., sign(v(k+1)) = -1.
[0023] Rule 3: If the current running cycle position error |θ error |>θslow And the current running speed |v(k)| < v max Then the running speed in the next cycle is |v(k+1)|=|v(k)|+a max ×T;
[0024] Rule 4: If the current running cycle position error |θ error |>θ slow And the current running speed |v(k)| ≥ v max Then the running speed in the next cycle is |v(k+1)|=v max ;
[0025] Rule 5: If the current running cycle position error |θ error |≤θ slow Then the running speed of the next cycle
[0026] Rule 6: If the current running cycle position error |θ error |≤θ threshold Then the speed in the next cycle will be zero.
[0027] The present invention has the following beneficial effects:
[0028] The method described in this invention is applicable to motion mechanisms driven by motors with reduction gears and encoders at the load end. It is suitable for applications requiring high-precision control. Because the acceleration is variable during deceleration and there are no abrupt changes in acceleration, the operation is smoother. Compared to trapezoidal control, it effectively reduces oscillations during convergence. This invention also solves the problem that existing sine acceleration and parabolic acceleration methods are not suitable for structures with gap control, while requiring less computation and having greater versatility. Attached Figure Description
[0029] Figure 1 This is a flowchart of a velocity planning fuzzy control method based on the arctangent function according to the present invention;
[0030] Figure 2 When θ initial =0°, θ exp Motion control curve at 100°;
[0031] Figure 3 When the input is a step input, the control comparison curves of the method of the present invention with those of fuzzy control and PI control methods are shown.
[0032] Figure 4 The diagram shown is the actual control operation diagram of the image despinning mechanism. Detailed Implementation
[0033] The present invention will be further described below with reference to the accompanying drawings and specific embodiments.
[0034] This invention proposes a speed planning fuzzy control method based on the arctangent function. The controlled object of the method is a motor that can be controlled by pulse width modulation waveform, and the motor drives the mechanism to run. The method infers and calculates the running speed of the mechanism in the next cycle by using the running position error, running speed, maximum speed, maximum acceleration, and maximum position error of the mechanism in the current cycle, thereby controlling the operation of the mechanism.
[0035] The method specifically includes the following steps:
[0036] Step 1: Calculate the motor's position deceleration zone value θ slow The position deceleration zone is when the position error is less than θ. slow At that time, it begins to decelerate;
[0037] Step 2: Based on the current cycle's operating position error θ error (θ error =θ exp -θ cur ), position deceleration zone value θ slow and maximum speed value v max Calculate the running direction and speed v(k+1) of the motor-driven mechanism in the next cycle and use them for control.
[0038] In step 1, to reduce the adjustment time of the control system and avoid overshoot and oscillation caused by the movement of the control system during each change of the desired position, the position deceleration zone value θ is set. slow Based on the maximum speed v max Maximum acceleration a max To calculate the position deceleration zone value θ slow The specific calculation formula is as follows:
[0039]
[0040] In step 2, let the operating speed of the mechanism in the current cycle be v(k), the operating speed of the mechanism in the next cycle be v(k+1), and the desired position value be θ. exp The current position value is θ cur The positional error is θ error , where θ error =θ exp -θ cur θ threshold Let the positioning threshold be the maximum permissible position error value, then the velocity planning formula is as follows:
[0041]
[0042]
[0043] in, arctan(x) is the arctangent function, π = 3.14159… is pi, T is the control period, and sign indicates the direction of the mechanism's running speed, with -1 indicating the negative direction and 1 indicating the positive direction.
[0044] The specific control process is as follows: Figure 1 As shown.
[0045] Assume a control mechanism has a maximum speed value v max =5° / s, maximum acceleration a max =20° / s 2 θ threshold = 0.0002°, initial position value θ initial =0°, desired position θ exp =100°:
[0046] Then we have θ slow =3.9789°.
[0047] Assuming the control operation period T is 1ms, according to the rules of the fuzzy control method described in this invention, the desired speed can be calculated from the current position error and speed, thereby calculating the corresponding pulse width modulation (PWM) waveform and outputting it to the motor driver to drive the motor to rotate. The specific rules are as follows:
[0048] Rule 1: If the position error θ error If the value is greater than 0, then the direction of the motor-driven mechanism is positive, i.e., sign(v(k+1)) = 1;
[0049] Rule 2: If the position error θ error If the value is less than 0, then the direction of the motor-driven mechanism is negative, i.e., sign(v(k+1)) = -1;
[0050] Rule 3: If the current running cycle position error |θ error If |>3.9789° and the current operating speed |v(k)|<5° / s, then the motor operating speed in the next cycle will be |v(k+1)|=|v(k)|+0.02;
[0051] Rule 4: If the current running cycle position error |θ error If |>3.9789° and the current operating speed |v(k)|≥5° / s, then the motor operating speed in the next cycle |v(k+1)|=v max =5° / s;
[0052] Rule 5: If the current running cycle position error |θ error If |≤3.9789°, then the mechanism begins to decelerate. The operating speed of the mechanism in the next cycle will be...
[0053] Rule 6: If the current running cycle position error |θ error |≤0.0002° indicates that the desired position has been reached and the position error is within the allowable range, then the velocity in the next cycle will be zero.
[0054] According to the above control rules, when θ initial =0°, θ exp When the angle is 100°, the motion control curve is shown below. Figure 2 As shown.
[0055] Example:
[0056] Taking a 1.2m wide-field telescope as an example, the telescope's focusing and dimming control mechanism includes multiple mechanisms such as focusing, image rotation correction, corrector focusing, and lens cap. Since the transmission mechanisms of each mechanism are different, including ball screw drives, gear drives, worm gear drives, and other transmission methods, each with nonlinear characteristics and varying friction coefficients due to different materials, the fuzzy control method described in this invention is used to control these mechanisms. The control program within the board is consistent, with the maximum speed value, deceleration zone value, maximum position error, and maximum acceleration of each mechanism stored as configurable parameters in the EEPROM. Mechanisms are distinguished by DIP switches; when the controlled object changes, only the configurable parameters need to be changed. This enhances the versatility of the board and program, shortens the debugging cycle, reduces program development time, and facilitates later maintenance. The method described in this invention has low computational load, simple calculation formulas, and significantly reduces the computational performance requirements of the control board while still achieving high control accuracy. Figure 3 When the input is a step input, the control comparison curves of the method of the present invention with those of fuzzy control and PI control methods are shown. Figure 4 The diagram shown is the actual control operation diagram of the image-de-rotation mechanism, and the final positioning accuracy reaches 0.2 arcseconds.
[0057] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any transformations or substitutions that can be conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of the present invention.
Claims
1. A fuzzy control method for velocity planning based on the arctangent function, characterized in that: The controlled object of the method is a motor controlled by pulse width modulation waveform, which drives the mechanism to run; The method uses the operating position error, operating speed, maximum speed, maximum acceleration, and maximum position error of the mechanism in the current cycle to infer and calculate the operating speed of the mechanism in the next cycle, thereby controlling the operation of the mechanism; The method specifically includes the following steps: Step 1: Calculate the position deceleration zone value The position deceleration zone refers to the period when the position error of the mechanism in the current cycle is less than [a certain value]. The area where deceleration begins; Based on the maximum speed value and maximum acceleration Perform the calculation: Step 2: Deceleration zone value based on the stated position Maximum speed value Maximum acceleration The current cycle's operating speed value And calculate the operating position error to determine the operating direction and speed of the mechanism in the next cycle. And used for control: specifically including the following steps: Let the operating speed of the mechanism in the current cycle be denoted as _____. The running speed value for the next cycle is The expected position value is The current position value is The running position error is ,in , The positioning threshold, i.e., the maximum position error value, is used to determine the operating direction and speed of the mechanism in the next cycle based on the calculation results of the following formula. : in, , It is the arctangent function. Let π be the mathematical constant, and T be the control period. This indicates the direction of the mechanism's operating speed; -1 indicates the negative direction, and 1 indicates the positive direction.
2. The fuzzy control method for velocity planning based on the arctangent function according to claim 1, characterized in that, The controlled object is a stepper motor.