Controlling the position of a continuous servo with a potentiometer and arduino
HTML-код
- Опубликовано: 18 окт 2024
- I try here to control the position of a Parallax continuous servo with a potentiometer and Arduino nano board. I use here two different codes: first I check and take note of the exact middle point (where the servo stops), than I put this value on the second code to control it. As you can see the problem with this kind of servos is that you can’t express rotation in degrees so there is no angle feedback. In conclusion the positioning will be very approximately. Do you know a better way?
Servo:
PARALLAX STD PM BB HT HS
Codes:
drive.google.c...
Basic wiring:
www.arduino.cc...
This! Thanks! Was wondering why servos seemed so basic.
You are a life saver
You are the best !!!!!!!!!!!!!!!!!!! Love u !!!!!!! :D
Hi.
very good video.
I got a question, should I start the variable "potStop" with what value?
Hi, thanks. The ‘potStop’ value starts at zero, such as ‘potVal’ and ‘servoStart’.
Could you use millis() as a way of limiting the rotation? Is the speed and acceleration of the motors at a given pulse width consistent enough?
It could be. But as I said, for that kind of precision I would use a different coding approach (see the library indicated in the description)
Is the acuraccy good enough ? I was thinking about using this method instead of stepper motor for controlling lens focus. What do you think ?
No, I think steppers are much better for your purpose. Servos are notoriously inaccurate, especially these one.
@@sandrolab OH ty for Fast reply I tried The small cheap stepper 28byj-48 but when I hold The shaft with my hand it started to spin other direction 😂 So I guess that motor Is too weak ? I am thinking about NEMA 17 17HS4023 0,14Nm do you think it is good ? Ty
The 28byj-48 is absolutely too weak for focusing a lens. Go ahead with NEMA 17 - no regrets! There are also a lot of good projects and tutorials out there.
@@sandrolab Thank you so much ! I am now deciding between NEMA 17 17HS2408 or NEMA 11 11HS2810 I need smallest possible version, that would be strong enough
Thank you all, this has been useful for me as I too am building a focus puller!
Bro.. Please help me out..
The servo is rotating continuously.. The rotation is not corresponding to the potentiometer value.. Just the speed of rotation is being affected i think.. I used the same code and same connections as shown in the video..
What should I do?
Did you try the first code for testing out the exact position of stop?
What is 65000 in the code , can u explain why 65000 is used for, this would of great help.
Hey man, cool video!! If you still have your code could you update your description link… It doesn’t seem to be working
Thanks! Have you tried the github link? It looks okay
@@sandrolabwhich one
Could I use a micro servo (180 degrees) to control the position of the Potentiometer, and program it to represent every degree of movement of the micro servo/pot as 2 degrees of movement on the continuous servo? I need 360 degree of positional control for a project, but I don't wanna spend $60 on a sail winch servo, or program an encoder. Any suggestions ?
You can try working on speed variable and do some calculations. The problem with this kind of servos is that you can’t express rotation in degrees and there is no angle feedback. So as you can see here, the positioning is very approximately.
I have a question can I use the same code for Arduino Uno too ? And also can I use two servos and potentiometers in the setup ?
Sure, you can use the same code for the Uno and with two servos as well (because both would be powered externally)
hey man, just wondering if you could upload an updated link for the code? i was feeling pretty hopeless about this project im doing until i saw this :C
github.com/sandrolab/continuous-servo-pot-control
Hello !! Continuous rotation servomotor can be controlled without potentiometer? Thanks !!
Hello! You can use writeMicroseconds() to control it in any way, although you can’t get an accurate position with any angle reference.
I am working on something like a vending machine in my graduation project and I am using cont. rotation servo motor but I discovered that the position is not fixed even when I specify an interval for it, the position changes. Is there any solution in your opinion? can I use something like this to fix the position by potentiometer I want to hear from you
I'm afraid not. You can’t be very accurate with a continuous servo. Try this library: github.com/akupila/ArduinoContinuousServo
What is the difference between using a normal motor and a continuous servo?
And
How to differentiate between a normal servo and continuous servo?
The servomotor has higher torque because of gears inside of it, and consequently it turns much slower than a normal motor.
Link with codes has been expired. Could you refresh it or give another in the comments, please!
github.com/sandrolab/continuous-servo-pot-control
codes link is not found. can you reupload ?
Hi,
Thanks a lot, its really greate effort and great knowledge.
i need to do a project for a preset position linear actuator with a DC motor abd a stepper motor, with Arduino Mega or UNO but i am not able to write the code and the scheme, can you please help.
Regards
Please contact me in private.
I really need the code for position control.... And the drive link is not working 😢.... Please help @sandro
github.com/sandrolab/continuous-servo-pot-control
Thanks
Can you share the code please? I'm working in a project that needs position control on the servo. Thanks!
Check the description!
Have you reached a solution to control the position of the servo? share me if you don't mind.
can you share schematic from this ?
Which servo motor is this and what is the exact model?
PARALLAX STD PM BB HT HS
your code link aint working
update Drive link please, it is not working
I have a servo name"tower pro mg 996r" is it continuous servo?
No, it should be 180 degrees.
It is a big servo
Can you give me a arduino code to test it out if it is a normal servo or continuous servo? Plz
@@domtoretto9809 www.arduino.cc/en/Tutorial/LibraryExamples/Sweep
Can I do this with any 360 servo?
Yes, only if you intend 360 "continuous" servo.
@@sandrolab I got one that says 360 a cheap mg996
@@dansv3872 In that case you probably don't need this code.
@@sandrolab Hello, Can you tell me how the code is gonna be different ? thank you
@@heisenberg7722 Here: docs.arduino.cc/learn/electronics/servo-motors
*Can repost the code files? Thanks in advance!*
Check on the GitHub link in the description
There isn't a github link. That was why asked. There was a google drive link, but that link showed a 404 error. @@sandrolab
@@OMNI_INFINITY github.com/sandrolab/continuous-servo-pot-control
Saw now. Thanks! @@sandrolab