Go Down

Topic: Servo Motor Position Control with potentiometer (Read 1 time) previous topic - next topic

ilker58

hello
  i have a project about position control. In my project, servo must turn 5 10 15 20 25 30 35 40 45 50 55 60 degrees. When Motor turns 5 degrees then coming 0 position (e.g 5 0 10 0 15 0) angels adjustment with pot. if you have similar example, can you share me?

thank you

JimboZA

I'm not 100% sure what you mean, but in any case, have you looked at this tutorial?

And what have you tried so far?
meArm build blog:     http://jimbozamearm.blogspot.com/

Please don't PM for technical advice. Firstly my advice is sometimes wrong, and second, in the forum you get a broader, more timely, range of responses.

ilker58

Firstly, i am sorry for bad english. i will use 10k pot and angle change by potentiometer. for example, digital value 200 and motor have to run 5 degree clockwise after this, motor must come first position (0 degree). it's my first project at arduino board.  :D

JimboZA

Well first of all try that knob tutorial... then think about how to get it back to 0 each time
meArm build blog:     http://jimbozamearm.blogspot.com/

Please don't PM for technical advice. Firstly my advice is sometimes wrong, and second, in the forum you get a broader, more timely, range of responses.

ilker58

your example tutorial http://arduino.cc/en/Tutorial/Knob  is  so basic. i used pic series for position control it's easy but i don't have an idea for turn back 0 position  so i search example code 

zoomkat

Quote
but i don't have an idea for turn back 0 position  so i search example code 


Generally you rotate the pot knob the opposite direction.
Google forum search: Use Google Advanced Search and use Http://forum.arduino.cc/index in the "site or domain:" box.

JimboZA


Quote
but i don't have an idea for turn back 0 position  so i search example code 


Generally you rotate the pot knob the opposite direction.


Yeah but In think he means, once it's "parked" at the X degree position as dictated by the pot, it must go back to 0 by itself. That, of course, will leave the pot still sitting at the position calling for X degrees so not sure what OP expects to happen then.....
meArm build blog:     http://jimbozamearm.blogspot.com/

Please don't PM for technical advice. Firstly my advice is sometimes wrong, and second, in the forum you get a broader, more timely, range of responses.

ash901226

Then its better to use an encorder. But 1 work around that i could think of if he turn thr pot to 0 if every time he what to move the servo

ilker58

yes i tried code and it's working good thanks but sometimes, there is a vibration on servo. How can i correct that? PID is useful for this mistake?

thank you for your answer :)

JimboZA

Quote
sometimes, there is a vibration on servo


Does the servo have its own power supply or is it from the Arduino 5v? Lots of "funnies" go away when a servo has its own power.
meArm build blog:     http://jimbozamearm.blogspot.com/

Please don't PM for technical advice. Firstly my advice is sometimes wrong, and second, in the forum you get a broader, more timely, range of responses.

ilker58

power supply is coming from arduino board.( 5v)

JimboZA

Try it with its own power, it might make a difference.... see my pic attached
meArm build blog:     http://jimbozamearm.blogspot.com/

Please don't PM for technical advice. Firstly my advice is sometimes wrong, and second, in the forum you get a broader, more timely, range of responses.

zoomkat

Google forum search: Use Google Advanced Search and use Http://forum.arduino.cc/index in the "site or domain:" box.

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy