Offline
Newbie
Karma: 0
Posts: 39
|
 |
« on: January 05, 2013, 05:31:59 pm » |
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
Online
Brattain Member
Karma: 137
Posts: 19001
I don't think you connected the grounds, Dave.
|
 |
« Reply #1 on: January 05, 2013, 05:34:14 pm » |
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.
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 39
|
 |
« Reply #2 on: January 05, 2013, 06:03:50 pm » |
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
Online
Brattain Member
Karma: 137
Posts: 19001
I don't think you connected the grounds, Dave.
|
 |
« Reply #3 on: January 05, 2013, 06:05:31 pm » |
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.
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 39
|
 |
« Reply #4 on: January 05, 2013, 06:09:47 pm » |
|
|
|
|
|
Logged
|
|
|
|
|
Seattle, WA USA
Offline
Brattain Member
Karma: 311
Posts: 35470
Seattle, WA USA
|
 |
« Reply #5 on: January 05, 2013, 06:10:19 pm » |
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
Online
Brattain Member
Karma: 137
Posts: 19001
I don't think you connected the grounds, Dave.
|
 |
« Reply #6 on: January 05, 2013, 06:11:25 pm » |
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.
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 39
|
 |
« Reply #7 on: January 05, 2013, 06:20:57 pm » |
the line i made runs perpendicular with the white plastic arm
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
UK
Online
Brattain Member
Karma: 137
Posts: 19001
I don't think you connected the grounds, Dave.
|
 |
« Reply #8 on: January 05, 2013, 06:26:59 pm » |
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.
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 39
|
 |
« Reply #9 on: January 05, 2013, 06:37:18 pm » |
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
Online
Brattain Member
Karma: 137
Posts: 19001
I don't think you connected the grounds, Dave.
|
 |
« Reply #10 on: January 05, 2013, 06:42:40 pm » |
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.
|
|
|
|
Seattle, WA USA
Offline
Brattain Member
Karma: 311
Posts: 35470
Seattle, WA USA
|
 |
« Reply #11 on: January 05, 2013, 06:43:52 pm » |
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
Newbie
Karma: 0
Posts: 39
|
 |
« Reply #12 on: January 05, 2013, 06:45:42 pm » |
thanks PaulS
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Tesla Member
Karma: 50
Posts: 6532
Arduino rocks
|
 |
« Reply #13 on: January 05, 2013, 08:02:21 pm » |
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
|
|
|
|
|
Left Coast, CA (USA)
Offline
Brattain Member
Karma: 279
Posts: 15309
Measurement changes behavior
|
 |
« Reply #14 on: January 05, 2013, 08:31:51 pm » |
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: It's a bidirectional variable speed geared motor drive that is controlled by a pwm pulse. From a SparkFun customer: "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
|
|
|
|
|
|