Pages: [1]   Go Down
Author Topic: how to control servo's stopping point?  (Read 623 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 39
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I recently purchased a servo https://www.sparkfun.com/products/10189 and am wondering how to write a code to start and stop the servo at certain points. Here is what I would like to do...

Using an arduino UNO:

when you power up the UNO the servo will find the "center" and stay there
when a simple pushbutton https://www.sparkfun.com/products/9190? is pushed once the servo would turn 90 degrees
when the button is pushed the second time it would rotate 90 degrees further (to the 180* point from center)
when the button is pushed the third time it would rotate 90 degreees further (to the 270* point from center)
when the button is pushed the forth time it would return back to the center position.



thanks for your help
Logged

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 238
Posts: 24322
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
when you power up the UNO the servo will find the "center" and stay there
Without extra hardware, that is never going to happen.

Hint: it isn't a servo anymore, despite what the seller tells you.

I think, under UK law, you'd have a very strong case for a refund.
Logged

"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

Offline Offline
Newbie
*
Karma: 0
Posts: 39
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Without extra hardware, that is never going to happen.

Hint: it isn't a servo anymore, despite what the seller tells you.

I think, under UK law, you'd have a very strong case for a refund.

So what you are saying is that I have the wrong type of "servo" for what I want to accomplish?

Logged

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 238
Posts: 24322
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
So what you are saying is that I have the wrong type of "servo" for what I want to accomplish?
I don't know, I haven't seen your spec.
Logged

"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

Offline Offline
Newbie
*
Karma: 0
Posts: 39
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

http://www.sparkfun.com/datasheets/Robotics/SM23-33%20Servo%20_E.pdf

is this what you want to see?
Logged

Seattle, WA USA
Online Online
Brattain Member
*****
Karma: 548
Posts: 46048
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
So what you are saying is that I have the wrong type of "servo" for what I want to accomplish?
Pick up the front of a bicycle. That front tire is a continuous rotation device, like your servo. Mark the "center point". Take a picture of where you marked. Then, we can talk about how to do the same thing with the not-a-servo that you have.
Logged

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 238
Posts: 24322
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
is this what you want to see?
No, I want to see your spec
Logged

"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

Offline Offline
Newbie
*
Karma: 0
Posts: 39
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

the line i made runs perpendicular with the white plastic arm


* servo.JPG (364.88 KB, 1280x960 - viewed 13 times.)
Logged

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 238
Posts: 24322
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
the line i made runs perpendicular with the white plastic arm
That's nice.
Logged

"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

Offline Offline
Newbie
*
Karma: 0
Posts: 39
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

just in case you haven't figured it out by now I'm a beginner so any advice would be appreciated!!
Logged

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 238
Posts: 24322
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You've been here more than a month - any details of what you want to achieve would be appreciated.
Logged

"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

Seattle, WA USA
Online Online
Brattain Member
*****
Karma: 548
Posts: 46048
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

It's a continuous rotation servo. There is no center point. There is no 0 degree mark, either. All such capabilities have been removed from that servo, to make it a continuous rotation servo. All that you can do with that "servo" is change the speed and direction that it rotates.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 39
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

thanks PaulS
Logged

0
Offline Offline
Tesla Member
***
Karma: 114
Posts: 8919
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

If uou need a servo that rotates more than 180 deg and is still a servo, then you might look at the sail winch servos.
Logged

Consider the daffodil. And while you're doing that, I'll be over here, looking through your stuff.   smiley-cool

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 331
Posts: 16514
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

It's a continuous rotation servo. There is no center point. There is no 0 degree mark, either. All such capabilities have been removed from that servo, to make it a continuous rotation servo. All that you can do with that "servo" is change the speed and direction that it rotates.

Actually they do a disservice and are misleading even calling it a servo. It's an ex-servo, it no longer represents anything that a servo controlled motor would share with it. It should be called what it has become sense being modified:

Quote
It's a bidirectional variable speed geared motor drive that is controlled by a pwm pulse.


From a SparkFun customer:

Quote
"If this were a servo motor, it would take a set point and adjust its position to be at the corresponding location, using internal feedback. If this is a continuous rotation motor, it takes a set point and scales its speed depending on that set point, but there’s no closed loop control, so it’s not a “servo”. This device may very well be in a package typical of servos and may even have been a servo before someone broke the feedback loop, but it’s not a servo if it’s continuous rotation, open-loop control."

Lefty
Logged

Pages: [1]   Go Up
Jump to: