CN209170340U - Pwm signal sample detecting circuit, processing circuit and chip - Google Patents

Pwm signal sample detecting circuit, processing circuit and chip Download PDF

Info

Publication number
CN209170340U
CN209170340U CN201822060189.XU CN201822060189U CN209170340U CN 209170340 U CN209170340 U CN 209170340U CN 201822060189 U CN201822060189 U CN 201822060189U CN 209170340 U CN209170340 U CN 209170340U
Authority
CN
China
Prior art keywords
pwm
signal
clock
output
pwm signal
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.)
Active
Application number
CN201822060189.XU
Other languages
Chinese (zh)
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.)
Zhuhai Amicro Semiconductor Co Ltd
Original Assignee
Zhuhai Amicro Semiconductor Co Ltd
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 Zhuhai Amicro Semiconductor Co Ltd filed Critical Zhuhai Amicro Semiconductor Co Ltd
Priority to CN201822060189.XU priority Critical patent/CN209170340U/en
Application granted granted Critical
Publication of CN209170340U publication Critical patent/CN209170340U/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Control Of Motors That Do Not Use Commutators (AREA)

Abstract

It includes PWM sample detecting module and PWM generation module that the utility model, which discloses a kind of pwm signal sample detecting circuit, processing circuit and chip, the processing circuit, and the PWM sample detecting module includes the pwm signal sample detecting circuit;The pwm signal PWM_IN to be processed of the pwm signal sample detecting circuit capture input and high frequency clock signal CLK_US for receiving the output of external system clock generator, and export the impulse speed signal speed based on pwm signal to be processed;The PWM generation module is used to receive the sampling clock Clk of external generation, and exports the controllable PWM output signal PWM_OU of the duty ratio based on sampling clock Clk.The processing circuit provides high-precision impulse speed signal and step size signal for external motor system, and exports suitable PWM output signal PWM_OUT based on aforementioned sample detection signal to adjust motor speed.

Description

Pwm signal sample detecting circuit, processing circuit and chip
Technical field
The utility model relates to signal modulation technique field, it is related to a kind of pwm signal sample detecting circuit, a kind of PWM letter Number processing circuit and chip.
Background technique
PWM (Pulse Width Modulation) technology is in industrial automation, robot, precise numerical control machine, boat The numerous areas such as empty space flight are used widely.Servo control system needs to generate the pwm signal driving of variable duty ratio IGBT, IPM constant power device;The kinetic control systems such as robot or numerically-controlled machine tool can between motion control card and servo-driver Pass through the pwm signal of changeable frequency, transmission location control instruction.
PWM and PFM is two kinds of control modes of DC/DC switch, and this kind of technology is usually used in some analog circuits or periphery electricity Machine is controlled.As the integrated level of IC is higher and higher.There are many kinds of implementations for most pwm circuit on the market, there is one It is realized a bit by the peripheral components such as square-wave oscillator or single limit comparator.In the architecture design of prior art PWM, output PWM signal is by CPU timing control, under intermittent mode, it may appear that CPU configuration causes the scene of PWM output error to go out It is existing;There are also the I/O pins using single-chip microcontroller, constantly export low and high level to the pin by software to realize PWM wave Output, this method will occupy the CPU plenty of time, make single-chip microcontroller that can not carry out other work, these circuits can not all be kept away Exempt to realize that BOM is at high cost, have a single function, without functions such as step countings.
Utility model content
In order to overcome the problems referred above, the utility model proposes a kind of pwm signal sample detecting circuits, a kind of pwm signal Processing circuit and chip.
A kind of pwm signal sample detecting circuit, pwm signal sample detecting circuit include filter, step-length counting submodule, Signal pre-divider, speed detector and the first clock pre-divider, wherein the signal input part of filter is as pwm signal The pwm signal input terminal of sample detecting circuit, the speed signal output end of speed detector is as pwm signal sample detecting circuit Output end;Connection relationship inside pwm signal sample detecting circuit is: the signal output end of filter is counted with step-length simultaneously The data input pin of submodule is connected with the input end of clock of signal pre-divider, the output terminal of clock and speed of signal pre-divider The data input pin of degree detector is connected;The clock output of the input end of clock of speed detector and the first clock pre-divider End is connected.
Further, the filter includes the d type flip flop and a comparison output module of the first preset quantity, and first is pre- If the d type flip flop of quantity constitutes the shift register of a first preset quantity bit, the d type flip flop of the first preset quantity Clock end is connected to the input end of clock of the filter, and the output end (Q) of the d type flip flop of the first preset quantity is connected respectively to Compare the data input pin of the first preset quantity of output module, signal of the data input pin of shift register as filter Input terminal compares signal output end of the output end of output module as the filter.
Further, in the shift register, each d type flip flop other than the d type flip flop of rightmost it is defeated The input terminal of one d type flip flop in the right is terminated to out, and the output end of the d type flip flop of rightmost accesses the relatively output module One data input pin, data input pin of the input terminal of leftmost d type flip flop as shift register.
Further, in the shift register, each d type flip flop other than leftmost d type flip flop it is defeated The input terminal of one d type flip flop in the left side is terminated to out, and the output end of leftmost d type flip flop accesses the relatively output module One data input pin, data input pin of the input terminal of the d type flip flop of rightmost as shift register.
Further, first preset quantity is set as 6, so that the filter is by the pwm signal to be processed of input (PWM_IN) the level shake in less than 5 clock cycle is all filtered as burr, wherein the clock cycle be it is described to Handle the pulse period of the jitter levels of pwm signal (PWM_IN).
It further, include step-length counter and direction register, direction register inside the step-length counting submodule Output end connect with the enable end of step-length counter, the terminal count output of step-length counter is as the step-length counting submodule Output end, data input pin of the counting input end of step-length counter as the step-length counting submodule.
Further, the speed detector includes rising edge detection circuit, pulsewidth counter and intermediate value averaging module;On Rising along detection circuit includes a d type flip flop and one and door, and the input terminal (D) of d type flip flop connects an input terminal with door, D type flip flop reversed-phase output () connection and another input terminal of door;The clock end of pulsewidth counter and d type flip flop when Zhong Duan is connected, and rising edge detection circuit with the output end of door with the reset terminal (reset) of pulsewidth counter by connecting, pulsewidth The data input pin of the data output end connection intermediate value averaging module of counter, the output end of intermediate value averaging module is as the speed The speed signal output end of detector is spent, the input terminal of rising edge detection circuit is inputted as the data of the speed detector End.
Further, the clock that the bit wide numerical value power of the 2 pulsewidth counter is greater than the pulsewidth counter inputs The ratio of the signal frequency of the input terminal (D) of the signal frequency at end and the d type flip flop.
A kind of processing circuit of pwm signal, the processing circuit are applied to the electric system outside adjusting, the processing circuit Including PWM sample detecting module and PWM generation module;The input end of clock of PWM sample detecting module and PWM generation module when Clock input terminal is connected;PWM sample detecting module includes the pwm signal sample detecting circuit;PWM generation module includes second Clock pre-divider and pwm signal generator, the output terminal of clock of second clock pre-divider and the data of pwm signal generator Input terminal is connected, output end of the data output end of pwm signal generator as PWM generation module.
Further, the pwm signal generator includes output frequency divider and comparator, the clock output of output frequency divider End input terminal compared with one of comparator connects, data of the input terminal of output frequency divider as the pwm signal generator Input terminal, data input pin of the input terminal of output frequency divider as the pwm signal generator, the output end conduct of comparator The data output end of the pwm signal generator.
A kind of chip, the chip interior include the processing circuit.
Compared with prior art, the configurable signal of one frequency division coefficient of the pwm signal sample detecting circuit design is pre- Frequency divider designs the first configurable Clock dividers of a frequency division coefficient to sampling to input pwm signal scaling down processing Clock carries out scaling down processing, such that the sampling clock after frequency dividing is accurate, the synchronously input PWM letter after sample detecting frequency dividing Number, then the signal pulsewidth of sample detecting is counted by counter measure and input pwm signal pulsewidth, and to measuring The pulsewidth numerical value arrived carries out intermediate value average treatment, so that the impulse speed based on input pwm signal after output is optimized is surveyed Magnitude;
Processing circuit passes through the to be processed of PWM sample detecting module capture input in technical solutions of the utility model The pwm signal PWM_IN and high frequency clock signal CLK_US for receiving external output, and export the pulse based on pwm signal to be processed Speed signal speed to external electric system, increase compared with the existing technology test the speed, step function;
The external sampling clock Clk exported is received by the PWM generation module simultaneously, and exports and is based on sampling clock The controllable PWM output signal PWM_OUT of the duty ratio of Clk is not needed CPU and is participated in adjusting point with the electric system outside adjusting Frequency processing operation reduces the complexity of software control process, improves the measuring speed of input pwm signal pulse period.
Detailed description of the invention
Fig. 1 is a kind of processing circuit structural schematic diagram of pwm signal of the utility model embodiment.
Fig. 2 is the circuit diagram of the filter of the utility model embodiment.
Fig. 3 is the circuit diagram of the speed detector of the utility model embodiment.
Fig. 4 is that the filtering of the utility model embodiment disappears the sampling time sequence figure of the pwm signal pulsewidth trembled.
Fig. 5 is the circuit diagram of the pwm signal generator of the utility model embodiment.
Specific embodiment
Specific embodiment of the present utility model is described further with reference to the accompanying drawing: as shown in Figure 1, this is practical new Type embodiment provides a kind of processing circuit of pwm signal, and the processing circuit includes that PWM sample detecting module and PWM generate mould The input end of clock of block, the PWM sample detecting module is connected with the input end of clock of the PWM generation module;The PWM The pwm signal input terminal of sample detecting module is used to capture the pwm signal PWM_IN to be processed of input, the PWM sample detecting The input end of clock of module is used to receive the high frequency clock signal CLK_US of external system clock generator output, practical new at this Under type embodiment, the frequency range of pwm signal PWM_IN to be processed is greater than 32Hz and is less than 2KHz, and external system clock generates The high frequency clock signal CLK_US of device output is the clock signal for being 0.2us in the period, plays signal by the counting of corresponding precision Disappear the effect of trembling;The PWM sample detecting module is used to export impulse speed signal speed based on pwm signal to be processed and right The pulse step size signal answered is used for external electric system as feedback quantity.Compared with the existing technology, it is defeated to expand pwm signal The application function of circuit out.The PWM generation module is used to receive the sampling clock Clk of external system clock generator output, And export the controllable PWM output signal PWM_OUT of the duty ratio based on sampling clock Clk;The PWM sample detecting module and institute It states PWM generation module and is commonly connected to the sampling clock Clk;Wherein, sampling clock Clk can also be from external AHB Bus clock in bus, corresponding clock frequency size includes 80MHz, 40MHz or 20MHz, so that the PWM output signal PWM_OUT meets the application demand of various electric machine control systems.When the PWM sample detecting module is that external electric system mentions When for impulse speed signal speed and corresponding pulse step size signal, external electric system is carried out according to aforementioned sample signal Adjustment, specifically adjusts frequency size, pwm signal PWM_IN to be processed and the high frequency clock signal of the sampling clock Clk of output Then CLK_US controls the PWM output signal PWM_OUT of the PWM generation module output duty ratio corresponding, to complete to outside The rotational speed regulation of electric system controls.
The processing circuit includes PWM sample detecting module and PWM generation module, and the PWM sample detecting module packet Pwm signal sample detecting circuit is included, since the pwm signal sample detecting circuit includes filter, step-length counting submodule, letter Number pre-divider, speed detector and the first clock pre-divider, so the PWM sample detecting module includes filter, step Long counting submodule, signal pre-divider, speed detector and the first clock pre-divider, under the utility model embodiment, The inside connection relationship of the pwm signal sample detecting circuit is equal to the connection relationship of the PWM sample detecting inside modules. Wherein, pwm signal input terminal of the signal input part of filter as PWM sample detecting module, the speed letter of speed detector Number output end of the output end as PWM sample detecting module.
As shown in Figure 1, the PWM sample detecting module (the i.e. described pwm signal sample detecting circuit) includes filter, step Long counting submodule, signal pre-divider, speed detector and the first clock pre-divider, the connection relationship of inside modules is: The signal output end of filter simultaneously with the data input pin of step-length counting submodule and the input end of clock of signal pre-divider Connection, the output terminal of clock of signal pre-divider are connected with the data input pin of speed detector;The clock of speed detector Input terminal is connected with the output terminal of clock of the first clock pre-divider;The signal input part of filter be used for capture input to Handle pwm signal PWM_IN, the high frequency clock signal of the clock input external system clock generator output of filter CLK_US, and under the driving effect of high frequency clock signal CLK_US, controls pwm signal PWM_IN filtering to be processed, then from institute State the signal output end outputting reference pwm signal Encoder of filter.Since high frequency clock signal CLK_US is can to configure , so, the filtering behaviour of the level dither signal of distinct pulse widths in pwm signal PWM_IN to be processed may be implemented in the filter Make.The signal output end of filter is inputted with the clock of the data input pin of step-length counting submodule and signal pre-divider simultaneously End connection, for benchmark pwm signal Encoder to be transferred to step-length counting submodule and signal pre-divider;Signal divides in advance Device is used for received benchmark pwm signal Encoder scaling down processing to export the first pwm signal Encoder1, wherein the letter The frequency divider of 2 frequency dividings, 4 frequency dividings or 8 frequency dividings is supported and be can be configured to number pre-divider;The clock output of the signal pre-divider End is connected with the data input pin of the speed detector, for the first pwm signal Encoder1 to be transferred to the speed Detector, to export the first pwm signal Encoder1 of different frequency to the speed detector.First clock divides in advance Device, the sampling clock Clk for controlling and receiving divide to obtain the first sub-frequency clock signal Clk_div1, and by the first frequency-dividing clock Signal Clk_div1 is exported to speed detector, and under the present embodiment, the frequency division coefficient of the first clock pre-divider is configured to 16. The input end of clock of the speed detector is connected with the output terminal of clock of the first clock pre-divider, the speed inspection Device is surveyed under the driving effect of the first sub-frequency clock signal Clk_div1, by the rising for detecting the first pwm signal Encoder1 The arteries and veins of corresponding first sub-frequency clock signal Clk_div1 within each pulse period to count the first pwm signal Encoder1 Number is rushed, the speed detector carries out the first pwm signal Encoder1 using the first sub-frequency clock signal Clk_div1 Sample detecting, and the pulse number is subjected to intermediate value average treatment, complete the noise reduction process of the pulse number.Due to described Output end of the speed signal output end of speed detector as the pwm signal sample detecting circuit, so in the speed The speed signal output end of detector exports impulse speed signal speed, reduces noise signal to pwm signal PWM_IN to be processed Impulse speed measured value influence, so that the impulse speed signal of higher precision is provided for external electric system, to mention The feedback signal of the revolving speed of power supply machine system.
The filter includes the d type flip flop of the first preset quantity and a comparison output module, the filter include The d type flip flop of first preset quantity and a comparison output module, the d type flip flop of the first preset quantity constitute one first and preset The shift register of number of bits position, the clock that the clock end of the d type flip flop of the first preset quantity is connected to the filter are defeated Enter end, the output end (Q) of the d type flip flop of the first preset quantity is connected respectively to the number for comparing the first preset quantity of output module According to input terminal, signal input part of the data input pin of shift register as filter, the output end for comparing output module is made For the signal output end of the filter.Under the present embodiment, first preset quantity is set as 6, as shown in Fig. 2, described Filter includes the first d type flip flop D1, the second d type flip flop D2, third d type flip flop D3, four d flip-flop D4, the 5th d type flip flop D5, the 6th d type flip flop D6 and a comparison output module, aforementioned 6 d type flip flops constitute the shift register of 6 bits, The clock end of aforementioned 6 d type flip flops all accesses high frequency clock signal CLK_US, the output end Q [0] of the first d type flip flop D1, second The output end Q [1] of d type flip flop D2, the output end Q [2] of third d type flip flop D3, the output end Q [3] of four d flip-flop D4, The output end Q [5] of the output end Q [4] and the 6th d type flip flop D6 of five d type flip flop D5, which are connected respectively to, compares 6 of output module Data input pin compares signal output end of the output end of output module as the filter.The relatively output module Data output end is for exporting the benchmark pwm signal Enco as one embodiment, in the shift register, in addition to most The output of each d type flip flop except the d type flip flop on the right terminates to the input terminal of one d type flip flop in the right, the D touching of rightmost The output end of hair device accesses a data input pin of the relatively output module, the input terminal conduct of leftmost d type flip flop The data input pin of shift register.As shown in Fig. 2, the data in the shift register are in the high frequency clock signal CLK_ When successively moving to right by turn under the driving effect of US, the output of each d type flip flop other than the 6th d type flip flop D6 terminates to the right side The input terminal D of the input terminal D, the first d type flip flop D1 of one, side d type flip flop access pwm signal PWM_IN to be processed.
As another embodiment, each D touching in the shift register, other than leftmost d type flip flop The output of hair device terminates to the input terminal of one d type flip flop in the left side, and the output end access of leftmost d type flip flop is described more defeated A data input pin of module out, when the data in the shift register are in the driving of the high frequency clock signal CLK_US When successively moving to left by turn under effect, the output end Q of each d type flip flop other than leftmost d type flip flop is connected to the left side one The input terminal D of the input terminal D of a d type flip flop, the d type flip flop of rightmost access the pwm signal PWM_IN to be processed.
The shift register can not only registered data, and can make under the action of the high frequency clock signal CLK_US Data therein are successively moved to left or are moved to right.Because since being added on trigger the rising edge of the high frequency clock signal CLK_US One section of delay time is steadily set up to output end new state, so when the high frequency clock signal CLK_US adds simultaneously When on to the d type flip flop of the preset quantity, received each d type flip flop is one, the left side (or the right) d type flip flop Central Plains The data come, then the data in the shift register successively move to right (or moving to left) one.
The internal logic relationship of the relatively output module are as follows: when 6 data input pins of the relatively output module are complete When being 0, i.e., when corresponding 6 bit signal Q [5:0]=0 of the output end of 6 triggers, the institute of the relatively output module output Stating benchmark pwm signal Encoder is low level;When 6 data input pins of the relatively output module are all 1, i.e., 6 touchings When sending out corresponding 6 bit signal Q [5:0]=6 ' b111111 of output end of device, the base of the relatively output module output Quasi- pwm signal Encoder is high level;When existing 0 in the relatively data input pin of the first preset quantity of output module When also having 1, i.e. Q [5:0]!=0 and Q [5:0]!When=6 ' b111111, the benchmark PWM letter of the relatively output module output It is constant that number Encoder retains original level state.
Preferably, first preset quantity is set as 6, so that the filter is by the pwm signal PWM_ to be processed Level shake in IN less than 5 clock cycle is all filtered as burr, wherein the clock cycle is described to be processed The pulse period of the jitter levels of pwm signal PWM_IN.If the pwm signal PWM_IN to be processed, which exists, is less than one fixed width Pulse needs filter out, when needing to filter out such as the jitter levels pulse of 1uS, the filter can be by 6 delay times The d type flip flop of 0.2us and a relatively output module are constituted, and the d type flip flop that 6 delay times are 0.2us constitutes one 6 The shift register of bit.Before disappearing to the pwm signal PWM_IN to be processed and trembling, the first of the relatively output module The input terminal of preset quantity is all ones or all zeroes, and the benchmark pwm signal Encoder of the relatively output module output is accordingly For high level or low level;It is trembled period disappearing to the pwm signal PWM_IN to be processed, the first of the relatively output module is pre- If the input terminal of quantity had not only had 1 there are 0, the benchmark pwm signal Encoder of the relatively output module output retains Level state originally is constant, is stable level signal during can determine that this.Disappear to the pwm signal PWM_IN to be processed After trembling, the input terminal of relatively first preset quantity of output module is all ones or all zeroes, the relatively output module output The benchmark pwm signal Encoder be accordingly high level or low level.So as to carried out at noise suppression to input signal Reason, the level shake less than 5 system clock cycles will be all filtered out, and the higher hamonic wave energy of the pwm signal of input is effectively reduced Amount reduces the electromagnetic interference of external motor system, has very strong practicability.
Include step-length counter and direction register inside the step-length counting submodule, the output end of direction register with The enable end of step-length counter connects, output end of the terminal count output of step-length counter as the step-length counting submodule, Data input pin of the counting input end of step-length counter as the step-length counting submodule.The direction register is for defeated Add-subtract control signal out, as " adding " or the direction control signal of the switch of " subtracting ", the plus-minus of the direction register output Control signal is connect with the step-length counter.If the add-subtract control signal is set to 1, the step-length counter is used for every A pulse period is made plus 1 counts, and the step-length counting submodule detects a rising edge of the benchmark pwm signal Encoder When signal, the step-length counter is since 0 plus 1 counts, while retaining built in current count value to the step-length counter In register, to provide the step Numerical based on the pwm signal PWM_IN to be processed for external motor control system, electricity is represented The distance value that machine rotates;After the count value of the step-length counter reaches maximum value, the step-length counter overflow is produced The Tick pulse signal of a raw clock cycle, the step-length counter restarts from 0 plus 1 counts.If the add-subtract control When signal is set to 0, the step-length counter is used to make the counting that subtracts 1, the step-length counting submodule detection in each pulse period When a rising edge signal of the benchmark pwm signal Encoder, the step-length counter is made to subtract 1 since pre-set count value It counts, while retaining in the register built in current count value to the step-length counter, to be external motor control system Step Numerical based on the pwm signal PWM_IN to be processed is provided, the distance value of motor rotation is represented;When the step-length counter Count value be reduced to 0 after, the step-length counter overflow (i.e. current count value is 0) generates the Tick of a clock cycle Pulse signal, the step-length counter load the pre-set count value, then restart to subtract 1 counting.
Preferably, the step-length counter in the step-length counting submodule is set as 32 digit counters, does not need pair Count value makees Symbol processing.
As shown in figure 3, the speed detector includes rising edge detection circuit, pulsewidth counter and intermediate value averaging module, For realizing the velocity amplitude of measurement motor rotation by the period for measuring the pwm signal PWM_IN to be processed, actually Measure the time width between two rising edges of the pwm signal PWM_IN to be processed.The rising edge detection circuit includes One d type flip flop and one and door, the input terminal D connection of d type flip flop and an input terminal of door, the anti-phase output of d type flip flop EndAnother input terminal of connection and door;The clock end of the pulsewidth counter is connected with the clock end of d type flip flop, described Rising edge detection circuit is connect by described with the output end of door with the reset terminal reset of the pulsewidth counter.The pulsewidth The data input pin of the data output end connection intermediate value averaging module of counter, the output end of intermediate value averaging module is as the speed The speed signal output end of detector is spent, the input terminal of rising edge detection circuit is inputted as the data of the speed detector End.For receiving the first pwm signal Encoder1, the first pwm signal Encoder1 is the input terminal D of d type flip flop What the benchmark pwm signal Encoder scaling down processing obtained;The clock end of d type flip flop is for receiving first frequency-dividing clock Signal Clk_div1, the first sub-frequency clock signal Clk_div1 are that the high frequency clock signal CLK_US divides to obtain. When the first moment was low level signal, d type flip flop latches the first pwm signal Encoder1 at the input terminal D of d type flip flop Firmly low level signal of the first pwm signal Encoder1 at the first moment, by the first sub-frequency clock signal Clk_div1 A clock cycle after, the reversed-phase output of d type flip flopHigh level signal is exported, if d type flip flop is defeated under synchronization Enter to hold D to become high level signal, i.e., is simultaneously high level signal with two input terminals of door, the rising edge detection circuit passes through High level signal is exported with door, can determine that the first pwm signal Encoder1 is rising edge signal at this time, and export to the pulsewidth The reset terminal reset of counter.
Under the driving of the first sub-frequency clock signal Clk_div1, when the pulsewidth counter sample detecting is described in When the rising edge signal of the first pwm signal Encoder1, counted the rising edge signal as reset signal input, often A reset signal is inputted, the pulsewidth counter is according to the pulse number of the first sub-frequency clock signal Clk_div1 It counts once, thus when obtaining the corresponding described first frequency dividing in a pulse period of the first pwm signal Encoder1 The pulse number of clock signal Clk_div1.As shown in figure 4, the pulsewidth counter often detects first pwm signal A rising edge signal of Encoder1, the first sub-frequency clock signal Clk_div1 has passed over 4 clock cycle, described Pulsewidth counter adds 4 on the basis of original count value, as current count value;The two of the first pwm signal Encoder1 Between a rising edge signal, the pulse number of the first sub-frequency clock signal Clk_div1 is 4, and the pulsewidth counter uses The clock cycle of 4 the first sub-frequency clock signal Clk_div1 removes first pwm signal of one pulse period of sampling Encoder1.In Fig. 4, confined 4 of the corresponding dotted line of two rising edge signals of the first pwm signal Encoder1 The pulse of the first sub-frequency clock signal Clk_div1, the mark as the pulsewidth for measuring the first pwm signal Encoder1 Standard, and then measure the corresponding motor speed of the pwm signal PWM_IN to be processed.Made under the conditions of the prior art using clock edge The mode of energy signal drives the pulsewidth counter to be counted, but can have the nonsynchronous problem of clock, and the utility model is real It applies example and drives the pulsewidth counter to the pulsewidth of the first pwm signal Encoder1 by the rising edge detection circuit It counts, really drives the pulsewidth counter to be counted under high frequency clock signal by Edge check enable signal, make Obtain the precision that clock is synchronous, and the pulse period of raising the first pwm signal Encoder1 samples.
Preferably, the bit wide numerical value power of the 2 pulsewidth counter is greater than the input end of clock of the pulsewidth counter Signal frequency and the d type flip flop input terminal D signal frequency ratio.The first sub-frequency clock signal Clk_div1 Highest input frequency be 80MHz, the first sub-frequency clock signal Clk_div1 is set as under the utility model embodiment 20MHz.In order to realize that the first pwm signal Encoder1's described in the first sub-frequency clock signal Clk_div1 synchronized sampling is upper It rises along signal, the ratio and the arteries and veins of the first sub-frequency clock signal Clk_div1 and the first pwm signal Encoder1 The bit wide of wide counter is there are power side's relationship, when the first pwm signal Encoder1 clock frequency is 32Hz, then described the The clock frequency of one sub-frequency clock signal Clk_div1 and the ratio of the clock frequency of the first pwm signal Encoder1 are 625000.Because 2 20 power are bigger than 625000,20 bits are set by the bit wide of the pulsewidth counter, thus The bit wide numerical value power for meeting the 2 pulsewidth counter is greater than the clock frequency of the first sub-frequency clock signal Clk_div1 With the ratio of the clock frequency of the first pwm signal Encoder1;Due to the high frequency clock signal CLK_US maximum clock Frequency is 80MHz, is 4 times of 20MHz, so when the high frequency clock signal CLK_US mono- frequency dividing obtains the described first frequency dividing Clock signal Clk_div1, and when the first pwm signal Encoder1 clock frequency is left as 32Hz, it need to be by the pulsewidth meter The bit wide of number device increases 2 bits, and the bit wide numerical value is set as 22 bits, this is as the correlation built in the pulsewidth counter Register carries out configuration of reservations, and loads corresponding bit wide numerical value under the premise of high frequency clock signal CLK_US input. The frequency that the d type flip flop of the rising edge detection circuit receives the first sub-frequency clock signal Clk_div1 is higher, Ke Yizeng The efficiency of strong rising edge detection, although the clutter of jump cannot be filtered off, the first pwm signal Encoder1, which has been subjected to disappear, to be trembled Processing, therefore clutter influences less.
The data output end of the pulsewidth counter connects the data input pin of the intermediate value averaging module, the pulsewidth meter The signal of the pulse number of number device output is connected to the intermediate value averaging module;It include one inside the intermediate value averaging module A counting sample register, the pulse number for the output of pulsewidth counter described in real-time storage;The intermediate value is averaged mould Block connects the pulsewidth counter, and the intermediate value averaging module controls the pulse number and the counting sample register stores The pulse number of the second preset quantity carry out size comparison, and be ranked up according to comparison result, its intermediate value then selected to represent The impulse speed signal speed;Wherein, the pulse number of second preset quantity is first pwm signal In Encoder1, in the pulse period for second preset quantity crossed by sample detecting when the corresponding described first frequency dividing The pulse number of clock signal Clk_div1.The intermediate value averaging module under the present embodiment is conducive to eliminate signal noise to described The influence of pulse number avoids the pulsewidth of the first pwm signal Encoder1 measured from excessive or too small phenomenon occur, from And it is the stable speed signal of external motor system acquisition.
As shown in Figure 1, the PWM generation module includes second clock pre-divider and pwm signal generator, inside modules Connection relationship be: the output terminal of clock of second clock pre-divider is connected with the data input pin of the pwm signal generator It connects, input end of clock of the input end of clock of second clock pre-divider as PWM generation module, the number of pwm signal generator Output end according to output end as PWM generation module.Specifically, second clock pre-divider and the PWM sample detecting module The first interior clock pre-divider is connected, for receiving sampling clock Clk;Second clock pre-divider, being used for will be received Sampling clock Clk scaling down processing is to export the second sub-frequency clock signal Clk_div2, under the present embodiment, the second frequency-dividing clock letter The clock frequency of number Clk_div2 can be 72MHz, 40MHz, 20MHz or 10MHz.Second clock pre-divider and pwm signal Generator is connected, for the second sub-frequency clock signal Clk_div2 to be transferred to pwm signal generator;Pwm signal generator, Believe for receiving reference level signal level, and according to the frequency division value of the second sub-frequency clock signal Clk_div2 and reference level The comparison result of number level generates PWM output signal PWM_OUT, and specifically, pwm signal generator is by counter by second Sub-frequency clock signal Clk_div2 scaling down processing, then again compared with reference level signal level carries out level, when second When the frequency division value of sub-frequency clock signal Clk_div2 is greater than the level value of reference level signal level, PWM output signal PWM_ OUT is high level, and otherwise, PWM output signal PWM_OUT is low level.
As shown in figure 5, the pwm signal generator includes output frequency divider and comparator, the clock of output frequency divider is defeated Outlet input terminal compared with one of the comparator connects, and the input terminal of output frequency divider is as the pwm signal generator Data input pin, data output end of the output end of comparator as the pwm signal generator.The pwm signal generates Output end of the data output end of device as PWM generation module.The output frequency divider is for receiving second frequency-dividing clock Signal Clk_div2, and scaling down processing is carried out to the second sub-frequency clock signal Clk_div2.In the utility model embodiment Under, it include a counter inside the output frequency divider, which is the counter of 10bit bit wide, frequency dividing system Number is 1024, therefore the second sub-frequency clock signal Clk_div2 is carried out 1024 scaling down processings by the output frequency divider, works as institute When the clock frequency for stating the second sub-frequency clock signal Clk_div2 is 72MHz, the frequency division value of the output frequency divider output is 72MHz/1024=70KHz can be used as highest output frequency to be compared, so that the signal of pwm signal generator output is Low-frequency PWM output signal as unit of KHz.
As shown in figure 5, the comparison input terminal of the comparator be separately connected the frequency division value of the output frequency divider with it is described Reference level signal level, for the frequency division value and the reference level according to the second sub-frequency clock signal Clk_div2 The level comparison result of signal level exports the PWM output signal PWM_OUT of corresponding level, when the frequency dividing When value is greater than the level value of the reference level signal level, PWM output signal PWM_OUT is high level;When the frequency division value When level value less than the reference level signal level, PWM output signal PWM_OUT is low level.Due to the output point The frequency division coefficient of frequency device and the second sub-frequency clock signal Clk_div2 of input are adjustable, thus PWM export letter The duty ratio of number PWM_OUT is controllable, while the PWM generation module also generates interrupt signal output, and the PWM is assisted to adopt The revolving speed of electric system outside the control of sample detection module.
A kind of chip, the chip interior integrate aforementioned processing circuit, the processing circuit include PWM sample detecting module and PWM generation module;The pwm signal PWM_IN to be processed of the PWM sample detecting module capture chip exterior input, receives chip The high frequency clock signal CLK_US of internal system clock generator output, and believed to chip exterior output based on PWM to be processed Number impulse speed signal speed.The PWM generation module is used to receive adopting for the system clock generator output of chip interior Sample clock Clk, and export the controllable PWM output signal PWM_OUT of the duty ratio based on sampling clock Clk, the PWM sampling inspection It surveys module and the PWM generation module is commonly connected to the sampling clock Clk.
Device embodiments described above are only schematical, wherein the unit as illustrated by the separation member It may or may not be physically separated, component shown as a unit may or may not be physics list Member, it can it is in one place, or may be distributed over multiple network units.It can be selected according to the actual needs In some or all of the modules realize the purpose of present embodiment scheme.Those of ordinary skill in the art are not paying creation Property labour in the case where, it can understand and implement.

Claims (11)

1. a kind of pwm signal sample detecting circuit, which is characterized in that pwm signal sample detecting circuit includes filter, step-length meter Number submodule, signal pre-divider, speed detector and the first clock pre-divider, wherein the signal input part of filter is made Speed signal output end for the pwm signal input terminal of pwm signal sample detecting circuit, speed detector is adopted as pwm signal The output end of sample detection circuit;
Connection relationship inside pwm signal sample detecting circuit is: the signal output end of filter counts submodule with step-length simultaneously The data input pin of block is connected with the input end of clock of signal pre-divider, and the output terminal of clock and speed of signal pre-divider are examined The data input pin for surveying device is connected;The output terminal of clock phase of the input end of clock of speed detector and the first clock pre-divider Connection.
2. pwm signal sample detecting circuit according to claim 1, which is characterized in that the filter includes first default The d type flip flop of the d type flip flop of quantity and a comparison output module, the first preset quantity constitutes a first preset quantity bit The shift register of position, the clock end of the d type flip flop of the first preset quantity are connected to the input end of clock of the filter, and first The output end Q of the d type flip flop of preset quantity is connected respectively to the data input pin for comparing the first preset quantity of output module, moves Signal input part of the data input pin of bit register as filter compares the output end of output module as the filter Signal output end.
3. pwm signal sample detecting circuit according to claim 2, which is characterized in that in the shift register, in addition to The output of each d type flip flop except the d type flip flop of rightmost terminates to the input terminal of one d type flip flop in the right, the D of rightmost The output end of trigger accesses a data input pin of the relatively output module, and the input terminal of leftmost d type flip flop is made For the data input pin of shift register.
4. pwm signal sample detecting circuit according to claim 2, which is characterized in that in the shift register, in addition to The output of each d type flip flop except leftmost d type flip flop terminates to the input terminal of one d type flip flop in the left side, leftmost D The output end of trigger accesses a data input pin of the relatively output module, and the input terminal of the d type flip flop of rightmost is made For the data input pin of shift register.
5. pwm signal sample detecting circuit according to claim 2, which is characterized in that first preset quantity is set as 6, so that the filter is all made the level shake in the pwm signal PWM_IN to be processed of input less than 5 clock cycle It is filtered for burr, wherein the clock cycle is the pulse period of the jitter levels of the pwm signal PWM_IN to be processed.
6. pwm signal sample detecting circuit according to claim 1, which is characterized in that inside the step-length counting submodule Including step-length counter and direction register, the output end of direction register is connect with the enable end of step-length counter, step-length meter Output end of the terminal count output of number device as the step-length counting submodule, the counting input end of step-length counter is as institute State the data input pin of step-length counting submodule.
7. pwm signal sample detecting circuit according to claim 1, which is characterized in that the speed detector includes rising Along detection circuit, pulsewidth counter and intermediate value averaging module;
Rising edge detection circuit includes a d type flip flop and one and door, and one of the input terminal D connection of d type flip flop and door is defeated Enter end, the reversed-phase output of d type flip flopAnother input terminal of connection and door;The clock end and d type flip flop of pulsewidth counter Clock end be connected, rising edge detection circuit with the output end of door with the reset terminal reset of pulsewidth counter by connecting, arteries and veins The data input pin of the data output end connection intermediate value averaging module of wide counter, described in the output end of intermediate value averaging module is used as The input terminal of the speed signal output end of speed detector, rising edge detection circuit is inputted as the data of the speed detector End.
8. pwm signal sample detecting circuit according to claim 7, which is characterized in that the bit wide of the 2 pulsewidth counter Numerical value power is greater than the signal of the signal frequency of the input end of clock of the pulsewidth counter and the input terminal D of the d type flip flop The ratio of frequency.
9. a kind of processing circuit of pwm signal, which is applied to the electric system outside adjusting, which is characterized in that place Managing circuit includes PWM sample detecting module and PWM generation module;The input end of clock and PWM of PWM sample detecting module generate mould The input end of clock of block is connected;
PWM sample detecting module includes any one of claim 1 to 8 pwm signal sample detecting circuit;
PWM generation module includes second clock pre-divider and pwm signal generator, the clock output of second clock pre-divider End is connected with the data input pin of pwm signal generator, and the input end of clock of second clock pre-divider generates mould as PWM The input end of clock of block, output end of the data output end of pwm signal generator as PWM generation module.
10. processing circuit according to claim 9, which is characterized in that the pwm signal generator include output frequency divider and Comparator, the output terminal of clock of output frequency divider input terminal compared with one of comparator connect, the input terminal of output frequency divider As the data input pin of the pwm signal generator, the output end of comparator is defeated as the data of the pwm signal generator Outlet.
11. a kind of chip, which is characterized in that the chip interior includes any one of claim 9 to 10 processing circuit.
CN201822060189.XU 2018-12-10 2018-12-10 Pwm signal sample detecting circuit, processing circuit and chip Active CN209170340U (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201822060189.XU CN209170340U (en) 2018-12-10 2018-12-10 Pwm signal sample detecting circuit, processing circuit and chip

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201822060189.XU CN209170340U (en) 2018-12-10 2018-12-10 Pwm signal sample detecting circuit, processing circuit and chip

Publications (1)

Publication Number Publication Date
CN209170340U true CN209170340U (en) 2019-07-26

Family

ID=67342923

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201822060189.XU Active CN209170340U (en) 2018-12-10 2018-12-10 Pwm signal sample detecting circuit, processing circuit and chip

Country Status (1)

Country Link
CN (1) CN209170340U (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109391247A (en) * 2018-12-10 2019-02-26 珠海市微半导体有限公司 A kind of filter based on pwm signal, processing circuit and chip
CN109412582A (en) * 2018-12-10 2019-03-01 珠海市微半导体有限公司 A kind of pwm signal sample detecting circuit, processing circuit and chip
CN112118028A (en) * 2020-09-16 2020-12-22 天津光电通信技术有限公司 Method for realizing automatic measurement of low-speed serial data bit rate

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109391247A (en) * 2018-12-10 2019-02-26 珠海市微半导体有限公司 A kind of filter based on pwm signal, processing circuit and chip
CN109412582A (en) * 2018-12-10 2019-03-01 珠海市微半导体有限公司 A kind of pwm signal sample detecting circuit, processing circuit and chip
CN109412582B (en) * 2018-12-10 2024-05-03 珠海一微半导体股份有限公司 PWM signal sampling detection circuit, processing circuit and chip
CN109391247B (en) * 2018-12-10 2024-05-03 珠海一微半导体股份有限公司 Filter, processing circuit and chip based on PWM signal
CN112118028A (en) * 2020-09-16 2020-12-22 天津光电通信技术有限公司 Method for realizing automatic measurement of low-speed serial data bit rate

Similar Documents

Publication Publication Date Title
CN109412582A (en) A kind of pwm signal sample detecting circuit, processing circuit and chip
CN109361381A (en) A kind of PWM generative circuit, processing circuit and chip
CN209170340U (en) Pwm signal sample detecting circuit, processing circuit and chip
CN103516279A (en) Permanent magnet synchronous motor control chip based on FPGA
CN209231361U (en) Speed detector, processing circuit and chip based on pwm signal
CN209233806U (en) Filter, processing circuit and chip based on pwm signal
CN102707083B (en) Motor speed calculating method
CN109391247A (en) A kind of filter based on pwm signal, processing circuit and chip
CN109580975A (en) A kind of speed detector based on pwm signal, processing circuit and chip
CN209170328U (en) PWM generative circuit, processing circuit and chip
CN111769822B (en) Frequency measuring device
CN113644856B (en) Driving control method of high-frequency converter
CN104898520A (en) Micro-controller used for motor control
CN108039883A (en) A kind of detection method and equipment of phaselocked loop output stable clock signal degree
CN109635355B (en) GPIO-oriented frequency-adjustable filter circuit
CN200979669Y (en) An internal integration clock generation circuit in USB equipment square chip
CN109085501A (en) A kind of detection method of brush direct current motor torque corner and revolving speed
CN204631519U (en) A kind of microcontroller for Electric Machine Control
CN105915214B (en) Phase-locked loop control circuit and method
CN205139221U (en) Motor stator looks voltage detection device
CN113193868A (en) Phase-locked detection device, phase-locked detection method and phase-locked loop
CN208707560U (en) A kind of single-phase sine wave direct current brushless motor speed adjustment system
CN109936678B (en) Linear array CCD drive circuit based on CPLD
CN110166045A (en) A kind of snapshot circuit extracting signal intensity edge
CN108418481A (en) A kind of single-phase sine wave direct current brushless motor speed adjustment system and method

Legal Events

Date Code Title Description
GR01 Patent grant
GR01 Patent grant