A Pulse Uniform Control Algorithm
Through the pulse uniform control algorithm, the 4-channel encoder and multi-function control are used to solve the control problems under uncertain frequency and duty cycle, and high-precision pulse control and waveform quality improvement under complex conditions are achieved.
Patent Information
- Application Number
- CN202111315452.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-08
- Publication Date
- 2025-07-18
- Estimated Expiration
- 2041-11-08
AI Technical Summary
The prior art cannot guarantee optimal control in the entire digital frequency domain range when the frequency and duty cycle are uncertain, resulting in a decrease in pulse amplitude accuracy, a single control method for analog control circuits, and a limited parameter setting range.
The pulse uniform control algorithm is adopted, including 4-channel encoder, frequency division function, variable pitch function, fixed frequency function and self-start and stop function. Through parameter selection and encoder counting value calculation, uniform pulse control is achieved and different operating load conditions are adapted.
It realizes flexible speed adjustment between micro-line segments in equal-period control, improves pulse amplitude accuracy and waveform quality, and is suitable for more complex control areas.
Smart Images

Figure CN114047951B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of automatic control, and particularly to a pulse uniform control algorithm. Background Art
[0002] Motors and generators are used in a variety of applications and under a variety of operating conditions. Generally, many modern motors have relatively high energy conversion efficiency. However, the energy conversion efficiency of most motors may vary significantly based on their operating load. Many applications require motors to operate under a variety of different operating load conditions, which means that the operating efficiency of the motors is usually not fully utilized.
[0003] In terms of the response characteristics of the control system, due to its immutability, the optimal control system operating point of the analog circuit can only work in the state of DC output or pulse output with a fixed frequency. For the situation where the frequency and duty cycle are uncertain, the analog circuit cannot guarantee the optimal control within the entire output frequency domain and cannot perform real-time adjustment, resulting in a decrease in the accuracy of the pulse amplitude. The analog control circuit is relatively single in the control method, mostly using a comparator to implement PID control, and limited by the electrical characteristics of the device, the range of parameter tuning is limited. Summary of the Invention
[0004] In view of the deficiencies of the prior art, the present invention provides a pulse uniform control algorithm, which solves the problems that for the situation where the frequency and duty cycle are uncertain, the analog circuit cannot guarantee the optimal control within the entire output frequency domain, cannot perform real-time adjustment, resulting in a decrease in the accuracy of the pulse amplitude, the analog control circuit is relatively single in the control method, and the range of parameter tuning is limited.
[0005] To achieve the above object, the present invention is realized through the following technical solutions: A pulse uniform control algorithm includes a 4-channel encoder, a frequency division function, a variable pitch function, a fixed frequency function, and a self-start and stop function, and specifically includes the following steps:
[0006] Step 1: Initialize the data, and then set the operating speed within a unit time;
[0007] Step 2: Read through the 4-channel encoder and the number of pulses the servo motor travels at this speed;
[0008] Step 3: Send the first pulse train according to the setting and start timing;
[0009] Step 3: At the end of the first control cycle, write a new pulse train parameter command word, and at the same time the encoder reads this parameter;
[0010] Step 4: At the end of the last pulse in the previous unit time, immediately use the new pulse train, and at this time enter the next unit timing stage;
[0011] Step 5: Repeatedly run Step 4 until the operation of one trajectory ends;
[0012] Frequency division function:
[0013] Any two of the four encoder count values are selected through parameters to participate in the frequency division calculation, marked as X\Y. The parameter inputs are the frequency division distance ΔL, the high-level time outtime, and the synchronization signal waiting time delaytime. The pulse count increments ΔX and ΔY of XY are obtained through counting. When the frequency division function is enabled and the following formula is satisfied: ΔX×ΔX + ΔY×ΔY = ΔL×ΔL, and a synchronization signal is received or the waiting time for the synchronization signal is greater than delaytime, a high level is output, and the high-level output time is outtime, as Figure 2 shown;
[0014] Variable pitch function:
[0015] The host informs the system of the encoder count value at the end position of the path in advance. The system judges whether it can be divided evenly according to the difference between the current count and the end count. If it cannot be divided evenly, the value of ΔL in the last section of the distance is appropriately modified to make it divisible, as Figures 3 - 8 shown;
[0016] Fixed frequency function:
[0017] Output a standard square wave according to the specified frequency and duty cycle, with a maximum frequency of 10M;
[0018] Self-start and stop function:
[0019] The host informs the system of the encoder count value when the function starts and stops, which is stored in the queue. When the encoder value is equal to the value (P) at the front of the queue, the function is turned on or off according to the corresponding function codes (F1, F0).
[0020] Preferably, in Step 2, the 4-channel encoder signal comes from the encoder signal of the servo motor, A\B direction, TTL pulse. Through this counting, the current position of the servo motor can be accurately known, and the counting accuracy is 10 pulses (one pulse is counted for each rising edge and falling edge of the A\B pulse), as Figure 1 shown. For example: after the count value is cleared, when the motor rotates forward and backward one circle, the count value should be within plus or minus 10.
[0021] Preferably, the 4-channel encoder includes 3 operating modes.
[0022] Preferably, when the operating mode of the 4-channel encoder is set to the first operating mode:
[0023] When Enable is 1:
[0024] Pulse count for Channel B, and calculate a = A × 0.1 and b = B × 0.1 in real time. When c > L, C1 and C2 output high level, the counts of A and B are cleared, and re - counting starts; while C1 and C2 are set to high level, a timer is started. When the timing time reaches Tc, the timer is reset, and C1 and C2 output low level.
[0025] When Enable is 0:
[0026] C1 and C2 output low level, and the timer and counter are cleared.
[0027] Preferably, when the operating mode of the 4 - channel encoder is set to the second operating mode:
[0028] When Enable is 1:
[0029] Pulse count for Channels A and B, and calculate a = A × 0.1 and b = B × 0.1 in real time. When c > L and a Synchro rising - edge signal is received, C1 and C2 output high level, the counts of A and B are cleared, and re - counting starts; while C1 and C2 are set to high level, a timer is started. When the timing time reaches Tc, the timer is reset, and C1 and C2 output low level.
[0030] When Enable is 0:
[0031] C1 and C2 output low level, and the timer and counter are cleared.
[0032] Preferably, when the operating mode of the 4 - channel encoder is set to the first operating mode:
[0033] When Enable is 1:
[0034] C1 and C2 output pulses with a 50% duty cycle at the FRE frequency.
[0035] When Enable is 0:
[0036] C1 and C2 output low level.
[0037] Preferably, for the split - screen function, if the moving distance of the motor can be exactly divided by ΔL, pulses can be output equidistantly. However, in actual situations, the case of exact division hardly occurs, and there will be a situation where no pulses are emitted in the last moving distance.
[0038] Preferably, for both the split - screen and variable - pitch functions, the host needs to send a start signal for the system to start working. For simple trajectories, this mode can complete the work. However, for the case of continuous motion without stopping and rapid start - stop of functions, due to reasons such as communication cycles, there will be a delay in start - stop, such as Figures 9 - 11As shown (4 rows, 3 columns, 12 straight lines), continuous straight line machining, the motor runs back and forth, and machining is carried out as required.
[0039] Beneficial effects
[0040] The present invention provides a pulse uniform control algorithm. Compared with the prior art, it has the following beneficial effects:
[0041] (1) For this pulse uniform control algorithm, in equal-period control, the connection speed between micro line segments is also calculated by speed preview. In each specific micro line segment, the speed is controlled in sub-periods, and the speed can be changed in real time. Equal-period control is more general and flexible, and is suitable for more complex control fields.
[0042] (2) For this pulse uniform control algorithm, the encoder count value at the end position of the path is informed to the system in advance by the host. The system judges whether it can be divided evenly according to the difference between the current count and the end count. If it cannot be divided evenly, the ΔL value of the last section of distance is appropriately modified to make it divisible, and the speed can be adjusted at any time to ensure the optimal control within the entire output frequency range and improve the pulse amplitude accuracy.
[0043] (3) For this pulse uniform control algorithm, in the present invention, it is not necessary to calculate the parameters of all remaining trajectories within each period, but only to pre-calculate a small subsequent section of the trajectory, which can ensure the smoothness of the trajectory, the output waveform quality in the full frequency band is good, the flatness of the square wave waveform is high, and the control system works at the optimal operating point in a higher frequency band. Description of the drawings
[0044] Figure 1 is a structural cross-sectional view of the present invention;
[0045] Figure 2 is a schematic diagram of the enabled state of the frequency division function of the present invention;
[0046] Figure 3 is a schematic diagram of the ideal effect of the variable pitch function in the XY plane of the present invention;
[0047] Figure 4 is a schematic diagram of the non-divisible effect of the variable pitch function in the XY plane of the present invention;
[0048] Figure 5 is a schematic diagram of the variable pitch effect of the variable pitch function in the XY plane of the present invention;
[0049] Figure 6 is a left structural view of the divisible effect of the single-motor movement of the variable pitch function of the present invention;
[0050] Figure 7 is a partial enlarged view of the non-divisible effect of the single-motor movement of the variable pitch function of the present invention;
[0051] Figure 8The front view of the structure of the non-integer variable pitch effect of the single-motor movement with variable pitch function of the present invention;
[0052] Figure 9 The schematic diagram of the ideal state of the self-start and stop function of the present invention;
[0053] Figure 10 The schematic diagram of the actual state of the self-start and stop function of the present invention;
[0054] Figure 11 The schematic diagram of the optimized state of the self-start and stop function of the present invention. Detailed implementation manners
[0055] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
[0056] Please refer to Figures 1 - 11 , the present invention provides a technical solution: a pulse uniform control algorithm, including a 4-channel encoder, a frequency division function, a variable pitch function, a fixed frequency function, and a self-start and stop function, specifically including the following steps:
[0057] Step 1: Initialize the data, and then set the running speed within a unit time;
[0058] Step 2; Read the pulses walked by the servo motor at this speed through the 4-channel encoder;
[0059] In step 2, the signal of the 4-channel encoder comes from the encoder signal of the servo motor, A\B direction, TTL pulse. Through this counting, the current position of the servo motor can be accurately known, and the counting accuracy is 10 pulses (one pulse is recorded for each of the rising edge and falling edge of the A\B pulse). As Figure 1 shown, for example: after the count value is cleared, when the motor rotates forward and backward one circle, the count value should be within plus or minus 10;
[0060] The 4-channel encoder includes 3 operating modes;
[0061] When the operating mode of the 4-channel encoder is set to the first operating mode:
[0062] When Enable is 1:
[0063] Count the pulses of the B channel, and calculate a = A × 0.1 and b = B × 0.1 in real time, When c > L, C1 and C2 output high level, the counts of A and B are cleared, and re - counting starts; while C1 and C2 are set to high level, the timer is started. When the timing reaches Tc, the timer is reset, and C1 and C2 output low level;
[0064] When Enable is 0:
[0065] C1 and C2 output low level, and the timer and counter are cleared;
[0066] When the operating mode of the 4 - channel encoder is set to the second operating mode:
[0067] When Enable is 1:
[0068] The pulses of channels A and B are counted, and a = A×0.1 and b = B×0.1 are calculated in real - time. When c > L and the rising - edge signal of Synchro is received, C1 and C2 output high level, the counts of A and B are cleared, and re - counting starts; while C1 and C2 are set to high level, the timer is started. When the timing reaches Tc, the timer is reset, and C1 and C2 output low level;
[0069] When Enable is 0:
[0070] C1 and C2 output low level, and the timer and counter are cleared;
[0071] When the operating mode of the 4 - channel encoder is set to the first operating mode:
[0072] When Enable is 1:
[0073] C1 and C2 output pulses with a 50% duty cycle at the FRE frequency;
[0074] When Enable is 0:
[0075] C1 and C2 output low level
[0076] Step 3: Send the first pulse train according to the setting and start timing;
[0077] Step 3: At the end of the first control cycle, write a new pulse - train parameter command word, and at the same time the encoder reads this parameter;
[0078] Step 4: At the end of the last pulse in the previous unit time, immediately use the new pulse train, and at this time enter the next unit - timing stage;
[0079] Step 5: Repeat Step 4 until the running of one trajectory ends;
[0080] Frequency - division function:
[0081] Any two count values of the four encoders are selected through parameters to participate in the frequency division calculation, marked as X\Y. The parameter inputs are the frequency division distance ΔL, the high-level time outtime, and the synchronization signal waiting time delaytime. The pulse count increments ΔX and ΔY of XY are obtained through counting. When the frequency division function is enabled and the following formula is satisfied: ΔX × ΔX + ΔY × ΔY = ΔL × ΔL, and a synchronization signal is received or the waiting time for the synchronization signal is greater than delaytime, a high level is output, and the high-level output time is outtime. As Figure 2 shown, for the split-screen function, if the motor movement distance can be exactly divided by ΔL, pulses can be output equidistantly. However, in actual situations, the case of exact division rarely occurs, so there will be a situation where no pulse is emitted in the last movement distance. The speed can be adjusted at any time to ensure the optimal control within the entire frequency division range and improve the pulse amplitude accuracy.
[0082] Variable pitch function:
[0083] The host notifies the system of the encoder count value at the end position of the path in advance. The system judges whether it can be exactly divided according to the difference between the current count and the end count. If it cannot be exactly divided, the value of ΔL in the last section of the distance is appropriately modified to make it divisible. As Figures 3 - 8 shown, for both the split-screen and variable pitch functions, the host needs to send a start signal for the system to start working. For simple trajectories, this mode can complete the work. In equal-period control, the connection speed between micro-segments is also calculated by speed preview. In each specific micro-segment, the speed can be controlled in sub-periods, and the speed can be changed in real time. Equal-period control is more general and flexible and is suitable for more complex control fields.
[0084] Fixed frequency function:
[0085] Output a standard square wave according to the specified frequency and duty cycle, with a maximum frequency of 10M;
[0086] Self-start and stop function:
[0087] The host notifies the system of the encoder count value at the start and stop of the function, which is stored in the queue. When the encoder value is equal to the value (P) at the front of the queue, the function is opened or closed according to the corresponding function codes (F1, F0). For continuous operation without stopping and rapid start and stop of the function, due to reasons such as the communication cycle, there will be a delay in start and stop. As Figures 9 - 11 shown (4 rows, 3 columns, 12 straight lines), for continuous straight line machining, the motor runs back and forth and processes as required. In each cycle of the present invention, it is not necessary to calculate the parameters of all remaining trajectories, but only to pre-calculate a small subsequent section of the trajectory to ensure the smoothness of the trajectory, good output waveform quality in the full frequency band, high flatness of the square wave waveform, and the control system works at the optimal operating point in a higher frequency band.
[0088] Meanwhile, the content not described in detail in this specification belongs to the prior art well known to those skilled in the art.
[0089] It should be noted that, in this article, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device comprising a series of elements not only includes those elements, but also includes other elements not expressly listed, or further includes elements inherent to such process, method, article or device.
[0090] Although the embodiments of the present invention have been shown and described, for those of ordinary skill in the art, it can be understood that various changes, modifications, substitutions and variations can be made to these embodiments without departing from the principles and spirit of the present invention. The scope of the present invention is defined by the appended claims and their equivalents.
Claims
1. A pulse uniform control algorithm, including a 4-channel encoder, a frequency division function, a variable pitch function, a fixed frequency function, and a self-start and stop function, characterized in that, Specifically, it includes the following steps: Step 1: Initialize the data and then set the running speed within a unit time; Step 2: Read through a 4-channel encoder and the number of pulses the servo motor travels at this speed; Step 3: Send out the first pulse train according to the setting and start timing; Step 3: At the end of the first control cycle, write a new pulse train parameter command word, and at the same time the encoder reads this parameter; Step 4: At the end of the last pulse in the previous unit time, immediately use the new pulse train, and at this time enter the next unit timing stage; Step 5: Repeatedly run Step 4 until the operation of a trajectory is completed; Frequency division function: Any two of the four encoders are selected by parameters to participate in the frequency division calculation, marked as X\Y, and the parameter input frequency division distance L, high-level time outtime, synchronization signal waiting time delaytime, and the pulse count increment of XY is obtained by counting X, Y. When the frequency division function is enabled and the following formula is satisfied: X × X + Y × Y = L × L. When a synchronization signal is received or the waiting synchronization signal time is greater than delaytime, a high level is output, and the high-level output time is outtime; Variable pitch function: The host computer informs the encoder count value at the end position of the system path in advance. The system judges whether it can be divided evenly according to the difference between the current count and the end count. If it cannot be divided evenly, the L value of the last section of distance is appropriately modified to make it divisible; Fixed frequency function: Output a standard square wave according to the specified frequency and duty cycle, with a maximum frequency of 10M; Self-start and stop function: The host tells the encoder count value when the system starts and stops, which is stored in the queue. When the encoder value is equal to the value (P) at the front of the queue, the function is turned on or off according to the corresponding function codes (F1, F0).
2. The pulse uniform control algorithm according to claim 1, wherein: In Step 2, the 4-channel encoder signal comes from the encoder signal of the servo motor, A / B direction, TTL pulse; through this counting, the current position of the servo motor can be accurately known, and the counting accuracy is 10 pulses (one pulse is counted for each rising edge and falling edge of the A / B pulse).
3. The pulse uniform control algorithm according to claim 1, wherein: The 4-channel encoder includes 3 operating modes.
4. A pulse uniform control algorithm according to claim 3, characterized in that: When the operating mode of the 4-channel encoder is set to the first operating mode: When Enable is 1: Pulse counting for channels A and B, and calculating a = A × 0.1 and b = B × 0.1 in real time. When c > L, C1 and C2 output high level, and the counts of A and B are cleared and counting restarts; when C1 and C2 are set to high level, a timer is started. When the timing time reaches Tc, the timer is reset and C1 and C2 output low level. When Enable is 0: C1 and C2 output low level, and the timer and counter are cleared.
5. A pulse uniform control algorithm according to claim 3, characterized in that: When the operating mode of the 4-channel encoder is set to the second operating mode: When Enable is 1: Pulse count for channels A and B, and calculate a = A × 0.1 and b = B × 0.1 in real time. When c > L and a Synchro rising-edge signal is received, C1 and C2 output high levels, the counts of A and B are cleared, and counting restarts; while C1 and C2 are at high levels, a timer is started. When the elapsed time reaches Tc, the timer is reset and C1 and C2 output low levels. When Enable is 0: C1 and C2 output low level, and the timer and counter are cleared.
6. A pulse uniform control algorithm according to claim 3, characterized in that: When the operating mode of the 4-channel encoder is set to the third operating mode: When Enable is 1: C1 and C2 output pulses with a 50% duty cycle at the FRE frequency; When Enable is 0: C1 and C2 output low level.
Citation Information
Patent Citations
Electric diplexer filter inner conductor length on-line measurement method
CN101266136A
Single-axis movement control system for industrial CT (computed tomography)
CN103309269A