CN103078608B - A kind of cosine differential signal production method - Google Patents
A kind of cosine differential signal production method Download PDFInfo
- Publication number
- CN103078608B CN103078608B CN201210558043.2A CN201210558043A CN103078608B CN 103078608 B CN103078608 B CN 103078608B CN 201210558043 A CN201210558043 A CN 201210558043A CN 103078608 B CN103078608 B CN 103078608B
- Authority
- CN
- China
- Prior art keywords
- value
- pulse
- equal portions
- array
- dsp
- 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.)
- Expired - Fee Related
Links
Landscapes
- Electronic Switches (AREA)
Abstract
The present invention relates to a kind of cosine differential signal production method.DSP is utilized to calculate anticosine, definition thresholding [-1,1] is divided into 10000 equal portions: namely can export 10000 control impuls in one-period, each equal portions is converted to IQ value, calculate inverse cosine value according to the equal portions value be divided into, what anticosine reality was corresponding is angle; The IQ value calculated is converted to floating number, and then calculate the differential seat angle that every equal portions are corresponding, every equal portions angle difference is multiplied by coefficient, then changes integer value into, the value of calculating saves as array DATA [10000], the benchmark that array value calculates as CPU timer; Each value of array, corresponding actual pulse duration, exports finally by DSP timer Interruption, forms the differential pulse signal that can control motor position.The base value of anticosine of the present invention adopts array mode to preserve, and greatly reduces DSP operation time, output waveform precision is high, stable, reliability is high.
Description
Technical field
The present invention relates to a kind of cosine differential signal production method.
Background technology
Current existing method produces cosine signal and adopts analog circuit to build, and hardware circuit is complicated, and needs when will change output waveform parameter to change hardware circuit, and output waveform affects by component parameter, and precision is not high.
Summary of the invention
For problems of the prior art, the object of the present invention is to provide a kind of technical scheme of cosine differential signal production method.
Described a kind of cosine differential signal production method, it is characterized in that: utilize DSP to be programmed by C language, calculate anticosine: definition thresholding [-1,1] 10000 equal portions are divided into, namely 10000 control impuls can be exported in one-period, each equal portions is converted to IQ value, calculates inverse cosine value according to the equal portions value be divided into, and what anticosine reality was corresponding is angle; The IQ value calculated is converted to floating number, then the differential seat angle that every equal portions are corresponding is calculated, every equal portions angle difference is multiplied by coefficient, change integer value again into, the value calculated saves as array DATA [10000], the benchmark that array value calculates as CPU timer, in a program, array value is kept in FLASH, waits to be called; Each value of array, corresponding actual pulse duration, exports finally by DSP timer Interruption, forms the differential pulse signal that can control motor position.
Described a kind of cosine differential signal production method, it is characterized in that described DSP timer Interruption flow process is as follows: first, Peroio_counter timer value is loaded into period register PRD, when pulse allows to export, system exports pulse, if forbidden, does not then export pulse, scene protection, then interrupts returning; After pulse exports, paired pulses counts, if 10000 pulses have exported, then Period_Times counter resets, then changes Electric Machine Control direction, and Period_Times counter continues to increase; If pulse is not totally lost, system is extracted and is calculated new Peroio_counter timer value, and Period_Times counter continues to increase; Finally carry out scene protection, interrupt returning.
Described a kind of cosine differential signal production method, is characterized in that the parameter of described differential pulse signal is by by key assignments, to form the control signal of different frequency change; Final pulse signal outputs to servo-driver, thus control servomotor operates according to Position Control; Control flow is: initialization DSP timer 1, initialization AD analog voltage sampling unit, then read AD value and carry out digital filtering, detect each switch and key-press status, if detect that switch NC1 presses, system reset pulse exports each variable, load timer value, pulse enable mark position 1, then judges show state flag bit LCD_flashstate, and LCD shows parameter current state; If NC1 does not press, pulse enable mark position 0, program reads new AD number of turns value, then judges show state flag bit LCD_flashstate, and LCD shows parameter current state, and final program returns and continues to read AD value, continues circulation.
The present invention adopts high-speed digital signal processor DSP, well solves in prior art the problem adopting analog circuit to build hardware circuit complexity; In addition, the base value of anticosine adopts array mode to preserve, and facilitates computing, greatly reduces DSP operation time, output waveform precision is high, stable, reliability is high.
Accompanying drawing explanation
Fig. 1 is the Establishing process figure of anticosine array of the present invention;
Fig. 2 is main program flow chart of the present invention;
Fig. 3 is timer interruption flow chart of the present invention.
Embodiment
Below in conjunction with Figure of description, the present invention will be further described:
A kind of cosine differential signal production method, DSP is utilized to be programmed by C language, calculate anticosine: definition thresholding [-1,1] 10000 equal portions are divided into, namely 10000 control impuls can be exported in one-period, each equal portions is converted to IQ value, calculates inverse cosine value according to the equal portions value be divided into, and what anticosine reality was corresponding is angle; The IQ value calculated is converted to floating number, then the differential seat angle that every equal portions are corresponding is calculated, every equal portions angle difference is multiplied by coefficient, change integer value again into, the value calculated saves as array DATA [10000], the benchmark that array value calculates as CPU timer, in a program, array value is kept in FLASH, waits to be called; Each value of array, corresponding actual pulse duration, exports finally by DSP timer Interruption, forms the differential pulse signal that can control motor position.
DSP timer Interruption flow process is as follows: first, and Peroio_counter timer value is loaded into period register PRD, and when pulse allows to export, system exports pulse, if forbidden, does not then export pulse, scene protection, then interrupts returning; After pulse exports, paired pulses counts, if 10000 pulses have exported, then Period_Times counter resets, then changes Electric Machine Control direction, and Period_Times counter continues to increase; If pulse is not totally lost, system is extracted and is calculated new Peroio_counter timer value, and Period_Times counter continues to increase; Finally carry out scene protection, interrupt returning.
The parameter of differential pulse signal is passed through to press key assignments, to form the control signal of different frequency change; Final pulse signal outputs to servo-driver, thus control servomotor operates according to Position Control; Control flow is: initialization DSP timer 1, initialization AD analog voltage sampling unit, then read AD value and carry out digital filtering, detect each switch and key-press status, if detect that switch NC1 presses, system reset pulse exports each variable, load timer value, pulse enable mark position 1, then judges show state flag bit LCD_flashstate, and LCD shows parameter current state; If NC1 does not press, pulse enable mark position 0, program reads new AD number of turns value, then judges show state flag bit LCD_flashstate, and LCD shows parameter current state, and final program returns and continues to read AD value, continues circulation.
The present invention adopts high-speed digital signal processor DSP, well solves in prior art the problem adopting analog circuit to build hardware circuit complexity; In addition, the base value of anticosine adopts array mode to preserve, and facilitates computing, greatly reduces DSP operation time, output waveform precision is high, stable, reliability is high.
Claims (3)
1. a cosine differential signal production method, it is characterized in that: utilize DSP to be programmed by C language, calculate anticosine: definition thresholding [-1,1] 10000 equal portions are divided into, namely 10000 control impuls can be exported in one-period, each equal portions is converted to IQ value, calculates inverse cosine value according to the equal portions value be divided into, and what anticosine reality was corresponding is angle; The IQ value calculated is converted to floating number, then the differential seat angle that every equal portions are corresponding is calculated, every equal portions angle difference is multiplied by coefficient, change integer value again into, the value calculated saves as array DATA [10000], the benchmark that array value calculates as CPU timer, in a program, array value is kept in FLASH, waits to be called; Each value of array, corresponding actual pulse duration, exports finally by DSP timer Interruption, forms the differential pulse signal that can control motor position.
2. a kind of cosine differential signal production method according to claim 1, it is characterized in that described DSP timer Interruption flow process is as follows: first, Peroio_counter timer value is loaded into period register PRD, when pulse allows to export, system exports pulse, if forbidden, does not then export pulse, scene protection, then interrupts returning; After pulse exports, paired pulses counts, if 10000 pulses have exported, then Period_Times counter resets, then changes Electric Machine Control direction, and Period_Times counter continues to increase; If pulse is not totally lost, system is extracted and is calculated new Peroio_counter timer value, and Period_Times counter continues to increase; Finally carry out scene protection, interrupt returning.
3. a kind of cosine differential signal production method according to claim 1, is characterized in that the parameter of described differential pulse signal is by by key assignments, to form the control signal of different frequency change; Final pulse signal outputs to servo-driver, thus control servomotor operates according to Position Control; Control flow is: initialization DSP timer 1, initialization AD analog voltage sampling unit, then read AD value and carry out digital filtering, detect each switch and key-press status, if detect that switch NC1 presses, system reset pulse exports each variable, load timer value, pulse enable mark position 1, then judges show state flag bit LCD_flashstate, and LCD shows parameter current state; If NC1 does not press, pulse enable mark position 0, program reads new AD number of turns value, then judges show state flag bit LCD_flashstate, and LCD shows parameter current state, and final program returns and continues to read AD value, continues circulation.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201210558043.2A CN103078608B (en) | 2012-12-20 | 2012-12-20 | A kind of cosine differential signal production method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201210558043.2A CN103078608B (en) | 2012-12-20 | 2012-12-20 | A kind of cosine differential signal production method |
Publications (2)
Publication Number | Publication Date |
---|---|
CN103078608A CN103078608A (en) | 2013-05-01 |
CN103078608B true CN103078608B (en) | 2016-01-20 |
Family
ID=48155032
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201210558043.2A Expired - Fee Related CN103078608B (en) | 2012-12-20 | 2012-12-20 | A kind of cosine differential signal production method |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN103078608B (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105302640B (en) * | 2015-11-18 | 2018-11-23 | 中工科安科技有限公司 | A kind of management of timeslice and control device and its management and control method |
US11797463B2 (en) * | 2020-12-25 | 2023-10-24 | Nidec Corporation | Signal generation device |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101110559A (en) * | 2006-07-20 | 2008-01-23 | 比亚迪股份有限公司 | Magneto synchronous generator controlling system used for hybrid vehicle |
CN202041221U (en) * | 2011-03-02 | 2011-11-16 | 西安交通大学 | Subdividing device of sine/cosine encoder |
-
2012
- 2012-12-20 CN CN201210558043.2A patent/CN103078608B/en not_active Expired - Fee Related
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101110559A (en) * | 2006-07-20 | 2008-01-23 | 比亚迪股份有限公司 | Magneto synchronous generator controlling system used for hybrid vehicle |
CN202041221U (en) * | 2011-03-02 | 2011-11-16 | 西安交通大学 | Subdividing device of sine/cosine encoder |
Non-Patent Citations (2)
Title |
---|
《基于DSP的数字振荡器的设计与实现》;黄福莹等;《微计算机信息(嵌入式与SOC)》;20090731;第25卷(第7-2期);正文第118-119页 * |
《用DSP产生高频、高精度余弦波的一种快速方法》;张宏等;《四川大学学报(自然科学版)》;20040630;第41卷(第3期);正文第547-550页 * |
Also Published As
Publication number | Publication date |
---|---|
CN103078608A (en) | 2013-05-01 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP2014116946A5 (en) | ||
CN103078608B (en) | A kind of cosine differential signal production method | |
CN102830247A (en) | Method and device for detecting rotation state of rotation part | |
CN102735971A (en) | Device for measuring and computing synchronous vector of power system based on field programmable gate array (FPGA) | |
GB2592166A9 (en) | Methods of estimating a position of a rotor in a motor under transient and systems thereof | |
CN103676769A (en) | Electronic cam control system and method of programmable logic controller | |
CN102608415A (en) | Software frequency tracking algorithm on basis of weighted double fitting | |
CN105356795A (en) | System and method for acquiring motor speed feedback signal | |
CN103257669A (en) | Electronic device and method with overclocking mode | |
CN202351339U (en) | Power quality monitoring device | |
CN104252280B (en) | The system and method for the anti-power supply disturbance of touch screen | |
CN204374293U (en) | A kind of current detection module of frequency converter | |
FI3542719T3 (en) | Information processing system, information processing device and information processing method | |
CN104767467A (en) | Method for calibrating mechanical zero of motor | |
CN204597934U (en) | A kind of arbitrary integer frequency dividing circuit of orthogonal optical photoelectric coder | |
CN103138914A (en) | Multi scroll chaotic attractor producing and synchronous method thereof based on hyperbolic tangent function | |
CN103516288A (en) | Self-adaptive encoder speed measuring device and method | |
CN203193558U (en) | Unposition sensor control system of permanent-magnet synchronous motor | |
CN104821771B (en) | Photoelectric code disk orthogonal frequency division method based on CPLD | |
CN105523210A (en) | Intelligent counting method for flow filling machine and device for implementing method | |
CN202586853U (en) | Hand pulse or rotary encoder with directional signal | |
CN202340201U (en) | Field programmable gate array (FPGA)-based speed setting controller for brushless direct current motor | |
CN204517716U (en) | A kind of Permanent Magnet Synchronous Motor Controller | |
CN103309278B (en) | A kind of method improving fixed cycle digital control system sampling antijamming capability | |
CN204360290U (en) | A kind of computer equipment being applicable to large data processing |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20160120 Termination date: 20161220 |
|
CF01 | Termination of patent right due to non-payment of annual fee |