CN109283354A - A kind of change M/T speed-measuring method based on incremental optical-electricity encoder - Google Patents
A kind of change M/T speed-measuring method based on incremental optical-electricity encoder Download PDFInfo
- Publication number
- CN109283354A CN109283354A CN201811184448.8A CN201811184448A CN109283354A CN 109283354 A CN109283354 A CN 109283354A CN 201811184448 A CN201811184448 A CN 201811184448A CN 109283354 A CN109283354 A CN 109283354A
- Authority
- CN
- China
- Prior art keywords
- timer
- speed
- encoder
- count value
- current
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Classifications
-
- G—PHYSICS
- G01—MEASURING; TESTING
- G01P—MEASURING LINEAR OR ANGULAR SPEED, ACCELERATION, DECELERATION, OR SHOCK; INDICATING PRESENCE, ABSENCE, OR DIRECTION, OF MOVEMENT
- G01P3/00—Measuring linear or angular speed; Measuring differences of linear or angular speeds
- G01P3/42—Devices characterised by the use of electric or magnetic means
- G01P3/44—Devices characterised by the use of electric or magnetic means for measuring angular speed
- G01P3/48—Devices characterised by the use of electric or magnetic means for measuring angular speed by measuring frequency of generated current or voltage
- G01P3/481—Devices characterised by the use of electric or magnetic means for measuring angular speed by measuring frequency of generated current or voltage of pulse signals
- G01P3/486—Devices characterised by the use of electric or magnetic means for measuring angular speed by measuring frequency of generated current or voltage of pulse signals delivered by photo-electric detectors
Landscapes
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Control Of Electric Motors In General (AREA)
Abstract
The invention discloses a kind of change M/T speed-measuring method based on incremental optical-electricity encoder, the following steps are included: step 1, the Initialize installation of device and system is timed using No. three timers of single-chip microcontroller, step 2, after Initialize installation is completed, first via timer optimizes count value to encoder quadrature signal-count and using K-Means clustering algorithm, step 3, start No. second timer, obtain the count value of current first via timer, step 4, start No. second timer, obtain the count value of current first via timer, step 5, with the rising edge of code device signal, failing edge synchronizes the start-stop of high-frequency impulse, step 6, calculate current motor speed.Superior effect of the invention is to compensate for the disadvantage of M/T method real-time difference in low speed while guaranteeing tradition M/T method rate accuracy, improve motor speed measurement precision.
Description
Technical field
The invention belongs to motor speed measuring field more particularly to a kind of sides of testing the speed change M/T based on incremental optical-electricity encoder
Method.
Background technique
Important physical amount one of of the motor speed as all kinds of motors, important work is played frequently as feedback quantity in the controls
With.Currently, rotary transformer velocimetry, measurement speed of micromotor method, photoelectric code disk velocimetry, Hall element velocimetry these methods exist
It is widely used in the velocity-measuring system that difference requires.Rotary transformer or tachometer will be connect with motor coaxle, increase electricity
Machine units' installation difficulty, on the other hand some power of motor very littles, the power that rotary transformer or tachometer consume account for motor
Most of, so testing the speed to some motors, both methods is not applicable.The speed-measuring method of Hall element and photoelectric code disk is basic
It is similar, all it is one very light and handy sensor of installation in shaft, the turn signal of motor is passed through into Hall element or photoelectric code
Disk is converted to electric pulse, to be tested the speed by the number for calculating electric pulse.Wherein photoelectric encoder has low inertia, low noise
Sound, high-resolution and high-precision advantage are widely used in motor speed measuring field.
Through retrieving, encoder speed-measuring method is divided into three classes: M method, T method and M/T method.M method is that direct meter draws fixed sampling week
Feedback pulse number in phase carrys out measuring speed, its main feature is that rate accuracy is low when rate accuracy high, low speed when high speed.T method is logical
The interval time for crossing two adjacent feedback pulses of measurement carrys out measuring speed, its main feature is that surveying when rate accuracy height, high speed when low speed
Fast precision is low, opposite with M method.M/T method is within the roughly equal sampling interval, and meter takes the feedback pulse of certain amount, and same
When meter take these feedback pulse intervals in the high frequency timing signal number of insertion, with measuring speed.This method is first two method
In conjunction with there is preferable accuracy in entire velocity interval.But in low speed, since this method sampling time interval is fixed,
If the sampling time is bigger than normal, occurring velocity perturbation in sampling interval will not be showed by velocity amplitude, be unfavorable for system tune
Speed is thus unable to satisfy the fast dynamic response index of Electrical Machinery Rotational Speed Testing System.
Therefore, it is high how to design a kind of motor speed measurement precision, and can be in the different motor speed ranks of low speed to high speed
It is this field technical problem urgently to be resolved that section, which all has preferable measurement accuracy and meets the measurement method of requirement of real-time,.
Summary of the invention
To solve the above-mentioned problems in the prior art, the present invention provides a kind of based on incremental optical-electricity encoder
Become M/T speed-measuring method.
The method of the invention the following steps are included:
Step 1, the Initialize installation that device and system are timed using No. three timers of single-chip microcontroller, first via timer
It is set as orthogonal encoder operational mode state, carries out the counting of high-frequency impulse;No. second timer chooses velocity shooting
Judgement;The counting of third road timer progress high-frequency clock pulse.
After step 2, Initialize installation are completed, first via timer is to encoder quadrature signal-count and utilizes K-
Means clustering algorithm optimizes count value, counts to get one group of encoder quadrature signal value and is obtained in cluster by algorithm process
Heart point is to reduce error, the specific steps are as follows:
Step 2.1, when obtain encoder quadrature signal value array be { m1, m2, m3 ..., mi ..., mn }, optionally several
Point is used as initial center;
Step 2.2 calculates remaining point using Euclidean distance formula respectively at a distance from initial center, with optional several points
The close point of distance as initial center is classified as one kind, sorts out until remaining all point and finishes;
Step 2.3 is recalculated cluster centre point by qualitative modeling, repeats above step;
Step 2.4, until algorithmic statement, that is, cluster centre point no longer changes, terminate.
Step 3, starting No. second timer, obtain the count value of current first via timer, at the end of timing again
The count value for obtaining current first via timer, the velocity shooting being presently in is judged by comparing front and back difference, determines speed
The M of section1, different orthogonal intersection code signal value M is set according to the height of motor speed1, by measuring different M1, to determine inspection
The time is surveyed, detection time is calculated by high-frequency clock pulse, shown in following formula:
Assuming that high-frequency clock pulse frequency is fclk, the high-frequency pulse signal number measured is M2, then detection time are as follows:
T=M2/fclk。
Step 4, starting No. second timer, obtain the count value of current first via timer, and third road timer is opened,
By the M of setting1After a count value, third road timer is turned off, the count value of third road timer is M2。
Step 5, the start-stop that high-frequency impulse is synchronized with the rising edge of code device signal, failing edge;In low speed, setting
M1Be worth it is small, by high-frequency clock pulse count time it is short;In high speed, the M of setting1Greatly, motor speed is high, and detection time is short.
Step 6 calculates current motor speed, before entering the counting period next time that third road timer count value is clear
Zero;It is as follows that motor speed calculates formula:
N=60M1fclk/NM2
In above formula, M1For the number of t time inner encoder orthogonal signalling;M2For the number of high-frequency clock pulse in the t time;N
Represent encoder resolution.
Superior effect of the invention is that the selection of the number of encoder quadrature signal is according to the current revolving speed of motor come really
Fixed, in high speed, value is big, and in low speed, value is small, and energy quick response, the method for the invention compensates for M/T method in low speed
The disadvantage of real-time difference, improves motor speed measurement precision.
Detailed description of the invention
Fig. 1 is the change M/T method pulse signal schematic diagram of the method for the invention;
Fig. 2 is the change M/T method motor speed measurement program flow diagram of the method for the invention;
Fig. 3 is the TIM2 timer interrupt program flow chart of the method for the invention.
Specific embodiment
Embodiments of the present invention are described in detail with reference to the accompanying drawing.The method of the invention includes following step
It is rapid:
Step 1, the Initialize installation that device and system are timed using No. three timers of single-chip microcontroller, first via timer
It is set as orthogonal encoder operational mode state, carries out the counting of high-frequency impulse;No. second timer chooses velocity shooting
Judgement;The counting of third road timer progress high-frequency clock pulse.
After step 2, Initialize installation are completed, first via timer is to encoder quadrature signal-count and utilizes K-
Means clustering algorithm optimizes count value, counts to get one group of encoder quadrature signal value and is obtained in cluster by algorithm process
Heart point is to reduce error, the specific steps are as follows:
Step 2.1, when obtain encoder quadrature signal value array be { m1, m2, m3 ..., mi ..., mn }, optionally several
Point is used as initial center;
Step 2.2 calculates remaining point using Euclidean distance formula respectively at a distance from initial center, with optional several points
The close point of distance as initial center is classified as one kind, sorts out until remaining all point and finishes;
Step 2.3 is recalculated cluster centre point by qualitative modeling, repeats above step;
Step 2.4, until algorithmic statement, that is, cluster centre point no longer changes, terminate.
Step 3, starting No. second timer, obtain the count value of current first via timer, at the end of timing again
The count value for obtaining current first via timer, the velocity shooting being presently in is judged by comparing front and back difference, determines speed
The M of section1, different orthogonal intersection code signal value M is set according to the height of motor speed1, by measuring different M1, to determine inspection
The time is surveyed, detection time is calculated by high-frequency clock pulse, shown in following formula:
Assuming that high-frequency clock pulse frequency is fclk, the high-frequency pulse signal number measured is M2, then detection time are as follows:
T=M2/fclk。
Step 4, starting No. second timer, obtain the count value of current first via timer, and third road timer is opened,
By the M of setting1After a count value, third road timer is turned off, the count value of third road timer is M2。
Step 5, the start-stop that high-frequency impulse is synchronized with the rising edge of code device signal, failing edge;In low speed, setting
M1Be worth it is small, by high-frequency clock pulse count time it is short;In high speed, the M of setting1Greatly, motor speed is high, and detection time is short.
Step 6 calculates current motor speed, before entering the counting period next time that third road timer count value is clear
Zero;It is as follows that motor speed calculates formula:
N=60M1fclk/NM2
In above formula, M1For the number of t time inner encoder orthogonal signalling;M2For the number of high-frequency clock pulse in the t time;N
Represent encoder resolution.
As shown in Figure 1, the number of encoder output pulse is M1, the number of high-frequency clock pulse is M2, t is detection time
Allow gate time, high-frequency clock pulse is opened in the rising edge or failing edge of encoder output pulse, by setting
High-frequency clock pulse, M are closed by the rising edge or failing edge of encoder pulse signal again after integer orthogonal signalling1It can only be rounded
Bring error when numerical value stops between two successive pulse signals to avoid encoder.High-frequency clock pulse M2In the presence of ± 1
A pulse error, relative error 1/M2, high-frequency clock pulse frequency is higher, and the motor revolution error measured is smaller.
In a particular embodiment, using No. 3 timers, wherein TIM1 is set as orthogonal encoder operational mode state;When
Start after TIM1 starting to externally input encoder quadrature signal-count, timer is 16, the overall situation of setting one 32
Variable carries out Overflow handling;TIM2 is used for the selection of velocity shooting, samples the encoder in a bit of time by interrupt routine
Which velocity shooting is the number of orthogonal signalling judge to be currently at, the corresponding M of each velocity shooting1Size and speed height at
Proportional relation;TIM3 is used for high-frequency clock pulse M2Counting, setting one 32 variable carry out Overflow handling.
As shown in Fig. 2, TIM1 starts to encoder quadrature signal-count, and TIM2 is obtained while starting after system initialization
Take the count value of current TIM1;After TIM2 timing, triggering, which is interrupted, enters interrupt function, obtains the meter of current TIM1 again
Numerical value judges the velocity shooting being presently in by comparing front and back difference, determines the M of velocity shooting1, Fig. 3 show TIM2 timing
Device interrupt routine flow chart.The count value of encoder pulse signal is obtained after being optimized using K-Means clustering algorithm, in acquisition
Optional several points make initial center in sample data, then using Euclidean distance formula calculate remaining point respectively with initial center
Distance classifies remainder data according to the distance apart from initial center, recalculates to obtain cluster centre with the method for average value,
Until data value convergence is that algorithm terminates;The count value for obtaining current TIM1 judges next meter in current value by difference
Numerical value starts unlatching TIM3, using the M for judging setting in interrupt routine1Turn off TIM3 after a count value, at this time TIM3
Count value is M2, current motor revolving speed is calculated by formula, TIM3 is reset before entering circulation next time, makes to encode
Device orthogonal signalling are occurred with integer number, set high-frequency impulse M according to current motor revolving speed in real time1Value, realize pair
Motor low speed to high speed the different motor speed stages precise measurement, while also achieving and motor speed measuring real-time wanted
It asks.
The above description is merely a specific embodiment, but scope of protection of the present invention is not limited thereto, any
In range disclosed by the invention, the change or replacement that can be readily occurred in should all be contained those familiar with the art
Lid is within the scope of the invention as claimed.
Claims (4)
1. a kind of change M/T speed-measuring method based on incremental optical-electricity encoder, which comprises the following steps:
Step 1, the Initialize installation that device and system are timed using No. three timers of single-chip microcontroller, first via timer setting
For orthogonal encoder operational mode state, the counting of high-frequency impulse is carried out;No. second timer carries out selection judgement to velocity shooting;
The counting of third road timer progress high-frequency clock pulse;
After step 2, Initialize installation are completed, first via timer is to encoder quadrature signal-count and poly- using K-Means
Class algorithm optimization count value counts to get one group of encoder quadrature signal value and obtains cluster centre point by algorithm process to drop
Low error;
Step 3, starting No. second timer, obtain the count value of current first via timer, obtain again at the end of timing
The count value of current first via timer, the velocity shooting being presently in is judged by comparing front and back difference, determines velocity shooting
M1;
Step 4, starting No. second timer, obtain the count value of current first via timer, and third road timer is opened, and pass through
The M of setting1After a count value, third road timer is turned off, the count value of third road timer is M2;
Step 5, the start-stop that high-frequency impulse is synchronized with the rising edge of code device signal, failing edge;In low speed, the M of setting1Value
Small, the time counted by high-frequency clock pulse is short;In high speed, the M of setting1Greatly, motor speed is high, and detection time is short;
Step 6 calculates current motor speed, resets third road timer count value before entering the counting period next time.
2. a kind of change M/T speed-measuring method based on incremental optical-electricity encoder according to claim 1, which is characterized in that
Specific step is as follows for the step 2:
Step 2.1 when obtaining encoder quadrature signal value array is { m1, m2, m3 ..., mi ..., mn }, and optional several points are made
For initial center;
Step 2.2 calculates remaining point using Euclidean distance formula respectively at a distance from initial center, with optional several points conduct
The close point of the distance of initial center is classified as one kind, sorts out until remaining all point and finishes;
Step 2.3 is recalculated cluster centre point by qualitative modeling, repeats above step;
Step 2.4, until algorithmic statement, that is, cluster centre point no longer changes, terminate.
3. a kind of change M/T speed-measuring method based on incremental optical-electricity encoder according to claim 1, which is characterized in that
In the step 3, different orthogonal intersection code signal value M is set according to the height of motor speed1, by measuring different M1, come true
Determine detection time, detection time is calculated by high-frequency clock pulse, shown in following formula:
Assuming that high-frequency clock pulse frequency is fclk, the high-frequency pulse signal number measured is M2, then detection time are as follows:
T=M2/fclk。
4. a kind of change M/T speed-measuring method based on incremental optical-electricity encoder according to claim 1, which is characterized in that
In the step 6, it is as follows that motor speed calculates formula:
N=60M1fclk/NM2
In above formula, M1For the number of t time inner encoder orthogonal signalling;M2For the number of high-frequency clock pulse in the t time;N is represented
Encoder resolution.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811184448.8A CN109283354A (en) | 2018-10-11 | 2018-10-11 | A kind of change M/T speed-measuring method based on incremental optical-electricity encoder |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811184448.8A CN109283354A (en) | 2018-10-11 | 2018-10-11 | A kind of change M/T speed-measuring method based on incremental optical-electricity encoder |
Publications (1)
Publication Number | Publication Date |
---|---|
CN109283354A true CN109283354A (en) | 2019-01-29 |
Family
ID=65177399
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811184448.8A Pending CN109283354A (en) | 2018-10-11 | 2018-10-11 | A kind of change M/T speed-measuring method based on incremental optical-electricity encoder |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109283354A (en) |
Cited By (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111337702A (en) * | 2020-03-24 | 2020-06-26 | 深圳市微秒控制技术有限公司 | Data processing system and method for optical incremental encoder |
CN111917407A (en) * | 2020-08-13 | 2020-11-10 | 深圳市蓝德欧智能控制技术有限公司 | M/T speed measurement system and method realized by using hardware gate circuit |
CN112450760A (en) * | 2019-09-09 | 2021-03-09 | 广东美的生活电器制造有限公司 | Motor speed measuring structure, motor, food processor and motor speed measuring method |
CN112986605A (en) * | 2021-02-22 | 2021-06-18 | 合肥宏晶微电子科技股份有限公司 | Motor speed measuring method and device |
CN113551590A (en) * | 2021-06-02 | 2021-10-26 | 广州南方卫星导航仪器有限公司 | Motor rotation angle measuring device and method, storage medium and motor |
CN114778884A (en) * | 2022-04-07 | 2022-07-22 | 善纳科技(苏州)有限公司 | Speed measuring method and device based on incremental encoder and electronic equipment |
CN117227331A (en) * | 2023-08-17 | 2023-12-15 | 肇庆北新建材有限公司 | Online gypsum board spray printing system and method |
Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105305755A (en) * | 2015-11-06 | 2016-02-03 | 中国科学院电工研究所 | Detection method for rotor position of permanent-magnet synchronous motor |
-
2018
- 2018-10-11 CN CN201811184448.8A patent/CN109283354A/en active Pending
Patent Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105305755A (en) * | 2015-11-06 | 2016-02-03 | 中国科学院电工研究所 | Detection method for rotor position of permanent-magnet synchronous motor |
Non-Patent Citations (2)
Title |
---|
李平舟 等: "基于微控制器的M/T法电机测速方法研究", 《电子科技》 * |
王海勇 等: "一种变M/T测速方法的研究与实验", 《测控技术》 * |
Cited By (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112450760A (en) * | 2019-09-09 | 2021-03-09 | 广东美的生活电器制造有限公司 | Motor speed measuring structure, motor, food processor and motor speed measuring method |
CN111337702A (en) * | 2020-03-24 | 2020-06-26 | 深圳市微秒控制技术有限公司 | Data processing system and method for optical incremental encoder |
CN111917407A (en) * | 2020-08-13 | 2020-11-10 | 深圳市蓝德欧智能控制技术有限公司 | M/T speed measurement system and method realized by using hardware gate circuit |
CN112986605A (en) * | 2021-02-22 | 2021-06-18 | 合肥宏晶微电子科技股份有限公司 | Motor speed measuring method and device |
CN113551590A (en) * | 2021-06-02 | 2021-10-26 | 广州南方卫星导航仪器有限公司 | Motor rotation angle measuring device and method, storage medium and motor |
CN113551590B (en) * | 2021-06-02 | 2024-04-09 | 广州南方卫星导航仪器有限公司 | Motor rotation angle measuring device and method, storage medium and motor |
CN114778884A (en) * | 2022-04-07 | 2022-07-22 | 善纳科技(苏州)有限公司 | Speed measuring method and device based on incremental encoder and electronic equipment |
CN117227331A (en) * | 2023-08-17 | 2023-12-15 | 肇庆北新建材有限公司 | Online gypsum board spray printing system and method |
CN117227331B (en) * | 2023-08-17 | 2025-03-07 | 肇庆北新建材有限公司 | Online gypsum board spray printing system and method |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109283354A (en) | A kind of change M/T speed-measuring method based on incremental optical-electricity encoder | |
CN102200541B (en) | Method and device for measuring motor speed | |
Kavanagh | Improved digital tachometer with reduced sensitivity to sensor nonideality | |
CN102035455B (en) | M/T speed measuring method for frequency converter | |
CN104569472B (en) | A kind of velocity acquiring method based on photoelectric pulse coder | |
CN201615907U (en) | Low angular rate detection device for rotating stage | |
CN102928677A (en) | Nano pulse signal acquiring method | |
CN105305755A (en) | Detection method for rotor position of permanent-magnet synchronous motor | |
CN105319384B (en) | A kind of adaptive M based on FPGA/T velocity-measuring systems | |
CN108181482A (en) | Real-time low-speed detection device based on virtual sine wave | |
CN108226560A (en) | A kind of method and device for obtaining motor slow-speed of revolution angular speed | |
CN103872851A (en) | Rotating speed and displacement measuring system for rotation motor | |
CN105245203B (en) | High-precision low-speed clock duty ratio detecting system and method | |
CN106645780A (en) | Rotating speed detection method and system base on DSP | |
CN202940701U (en) | Rotation speed and displacement measurement system for rotation motor | |
CN205301352U (en) | Speed meter for hall sensor | |
CN101424695A (en) | Rotate speed and differential measurement method without velocity metre | |
CN110133316A (en) | A photoelectric encoder precision speed measurement system and method | |
CN102608348B (en) | Method for measuring rotating speed for irregular pulse signals | |
CN103105534A (en) | Phase difference measurement circuit and measurement method based on field programmable gata array (FPGA) identical periodic signals | |
CN105547130A (en) | Method and device for detecting pitch error of ABS ring gear | |
CN106089598A (en) | A kind of wind power generator rotor detection method and system | |
CN101702617B (en) | High Precision ±180° Digital Phase Discrimination Method and Its Implementing Device | |
US4537081A (en) | Flow metering circuit and method | |
CN202998070U (en) | Digital frequency voltage conversion circuit |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20190129 |
|
RJ01 | Rejection of invention patent application after publication |