A variable window speed measurement method with acceleration correction for orthogonal photoelectric encoder
By using a variable window speed measurement method with acceleration correction in the orthogonal photoelectric encoder, the problem of low-speed and high-speed speed measurement accuracy in the prior art and the problem of poor performance when the speed changes quickly are solved, and the full-speed segment smooth speed measurement and speed measurement requirements in complex industrial sites are achieved.
Patent Information
- Application Number
- CN202310385892.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-12
- Publication Date
- 2025-05-23
- Estimated Expiration
- 2043-04-12
AI Technical Summary
The speed measurement method of the existing orthogonal photoelectric encoder has the problem of speed measurement accuracy at low speeds and high speeds, and has poor performance in occasions where speed changes rapidly.
The variable window speed measurement method with acceleration correction is adopted. By determining the speed measurement time window and adjusting according to the current speed and angular acceleration, we ensure smooth and no switching during the speed measurement process in the full speed segment, and maintain good speed measurement performance when the speed changes rapidly.
The smooth and switching-free speed measurement process of the full speed segment is achieved, ensuring that the speed measurement needs are met in complex and changeable industrial sites, and still maintaining good speed measurement performance when speed changes rapidly.
Smart Images

Figure CN116400093B_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of orthogonal encoders, and in particular relates to a variable window speed measurement method of a photoelectric encoder with angular acceleration correction. Background Art
[0002] The orthogonal photoelectric encoder is a sensor that converts the displacement arc on the motor shaft into pulse quantity by photoelectric conversion. The orthogonal photoelectric encoder is composed of a light source, a grating disk and a photosensitive element. The orthogonal incremental encoder has two separate pins, which serve as sensing channels and act like signal detectors, usually called channel A and channel B. By analyzing the pulse signals generated by channel A and channel B over a period of time, the current motor speed, direction and shaft position can be obtained.
[0003] At present, the most widely used application of orthogonal photoelectric encoders is the measurement of asynchronous motor speed (hereinafter referred to as "speed"), which is used for speed closed-loop control of DSP and other related chips. The traditional speed measurement methods based on orthogonal photoelectric encoders include "M method", "T method" and "MT method" which combines "M method" and "T method". Specifically, the principles of "M method", "T method" and "MT method" are as follows: Figure 1 As shown. Among them, the "M method" is mainly used to measure occasions with relatively high speeds. Its principle is to measure the number of pulses within a period of time and finally calculate the current speed. This method is simple to calculate, but there will be an error in a pulse. This error will increase at low speeds and significantly affect the speed measurement accuracy; the "T method" is mainly used to calculate the time of a complete pulse cycle. This method works well at low speeds, but the number of sampled pulses is too small at high speeds, and the narrow pulses can easily lead to a decrease in measurement accuracy; the "MT method" combines the advantages of the above two speed measurement methods, and has good performance at both low and high speeds, but this method also has obvious disadvantages: First, the switching between the "M method" and the "T method" is not smooth, and there will be speed jitter when the two methods are switched at a certain speed point; second, in situations where the speed changes quickly, the performance of the "MT method" is poor. Summary of the invention
[0004] In view of the above-mentioned deficiencies in the prior art, the present invention provides a variable window speed measurement method of an orthogonal photoelectric encoder with acceleration correction to solve the above-mentioned technical problems.
[0005] The present invention provides a variable window speed measurement method with an orthogonal photoelectric encoder and acceleration correction, comprising:
[0006] Determine the speed measurement time window T w , in the quadruple frequency pulse signal P ΑB Start timing when the vehicle arrives, and update the pulse position if the turn signal remains unchanged;
[0007] When the timing time reaches the speed measurement time window Tw When the time is up, the timing continues until the next quadruple frequency pulse signal P ΑB Arrival, the pulse increment δp of the quadruple frequency pulse signal is determined according to the pulse position;
[0008] Determine the current speed Vcur according to the pulse increment δp and the timing time δt, and determine the angular acceleration α according to the change of the current speed Vcur;
[0009] Re-determine the speed measurement time window T through the angular acceleration α and the current speed Vcur w , where the current speed Vcur is the speed measurement time window T w The adjustment is based on the speed measurement time window T w The pulse increment within is determined; the angular acceleration α is determined by the speed measurement time window T w The adjustment is determined according to the closed-loop response speed.
[0010] Furthermore, the speed measurement time window T is re-determined w The formula is: T w-new =T w +k1*t u +k2*t u , k1 is the angular acceleration coefficient, k2 is the velocity coefficient, k1 and k2 are positive and negative integers, t u is the basic speed measurement time unit, t u and T w In multiple relationship, T w-new It is the updated speed measurement time window.
[0011] Furthermore, it also includes: obtaining a turning signal, if the turning occurs when the speed is higher than the upper speed limit, outputting an encoder fault and marking the currently calculated speed as invalid;
[0012] If a turn occurs when the speed is lower than the lower speed limit, the turn signal is recorded, the last calculated speed is used as the current speed, and the speed measurement is restarted.
[0013] Furthermore, when the speed is measured for the first time and the power is turned on, the initial direction is forward and the initial speed measurement time window T is w , the initialization timing time δt is the maximum time that the time counter can accumulate, and the initialization pulse increment δp is 0;
[0014] Furthermore, the method further includes: after initialization, waiting for the first quadruple frequency pulse signal P after the orthogonal encoder is powered on ΑB Arriving, the first quadruple frequency pulse signal P ΑB After arrival, the time counter is restarted to determine the timing time δt and the pulse increment δp.
[0015] Furthermore, when the speed measurement is restarted, the time counter is reset to zero, and the timing time δt and the pulse increment δp are re-determined.
[0016] Further, continue to wait for a valid quadruple frequency pulse signal P ΑB If the quadruple frequency pulse signal P ΑB When the time counter arrives, the time counter will accumulate the timeout time, and then output the current speed Vcur=0, and spin wait until the quadruple frequency pulse signal P ΑB At a certain moment after the timeout, the timing time δt and the pulse increment δp are re-determined.
[0017] Further, the determining of the current speed Vcur according to the pulse increment δp and the sampling time δt includes:
[0018] Comparison time counter timing t c and speed measurement time window T w , until the time counter counts up to t c Reach the speed measurement time window T w When t is t, let the timing time δt = t c , and calculate the current speed Vcur according to the formula Vcur = δp / (δt*C); where C is the number of quadruple frequency pulses of the orthogonal photoelectric encoder in one revolution.
[0019] Further, the determining of the angular acceleration α according to the change of the current speed Vcur includes:
[0020] Compare the current speed Vcur with the historical speed Vold calculated last time, and calculate the angular acceleration α according to the following formula: α = |Vcur-Vold| / δt;
[0021] According to the updated speed measurement time window T w-new Recalculate the current speed Vcur.
[0022] Furthermore, the method further comprises: ΑB Identification is performed after narrow pulse filtering.
[0023] The beneficial effects of the present invention are that the variable window speed measurement method of the orthogonal photoelectric encoder with acceleration correction provided by the present invention can achieve smooth speed measurement process without switching in the entire speed range; it can still have good speed measurement performance when the speed changes too fast; it is truly suitable for the complex and changeable speed measurement needs of industrial sites. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0025] Figure 1 is a principle comparison diagram of the prior art of a method according to an embodiment of the present invention;
[0026] Figure 2 is a schematic flow chart of a method according to an embodiment of the present invention;
[0027] Figure 3 It is a schematic diagram of the principle of a method of an embodiment of the present invention;
[0028] Figure 4 is a state flow chart of a method according to an embodiment of the present invention. DETAILED DESCRIPTION
[0029] In order to enable those skilled in the art to better understand the technical solutions in the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0030] After actual verification in many fields, the traditional "M method", "T method" and "MT method" always have various problems when facing complex industrial occasions and changing speed measurement requirements (such as ultra-high-speed operation, rapid acceleration and deceleration, frequent forward and reverse rotation, 0-speed jitter, 0-speed hovering, etc.). In order to solve the above complex problems, the author proposes this design solution.
[0031] The biggest advantage of this design is that it can be effectively compatible with various occasions. For example, under extremely low speed conditions, this design can be better than the "MT method" with the same parameters. Under ultra-high speed, the speed fluctuation of this design is significantly smaller than that of the "M method". In addition, this design also conducted detailed tests on 0.1s rated rapid acceleration and deceleration, frequent forward and reverse rotation, 0-speed excitation jitter, and 0-speed hovering, and the results were all in line with expectations.
[0032] This design is most suitable for CPLD implementation. First, the parallel computing capability of CPLD ensures that the time counter can accumulate time and reset normally under any circumstances; second, CPLD can conveniently use the state machine concept when designing hardware; finally, CPLD has various flexible configurations and can effectively adjust t c Timing accuracy, modify various parameters, etc.
[0033] The embodiment of the present invention provides a variable window speed measurement method with acceleration correction of an orthogonal photoelectric encoder, comprising:
[0034] Determine the speed measurement time window T w , in the quadruple frequency pulse signal P ΑB Start timing when the vehicle arrives, and update the pulse position if the turn signal remains unchanged;
[0035] When the timing time reaches the speed measurement time window T w When the time is up, the timing continues until the next quadruple frequency pulse signal P ΑB Arrival, the pulse increment δp of the quadruple frequency pulse signal is determined according to the pulse position;
[0036] Determine the current speed Vcur according to the pulse increment δp and the timing time δt, and determine the angular acceleration α according to the change of the current speed Vcur;
[0037] Re-determine the speed measurement time window T through the angular acceleration α and the current speed Vcur w , where the current speed Vcur is the speed measurement time window T w The adjustment is based on the speed measurement time window T w The pulse increment within is determined; the angular acceleration α is determined by the speed measurement time window T w The adjustment is determined according to the closed-loop response speed.
[0038] In this embodiment, the speed measurement time window T w The range is an empirical value for multiple industrial field applications. The present invention uses a pulse counter. In the forward direction, the pulse counter is incremented by 1 for each pulse. In the reverse direction, the pulse counter is incremented by 1 for each quadruple frequency pulse signal P. ΑB The pulse counter is decremented by 1, and the pulse increment is calculated in this way.
[0039] For updating the speed measurement time window according to angular acceleration, this embodiment provides a simple modeling method, namely, multi-angular acceleration segment modeling, based on the principle that when the output of the speed loop reaches the expected value and is in a uniform steady state, assuming that the speed does not fluctuate, and the given or feedforward does not change, then after sampling the speed once, the next time can be infinitely long. When any link causes the speed to change, it is necessary to speed up the sampling rate output change speed to meet the response characteristics of the speed loop. The specific definitions are as follows:
[0040] When the speed is uniform or nearly uniform, that is, the angular acceleration is equal to 0, because the speed is stable in this case, the speed measurement time window T is increased. w , using a longer sampling time to obtain more reliable and accurate speed measurement results;
[0041] When the speed changes little, that is, the angular acceleration is lower than a certain threshold, in this case, it is necessary to maintain or appropriately reduce the speed measurement time window T w To cope with the change of speed;
[0042] When the speed changes dramatically, that is, the angular velocity is higher than a certain threshold, in this case, the speed measurement time window T must be converged as soon as possible. w To a smaller value to ensure the timeliness of speed closed-loop control.
[0043] Regarding the design of angular acceleration threshold, the specific range parameters are no longer given here. The linear fitting and weight combination method can be used to obtain the specific threshold range through empirical parameters. Note that the range plus the hysteresis loop should be considered in specific applications.
[0044] Optionally, as an embodiment of the present invention, the speed measurement time window T is re-determined. w The fitting formula is: w-new =T w +k1*t u +k2*t u , k1 is the angular acceleration coefficient, k2 is the velocity coefficient, k1 and k2 are positive and negative integers, t u is the basic speed measurement time unit, t u and T w In multiple relationship, T w-new It is the updated speed measurement time window.
[0045] In this embodiment, the basic speed measurement time unit t u The value of is the empirical value of industrial field application. In this embodiment, the basic speed measurement time unit t is defined u The basic speed measurement time unit t is 200 microseconds (200us). u The same as the control cycle of the closed-loop controller DSP; in the speed measurement process, the speed measurement time window is defined as T w , the speed measurement time window is T w and basic speed measurement time unit t u The relationship is T w =k*t u , where k∈[10, 100], i.e., the speed measurement time window T w Between 2ms and 20ms, this range can be adjusted according to actual speed measurement needs and is not limited here.
[0046] To show that the speed measurement time window T is re-determined by the angular acceleration α and the current speed Vcur w The embodiment of the present invention provides a specific fitting formula, which can be adjusted based on actual experience.
[0047] In the embodiment, in this embodiment, k1 and k2 are coupled to the speed measurement time window T w In the update of , the angular acceleration coefficient k1 can be artificially divided into multiple angular acceleration intervals, and each interval is assigned a different angular acceleration coefficient k1, and a relationship table between the angular acceleration α and the angular acceleration coefficient k1 is preset, so that the technician can use the relationship table to find the angular acceleration coefficient k1 corresponding to the current angular acceleration α when measuring the speed. This method is simple, stable, and highly practical.
[0048] For the speed coefficient k2, when the speed is faster, in the same speed measurement time window T w The number of internal sampling pulses is large, so the speed measurement time window T can be appropriately reduced. w , when the speed is slower, in the same speed measurement time window T w The number of internal sampling pulses is small, so the speed measurement time window T can be appropriately increased. w .
[0049] The embodiment of the present invention provides a target pulse number method to define a speed measurement time window T w It is reliable when the sampling reaches M pulses. When the sampling exceeds M pulses, k2=-1 is defined to reduce the time window. If the sampling is less than M pulses, k2=1 is defined to increase the time window. If the sampling is M pulses, k2=0 is defined to keep the time window unchanged.
[0050] In this embodiment, the update of the time window by k1 and k2 is in a competitive relationship. Compared with k1, the weight of k2 is lower, which is equivalent to fine-tuning the time window. However, the speed measurement time window T of the present invention is w Set the upper and lower limits, the upper limit is 20ms, and the lower limit is 2ms. Therefore, the worst result obtained by the competition between k1 and k2 will not destroy the stability of the speed measurement method. For example:
[0051] One case where the speed measurement time window is increased is: T w-new =T w +(20+1)*t u , where k1 = 20, k2 = 1, T W =16ms, T w-new =20.2ms, due to T w-new ≤20ms, so T w-new =20ms;
[0052] A case where the speed measurement time window remains unchanged is: T w-new =T w +(-1+1)*t u , where k1 = -1, k2 = 1, T W =16ms, T w-new=16ms, 2ms≤T w-new ≤20ms;
[0053] The formula for reducing the speed measurement time window is: T w-new =T w +(-40-1)*t u , where k1 = -40, k2 = -1, T W =16ms, T w-new =7.8ms, T w-new ≥2ms.
[0054] Optionally, as an embodiment of the present invention, it also includes: obtaining a turn signal, if the turn occurs when the speed is higher than the upper speed limit (according to the inertia principle, it is obviously impossible to turn at high speed), then output an encoder fault and mark the currently calculated speed as invalid; if the turn occurs when the speed is lower than the lower speed limit, then record the turn signal, then use the last calculated speed as the current speed, and restart the speed measurement. Because the speed will not change suddenly, and the speed cannot be accurately measured due to the pulse being too wide when the turn changes, in the above special case, the last valid speed can be directly continued.
[0055] Optionally, as an embodiment of the present invention, it further includes: when the speed is measured for the first time and the power is turned on, the initialization direction is forward, and the initialization speed measurement time window T w , the initialization timing time δt is the maximum time that the time counter can accumulate, and the initialization pulse increment δp is 0.
[0056] In the power-on state, the turn signal is initialized to the positive direction, and the speed measurement time window T is initialized w =10*t u =2ms, t c =δt=200ms; in speed measurement, Vcur=δp / (δt*C), in order to ensure that the initial speed is 0 when power is turned on, the initialization pulse increment δp should take the minimum value 0, and the initialization timing time δt is the maximum time that the time counter can accumulate, that is, δt takes the maximum value 200ms, T w ≤t c ≤200ms, so when t c = 200ms, the speed can be regarded as 0, as long as the motor does not rotate, t c It will continue to accumulate until the upper limit of 200ms is reached.
[0057] In this embodiment, the time counter is used for timing when measuring speed. The time counter counts t at the end of each speed measurement. c The cumulative time is δt, and the quadruple frequency pulse P collected within the range of δt ΑBThe number of pulse increments is δp. Assuming that the number of quadrature frequency pulses per revolution of the orthogonal photoelectric encoder is C, and the unit of δt is "second", the final speed Vcur = δp / (δt*C). The speed uses a non-standard unit: r / s, which is the number of revolutions per second.
[0058] Optionally, as an embodiment of the present invention, it further comprises: after initialization, waiting for the first quadruple frequency pulse signal P after the orthogonal encoder is powered on ΑB Arriving, the first quadruple frequency pulse signal P ΑB After arrival, the time counter is restarted to determine the timing time δt and the pulse increment δp.
[0059] In this embodiment, after initialization, the first quadruple frequency pulse signal P of the orthogonal encoder is waited for after power-on. ΑB When the first quadruple frequency pulse signal P ΑB If it doesn't come, just wait until the first quadruple frequency pulse signal P is captured. ΑB , the first quadruple frequency pulse signal P ΑB After being filtered by the filter module and recognized, the time counter is reset to zero, that is, t c =0, start to determine the timing time δt, and update the pulse increment δp in real time.
[0060] Optionally, as an embodiment of the present invention, in the case of restarting the speed measurement, the time counter is reset to zero, and the timing time δt and the pulse increment δp are re-determined.
[0061] In this embodiment, the restarting of speed measurement includes: (1) the direction changes and the change is reasonable, and the last valid speed measurement result is used as the current speed measurement result; (2) after completing the update of the speed measurement time window, it is necessary to enter the next speed measurement process. In both cases, wait for the quadruple frequency pulse P ΑB It is a newly arrived state, so there is no need to wait for the quadruple frequency pulse P ΑB arrival.
[0062] Optionally, as an embodiment of the present invention, the method further includes: continuing to wait for a valid quadruple frequency pulse signal P ΑB If the quadruple frequency pulse signal P ΑB When the time counter arrives, the time counter will accumulate the timeout time, and then output the current speed Vcur=0, and spin wait until the quadruple frequency pulse signal P ΑB At a certain moment after the timeout, the timing time δt and the pulse increment δp are re-determined.
[0063] In this embodiment, if the time counter does not accumulate to the speed measurement time window T after the timing starts, w , need to wait for the effective quadruple frequency pulse signal P ΑBArrival, if the time counter of the time counter is timing t c Wait for a valid quadruple frequency pulse signal P before timeout ΑB , directly make a steering judgment. This is the normal pulse counting process and will not cause t c = 0. If you can’t wait for P ΑB Arrival, t c The timeout will accumulate, and the current speed Vcur = 0 (δp = 0, δt = 200ms) will be output. Once the quadruple frequency pulse signal P ΑB In t c After the timeout, at a certain moment, t is reset. c =0, start calculating the timing time δt and pulse increment δp, and then make a steering decision.
[0064] Optionally, as an embodiment of the present invention, the current speed Vcur is determined according to the pulse increment δp and the sampling time δt, comprising: comparing the time counter timing t c and speed measurement time window T w , until the time counter counts up to t c Reach the speed measurement time window T w When t is t, let the timing time δt = t c , and calculate the current speed Vcur according to the formula Vcur = δp / (δt*C); where Vcur is the non-standard symbol of the rotation speed, and C is the number of quadruple frequency pulses of the orthogonal photoelectric encoder in one revolution.
[0065] When using this method to measure speed, from the start of measurement (t c =0) to the result speed, t c Should not be less than T w For example, T w At a certain moment, t c The accumulated timing time δt should be greater than or equal to 16ms.
[0066] Optionally, as an embodiment of the present invention, determining the angular acceleration α according to the change of the current speed Vcur includes: comparing the current speed Vcur with the historical speed Vold calculated last time, and calculating the angular acceleration α according to the following formula: α=|Vcur-Vold| / δt; according to the updated speed measurement time window T w-new Recalculate the current speed Vcur.
[0067] Optionally, as an embodiment of the present invention, the method further comprises: ΑB Identification is performed after narrow pulse filtering.
[0068] In this embodiment, a filtering module is provided to filter the incremental encoder pulse signals A and B and the quadruple frequency pulse signal P after frequency multiplication. ΑB Perform narrow pulse filtering to eliminate glitch signals.
[0069] like Figure 2 , 3 As shown, the whole method is described below by dividing the state process, such as Figure 4 The state transition diagram shown in the figure uses S1, S2, etc. to represent each state. In addition, it is important to note that for the time counter timing t c , whose time accumulation is automatic, assuming t c The time unit is microseconds (us), so every 1us time t c Automatically add one and follow this feature in any state.
[0070] S1, initialization state: When the orthogonal encoder is powered on, the initialization direction is forward, and the initialization speed measurement time window T w =10*t u =2ms, δt=200ms, δp=0. In speed measurement, the formula Vcur=δp / (δt*C) is used for calculation. In order to ensure that the initial speed is 0 when power is turned on, δp should take the minimum value of 0 and δt should take the maximum value of 200ms. It is worth noting that the maximum value of the timing time δt is the maximum time that the time counter can accumulate, that is, T w ≤t c ≤200ms, so when t c = 200ms, the speed can be regarded as 0, that is, as long as the motor does not rotate, the time counter counts t c It will continue to accumulate until the upper limit of 200ms, and then jump to S2 state after initialization is completed.
[0071] S2, start timing: If the current state is jumped from the initialization state S1, wait for the first quadruple frequency pulse P after the orthogonal encoder is powered on ΑB If the first quadrupled frequency pulse P ΑB When it arrives, it is filtered by the filter module. After being recognized, the time counter is cleared to start calculating the timing time δt and the pulse increment δp, and then jumps to the S3 state. ΑB If it does not come, it will be in the waiting state. At this time, the S1 state has initialized the speed to 0, t c It is 200ms, which is equivalent to the waiting timeout state.
[0072] If the current state is jumped from state S3 or S7, since these two states occur, the quadruple frequency pulse signal P ΑB It must have just arrived, so there is no need to wait for the quadruple frequency pulse signal PΑB When it arrives, the time counter is directly reset to zero, and the timing time δt and pulse increment δp are calculated; then the state is jumped to S3.
[0073] If the current state is jumped from S5, it is necessary to wait for a valid quadruple frequency pulse signal P ΑB Arrival. If at t c Wait until the quadruple frequency pulse signal P is filtered by the filter module before the timeout. ΑB , jump directly to S3 state. It should be noted that this state will not cause the time counter to count t c = 0, this state is the normal pulse counting state. If the quadruple frequency pulse signal P ΑB Arrival, t c The timeout will accumulate, and the current speed Vcur = 0 (δp = 0, δt = 200ms) will be output. Then it will spin and wait in the S2 state. Once P ΑB In t c When a certain moment arrives after the timeout, the time counter is reset to zero, the timing time δt and the pulse increment δp are calculated, and the state jumps to S3.
[0074] S3. Steering judgment:
[0075] Correct change: If a steering change occurs and the change is reasonable, the last valid speed measurement result is written into the current speed measurement result (approximate method, because there are few pulses at near 0 speed and the speed is difficult to measure accurately), and then jump to S2 state.
[0076] Error change: If a steering change occurs and the change is unreasonable, for example, a steering change occurs at high speed, which is obviously impossible due to the inertia principle. At this time, a fault signal is issued, and the current speed is still the normal speed measured last time, until the reset signal is received and the state is transferred to S1;
[0077] If the direction of rotation has not changed, the pulse position is updated normally and then jumps to the S4 state.
[0078] S4, position update: Update its own pulse position according to the pulse of the steering module and the steering signal. After the update is completed, a pulse signal is sent to notify the speed calculation module and jump to S5 state.
[0079] S5, timing judgment: If the time counter counts t c <Speed measurement time window T w , that is, the time counter has not yet accumulated the time to the set speed measurement time window T w , then jump to S2 state, if the time counter counts t c ≥Speed measurement time window T w Jump to S6 state.
[0080] S6: Note that when jumping from S5 state to this state, t c Probably much larger than T w , for example, in the S5 state, t c <T w , but very close to T w , then it will jump to S2 state. If the motor is close to stopping at this time, it needs to wait for a long time in S2 for the next quadruple frequency pulse P ΑB To reach. For example, T w =8ms, t c It may be 8.1ms, 9ms, or even 199.999ms. The accuracy of the time counter may be very high, which is mainly determined by the high-speed clock used inside the time counter.
[0081] At this time, let δt = t c , calculate δp (i.e., the pulse increment accumulated in the δt time period) according to the turning signal in the S3 state and the position signal in the S4 state, and calculate the current speed Vcur according to the formula Vcur=δp / (δt*C). Then jump to the S7 state.
[0082] S7: Compare the currently calculated speed Vcur with the last calculated speed Vold, and combine with the current sampling time δt to calculate the angular acceleration α = |Vcur-Vold| / δt, at which point Vold = 0. Re-determine the speed measurement time window T w The formula, T w-new =T w +k1*t u +k2*t u , k1 is the angular acceleration coefficient, k2 is the velocity coefficient, k1 and k2 are positive and negative integers, t u is the basic speed measurement time unit, t u and T w In multiples, for example, t u =200us, T w =10*t u =2ms, T w-new It is the updated speed measurement time window.
[0083] Assume T w Target pulse M = 10, T w The number of pulses is less than 10, so k2 = 1. According to the table lookup method, the angular acceleration at this time corresponds to k1 = 1. Therefore, T w-new =T w +(1+1)*t u = 2.4ms, the speed measurement time window of the next complete pulse signal is updated to 2.4ms, that is, T w =Tw-new = 2.4ms, based on the same angular acceleration, the new speed measurement time window T calculated by the next complete pulse signal w-new =2.8ms.
[0084] Updated T w After that, the current speed is taken as the new historical speed to carry out the next round of speed measurement, and Vold = Vcur is set. Then, the state is jumped to S2 to sample and calculate the next speed. The process completes the closed loop.
[0085] Although the present invention has been described in detail by referring to the accompanying drawings and in combination with the preferred embodiments, the present invention is not limited thereto. Without departing from the spirit and essence of the present invention, a person of ordinary skill in the art may make various equivalent modifications or substitutions to the embodiments of the present invention, and these modifications or substitutions shall be within the scope of the present invention or any person skilled in the art who is familiar with the present invention may easily think of changes or substitutions within the technical scope disclosed by the present invention, and shall be within the scope of protection of the present invention. Therefore, the scope of protection of the present invention shall be subject to the scope of protection of the claims.
Claims
1. A variable window speed measurement method with orthogonal photoelectric encoder and acceleration correction, It is characterized in that include: Determine the speed measurement time window T w , in the quadruple frequency pulse signal P ΑB Start timing when the vehicle arrives, and update the pulse position if the turn signal remains unchanged; When the timing time reaches the speed measurement time window T w When the time is up, the timing continues until the next quadruple frequency pulse signal P ΑB Arrival, the pulse increment δp of the quadruple frequency pulse signal is determined according to the pulse position; Determine the current speed Vcur according to the pulse increment δp and the timing time δt, and determine the angular acceleration α according to the change of the current speed Vcur; Re-determine the speed measurement time window T through the angular acceleration α and the current speed Vcur w , where the current speed Vcur is the speed measurement time window T w The adjustment is based on the speed measurement time window T w The pulse increment within is determined; the angular acceleration α is determined by the speed measurement time window T w The adjustment is determined according to the closed-loop response speed.
2. The variable window speed measurement method with acceleration correction of the orthogonal photoelectric encoder according to claim 1, It is characterized in that Re-determine the speed measurement time window T w The formula is: T w-new =T w +k1*t u +k2*t u , k1 is the angular acceleration coefficient, k2 is the velocity coefficient, k1 and k2 are positive and negative integers, t u is the basic speed measurement time unit, t u and T w In multiple relationship, T w-new It is the updated speed measurement time window.
3. The variable window speed measurement method with acceleration correction of the orthogonal photoelectric encoder according to claim 1, It is characterized in that Also includes: Get the steering signal. If the steering occurs when the speed is higher than the upper speed limit, the encoder fault is output and the currently calculated speed is marked as invalid. If a turn occurs when the speed is lower than the lower speed limit, the turn signal is recorded, the last calculated speed is used as the current speed, and the speed measurement is restarted.
4. The variable window speed measurement method with acceleration correction of the orthogonal photoelectric encoder according to claim 1, It is characterized in that When the speed is measured for the first time and the power is turned on, the initial direction is forward and the initial speed measurement time window T is w , the initialization timing time δt is the maximum time that the time counter can accumulate, and the initialization pulse increment δp is 0.
5. The variable window speed measurement method with acceleration correction of the orthogonal photoelectric encoder according to claim 1, It is characterized in that Also includes: After initialization, wait for the first quadruple frequency pulse signal P after the orthogonal encoder is powered on. ΑB Arriving, the first quadruple frequency pulse signal P ΑB After arrival, the time counter is restarted to determine the timing time δt and the pulse increment δp.
6. The variable window speed measurement method with acceleration correction of the orthogonal photoelectric encoder according to claim 1, It is characterized in that When the speed measurement is restarted, the time counter is reset and the timing time δt and the pulse increment δp are re-determined.
7. The variable window speed measurement method with acceleration correction of the orthogonal photoelectric encoder according to claim 1, It is characterized in that Continue to wait for a valid quadruple frequency pulse signal P ΑB If the quadruple frequency pulse signal P ΑB When the time counter arrives, the time counter will accumulate the timeout time, and then output the current speed Vcur=0, and spin wait until the quadruple frequency pulse signal P ΑB At a certain moment after the timeout, the timing time δt and the pulse increment δp are re-determined.
8. The variable window speed measurement method with acceleration correction of the orthogonal photoelectric encoder according to claim 1, It is characterized in that Determining the current speed Vcur according to the pulse increment δp and the sampling time δt includes: Comparison time counter timing t c and speed measurement time window T w , until the time counter counts up to t c Reach the speed measurement time window T w When the time is up, the timing continues until the next quadruple frequency pulse signal P ΑB Arrival, let the timing time δt = t c , and calculate the current speed Vcur according to the formula Vcur = δp / (δt*C); where C is the number of quadruple frequency pulses of the orthogonal photoelectric encoder in one revolution.
9. The variable window speed measurement method with acceleration correction of the orthogonal photoelectric encoder according to claim 1, It is characterized in that Determining the angular acceleration α according to the change of the current speed Vcur includes: Compare the current speed Vcur with the historical speed Vold calculated last time, and calculate the angular acceleration α according to the following formula: α = |Vcur-Vold| / δt; According to the updated speed measurement time window T w-new Recalculate the current speed Vcur.
10. The variable window speed measurement method with acceleration correction of the orthogonal photoelectric encoder according to claim 1, It is characterized in that Also includes: quadruple frequency pulse signal P ΑB Identification is performed after narrow pulse filtering.
Citation Information
Patent Citations
High-impact acceleration sensor dynamic characteristic tracing calibrating method
CN101458263A
Self-adaptive MT transition speed measurement method
CN112305256A