There is a position sensor that measures position changes. When the output signal of the sensor is measured with the voltage range of a multimeter, the result shows an analog signal, that is, the position and the signal output are linearly related. However, when the output signal of the sensor is measured with an oscilloscope (Picoscope 4227), it shows a PWM signal (pulse width modulation), that is, the duty cycle of the output PWM signal is different for different positions.
The parameters of the PWM signal are: 200 Hz, low level is 0V, high level is 18V.
Now it is confirmed that the output signal of my sensor is a PWM signal. The PWM signal needs to be input into the controller I/O, but the controller I/O port does not have the function of directly collecting PWM signals.
solution
Design a circuit to convert the PWM signal into an analog signal, and then input the converted analog signal into the controller analog I/O port.
Conversion circuit
1. Second-order voltage-controlled active low-pass filter circuit.
Design a deep filtering circuit. The filtering circuit diagram is:
The formula for low-pass filter frequency is: f=1/(2π*RC). I finally chose R=1K, C=10uf, and the calculated low-pass cutoff frequency f=15.9HZ.
The back end of the filter circuit is an operational amplifier, and the amplification formula is: A=1+Rf/R1. I don't want the voltage to be amplified, so I choose A=1.1. And because R1//Rf=2R (the value of R1 and Rf in parallel is equal to the value of R in series), the final result is: Rf=220 ohms, R1=2.2k, R=1k.
2. Integral circuit (passive filter circuit)
There is a two-stage integration circuit in front of the low-pass filter circuit (both capacitors are grounded), R=1K, C=10uf. The figure below is a first-stage integration circuit. The designed integration circuit is to connect the two circuits in series to form a second-stage integration circuit:
To test the circuit effect, I used a PicoScope4227. Since the device can only generate a voltage signal of positive or negative 1V at most, I generated a PWM signal with an amplitude of 1V (low level 0V, high level 1V) and a frequency of 200HZ as the input signal of the integration circuit. The various effect diagrams are as follows:
The oscilloscope directly samples the PWM signal generated by the generator, and the waveform is as follows:
The oscilloscope collects signals from the input end of the second-order filter circuit, and the waveform is as follows. It is found that this waveform has changed compared with the waveform in the figure above.
The signal waveform collected by the oscilloscope from the output end of the first-order filter circuit, that is, the output waveform of the intersection of the first resistor and the first capacitor from left to right in the filter circuit:
The signal waveform collected by the filter from the output end of the second-order filter circuit, that is, the final output signal waveform
Parameters of the final output waveform.
question
1: Why is it that when I use the voltage range of a multimeter to measure the output signal of a sensor, the result is an analog signal, while when I use an oscilloscope, the result is a PWM signal? Which result should I believe?
A: This question involves the resolution of the measurement input port. The resolution of the multimeter input port is low (in this example, it is less than 200HZ), while the resolution of the oscilloscope input port is high, reaching several thousand or even several megahertz, so the output results are different. We have to believe the results displayed by the oscilloscope. I understand that the essence of PWM signals is to achieve the effect of analog quantity, but the expression form is different.
2: About the calculation formula
Answer: In the low-pass filter circuit, there is a frequency formula f=1/(2π*RC), which calculates the low-pass cutoff frequency (-3dB). In the integration circuit, there is a formula T=RC. This T refers to the time required for the capacitor to charge and discharge. When selecting T, according to the general empirical formula, T>10 * T' (T' represents the signal period).
In the integration circuit of this example, RC=10ms, which is only twice the signal period, but through testing, the signal effect is still relatively ideal. If more integration circuits are connected in series, the effect will be better.
3: Are there any other solutions for the PWM signal to be collected by the controller?
Answer: Solution 1: Multiply the PWM signal, that is, increase the frequency of the PWM signal, but the duty cycle does not change. If the frequency after PWM multiplication is greater than the resolution of the controller I/O, it can be regarded as analog by the controller by default, and can be input into the analog I/O.
Solution 2: Calculate the PWM duty cycle by software. Write a program in the controller to first set the timing and measure the high level time of the PWM signal during this period of time, so as to calculate the duty cycle.
Previous article:DMM7510 Graphical Sampling Multimeter for Measuring Power-On and Power-Off Transient Events
Next article:Steps and methods for testing junction field effect transistors using a multimeter
- Popular Resources
- Popular amplifiers
- 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?
- In what situations are non-contact temperature sensors widely used?
- How non-contact temperature sensors measure internal temperature
- LED chemical incompatibility test to see which chemicals LEDs can be used with
- Application of ARM9 hardware coprocessor on WinCE embedded motherboard
- What are the key points for selecting rotor flowmeter?
- LM317 high power charger circuit
- A brief analysis of Embest's application and development of embedded medical devices
- Single-phase RC protection circuit
- stm32 PVD programmable voltage monitor
- Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer
- Improved design of Linux system software shell protection technology
- What to do if the ABB robot protection device stops
- CGD and Qorvo to jointly revolutionize motor control solutions
- CGD and Qorvo to jointly revolutionize motor control solutions
- Keysight Technologies FieldFox handheld analyzer with VDI spread spectrum module to achieve millimeter wave analysis function
- Infineon's PASCO2V15 XENSIV PAS CO2 5V Sensor Now Available at Mouser for Accurate CO2 Level Measurement
- Advanced gameplay, Harting takes your PCB board connection to a new level!
- Advanced gameplay, Harting takes your PCB board connection to a new level!
- A new chapter in Great Wall Motors R&D: solid-state battery technology leads the future
- Naxin Micro provides full-scenario GaN driver IC solutions
- Interpreting Huawei’s new solid-state battery patent, will it challenge CATL in 2030?
- Are pure electric/plug-in hybrid vehicles going crazy? A Chinese company has launched the world's first -40℃ dischargeable hybrid battery that is not afraid of cold
- What are the differences between wire-wound common mode inductors and chip-wound inductors?
- I don't understand some parameters in the datasheet of the op amp TL237X
- 【Live Replay Summary】Microchip ShieldsUP! Security Solutions Online Seminar Series (18 sessions)
- Lua script development based on serial port screen - use of pi
- NU510 can control the light strip without single chip microcomputer, dual color temperature dimming and color flow light
- TI mmWave Radar MIMO (2TX4RX) Setup
- [STM32MP157C-EV1] After the first unboxing and evaluation, I will run rtt on it and share other
- If you understand these eight basic circuits, analog circuit analysis will not be difficult!
- MSP430 Program Library---Button
- EEWORLD University ---- Live Replay: How Littelfuse Improves the Safety and Reliability of Electronic Equipment in Smart Buildings in the Internet of Things Era