CN113300902A - Multichannel pulse width measurement and data transmission processing method - Google Patents

Multichannel pulse width measurement and data transmission processing method Download PDF

Info

Publication number
CN113300902A
CN113300902A CN202110331734.8A CN202110331734A CN113300902A CN 113300902 A CN113300902 A CN 113300902A CN 202110331734 A CN202110331734 A CN 202110331734A CN 113300902 A CN113300902 A CN 113300902A
Authority
CN
China
Prior art keywords
channel
variable
value
message
timer
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.)
Granted
Application number
CN202110331734.8A
Other languages
Chinese (zh)
Other versions
CN113300902B (en
Inventor
朱银东
方泽莉
陈汉生
黄振强
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
FMI Technologies Inc
Original Assignee
FMI Technologies Inc
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by FMI Technologies Inc filed Critical FMI Technologies Inc
Priority to CN202110331734.8A priority Critical patent/CN113300902B/en
Publication of CN113300902A publication Critical patent/CN113300902A/en
Application granted granted Critical
Publication of CN113300902B publication Critical patent/CN113300902B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • H04L43/0852Delays
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01KMEASURING TEMPERATURE; MEASURING QUANTITY OF HEAT; THERMALLY-SENSITIVE ELEMENTS NOT OTHERWISE PROVIDED FOR
    • G01K7/00Measuring temperature based on the use of electric or magnetic elements directly sensitive to heat ; Power supply therefor, e.g. using thermoelectric elements
    • G01K7/16Measuring temperature based on the use of electric or magnetic elements directly sensitive to heat ; Power supply therefor, e.g. using thermoelectric elements using resistive elements
    • G01K7/22Measuring temperature based on the use of electric or magnetic elements directly sensitive to heat ; Power supply therefor, e.g. using thermoelectric elements using resistive elements the element being a non-linear resistance, e.g. thermistor
    • G01K7/24Measuring temperature based on the use of electric or magnetic elements directly sensitive to heat ; Power supply therefor, e.g. using thermoelectric elements using resistive elements the element being a non-linear resistance, e.g. thermistor in a specially-adapted circuit, e.g. bridge circuit
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01RMEASURING ELECTRIC VARIABLES; MEASURING MAGNETIC VARIABLES
    • G01R29/00Arrangements for measuring or indicating electric quantities not covered by groups G01R19/00 - G01R27/00
    • G01R29/02Measuring characteristics of individual pulses, e.g. deviation from pulse flatness, rise time or duration
    • G01R29/023Measuring pulse width
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/40Bus networks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/40Bus networks
    • H04L2012/40208Bus networks characterized by the use of a particular bus standard
    • H04L2012/40215Controller Area Network CAN

Landscapes

  • Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Nonlinear Science (AREA)
  • Environmental & Geological Engineering (AREA)
  • Arrangements For Transmission Of Measured Signals (AREA)

Abstract

The invention belongs to the technical field of signal processing, and particularly relates to a multichannel pulse width measurement and data transmission processing method. The invention adopts a FreeRTOS system, which comprises the following steps: each channel of the system finishes the establishment and the initialization of a capture mark variable and timer value storage variables of a rising edge and a falling edge, and starts to perform pulse measurement at regular time after the initialization variables are finished; inputting an interrupt callback function of a capture timer, performing channel judgment in the interrupt callback function of the timer, performing corresponding processing and simultaneously sending out a CAN message; receiving a CAN message, judging a command code in the received CAN message, and carrying out corresponding processing; and acquiring a corresponding binary semaphore, starting to calculate the temperature through the voltage, and replying a temperature reading CAN message. The invention has the characteristics of stability, reliability, capability of responding to the effect of communication processing in time and no need of additionally increasing hardware cost.

Description

Multichannel pulse width measurement and data transmission processing method
Technical Field
The invention belongs to the technical field of signal processing, and particularly relates to a multichannel pulse width measurement and data transmission processing method.
Background
At present, MCU often needs to carry out PWM control to multichannel fan, heating strip in temperature control process, in order to obtain closed feedback signal, often need to measure the pulse signal of the PWM signal of output or fan test, measurement based on MCU often is to count with the timer and measures, but because the system timer resource that occupies is more when the passageway that needs to measure is more, can cause the timer dysfunction when the pulse is faster, at this moment, the timer is unusual often to cause the chronogenesis disorder, subsequent control box communication all can go wrong.
In view of the above problems, the existing technical solutions often adopt to reduce the measurement channels or use the FPGA as a processor for processing. However, the problem exists that reducing the measurement channel can reduce the MCU burden to a certain extent to realize temperature measurement and operation, but the more comprehensive measurement can not be carried out, so that part of monitoring signals have the condition of being incapable of being monitored; although the multi-channel parallel data processing can be realized by adopting the FPGA for monitoring, the cost is undoubtedly increased by additionally adding an FPGA chip on the main control MCU.
Therefore, it is necessary to design a measuring method that can stably and reliably perform multi-channel pulse width measurement, respond to the communication processing effect in time, and do not need to increase the cost additionally.
For example, the implementation method of the multi-channel laser fuse target feature identification signal processing circuit described in chinese patent application No. CN201711099390.2 integrates an FPGA chip and a TDC chip, performs real-time processing on multi-channel pulse signals at the same time, and measures echo delay and pulse width reflecting target features; carrying out echo high-speed sampling, time sequence processing and digital signal processing by the FPGA chip, and carrying out parameter configuration and delayed data transmission on the TDC chip; and the TDC chip performs delay measurement and transmits data of the delay measurement to the FPGA chip. Although the echo delay measurement and the high-speed sampling are integrated into a digital signal processing circuit based on an integrated design scheme of full digital signal processing, the echo pulses of 8 detection channels can be simultaneously sampled at high speed, the delay measurement precision reaches +/-0.1 ns, and the pulse width measurement precision reaches +/-1 ns. And fitting a criterion function according to the delay and pulse width functions of the target, screening the delay and pulse width combinations of the echoes of the 8 detection channels, identifying the characteristics of the target, and removing invalid interference echo signals. However, the method has the disadvantages that the FPGA chip and the TDC chip are integrated to simultaneously process the multi-channel pulse signals in real time, so that the hardware cost is increased, and the popularization and the use are not facilitated.
Disclosure of Invention
The invention provides a multichannel pulse width measurement and data transmission processing method which is more stable and reliable, can respond to communication processing in time and does not need to additionally increase hardware cost, aiming at solving the problems that the prior art cannot carry out more comprehensive measurement by adopting a mode of reducing measurement channels or using an FPGA (field programmable gate array) as a processor for processing aiming at multichannel pulse width measurement, so that part of monitoring signals cannot be monitored and the hardware cost can be increased.
In order to achieve the purpose, the invention adopts the following technical scheme:
a multichannel pulse width measurement and data transmission processing method adopts a FreeRTOS system, wherein the FreeRTOS system comprises a plurality of measurement channels; the method comprises the following steps:
s1, each channel of the system completes the creation and initialization of the capture mark variable and the timer value storage variable of the rising edge and the falling edge, and starts to perform pulse measurement at regular time after the initialization variable is completed;
s2, inputting the interrupt callback function of the capture timer, judging the channel in the interrupt callback function of the timer, and sending out the CAN message while processing correspondingly;
s3, receiving the CAN message, judging the command code in the received CAN message, and if the command code is a CAN command, directly replying by the system; if the command code needs to be consumed, releasing the binary semaphore in the interruption, enabling the task to acquire the binary semaphore, and starting to execute the processing method of the consumed time command code after synchronizing the task;
s4, obtaining the corresponding binary semaphore from step S3, starting to calculate the temperature by voltage, and replying with the read temperature CAN message.
Preferably, step S1 specifically includes the following steps:
s11, creating a captured mark variable in each channel of the system and initializing the mark variable to 0, and simultaneously creating timer values of a rising edge and a falling edge corresponding to each channel and storing the variables to 0;
s12, judging whether the flag variable is 0, if the flag variable is 0, adding 1 to the flag variable value, and starting rising edge detection to enable capture interruption; if the flag variable is not 0, it is continuously determined whether the flag variable is 3.
Preferably, step S1 further includes the steps of:
s13, if the flag variable is 3, subtracting the timer value at the falling edge from the timer value at the rising edge, resetting the flag variable to 0, and delaying for 500ms by using the system delay function; if the flag variable is not 3, the process returns to step S12.
Preferably, step S2 specifically includes the following steps:
s21, when the interrupt is triggered, judging whether the timer is triggered by the input capture timer, if not, returning to the operation before the interrupt is triggered; if the input captured timer is triggered, continuously judging which channel mark variable is changed;
s22, after finding out the channel with the changed mark variable, judging the number of the changed mark variable in the channel;
s23, if the value of the flag variable is 1, assigning the capture register value of the channel corresponding to the flag variable to the rising edge variable, simultaneously changing the trigger condition of the channel into falling edge trigger, and adding 1 to the flag variable value;
and S24, if the value of the flag variable is 2, assigning the capture register value of the channel corresponding to the flag variable to the falling edge variable, stopping the detection of the channel at the same time, and adding 1 to the flag variable value.
Preferably, step S3 specifically includes the following steps:
s31, receiving the CAN message, intercepting the command code from the extended frame CAN ID, and judging the specific instruction of the command code;
s32, if the command code is read version command, immediately replying version message;
s33, if the command code is a command for reading the fan speed, the latest fan speed value is put in the data area and the current fan speed command is sent;
s34, if the command code is a command for setting the fan rotating speed, releasing a binary semaphore 1 and replying a response message;
s35, if the command code is a read temperature command, the binary semaphore 2 is released.
Preferably, the multichannel pulse width measurement and data transmission processing method further includes an analog-to-digital converter ADC and a PTC thermistor, and step S4 specifically includes the following steps:
s41, blocking to wait for receiving the binary semaphore 2, and updating the DMA storage of the analog-to-digital converter ADC;
s42, sorting the updated arrays according to a bubbling method, and calculating an average value after removing the maximum value and the minimum value of the sorted data;
s43, calculating the voltage value of the PTC thermistor by using the filtered ADC data, and calculating the temperature according to the voltage value;
and S44, delaying for 500ms by using the system delay function, and replying to read the temperature CAN message.
Preferably, the delay function is a delay function of a FreeRTOS system, and is used for releasing the MCU.
Compared with the prior art, the invention has the beneficial effects that: (1) according to the invention, a processing mechanism and a task processing method are optimized, a time-consuming task is put into the task for processing, a binary semaphore synchronization task is utilized, a non-time-consuming task is processed immediately in an interrupt callback, the interrupt occupation time is reduced, and the effects of stable system and quick response are achieved; (2) the invention realizes the pulse width measurement function of a plurality of channels by utilizing the multitask processing mechanism of the FreeRTOS system, achieves the effect of multitask simultaneous processing realized by a bare computer, improves the stable processing of the multichannel pulse width measurement, does not need to reduce detection channels, does not need to increase FPGA hardware, and achieves the effects of low cost, stability and reliability.
Drawings
FIG. 1 is a flow chart of the present invention for pulse width measurement;
FIG. 2 is a flow diagram of interrupt callback function processing in accordance with the present invention;
FIG. 3 is a flow chart of CAN message processing in the present invention;
FIG. 4 is a flow chart of a temperature calculation process performed in the present invention;
FIG. 5 is a circuit diagram for temperature acquisition according to the present invention;
FIG. 6 is a circuit diagram for CAN message processing in accordance with the present invention;
FIG. 7 is a circuit diagram of the present invention for connecting the PWM feedback signal to the MCU input capture;
fig. 8 is a circuit diagram of the measurement of the mid-stage signal for temperature control according to the present invention.
Detailed Description
In order to more clearly illustrate the embodiments of the present invention, the following description will explain the embodiments of the present invention with reference to the accompanying drawings. It is obvious that the drawings in the following description are only some examples of the invention, and that for a person skilled in the art, other drawings and embodiments can be derived from them without inventive effort.
Example 1:
the invention provides a multichannel pulse width measurement and data transmission processing method, which adopts a FreeRTOS system, wherein the FreeRTOS system comprises a plurality of measurement channels; the method comprises the following steps:
s1, each channel of the system completes the creation and initialization of the capture mark variable and the timer value storage variable of the rising edge and the falling edge, and starts to perform pulse measurement at regular time after the initialization variable is completed;
s2, inputting the interrupt callback function of the capture timer, judging the channel in the interrupt callback function of the timer, and sending out the CAN message while processing correspondingly;
s3, receiving the CAN message, judging the command code in the received CAN message, and if the command code is a CAN command, directly replying by the system; if the command code needs to be consumed, releasing the binary semaphore in the interruption, enabling the task to acquire the binary semaphore, and starting to execute the processing method of the consumed time command code after synchronizing the task;
s4, obtaining the corresponding binary semaphore from step S3, starting to calculate the temperature by voltage, and replying with the read temperature CAN message.
Further, as shown in fig. 1, step S1 specifically includes the following steps:
s11, creating a captured mark variable in the channel 1 and initializing the mark variable to 0, and simultaneously creating timer values of a rising edge and a falling edge corresponding to the channel 1 and storing the variables to 0;
s12, judging whether the flag variable is 0, if the flag variable is 0, adding 1 to the flag variable value, and starting rising edge detection to enable capture interruption; if the flag variable is not 0, it is continuously determined whether the flag variable is 3.
S13, if the flag variable is 3, subtracting the timer value at the falling edge from the timer value at the rising edge, resetting the flag variable to 0, and delaying for 500ms by using the system delay function; if the flag variable is not 3, the process returns to step S12.
Fig. 1 is a flow chart illustrating a task by taking a pulse width measurement channel 1 as an example, in which pulse measurement can be performed at regular time in the task after initialization variables are completed, and the delay adopts a delay function of a FreeRTOS system to facilitate release of an MCU. The processing method for channel 1 can measure the pulse width for each of the other channels in the same manner.
Further, as shown in fig. 2, step S2 specifically includes the following steps:
s21, when the interrupt is triggered, judging whether the timer is triggered by the input capture timer, if not, returning to the operation before the interrupt is triggered; if the input captured timer is triggered, continuously judging which channel mark variable is changed;
s22, after finding out the channel with the changed mark variable, judging the number of the changed mark variable in the channel;
s23, if the value of the flag variable is 1, assigning the capture register value of the channel corresponding to the flag variable to the rising edge variable, simultaneously changing the trigger condition of the channel into falling edge trigger, and adding 1 to the flag variable value;
and S24, if the value of the flag variable is 2, assigning the capture register value of the channel corresponding to the flag variable to the falling edge variable, stopping the detection of the channel at the same time, and adding 1 to the flag variable value.
The flow shown in fig. 2 is to implement the task of measuring the pulse width, and in addition to the task, the channel determination is also needed in the interrupt callback function of the timer, and the corresponding processing is performed. In fig. 2, there are N flag variables corresponding to N channels, each channel corresponds to 1 flag variable, the flag variable 1 corresponds to channel 1, the flag variable 2 corresponds to channels 2 and … …, and the flag variable N corresponds to channel N, and when the flag variable changes, the corresponding channel generates the processing operations of step S23 and step S24.
Both single channel and multi-channel measurements can be measured by the flow of fig. 1 and 2.
Further, as shown in fig. 3, step S3 specifically includes the following steps:
s31, receiving the CAN message, intercepting the command code from the extended frame CAN ID, and judging the specific instruction of the command code;
s32, if the command code is read version command, immediately replying version message;
s33, if the command code is a command for reading the fan speed, the latest fan speed value is put in the data area and the current fan speed command is sent;
s34, if the command code is a command for setting the fan rotating speed, releasing a binary semaphore 1 and replying a response message;
s35, if the command code is a read temperature command, the binary semaphore 2 is released.
In order to ensure stable operation, realize task execution and response to an upper computer as far as possible, and also need to optimize CAN communication reply and other corresponding time-consuming task processing flows, the invention directly replies to a non-time-consuming CAN command, and the time-consuming commands (such as a fan rotating speed reading command, a fan rotating speed setting command and a temperature reading command) are not processed in the interruption by the CAN, but a method for releasing a binary semaphore in the interruption, acquiring the binary semaphore in the task, and starting to execute the time-consuming task after the task is synchronized is adopted.
Further, as shown in fig. 4, the multichannel pulse width measurement and data transmission processing method further includes an analog-to-digital converter ADC and a PTC thermistor, and step S4 specifically includes the following steps:
s41, blocking to wait for receiving the binary semaphore 2, and updating the DMA storage of the analog-to-digital converter ADC;
s42, sorting the updated arrays according to a bubbling method, and calculating an average value after removing the maximum value and the minimum value of the sorted data;
s43, calculating the voltage value of the PTC thermistor by using the filtered ADC data, and calculating the temperature according to the voltage value;
and S44, delaying for 500ms by using the system delay function, and replying to read the temperature CAN message.
In the invention, it is time-consuming to process the temperature acquisition and calculation of the ADC during temperature acquisition, and here, the temperature processing is taken as an example to explain a processing mechanism of a time-consuming task, as shown in fig. 4, temperature acquisition of a detection point is not required to be performed most of the time in the temperature acquisition task, and the time-consuming calculation and task processing are performed after a corresponding binary semaphore is acquired.
Further, the delay function is a delay function of a FreeRTOS system, and is used for releasing the MCU.
Example 2:
the invention uses STM32F767IGT6 as MCU (main control chip), the MCU master frequency can reach up to 216MHz, and enough FLASH runs FreeRTOS system and stores application code.
The PTC thermistor is used for temperature measurement, and the resistance value of the thermistor is calculated through voltage division so as to obtain the temperature. Part of the circuit for temperature acquisition is shown in fig. 5. The circuit in fig. 5 includes a chip DA26, a capacitor C28, a capacitor C29, a capacitor C30, a capacitor C31, a capacitor C32, a capacitor C33, a resistor R15, a resistor R16, a resistor R17, a resistor R18, a resistor R19, and a resistor R20. The capacitors are all 1000PF, and the resistors are all 10K omega.
The CAN message communication in the invention adopts TJA050 as a CAN transceiver, and a specific application circuit is shown in figure 6. The circuit of fig. 6 includes a common mode inductor ACT45B that functions as an EMI filter to suppress the emission of electromagnetic waves radially outward from the high speed signal lines. The circuit in fig. 6 further includes a capacitor C60, a resistor R72, a diac D14, and a diac D15.
In the invention, an application circuit used for accessing a PWM feedback signal to MCU input capture is shown in FIG. 7, and the PWM feedback signal of a fan in FIG. 7 is isolated by an optical coupler and then is connected to the input capture IO of the MCU. The circuit in fig. 7 includes a photocoupler PS2801C-4, a resistor R25, a resistor R26, a resistor R27, a resistor R28, a resistor R29, a resistor R30, a resistor R31, and a resistor R32. And the photoelectric coupler is used for carrying out optical coupling isolation on the PWM feedback signal.
In addition, in the invention, the intermediate-level signal of temperature control can also be measured, and can be input to the MCU after being isolated by four optical couplers like the feedback signal of the fan, and the specific application circuit is shown in fig. 8. The circuit in fig. 8 includes a photo coupler PS2801C-4, a resistor R48, a resistor R49, a resistor R51, a resistor R52, a resistor R53, and a resistor R54.
According to the invention, a processing mechanism and a task processing method are optimized, a time-consuming task is put into the task for processing, a binary semaphore synchronization task is utilized, a non-time-consuming task is processed immediately in an interrupt callback, the interrupt occupation time is reduced, and the effects of stable system and quick response are achieved; the invention realizes the pulse width measurement function of a plurality of channels by utilizing the multitask processing mechanism of the FreeRTOS system, achieves the effect of multitask simultaneous processing realized by a bare computer, improves the stable processing of the multichannel pulse width measurement, does not need to reduce detection channels, does not need to increase FPGA hardware, and achieves the effects of low cost, stability and reliability.
The foregoing has outlined rather broadly the preferred embodiments and principles of the present invention and it will be appreciated that those skilled in the art may devise variations of the present invention that are within the spirit and scope of the appended claims.

Claims (7)

1. The multichannel pulse width measurement and data transmission processing method is characterized in that a FreeRTOS system is adopted, and the FreeRTOS system comprises a plurality of measurement channels; the method comprises the following steps:
s1, each channel of the system completes the creation and initialization of the capture mark variable and the timer value storage variable of the rising edge and the falling edge, and starts to perform pulse measurement at regular time after the initialization variable is completed;
s2, inputting the interrupt callback function of the capture timer, judging the channel in the interrupt callback function of the timer, and sending out the CAN message while processing correspondingly;
s3, receiving the CAN message, judging the command code in the received CAN message, and if the command code is a CAN command, directly replying by the system; if the command code needs to be consumed, releasing the binary semaphore in the interruption, enabling the task to acquire the binary semaphore, and starting to execute the processing method of the consumed time command code after synchronizing the task;
s4, obtaining the corresponding binary semaphore from step S3, starting to calculate the temperature by voltage, and replying with the read temperature CAN message.
2. The multi-channel pulse width measurement and data transmission processing method of claim 1, wherein the step S1 specifically comprises the following steps:
s11, creating a captured mark variable in each channel of the system and initializing the mark variable to 0, and simultaneously creating timer values of a rising edge and a falling edge corresponding to each channel and storing the variables to 0;
s12, judging whether the flag variable is 0, if the flag variable is 0, adding 1 to the flag variable value, and starting rising edge detection to enable capture interruption; if the flag variable is not 0, it is continuously determined whether the flag variable is 3.
3. The multi-channel pulse width measurement and data transmission processing method of claim 2, wherein the step S1 further comprises the steps of:
s13, if the flag variable is 3, subtracting the timer value at the falling edge from the timer value at the rising edge, resetting the flag variable to 0, and delaying for 500ms by using the system delay function; if the flag variable is not 3, the process returns to step S12.
4. The multi-channel pulse width measurement and data transmission processing method of claim 1, wherein the step S2 specifically comprises the following steps:
s21, when the interrupt is triggered, judging whether the timer is triggered by the input capture timer, if not, returning to the operation before the interrupt is triggered; if the input captured timer is triggered, continuously judging which channel mark variable is changed;
s22, after finding out the channel with the changed mark variable, judging the number of the changed mark variable in the channel;
s23, if the value of the flag variable is 1, assigning the capture register value of the channel corresponding to the flag variable to the rising edge variable, simultaneously changing the trigger condition of the channel into falling edge trigger, and adding 1 to the flag variable value;
and S24, if the value of the flag variable is 2, assigning the capture register value of the channel corresponding to the flag variable to the falling edge variable, stopping the detection of the channel at the same time, and adding 1 to the flag variable value.
5. The multi-channel pulse width measurement and data transmission processing method of claim 1, wherein the step S3 specifically comprises the following steps:
s31, receiving the CAN message, intercepting the command code from the extended frame CAN ID, and judging the specific instruction of the command code;
s32, if the command code is read version command, immediately replying version message;
s33, if the command code is a command for reading the fan speed, the latest fan speed value is put in the data area and the current fan speed command is sent;
s34, if the command code is a command for setting the fan rotating speed, releasing a binary semaphore 1 and replying a response message;
s35, if the command code is a read temperature command, the binary semaphore 2 is released.
6. The multi-channel pulse width measurement and data transmission processing method according to claim 5, further comprising an analog-to-digital converter (ADC) and a Positive Temperature Coefficient (PTC) thermistor, wherein the step S4 specifically comprises the following steps:
s41, blocking to wait for receiving the binary semaphore 2, and updating the DMA storage of the analog-to-digital converter ADC;
s42, sorting the updated arrays according to a bubbling method, and calculating an average value after removing the maximum value and the minimum value of the sorted data;
s43, calculating the voltage value of the PTC thermistor by using the filtered ADC data, and calculating the temperature according to the voltage value;
and S44, delaying for 500ms by using the system delay function, and replying to read the temperature CAN message.
7. The method of claim 3 or 6, wherein the delay function is a delay function of a FreeRTOS system for releasing MCU.
CN202110331734.8A 2021-03-29 2021-03-29 Multichannel pulse width measurement and data transmission processing method Active CN113300902B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110331734.8A CN113300902B (en) 2021-03-29 2021-03-29 Multichannel pulse width measurement and data transmission processing method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110331734.8A CN113300902B (en) 2021-03-29 2021-03-29 Multichannel pulse width measurement and data transmission processing method

Publications (2)

Publication Number Publication Date
CN113300902A true CN113300902A (en) 2021-08-24
CN113300902B CN113300902B (en) 2022-05-20

Family

ID=77319296

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110331734.8A Active CN113300902B (en) 2021-03-29 2021-03-29 Multichannel pulse width measurement and data transmission processing method

Country Status (1)

Country Link
CN (1) CN113300902B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114814379A (en) * 2022-05-13 2022-07-29 长沙祥云瑞风信息技术有限公司 Fault injection-based narrow pulse detection method, system, medium and equipment

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102298095A (en) * 2011-06-27 2011-12-28 中国国土资源航空物探遥感中心 Method for ensuring accurate measurement on pulse width in multi-task singlechip system and device
US20140021938A1 (en) * 2011-04-06 2014-01-23 Sangyong Lee Multi-channel pwm waveform measuring device
CN106569032A (en) * 2016-10-17 2017-04-19 长沙开元仪器股份有限公司 Signal frequency and duty ratio prediction method based on embedded microcontroller
CN106707034A (en) * 2016-12-26 2017-05-24 哈尔滨工业大学 Pulse signal detection method based on Windows system function and multi-thread technology
CN108061885A (en) * 2017-11-09 2018-05-22 上海无线电设备研究所 The implementation method of multi-channel laser Fuze target feature recognition signal processing circuit
CN108549280A (en) * 2018-04-03 2018-09-18 芜湖懒人智能科技有限公司 A kind of digital rudder controller control method for supporting multi signal to input
US20200174051A1 (en) * 2018-11-30 2020-06-04 Sequans Communications S.A. Duty Cycle Estimation
CN111693785A (en) * 2020-05-14 2020-09-22 湖南毂梁微电子有限公司 Digital pulse signal width measuring circuit and measuring method
CN112242828A (en) * 2020-09-11 2021-01-19 深圳市杉川机器人有限公司 Method, device and equipment for capturing pulse width modulation signal

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140021938A1 (en) * 2011-04-06 2014-01-23 Sangyong Lee Multi-channel pwm waveform measuring device
CN102298095A (en) * 2011-06-27 2011-12-28 中国国土资源航空物探遥感中心 Method for ensuring accurate measurement on pulse width in multi-task singlechip system and device
CN106569032A (en) * 2016-10-17 2017-04-19 长沙开元仪器股份有限公司 Signal frequency and duty ratio prediction method based on embedded microcontroller
CN106707034A (en) * 2016-12-26 2017-05-24 哈尔滨工业大学 Pulse signal detection method based on Windows system function and multi-thread technology
CN108061885A (en) * 2017-11-09 2018-05-22 上海无线电设备研究所 The implementation method of multi-channel laser Fuze target feature recognition signal processing circuit
CN108549280A (en) * 2018-04-03 2018-09-18 芜湖懒人智能科技有限公司 A kind of digital rudder controller control method for supporting multi signal to input
US20200174051A1 (en) * 2018-11-30 2020-06-04 Sequans Communications S.A. Duty Cycle Estimation
CN111693785A (en) * 2020-05-14 2020-09-22 湖南毂梁微电子有限公司 Digital pulse signal width measuring circuit and measuring method
CN112242828A (en) * 2020-09-11 2021-01-19 深圳市杉川机器人有限公司 Method, device and equipment for capturing pulse width modulation signal

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114814379A (en) * 2022-05-13 2022-07-29 长沙祥云瑞风信息技术有限公司 Fault injection-based narrow pulse detection method, system, medium and equipment

Also Published As

Publication number Publication date
CN113300902B (en) 2022-05-20

Similar Documents

Publication Publication Date Title
US9086275B2 (en) System and method for LIDAR signal conditioning
KR101575502B1 (en) Multi-protocol storage controller
CN113300902B (en) Multichannel pulse width measurement and data transmission processing method
CN103743430B (en) A kind of correlation photoelectric sensor
CN112534301A (en) Distance measurement method, device and equipment
CN104199042A (en) Multi-echo laser ranging method and laser range finder
US20170031008A1 (en) Measurement system incorporating ambient light component nullification
CN110443275B (en) Method, apparatus and storage medium for removing noise
CN113050071B (en) Laser radar data processing method, device, equipment and storage medium
CN109564270B (en) Positioning information determining method and device
CN113050069A (en) Interference signal acquisition method, device, equipment and storage medium of laser radar
CN109640013B (en) Timing sequence calibration method and chip testing machine
CN110392207A (en) A kind of method and device that triggering picture pick-up device focuses
CN109782135A (en) A kind of method of Precise Diagnosis cable damage position
CN211348623U (en) Laser radar signal noise reduction device
WO2021259117A1 (en) Optical fiber measurement method, system and apparatus
CN112526494B (en) Distance measurement data acquisition method and device, storage medium and electronic device
CN110687543B (en) Ranging power determination method, device, equipment and storage medium
CN116256741A (en) Distance measurement method and electronic equipment
CN113050070B (en) Laser radar data processing method, device, equipment and storage medium
JPH0266484A (en) Pulse laser range finding device
CN111580096B (en) Defense area drawing method and device
US10050727B2 (en) Peak detection in data stream
CN219715755U (en) Laser ranging data acquisition device
CN107678011A (en) A kind of real-time upload process method of all-wave graphic data applied to laser measurement system

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
GR01 Patent grant
GR01 Patent grant