久久久久久久999_99精品久久精品一区二区爱城_成人欧美一区二区三区在线播放_国产精品日本一区二区不卡视频_国产午夜视频_欧美精品在线观看免费

 找回密碼
 立即注冊

QQ登錄

只需一步,快速開始

搜索
查看: 3980|回復: 0
打印 上一主題 下一主題
收起左側

基于單片機的多路舵機控制器設計外文翻譯

[復制鏈接]
跳轉到指定樓層
樓主
ID:291756 發表于 2018-3-14 13:27 | 只看該作者 回帖獎勵 |倒序瀏覽 |閱讀模式
外文翻譯2
原文:
Based on The AT89C2051 Servo Controller Design
Author:Huabo Wu  Cunlai Qian
Abstract
Steering robot, electrical system, and is the important actuators hog. The controller for steering gear to provide the necessary energy and control signals. This paper proposes a kind of external interruption to count on the basis of PWM waves method. This method is simple and convenient, low cost, can achieve more independent PWM output advantages of road.
Keywords: AT89C2051 steering PWM controller external interruption
Introduction:
    Steering gear is a kind of position servo drive. It receives some control signal output and certain Angle,applicable to those who need Angle and can keep the control system.In microelectromechanical system and rc, it is one of the basic output actuators.
1.The working principle of steering gear
In Japan S3003 FUTABA type steering gear, for example, the figure 1 is the FUTABA - S3003 type steering internal circuitry.
The working principle of PWM signal is: by receiving signal demodulating circuit BA6688L channel into 12 feet were demodulated, get a dc bias voltage. The dc bias voltage and comparison, the voltage potentiometer voltage difference of three feet by BA6688 output. The output into motor drive IC BAL6686 to drive motor rotation. When the motor speed through a certain cascade reduction gear drive Rw1 potentiometer, until the voltage difference for 0, the motor stopped rotating. Servo control signal is using PWM signal, SHCH changes of steering gear.
2.the steering gear control method
    Standard of steering gear with three wires, respectively is: power, ground, line, as shown in figure 2. Power and ground for the internal control circuit of dc motor and the energy needed, voltage usually between 4 ~ 6 V, one As take 5 V. Note that the power supply for steering gear should provide enough power to. Line of input is a pulse width can be adjusted periodically pulse signal,the square of the pulse signal for 20 to 50 ms (i.e. frequency speed). When the pulse width of the pulse change, steering shaft Angle of view, change with the changes of the pulse width is proportional to the change. A type of steering Angle and the input signal output shaft of the relationship between pulse width is available to figure 3.
              
3. the controller design
(1)the controller hardware circuit design
From the Angle of steering gear control method can see, steering gear control signal is an adjustable width of the pulse signal( PWM ). The pulse signal by the FPGA, analog circuits or microcontroller. Adopted FPGA cost is higher, with analog circuit is complicated circuit to realize multiple output, are generally made of steering gear adopts single-chip microcomputer controller. Now do the one-chip computer controller, can use more scheme of microcontroller timer interrupt realize PWM. The plan will be 20 ms periodic signal is divided into two regularly interrupted: a regular realize high-level timing Th, A regular realize low level timing Tl. Th, the time value of Tl with pulse width of transformation and change but Th + Tl = 20 ms. The advantage of this method is completely by MCU, PWM signal inside the timer interruption to realize, need not add peripheral hardware faults is a cycle of PWM signal to interrupt, two for calculating the interruption twice as a trouble, In order to satisfy the cycle, 20 ms chip to reduce the frequency of crystals, Not realizing multi-way output. Can also adopts singlechip + 8253 counter scheme. The scheme of microcomputer produce counting pulse (or an external circuit counting pulse) to count by MCU, 8253 is compared to the count 8253 output pulse-width change the advantages of the plan is to achieve more ways of output, software design is simple, Defect is to add 1 piece 8253 counter, increase the cost of hardware. Based on the combination of the two microcontroller steering gear control scheme is proposed, based on a new design scheme, as shown in figure 4.
The scheme of the controller to AT89C2051 singlechip, consisting of a regular 555 oscillator, SCM based on the pulse signal generated 555 oscillator to generate PWM signal count. This control
The SCM can produce eight PWM channels signal, the P1.0 ~ P1.7 by AT89C2051 (12-19 pin) ports output. The eight PWM signal output by light-coupler to lower level isolation circuit. Because the signal transmitted through light-coupler process, so the signals from light-coupler to inverter reverse phase. Pulse signal transmission through light-coupler, frontier and the distortion, so will happen CD40106 schmidt inverter adopts inverter of optical coupling transmission signals, produce plastic PWM signal. Standard torque-current In the process of experiment, steering gear in the operation process of absorbing from power steering gear and current, if share a microcomputer controller, servo will to power of chip. Therefore, the microcomputer controller and power supply, two by two, not to isolate light-coupler through, and the power supply for steering the output power of switch power. The steering gear controller chip occupy 1 SCI serial port. Serial transmission come to accept a PC control commands,to adjust the output signal of each channel pulse width. MAX232 for level of PC converter, will convert TTL multilevel RS232 level.
(2)multi-way PWM signal principle
In analog circuits, PWM pulse signal can be through with the sawtooth wave signal dc level compared to get. In the SCM,sawtooth wave can be based on an integer 1 operation to realize, as shown in figure 5. Assuming microcontroller program Set a variable in the value of a range of ~. SawVal, 0 N 555 oscillating circuit of external clock signal input to count the feet. INT0 AT89C2051 Whenever in the external counting down the clock pulse, the microcontroller generate external interruption along,INT0 external interruption of an interrupt service routine. Each time to generate external interruption, SawVal execution time plus 1 operation, if SawVal has reached the maximum N, to SawVal qing 0.SawVal value change rule of the equivalent of sawtooth wave, as shown in figure 5. If the microcontroller program in the whole set of DutyVal variables, the range of 0 ~ N. Whenever SawVal in qing dynasty, from the upper DutyVal 0In order to send machine control input pulse width coefficient values, such as H ( 0 acuities H acuities N ). If DutyVal SawVal p, corresponding to the high power lost ports; If DutyVal < SawVal, the corresponding ports output low level. Can see from figure 5, if change DutyVal value, the corresponding ports output pulse width changes, but the output pulse frequency, this is for PWM waves.
Set the clock cycle count for external TINT0, sawtooth wave period ( PWM pulse cycle ) for TPWM PWM pulse width,SHCH as D, figure 5 can draw as follows:
                          
By type ( 3 ), TPWM cycle of PWM waves, only once selected counting maximum N, can determine the external clock pulse frequency required cycle ( Frequency ). External clock cycle TINT0 apparently PWM pulse width transform interval, namely, the minimum regulation accuracy. By type(4), N, is occupied the smaller percentage of PWM cycle, higher accuracy. For example, if the eight using 8-bit integer variables, the maximum N = 2-1 = 255, accuracy of 1/16 ( 255 + 1 ) = 1/256, If using 16-bit an integer value, N = 2-1 = 65 535, precision for 1/65 536. The counter variable SawVal using 8-bit integer variables, N = 255. In general, the accuracy of the application is enough. Just as TPWM requirements, steering gear = 20 ms, can calculate external clock cycle for:
Therefore, when the oscillating circuit design 555, the output pulse frequency should be:
When more than one variable and SawVal comparison, comparing to multiple outputs, formed port multi-channel PWM waves. Variables can be independent of value, so each change of PWM SHCH can also independent regulation, each other. Multiple PWM waves generated as shown in figure 6. Graph 3 road of PWM waves, for example.
4. the controller of software design
Steering gear control core controller for a single chip microcomputer AT89C2051. This program written by C51 and way of working for QianHouTai way to work. Microcontroller program including system initialization procedures, serial communication program, PC and ordered a PWM pulse-width generating procedures and multi-channel PWM output process. Serial communication program and multiple output program using PWM interruption. Serial communication format for baud rate and 600 BPS, 8 bits of data bits, and stop bits, calibration, ASCII characters. Serial communication program for receiving PC to send over control commands. Control command by custom text content, in which the protocol agreement for the ASCII characters. Communication protocol format, as shown in figure 7.
For example, to control the PWM channels 1 pulse width, pulse width coefficient for 25, communication protocol for "#" content "1", "2", "0", "5"!" The six characters. This passage 1 PWM SHCH as 25/256 = 0.098. A channel number corresponds to a PWM pulse output port. This design for 8 channels, the number is 1-8, corresponding to the P1.0 ~ P1.7 chip. Starting and termination of the role play frame synchronization. Serial communication processes as shown in figure 8.
Figure 8, CHNo deposit is PWM channels, Duty100, Duty10 ASCII code, and stored Duty1 respectively the pulse width of the coefficient is 100 digits, ten digits and single-digit ASCII ( note, if high digits 0, then it should be "0" the character, not omit. 25,complete characters should be "0" "2" and "five" ). CharNo for signal, used to receive the characters and serial interrupt and superordination machine serial order process between the synchronization.
5 .the controller experiment
Figure 9 for steering gear control panel output of PWM waves along with servo load ( . ). Can see from figure 9 PWM controller outputs, steering stability, clean, wave meet the design requirement.
6 ."theory
In this paper the steering gear controller design method, as the core, with a single chip microcomputer AT89C2051 by external oscillating circuit provides PWM pulse timing benchmark, control and steering gear drive by two power supply, both electrical isolation. This kind of design scheme is:
1 PWM waves from external oscillating circuit chip, and provide timing benchmark internal oscillator frequency, do not affect serial communication, timer and other parameters of the configuration.
2 accuracy of PWM waves can be arbitrary.
3 this design can be applied to any number of PWM output, as long as SCM can provide enough output port, for example, can change AT89C2051 AT89S51 provide at least 24 PWM output ( P2 ) P0, P1.
4 by SCI serial input control parameters, wide adaptability, PC can be PCS, SCM or PLC.
This method possesses 5, any microcontroller as long as can provide SCI interrupt and external interruption, this method can be applied.
References
[1] facts technology. The typical examples of navigation module design chip. Beijing: people's press, 2004.
[2] microcontroller PWM signal for steering gear control. WWW. Vip998.com/right/MCU McUyj / 200603/237. / HTML.
譯文:
基于AT89C2051的多路舵機控制器設計
作者:吳華波 錢春來
摘要
舵機是機器人、機電系統和航模的重要執行機構。舵機控制器為舵機提供必要的能源和控制信號。本文提出一種以外部中斷計數為基礎的 PWM 波形實現方法。該方法具有簡單方便,成本低,可實現多路獨立 PWM 輸出的優點。
關鍵詞: AT89C2051;舵機;控制器;外部中斷;PWM
引言:
舵機是一種位置伺服的驅動器。它接收一定的控制信號,輸出一定的角度,適用于那些需要角度不斷變化并可以保持的控制系統。在微機電系統和航模中,它是一個基本的輸出執行機構。
1  舵機的工作原理
以日本 FUTABA S3003型舵機為例,圖1是 FUTABA-S3003 型舵機的內部電路。
舵機的工作原理是:PWM 信號由接收通道進入信號解調電路BA6688L 的12 腳進行解調,獲得一個直流偏置電壓。該直流偏置電壓與電位器的電壓比較,獲得電壓差由BA6688 的 3 腳輸出。該輸出送入電機驅動集成電路BAL6686,以驅動電機正反轉。當電機轉速一定時,
通過級聯減速齒輪帶動電位器 Rw1旋轉,直到電壓差為0,電機停止轉動。舵機的控制信號是 PWM 信號,利用占空比的變化改變舵機的位置。
2  舵機的控制方法
標準的舵機有 3 條導線,分別是:電源線、地線、控制線,如圖2 所示。電源線和地線用于提供舵機內部的直流電機和控制線路所需的能源,電壓通常介于 4~6 V ,一般取5 V。注意,給舵機供電的電源應能提供足夠的功率?刂凭的輸入是一個寬度可調的周期性方波脈沖信號,方波脈沖信號的周期為 20 ms(即頻率為50 Hz)。當方波的脈沖寬度改變時,舵機轉軸的角度發生改變,角度變化與脈沖寬度的變化成正比。某型舵機的輸出軸轉角與輸入信號的脈沖寬度之間的關系可用圖3來表示。
              
3  舵機控制器的設計
(1) 舵機控制器硬件電路設計
    從上述舵機轉角的控制方法可看出,舵機的控制信號實質是一個可調寬度的方波信號(PWM) 。該方波信號可由 FPGA、模擬電路或單片機來產生。采用 FPGA 成本較高,用模擬電路來實現則電路較復雜,不適合作多路輸出一般采用單片機作舵機的控制器。目前采用單片機做舵機控制器的方案比較多,可以利用單片機的定時器中斷實現 PWM。該方案將20 ms 的周期信號分為兩次定時中斷來完成: 一次定時實現高電平定時 Th ;一次定時實現低電平定時 Tl 。Th 、Tl的時間值隨脈沖寬度的變換而變化但 Th + Tl =20 ms。該方法的優點是,PWM 信號完全由單片機內部定時器的中斷來實現,不需要添加外圍硬件缺點是一個周期中的 PWM 信號要分兩次中斷來完成,兩次中斷的定時值計算較麻煩;為了滿足20ms 的周期,單片機晶振的頻率要降低;不能實現多路輸出。也可以采用單片機+8253 計數器的實現方案。該方案由單片機產生計數脈沖(或外部電路產生計數脈沖)提供給8253 進行計數,由單片機給出8253 的計數比較值來改變輸出脈寬該方案的優點是可以實現多路輸出,軟件設計較簡單;缺點是要添加 1 片 8253 計數器,增加了硬件成本。本文在綜合上述兩個單片機舵機控制方案基礎上,提出了一個新的設計方案,如圖4 所示。
該方案的舵機控制器以 AT89C2051 單片機為核心,555 構成的振蕩器作為定時基準,單片機通過對555 振蕩器產生的脈沖信號進行計數來產生 PWM 信號。該控制
器中單片機可以產生 8 個通道的 PWM 信號,分別由AT89C2051 的 P1.0~P1.7(12~19 引腳) 端口輸出。輸出的8 路 PWM 信號通過光耦隔離傳送到下一級電路中。因為信號通過光耦傳送過程中進行了反相,因此從光耦出來的信號必須再經過反相器進行反相。方波信號經過光耦傳輸后,前沿和后沿會發生畸變,因此反相器采用CD40106 施密特反相器對光耦傳輸過來的信號進行整形,產生標準的 PWM 方波信號。筆者在實驗過程中發現,舵機在運行過程中要從電源吸納較大的電流,若舵機與單片機控制器共用一個電源,則舵機會對單片機產生較大的干擾。因此,舵機與單片機控制器采用兩個電源供電,兩者不共地,通過光耦來隔離,并且給舵機供電的電源最好采用輸出功率較大的開關電源。該舵機控制器占用單片機的1個SCI串口。串口用于接收上位機傳送過來的控制命令,以調節每一個通道輸出信號的脈沖寬度。MAX232 為電平轉換器,將上位機的 RS232 電平轉換成 TTL 電平。
(2) 實現多路 PWM信號的原理
在模擬電路中,PWM 脈沖信號可以通過直流電平與鋸齒波信號比較來得到。在單片機中,鋸齒波可以通過對整型變量加1 操作來實現,如圖5 所示。假定單片機程序
中設置一整型變量 其值變化范圍為 ~ 。SawVal , 0 N 555振蕩電路產生的外部計數時鐘信號輸入到 AT89C2051 的INT0腳。每當在外部計數時鐘脈沖的下降沿,單片機產生外部中斷,執行外部中斷INT0的中斷服務程序。每產生一次外部中斷,對 SawVal 執行一次加1 操作,若 SawVal 已達到最大值 N ,則對 SawVal 清 0。SawVal 值的變化規律相當于鋸齒波,如圖5 所示。若在單片機程序中設置另一整型變量 DutyVal ,其值的變化范圍為 0~N。每當在SawVal 清 0 時,DutyVal 從上位機發送的控制命令中讀入脈沖寬度系數值,例如為 H(0 ≤H ≤N)。若DutyVal ≥SawVal,則對應端口輸出高電平; 若 DutyVal <SawVal ,則對應端口輸出低電平。從圖5 中可看出,若改變 DutyVal的值,則對應端口輸出脈沖的寬度發生變化,但輸出脈沖的頻率不變,此即為 PWM波形。
設外部計數時鐘周期為 TINT0 ,鋸齒波周期(PWM 脈沖周期)為TPWM ,PWM 脈沖寬度占空比為 D,由圖5 可得出如下關系:
由式(3)可知,PWM 波形的周期 TPWM一旦確定下來,只須選定計數最大值 N,就可以確定外部時鐘脈沖所需周期(頻率)。外部時鐘脈沖周期 TINT0 顯然是 PWM 脈沖寬度變換的最小步距,即調節精度。由式(4)可知,N 越大,步距所占 PWM 周期的百分比越小,精度越高。例如,若8采用8 位整型變量,最大值 N = 2 - 1 =255,則精度為1/16(255 +1) =1/256;若采用16 位整型變量,最大值 N = 2- 1 =65 535,則精度為1/65 536。文中計數變量 SawVal采用8 位整型變量,因此 N =255。對于一般應用,其精度已足夠。就舵機而言,要求 TPWM = 20 ms,則可算得外部時鐘周期為:
因此,設計555 振蕩電路時,其輸出脈沖的頻率應為:
當有多個變量與 SawVal 比較,將比較結果輸出到多個端口時,就形成了多路 PWM 波形。各個變量的值可以獨立變化,因此各路 PWM 波形的占空比也可以獨立調節,互不相干。多路 PWM 波形的產生如圖6 所示。圖中以3 路 PWM 波形為例。
4  舵機控制器軟件的設計
舵機控制器的控制核心為單片機 AT89C2051。文中,程序用 C51 編寫,工作方式為前后臺工作方式。單片機程序包括系統初始化程序、串口通信程序、上位機命令解釋與 PWM 脈寬生成程序和多路 PWM 波形輸出程序。串行通信程序和多路 PWM 波形輸出程序采用中斷方式。串口通信格式為波特率 9 600 bps、8 位數據位、1 位停止位、無校驗、ASCII 碼字符通信。串口通信程序用于接收上位機發送過來的控制命令?刂泼畈捎米远x文本協議,即協議內容全部為ASCII碼字符。通信協議格式如圖7 所示。
例如,要控制通道1 的 PWM 脈寬,脈寬系數為25,則通信協議內容為“#”“1”“0”“2”“5”“!”這6 個字符。這時通道1 的 PWM 占空比為25/256 =0.098。一個通道號對應一個 PWM 脈沖輸出端口。本設計為8 個通道,號碼為1~8,對應單片機的 P1.0~P1.7。起始符和終止符起到幀同步的作用。串口通信程序流程如圖8 所示。
圖8 中,CHNo 存放的是 PWM 通道號 ASCII 碼,Duty100、Duty10、Duty1 分別存放的是脈寬系數的百位數、十位數和個位數的 ASCII 碼(注意,若高位數為 0,則該位的字符應為“0”,不能省略。如25,完整字符應為“0”“2”“5”)。CharNo 為信號量,用于對串口接收的字符順序以及串口中斷與上位機命令解釋程序之間進行同步。
5  舵機控制器實驗
圖9 為舵機控制板輸出的其中一路 PWM 波形(帶舵機負載)。從圖9 中可看出,舵機控制器輸出的 PWM 波形穩定、干凈,符合設計要求。
6  結 論
本文提出的多路舵機控制器設計方法,以單片機AT89C2051 為核心,由外部振蕩電路提供 PWM 脈沖的定時基準,控制部分與舵機驅動部分由兩個電源供電,兩者電氣隔離。這種設計方案的優點是:
①PWM 波形由外部振蕩電路提供定時基準,與單片機內部振蕩器的頻率無關,不影響串口通信、定時器等參數的配置。
②PWM波形的調整精度可任意確定。
③本設計思路可應用于任意多路的 PWM 輸出,只要單片機能提供足夠多的輸出端口,例如將AT89C2051換成AT89S51,就可以提供至少24 路的 PWM 輸出 (P0、P1、P2)。
④控制參數由 SCI串口輸入,適應面廣,上位機可以是 PC機、單片機或是 PLC。
⑤本方法具有一般性,任何單片機只要能提供 SCI中斷、外部中斷就可以應用本方法。

完整的Word格式文檔51黑下載地址:
基于單片機的路燈遙控裝置的設計外文翻譯.doc (472.61 KB, 下載次數: 41)


分享到:  QQ好友和群QQ好友和群 QQ空間QQ空間 騰訊微博騰訊微博 騰訊朋友騰訊朋友
收藏收藏 分享淘帖 頂 踩
回復

使用道具 舉報

您需要登錄后才可以回帖 登錄 | 立即注冊

本版積分規則

小黑屋|51黑電子論壇 |51黑電子論壇6群 QQ 管理員QQ:125739409;技術交流QQ群281945664

Powered by 單片機教程網

快速回復 返回頂部 返回列表
主站蜘蛛池模板: 日韩在线播放第一页 | 国产精品91视频 | h在线 | 国产精品美女久久久久aⅴ国产馆 | 日韩精品一区二区三区中文字幕 | 国产精品二区三区在线观看 | 国产激情免费视频 | 日韩在线视频一区二区三区 | 亚洲精品一区二区三区丝袜 | 免费观看av | 91av视频在线观看 | 日韩一区二区三区在线视频 | 欧美亚洲国产日韩 | 国产精品亚洲二区 | 免费黄色录像视频 | av在线黄 | 美女天堂在线 | 午夜视频在线免费观看 | 国产95在线 | 精品一区二区三区91 | yiren22综合网成人 | 久久777 | 国产精品观看 | 亚洲国产成人久久综合一区,久久久国产99 | 欧美日韩精品 | 亚洲精品一区二区在线观看 | 亚洲成人毛片 | 国产精品伦一区二区三级视频 | 妖精视频一区二区三区 | 久久伊人一区 | 亚洲精品9999 | 欧美亚洲视频在线观看 | 亚洲69p | 久久性色| 欧美色综合天天久久综合精品 | 一本在线 | 日韩电影中文字幕 | 天天干夜夜操 | 在线91| 欧美色视频免费 | 国产亚洲一区二区精品 |