Offline
Newbie
Karma: 0
Posts: 12
|
 |
« on: February 08, 2013, 09:34:26 am » |
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
|
|
|
|
|
Logged
|
|
|
|
|
Johannesburg UTC+2
Offline
Edison Member
Karma: 34
Posts: 1705
|
 |
« Reply #1 on: February 08, 2013, 09:45:48 am » |
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?
|
|
|
|
|
Logged
|
IT Crowd: Roy... "Have you tried turning it off and on again?" Moss.. "Have you tried forcing an unexpected reboot?"
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 12
|
 |
« Reply #2 on: February 08, 2013, 10:50:28 am » |
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. 
|
|
|
|
|
Logged
|
|
|
|
|
Johannesburg UTC+2
Offline
Edison Member
Karma: 34
Posts: 1705
|
 |
« Reply #3 on: February 08, 2013, 11:12:06 am » |
Well first of all try that knob tutorial... then think about how to get it back to 0 each time
|
|
|
|
|
Logged
|
IT Crowd: Roy... "Have you tried turning it off and on again?" Moss.. "Have you tried forcing an unexpected reboot?"
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 12
|
 |
« Reply #4 on: February 08, 2013, 11:33:22 am » |
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
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Tesla Member
Karma: 50
Posts: 6546
Arduino rocks
|
 |
« Reply #5 on: February 08, 2013, 12:11:43 pm » |
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.
|
|
|
|
|
Logged
|
|
|
|
|
Johannesburg UTC+2
Offline
Edison Member
Karma: 34
Posts: 1705
|
 |
« Reply #6 on: February 08, 2013, 12:27:25 pm » |
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.....
|
|
|
|
|
Logged
|
IT Crowd: Roy... "Have you tried turning it off and on again?" Moss.. "Have you tried forcing an unexpected reboot?"
|
|
|
|
Malaysia
Offline
Sr. Member
Karma: 7
Posts: 385
|
 |
« Reply #7 on: February 08, 2013, 06:53:54 pm » |
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
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 12
|
 |
« Reply #8 on: February 09, 2013, 05:33:44 am » |
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 
|
|
|
|
|
Logged
|
|
|
|
|
Johannesburg UTC+2
Offline
Edison Member
Karma: 34
Posts: 1705
|
 |
« Reply #9 on: February 09, 2013, 06:04:22 am » |
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.
|
|
|
|
|
Logged
|
IT Crowd: Roy... "Have you tried turning it off and on again?" Moss.. "Have you tried forcing an unexpected reboot?"
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 12
|
 |
« Reply #10 on: February 09, 2013, 01:26:49 pm » |
power supply is coming from arduino board.( 5v)
|
|
|
|
|
Logged
|
|
|
|
|
Johannesburg UTC+2
Offline
Edison Member
Karma: 34
Posts: 1705
|
 |
« Reply #11 on: February 09, 2013, 01:33:33 pm » |
Try it with its own power, it might make a difference.... see my pic attached
|
|
|
|
|
Logged
|
IT Crowd: Roy... "Have you tried turning it off and on again?" Moss.. "Have you tried forcing an unexpected reboot?"
|
|
|
|
0
Offline
Tesla Member
Karma: 50
Posts: 6546
Arduino rocks
|
 |
« Reply #12 on: February 09, 2013, 06:32:45 pm » |
power supply is coming from arduino board.( 5v) Bad!
|
|
|
|
|
Logged
|
|
|
|
|
|