Society of Robots - Robot Forum
Software => Software => Topic started by: airman00 on October 20, 2007, 05:46:33 PM
-
I am using the PIC16F616
I modified two HS425BB servos for continuous rotation and I cannot get them to go counterclockwise. Every pulse that I give makes the servo spin clockwise ( but at different speeds based on the pulse).
the servos and microcontroller are powered by a 5V 1A regulator.
What can I do to make it go counterclockwise????
' PIC BASIC Program
Define OSC 8
symbol servo1=portc.3
symbol servo2=portc.2
x var byte
b var byte
pause 20
x = 50
b = 250
main:
pulsout servo1,x
Pulsout servo2,b
goto main
-
is it 1 in pic basic means 1us?
if that is so then from 1us to 1000us that is a clockwise
-
A 1 in picbasic represents 10uS
is it possible that a servo only turns in one direction??
-
then 50x10=500us = clockwise
250x10=2500us - this is beyond 2ms,
so try 200x10 =2ms: this should reverse the servo
remember for standard servo : 2ms means counterclockwise and 1 ms is clockwise
standard refresh rate is 20ms but other servo has 20-30ms refresh rate.
-
No dice,
does the Hs-425BB go backwards at all??
any other things I should try???
-
If I were to open up the servo and reverse the wires going to them motor it would go backwards, right??
Also, would I need to reverse the wires on the pot also to make it go in reverse?
-
The servo must go both ways.
the unmodified version can go -45 degrees and +45 degrees (forwards and backwards)
what speed crystal are you using on the pic, and is pic basic calibrated for this speed?
http://www.servocity.com/html/hs-425bb_super_sport_bb.html (http://www.servocity.com/html/hs-425bb_super_sport_bb.html)
-
Thanks paul
when i set the oscilaltor to 4mhz it worked!
thanks a lot!!!!
I'm guessing that the servo cannot run of a PIC set to 8mhz even if the program is set to be run at 8mhz.
-
IF you are running the PIC at 8 mhz then a 1 in the pulsout represents 5uS instead of the 10us it represents in a 4mhz PIC.
-
another thing you may want to check is that the port pin you are using is definately set to low before you run the pulsout command. the pulsout only toggles the port twice, so if the port pins initial state is high, it will pulse the pin low for your desired time. I had a bit of trouble with this once, it took me ages to work out why it was working properly.
-
Thanks,
I'll add that to my program.