If you were Registered and logged in, you could reply and use other advanced thread options
|
Posted by on April 24, 2006, 10:56 am
Hello, I'm working on a pole climbing robot
(http://img.photobucket.com/albums/v412/Stompy1/climbrobotclimb.jpg )
for my individual project at Uni, and its come to the stage where I
must programme it! This, I am not very good at, but I am making some
progress. I'm programming in BASIC for a PICAXE microcontroller, if
this helps.
I'm at the stage where I can tell a servo to move to a specific
postion, I've also been fiddling with microswitches, so a press of the
switch causes the servo to do some stuff:
symbol RARM = 2
main: if pin3 = 0 then loop
goto main
loop: servo RARM,75
pause 1000
servo RARM,220
pause 1000
if pin3 = 1 then main
goto loop
(Its a little over-complicated, but only because I'm using it to
investigate how it works.)
The two things I would like to know are as follows:
1) How do I programme the servo to move more slowly?
2) I want a microswitch to - when depressed - interrupt the servo's
movement, regardless of its position (i.e: on my robot, a microswitch
has been mounted at the limit of its arm's gaits. The arm reaches the
limit, the microswitch is depressed, which means the servo must go back
again.
Many Thanks,
James
|
|
Posted by on April 24, 2006, 1:45 pm
symbol RARM = 2
start = 75
stop = 220
DELAY = speed to move servo
main: if pin3 = 0 then loop ;if button = pressed, then move
servo
goto main ;otherwise wait for button
press
loop:
for i = 1 to 100
servo RARM,start
if pin3 = 0 then main
pause DELAY
next i
for i = 1 to 100
servo RARM,stop
if pin3 = 0 then main
pause DELAY
next i
if pin3 = 1 then main
goto loop
You need to read about the
servo RARM,stop command for your
CPU.. How long does the signal get sent after
you give the command?
You might have to use another command if
you want to slow the servo down.
R
|
|
Posted by Jim Hewitt on April 24, 2006, 1:57 pm
> Hello, I'm working on a pole climbing robot
> (http://img.photobucket.com/albums/v412/Stompy1/climbrobotclimb.jpg )
> for my individual project at Uni, and its come to the stage where I
> must programme it! This, I am not very good at, but I am making some
> progress. I'm programming in BASIC for a PICAXE microcontroller, if
> this helps.
> I'm at the stage where I can tell a servo to move to a specific
> postion, I've also been fiddling with microswitches, so a press of the
> switch causes the servo to do some stuff:
> symbol RARM = 2
> main: if pin3 = 0 then loop
> goto main
> loop: servo RARM,75
> pause 1000
> servo RARM,220
> pause 1000
> if pin3 = 1 then main
> goto loop
> (Its a little over-complicated, but only because I'm using it to
> investigate how it works.)
> The two things I would like to know are as follows:
> 1) How do I programme the servo to move more slowly?
> 2) I want a microswitch to - when depressed - interrupt the servo's
> movement, regardless of its position (i.e: on my robot, a microswitch
> has been mounted at the limit of its arm's gaits. The arm reaches the
> limit, the microswitch is depressed, which means the servo must go back
> again.
I assume you are using standard R/C servos. They are controlled by pulse
widths which basically tell the servo which position to go to - and they
gother as quickly as they can given the power suply. the make them move
slowly, you'd have to know where they already are and then slowly ramp up
[or sdown] the pulse width to get where you want to be.
For this type of thing, it _might_ be better to miodify your ervos so you
can adjust the resistance in the potentiometer that it uses to 'sense' its
position. Thus, you wouild provide a fixed pulse width signal to the servo,
but you would bypass the internal pot and use some type of digital pot to
fool the servo. This would also allow you to calibrate the servo position
with the pot value and you could change it very slowly to get the behavior
you need.
You'd still probably wnat your limit switches so you can verify where the
servos are.
Good luck.
Jim
PS I wish they had such fun projects when I was in school...
|
|
Posted by on April 24, 2006, 3:01 pm
Thanks to both of you, you've been very helpful!
On a slightly different note, every example I've seen have had servos'
extents at 75 and 225, with 150 in the middle. For one of my servos, at
least it seems the limits are around 40 and 180? Is it unusual for
this, or am I just being an idiot?!
Also, one of my servos seems to be struggling, moving slower, not
moving the full distance and making a loud buzzing noise when powered.
Is the the sign of a knackered servo, or what?!
Many thanks,
James
|
|
Posted by on April 24, 2006, 3:16 pm
>For one of my servos, at
>least it seems the limits are around 40 and 180? Is it unusual for
>this, or am I just being an idiot?!
All servos are different... That isn't unusual.
the buzzing struggler sounds like it may be knackered. :-)
Rich
|
Page 1 of 2 1 2 > last >>
Related Posts
Latest Posts
|
|
> (http://img.photobucket.com/albums/v412/Stompy1/climbrobotclimb.jpg )
> for my individual project at Uni, and its come to the stage where I
> must programme it! This, I am not very good at, but I am making some
> progress. I'm programming in BASIC for a PICAXE microcontroller, if
> this helps.
> I'm at the stage where I can tell a servo to move to a specific
> postion, I've also been fiddling with microswitches, so a press of the
> switch causes the servo to do some stuff:
> symbol RARM = 2
> main: if pin3 = 0 then loop
> goto main
> loop: servo RARM,75
> pause 1000
> servo RARM,220
> pause 1000
> if pin3 = 1 then main
> goto loop
> (Its a little over-complicated, but only because I'm using it to
> investigate how it works.)
> The two things I would like to know are as follows:
> 1) How do I programme the servo to move more slowly?
> 2) I want a microswitch to - when depressed - interrupt the servo's
> movement, regardless of its position (i.e: on my robot, a microswitch
> has been mounted at the limit of its arm's gaits. The arm reaches the
> limit, the microswitch is depressed, which means the servo must go back
> again.