PDA

View Full Version : Problem Controlling Continuous Rotation Servo to 90 degrees



Yan Han
03-23-2007, 10:39 AM
i have written an assembly language source code, as shown below to control the Continuous Rotation servo motor, such that it rotates CLOCKWISE 90 degrees and stop momentarily until the next input is triggered. Then it rotates CLOCKWISE again 90 degrees and stop. the process repeats.

Run
movlw 0x0C
movwf COUNT_2

loopd
decfsz COUNT_2,f
goto One
return

One
BSF PORTB,7
CALL Delay
BCF PORTB,7
CALL Delay
CALL Delay
CALL Delay
CALL Delay
CALL Delay
CALL Delay
CALL Delay
CALL Delay
CALL Delay
CALL Delay
CALL Delay
CALL Delay
CALL Delay
CALL Delay
CALL Delay
CALL Delay
CALL Delay
CALL Delay
CALL Delay
CALL Delay
CALL Delay
CALL Delay
CALL Delay
CALL Delay
CALL Delay
CALL Delay

GOTO loopd

Delay
movlw 0xF9
movwf COUNT_1
loop
decfsz COUNT_1,f
goto loop
RETURN

i understand that this method is different from the conventional time-pulse method. Initially, it worked sort of well for the first few rotations, but gradually the position is no longer perpendicular.

is there any explaination for this? or even better, can anyone provide an example program to execute the desired movement? i am looking forward to receiving replies a.s.a.p, as i urgently need to solve this for my final year project. thanks!

Forrest
03-23-2007, 10:42 AM
Check this message from 2 days ago http://forums.parallax.com/showthread.php?p=639459

Yan Han
03-23-2007, 11:26 AM
this method is using the optical sensor to control the position. but i thought the positioning of servo motor is controlled by various time pulse; 1.0 ms hi for anti-clockwise, 2.0 ms hi for clockwise.

Phil Pilgrim (PhiPi)
03-23-2007, 11:45 AM
In a continuous-rotation servo, the internal feedback mechanism (a potentiometer) has been mechanically disconnected from the shaft. The only thing that the pulse widths control is the speed of rotation — not the position. To get accurate positioning, you need additional position feedback. An opto sensor is one such method.

-Phil

Yan Han
03-23-2007, 11:56 AM
no wonder.... ok thanks a lot!

Chris Savage
03-23-2007, 10:26 PM
This thread is being moved from the BASIC Stamp Forum to the Sandbox Forum.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support