Abstract: This article introduces a hardware circuit implementation method that applies the M/T method speed measurement principle and uses single-chip microcomputer P89C51RC+IA and EMP7064S to realize speed measurement. The implementation of the programmable device (EMP7064S) of the code disk pulse preprocessing circuit is also given.
Keywords: code wheel speed measurement measurement time encoding pulse
Speed measurement is an important part of the servo control system. So far, speed measurement can be divided into two categories: analog circuit speed measurement and digital circuit speed measurement. The development of microelectronics technology, the advancement of digital speed measurement technology, and the improvement of digital speed measurement performance have attracted people's attention to digital speed measurement.
With the development of microelectronics technology and the maturity of computer technology, digital speed measuring devices with computers as the core have emerged. Such a speed measuring device has a wide measuring range, flexible working methods, and wide adaptability, and has advantages that ordinary digital speed measuring devices cannot match. This article applies the M/T method speed measurement principle and uses PHILIPS P89C51RC+IA and ALTERAEPM7064S to achieve speed measurement.
1 Working principle of M/T measurement method
The key component used in digital speed measurement is the photoelectric encoder, commonly known as the code disk. The encoder is an angle sensor that converts the angle into a pulse train. The number of engraved lines m, the engraved line error ε and the electrical characteristics of the output signal are the main technical indicators of the code disk. The code disk outputs two rectangular pulse trains with a difference of 90°, and outputs m pulses per rotation. The rotational speed can be measured by measuring the frequency of the pulse train.
This article uses the M/T method to measure speed. This method requires a code disk pulse counter, a standard time counter, and a timer. The timer sets the measurement time Ts. Within the measurement time Ts, the code disk pulses and standard time signals are counted simultaneously. When the measurement time is up, a scheduled interrupt is generated. The microcontroller executes the interrupt program, reads the value of the code disk pulse counter and the standard time count, and calculates the rotation speed from the count value.
2 EMP7064S implementation of code disk pulse preprocessing
In a digital speed measurement system using a code wheel, the processing of the code wheel signal includes frequency multiplication, output control and direction signal extraction.
2.1 Code disk pulse frequency multiplication circuit
Doubling the frequency of the code wheel output pulse is equivalent to increasing the number of code wheel markings, which can improve the measurement accuracy and improve the dynamic performance of the measurement. The size of the code disk pulse count value affects the size of the engraving error. For the same code disk, after the output signal is processed by the code disk pulse frequency multiplication circuit, the frequency increases, the count value of the code disk pulse within the same measurement time is large, and the error caused by the engraved line in the measurement results is small. At the same time, if the lower limit of the measurement time is fixed, the lower limit of the measurable rotation speed will be low. The pulse signal of up to 4 times the frequency can be obtained by pulse processing of the code disk. The processing circuit and timing relationship are shown in Figure 1.
2.2 Capture pulse output control circuit
In order to ensure the connectivity of the measurement, the code disk pulse counter and the standard time counter must count continuously, and the count values of these two counters must be read continuously during the measurement process. In order to prevent the counter value from being unstable and misreading during the counting process, a counter with a capture function must be used. At the required moment, capture the count value into the register by capturing the signal, and then read the capture register, so that the read value is stable and reliable. In order to ensure that the read code disk pulse count value and the standard time count value are at the same time, the capture signal should be the same. This signal is the code disk pulse signal. In this way, it is only the basic condition to ensure that the two count values read out are at the same time. If a new capture occurs during the process of reading out data, the data read out will not be at the same time, causing measurement errors. Therefore, after reading the data, you should use the capture flag to determine whether a new capture has occurred. If a new capture occurs, read again until no new capture occurs. In this method, if the output of the capture signal is not limited, when the frequency of the code disk output pulse is very high, the adjacent capture time will be short. When it is short to a certain extent and the capture time is less than the reading and judgment time of the program, the count value cannot be read, thus limiting the upper limit of the speed measurement. Controlling the capture pulse output is to increase the upper limit of speed measurement. The functional circuit and timing are shown in Figure 2. Among them, C is the capture signal, and Ctl is the output control signal, which is used to control the output of the code disk pulse Fm.
2.3 Direction signal extraction circuit
When measuring rotational speed, not only the magnitude of the speed but also the direction of the speed must be given. From the measurement principle used, it can be seen that the direction information cannot be obtained during the measurement process, and the rotation direction can only be obtained through the code wheel output pulse. Assume that when turning clockwise, A leads B by 90°; conversely, B leads A by 90°. According to this relationship, the direction signal can be obtained. The circuit and timing to implement this function are shown in Figure 3. D represents different levels representing different directions of rotation.
3. Composition of measurement system
A timer, a code disk pulse counter with capture function and a standard time counter with capture function are used in the measurement process. P89C51RC+IA has three timers TIME0~0 and a PCA programmable counting array. Among them, timer 2 and PCA array have count capture function. The measurement block diagram shown in Figure 4 is constructed according to the measurement method used. As can be seen from Figure 4, timer 2 is used to count code disk pulses, the PCA array is used to count standard time signals, and timer 1 is used to determine the measurement time, thus forming a basic measurement system. The measurement time is determined during measurement, thus forming a basic measurement system. The code disk pulse Fm (signal after frequency multiplication) and the standard time signal are counted simultaneously within the measurement time Ts. Timer 1 generates an interrupt every time Ts. Both Timer 2 and the PCA count array are captured on the falling edge. The values of the capture register at time a and b are the counting values of the counter at time ti and ti+1 respectively. Set the values of timer 2 and PCA array capture register at time a and b to Cti, Cti+1 and Cmi, Cmi+1 respectively. Then the rotation speed is ω=[90 (Cmi+1-Cmi)/mTc(Cti+1-Cti)](°/s).
4 Software design
This article introduces the digital measurement method based on the M/T method to implement rotational speed measurement for PHILIPS P89C51RC+IA and ALTERA EMP7064S. Due to the special structure of P89C51RC+IA microcontroller timer 2, PCA programmable counter capture function and the programmable function of EMP7064S, the circuit design is greatly simplified and the reliability of the system is improved. This instrument is made into a PC ISA card personal instrument, which can not only utilize the resources of the PC, but also simplify the measurement system. This design has been successfully used in the rate measurement of the simulated test turntable.
Previous article:Development of mobile temperature data collector with infrared interface
Next article:Research on Microcomputer Keyboard Interface and Its Application in Instruments
- Popular Resources
- Popular amplifiers
- Keysight Technologies Helps Samsung Electronics Successfully Validate FiRa® 2.0 Safe Distance Measurement Test Case
- From probes to power supplies, Tektronix is leading the way in comprehensive innovation in power electronics testing
- Seizing the Opportunities in the Chinese Application Market: NI's Challenges and Answers
- Tektronix Launches Breakthrough Power Measurement Tools to Accelerate Innovation as Global Electrification Accelerates
- Not all oscilloscopes are created equal: Why ADCs and low noise floor matter
- Enable TekHSI high-speed interface function to accelerate the remote transmission of waveform data
- How to measure the quality of soft start thyristor
- How to use a multimeter to judge whether a soft starter is good or bad
- What are the advantages and disadvantages of non-contact temperature sensors?
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- [Perf-V Review] + Issues to note when installing Perf-V IDE
- Multi-channel Bluetooth antenna design
- Which expert can give me a complete cadence project?
- Working principle, functional characteristics and classification of photoelectric liquid level sensors
- EEWORLD University Hall--Detailed explanation of MATLAB image functions and their applications
- Get free high-speed digital design tips to avoid starting over with complex PCB designs
- What is the value of open source? Preliminary findings from a European Commission study
- [Erha Image Recognition Artificial Intelligence Vision Sensor] 1. Unboxing Experience
- TMS320C6000 Basic Learning (5) - Reading the DSP6713 Datasheet
- I need help, stlink v2 cannot be recognized and the firmware version cannot be seen