• slider image 442
  • slider image 492
  • slider image 493
  • slider image 494
  • slider image 495
  • slider image 496
  • slider image 491
:::


Browsing this Thread:   1 Anonymous Users






新手請問伺服馬達轉向控制問題
#1
高級會員
高級會員


查看用戶資訊
我用延遲寫出PWM的方式去控制一顆伺服馬達
這是我用的伺服馬達的說明書http://www.gws.com.tw/chinese/product/SERVO/servo%20form.htm
簡單的說 週期要20ms 0.9ms脈波是正轉 2.1ms脈波是反轉

以下是我寫的程式 PIC877A 20MHz
list p=16f877a
#include <p16f877A.inc>

VAL_TIME1             EQU    .25
VAL_TIME2             EQU    .1
DEL_MS        EQU    .4
VAL_US        EQU    .249
TIME1        EQU    0x20
TIME2        EQU    0x21
DELAY         EQU    0x22
COUNT        EQU    0X23

        ORG    0x00
        NOP

INITIAL
:
        
BANKSEL    TRISC
        CLRF    TRISC
        BANKSEL    PORTC
        CLRF    PORTC

START
:
        
MOVLW    VAL_TIME1
        MOVWF    TIME1
        MOVLW    VAL_TIME2
        MOVWF    TIME2
TIME1_LOOP    MOVLW    
B'11111111'
        
MOVWF    PORTC
        CALL    DELAY_800US
        DECFSZ    TIME1
,F
        
GOTO    TIME1_LOOP
TIME2_LOOP    MOVLW    
B'11111110'
        
MOVWF    PORTC
        CALL    DELAY_800US
        DECFSZ    TIME2
,F
        
GOTO    TIME2_LOOP
        
GOTO    TIME1_LOOP

DELAY_800US
:
        
MOVLW    DEL_MS
        MOVWF    DELAY
DELAY_LOOP    CALL    DELAY_200US
        DECFSZ    DELAY
,F
        
GOTO    DELAY_LOOP
        
RETURN

DELAY_200US:
        
NOP
        MOVLW    VAL_US
        MOVWF    COUNT
DEC_LOOP    NOP
        DECFSZ    COUNT
,F
        
GOTO    DEC_LOOP
        
RETURN

        
END

目前我把VAL_TIME2設為1 是0.8ms 所以應該正轉(順時針) 但是卻是逆時針轉(反轉)
當我把VAL_TIME2設為2或3(1.6ms 或 2.4ms)是逆轉

目前的問題是 伺服馬達不受我控制正轉(順時針)

麻煩先進高手 指點一下

感謝

發表於: 2006/1/4 1:50
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部







You can view topic.
不可以 發起新主題
You cannot reply to posts.
You cannot edit your posts.
You cannot delete your posts.
You cannot add new polls.
You cannot vote in polls.
You cannot attach files to posts.
You cannot post without approval.
You cannot use topic type.
You cannot use HTML syntax.
You cannot use signature.
You cannot create PDF files.
You cannot get print page.

[進階搜尋]


:::

Microchip連結

https://www.facebook.com/microchiptechnologytaiwan/
http://www.microchip.com.tw/modules/tad_uploader/index.php?of_cat_sn=13
https://mu.microchip.com/page/tmu
http://elearning.microchip.com.tw/modules/tad_link/index.php?cate_sn=1
https://page.microchip.com/APAC-PrefCenters-TW.html
http://www.microchip.com/
http://www.microchip.com/treelink
http://www.microchipdirect.com/
http://www.microchip.com.cn/newcommunity/index.php?m=Video&a=index&id=103
http://www.microchip.com.tw/modules/tad_uploader/index.php?of_cat_sn=2
http://www.microchip.com.tw/Data_CD/eLearning/index.html
http://www.microchip.com.tw/RTC/RTC_DVD/
https://www.microchip.com/development-tools/
https://www.youtube.com/user/MicrochipTechnology
[ more... ]

教育訓練中心

!開發工具購買
辦法說明 [業界客戶] [教育單位]
----------------------------------
!校園樣品申請
辦法說明 [教師資格] [學生資格]
----------------------------------