Arduino multiple servo's the simple way

  Рет қаралды 33,592

Robonza

Robonza

Күн бұрын

Пікірлер: 79
@charles26842
@charles26842 Жыл бұрын
Just by watching this video for a short time, you have helped me so so so so much with my project, thank you immensely!
@Robonza
@Robonza Жыл бұрын
Awesome to hear that, thanks
@CrisDFF30917
@CrisDFF30917 2 жыл бұрын
To avoid the start jump that servos have when you turn on the power, try to first give 5V to signal pin, then power the servo, it worked for me.
@johnpanter
@johnpanter 4 жыл бұрын
This has been the most usefull thing I've seen on the net today; just what I was after. Many thanks.
@nefarious6986
@nefarious6986 4 жыл бұрын
It's nice to hear a Kiwi explaining this!
@thachyourlife1828
@thachyourlife1828 2 жыл бұрын
is there no PCA 9685 at this time ?
@DustinjBailey
@DustinjBailey 2 жыл бұрын
This is so incredibly helpful!
@Robonza
@Robonza 2 жыл бұрын
Thanks Dustin, I kinda feel bad I have not repaired the source code link when it broke
@benporter6576
@benporter6576 2 жыл бұрын
@@Robonza please check it again! it isn;t working I'm afraid
@techparistech2659
@techparistech2659 3 жыл бұрын
Excellent job
@galagatron5319
@galagatron5319 Жыл бұрын
HI. I want to program 4 to 6 servos to do stuff individually. I have a servo driver pca9685. Im trying to make something with these motors and a couple of lights and sound. I do not want batteries. I want to be able to plug this thing in the wall with only one cord not 2. Looks like though I need 2 seperate power supplies. I cant find anything online. Something I buy? A hack? Thanks
@ianmoon8764
@ianmoon8764 2 жыл бұрын
Would you be kind enough to upload the code again please as the link does not work. thank you
@ddraigking9031
@ddraigking9031 2 жыл бұрын
Hello The link in the description isn't working, I loved the video and I'm hoping it'll helped further my knowledge of servo control
@johnkadrich44
@johnkadrich44 2 жыл бұрын
Can I get the code for this, it looks like the link is no longer valid. Thanks.
@ConnorCain25
@ConnorCain25 Жыл бұрын
Hey mate, I tried to get access to the code you made available but the link wouldn't work. iS there any way you could make a new link?. Cheers
@DJMovit
@DJMovit 4 жыл бұрын
This is awesome! Thanks for posting it! I have been wanting to make a 3 axis Halloween Skull and now I am one step closer. Now I need to build the platform and movements. I hope to tweak your code to get the head to move loft to right, and and down and hopefully tilt. Thanks again for sharing it I greatly appreciate it.
@chriskiepfer450
@chriskiepfer450 6 ай бұрын
is there a source for the code, the link does not work?
@katalinkristof6383
@katalinkristof6383 4 жыл бұрын
Thank you for this awesome tutorial! May I ask some beginner question here? Does it damage the servos if they hold the position for a longer time? Why I'm asking: I am about to program a robot owl, and it should ideally hold a particular position after a movement is done. If I simply detach the servos, gravity would do its job. (Your cat is so cute!!)
@Robonza
@Robonza 4 жыл бұрын
Servo's are well known to burn out if left "holding" something. The best thing to do with your owl is to counterbalance it if you can. This way it will hold position with no power.
@katalinkristof6383
@katalinkristof6383 4 жыл бұрын
@@Robonza thank you for your reply! Counterbalancing will be a problem, but I can program it to end each movement in a stable position (and then detach). I didn't know it was an issue with servos.
@Robonza
@Robonza 4 жыл бұрын
@@katalinkristof6383 Some high quality servos might deal with it. I guess like a lot of things its a gamble on how long it will last. Detached servos will last the longest
@katalinkristof6383
@katalinkristof6383 4 жыл бұрын
@@Robonza well, it's definitely one of the most useful things I learned this month :)
@thisisrobophil
@thisisrobophil 2 жыл бұрын
the link for the code seems down.. possible to check it please
@Robonza
@Robonza 2 жыл бұрын
Yeah, sorry. I will fix that one day when I setup another website. unless you want to host it
@pasternakjdp
@pasternakjdp 2 жыл бұрын
Thanks so much for this absolutely brilliant. You say the source code is below but it doesn't seem to be, is it still available? Thanks again
@bitekiful
@bitekiful 3 жыл бұрын
Thank you thank you thank you! Froma complete novice you've helped me gain knowledge. I have some questions. I'm making an xwing and want the wings to open up and r2d2's head to swivel. I used your servo version one code and I want to add more positions. Thanks to you my servo is moving 10° and back to close but I want it to hold in the 10°position for a few seconds before it closes again, also i want it so start off slow ,speed up and slow before it gets to 10° everything i try to add more steps the the animation it doesn't work and I'm not sure why
@ChristoCJ03
@ChristoCJ03 6 жыл бұрын
thanks bro, finally I found way to this, thanks a lot
@JohnBaxterWalker
@JohnBaxterWalker 4 жыл бұрын
Probably a daft newbie question. I have loaded the INI file into the Arduino. Where do I add/use the servo0/1/2 CPP and servos H file ?
@Robonza
@Robonza 4 жыл бұрын
All files must be added to the project before compiling or it will not compile. Standard practise.
@rag2273
@rag2273 2 жыл бұрын
WHICH SERVO IS THIS
@adioooo6
@adioooo6 5 жыл бұрын
answer to all my questions, thank you!
@oldfarmhand7714
@oldfarmhand7714 3 жыл бұрын
Hello I tried to look at your source code but it is a blank screen I know this is an old video but I just found your page and I did use a proxy
@Custom3dPrinting4U
@Custom3dPrinting4U 4 жыл бұрын
I really appreciate the tutorial. I now have 4 servos wired up but I want to make it to where when i click the button then the code is executed and then returned to home position before executing the rotation. Can you help me?
@imaad_refai
@imaad_refai 3 жыл бұрын
This would be really useful for my college project. I am unable to open those links provided in the decription.
@Robonza
@Robonza 3 жыл бұрын
Link fixed. Google and KZbin broke it.
@n1spen
@n1spen 3 жыл бұрын
@@Robonza i think they have broken it again will not work for me but a very useful vid thanks
@Robonza
@Robonza 3 жыл бұрын
@@n1spen I just tested it, its fine. Maybe its blocked for your IP. Try accessing via proxy or get a friend to download it for you
@jonpurkis2075
@jonpurkis2075 4 ай бұрын
Great video, trying to get the source code but the link no longer works. Is it available from somewhere else?👍
@alfiechenery4146
@alfiechenery4146 4 жыл бұрын
Very well explained. Although could you explain the circuit wiring. I can assume how the servos are attached to PWM pins, but I notice a capacitor there. What is it for and how exactly is it wired, and is it essential or is it just like a protection thing
@Robonza
@Robonza 4 жыл бұрын
The capacitor is there to avoid servo noise getting into the micro power supply and glitching it. It is standard practice. Just about all circuits need power supply capacitors. I have noticed a lot of builders miss this.
@joegob100
@joegob100 2 жыл бұрын
This is so helpful, my level of coding is copy paste and play with values, is there any way to get this code. I am making a prop raven
@alonsovargas8046
@alonsovargas8046 3 жыл бұрын
Quick question, can anyone share the link to review the code or the code itself? The link doesnt work, Thanks!
@Robonza
@Robonza 3 жыл бұрын
The link does work, try a proxy site , you may be on a banned internet block due to hackers,
@alonsovargas8046
@alonsovargas8046 3 жыл бұрын
@@Robonza thanks! It works
@Surajborate1
@Surajborate1 3 жыл бұрын
Very well explained Appreciate your efforts Thank you for giving us this readymade Please help not able to open link
@Robonza
@Robonza 3 жыл бұрын
I just tried the link and it is working for me
@Surajborate1
@Surajborate1 3 жыл бұрын
Thank you for replying What App or software you are using to open this file
@Robonza
@Robonza 3 жыл бұрын
Arduino IDE
@Surajborate1
@Surajborate1 3 жыл бұрын
@@Robonza Thank you for replying I am able to open the link Will I be able to make changes and use this for my project If yes how to open cpp file
@Allanusmonostat
@Allanusmonostat 2 жыл бұрын
I think the link is dead.
@TRCVJU
@TRCVJU 3 жыл бұрын
Very nice. Gr8. Thanks for sharing.
@k2h215
@k2h215 5 жыл бұрын
Hi sir, can you make a video for your updated code ? I figured out there is a button in pin 2 and my test failed cause I think I made some mistakes.
@JohnDoe-wl5wh
@JohnDoe-wl5wh 4 жыл бұрын
Would this code work with an Arduino uno? I'm trying to move a robotic arm with 6 servos with an arduino uno, I have an external power supply that provides 7.5 V but I keep getting these weird glitches where only 2 of the 6 servos move. I believe it's because my code has them moving at the same time, however this code allows them to move simultaneously right?
@Robonza
@Robonza 4 жыл бұрын
It should work fine. Its not demanding code. Make sure you add the capacitor like I did. Yes this code can expand and move 6
@alfiechenery4146
@alfiechenery4146 4 жыл бұрын
I’m having the same issue trying to run 3 servos from a battery. I’m trying to run the servos and the nano all off 4xAA batteries. I suspect I’m maxing out the current draw of the battery and that is causing issues. What’s more weird is when I hit the reset button 2 of the 3 servo move but it’s rarely the same 2. Like it seems random. One time they all moved but then one of them started spasming and twitching a bit. I’m gonna try swapping for a bigger capacitor, and if not putting more batteries in parallel to try to increase the max current output
@kennethkindrich3114
@kennethkindrich3114 4 жыл бұрын
been searching the internet for days and still havnt found an answer. I want to make several servos move with if statements. like, if a servo position is at 70, i want another servo to go to 30....if that makes sense....anyone have any answers?
@Robonza
@Robonza 4 жыл бұрын
The code I have supplied will do that. You just need to spend some time using and understanding it.
@ico-theredstonesurgeon4380
@ico-theredstonesurgeon4380 5 жыл бұрын
So from what i can understand, splitting the code in cpp files makes it possible to run multiple functions simultaneously. Am i right??
@Robonza
@Robonza 5 жыл бұрын
its impossible to run thing simultaneously. What it does do is make things tidy and easy to maintain. One rule I try to follow is make my main loop under one page when possible as it makes it easy to read and fix in 5 years time when you forgot how it works.
@ico-theredstonesurgeon4380
@ico-theredstonesurgeon4380 5 жыл бұрын
@@Robonza Then how can you control the servos simultaneoulsy without constantly skipping back and foward between them? I watched the video multiple times and downloaded the code to read it but i'm still kinda lost...
@Robonza
@Robonza 5 жыл бұрын
Each servo is updated sequentially at a rate that appears simultaneous.
@ico-theredstonesurgeon4380
@ico-theredstonesurgeon4380 5 жыл бұрын
@@Robonza ohh that makes much more sense... and can i apply the same concept with a pwm servo driver?
@robertrobert5583
@robertrobert5583 5 жыл бұрын
Thanks for posting this and for sharing the code. When I validate I get this error message though: error: 'TICK_TIME' was not declared in this scope
@Robonza
@Robonza 5 жыл бұрын
That typically means you do not have all the files added to the sketch so it cannot find a value needed. Make sure all files are add to the sketch
@robertrobert5583
@robertrobert5583 5 жыл бұрын
@@Robonza thank you for getting back to me so quickly. I think I have all the files: robonza_servo.ver3.ino, servo0.cpp, servo1.cpp, servo2.cpp, servo.h
@Robonza
@Robonza 5 жыл бұрын
Did you open the INO file using Arduino? TICK_TIME' is clearly in servo..h so that means the h file is not visible to your sketch. Its not an issue with my code.
@teltowfamily2223
@teltowfamily2223 2 жыл бұрын
i miss when ardiuno was 3 dollars!
@techparistech2659
@techparistech2659 3 жыл бұрын
the link is not working
@V1RGINEVO9
@V1RGINEVO9 3 жыл бұрын
I too can not get the link to work :( Looks like great work
@brianseaver6979
@brianseaver6979 2 ай бұрын
It worked
@ModelSceneryTutorials
@ModelSceneryTutorials 4 жыл бұрын
Let me preface this by saying I am not a coder. I an a one time user at the copy and paste level of knowledge. I found this script for moving model railroad turnout servos. But it is only for one turnout. I have 6 on my layout. Would you be so kind as to give me the code to have this work for 6 turnouts and for each turnout, instead of only having 2 position indicator LEDs, I would like to have 2 other LEDS that would be used for a signal light. They would change with when the position LEDs change. Thank you for the time, help and patience. Gary G #include // original nscaler control of 1 turnout. // constant variables used to set servo angles, in degrees const int straight = 90; const int divergent = 110; // constant variables holding the ids of the pins we are using const int divergent_led = 6; const int straight_led = 7; const int buttonpin = 8; const int servopin = 9; // servo movement step delay, in milliseconds const int step_delay = 70; // create a servo object Servo myservo; // global variables to store servo position int pos = straight; // current int old_pos = pos; // previous void setup() { // set the mode for the digital pins in use pinMode(buttonpin, INPUT); pinMode(straight_led, OUTPUT); pinMode(divergent_led, OUTPUT); // setup the servo myservo.attach(servopin); // attach to the servo on pin 9 myservo.write(pos); // set the initial servo position // set initial led states digitalWrite(straight_led, HIGH); digitalWrite(divergent_led, LOW); } void loop() { // start each iteration of the loop by reading the button // if the button is pressed (reads HIGH), move the servo int button_state = digitalRead(buttonpin); if(button_state == HIGH){ // turn off the lit led if(pos == straight){ digitalWrite(straight_led, LOW); } else { digitalWrite(divergent_led, LOW); } old_pos = pos; // save the current position // Toggle the position to the opposite value pos = pos == straight ? divergent: straight; // Move the servo to its new position if(old_pos < pos){ // if the new angle is higher // increment the servo position from oldpos to pos for(int i = old_pos + 1; i = pos; i--){ myservo.write(i); // write the next position to the servo delay(step_delay); // wait } } // turn on the appropriate LED. if(pos == straight){ digitalWrite(straight_led, HIGH); } else { digitalWrite(divergent_led, HIGH); } } }// end of loop
@NeilvanGeffen
@NeilvanGeffen 7 жыл бұрын
i use that servo code for my automated blinds :)
@Robonza
@Robonza 7 жыл бұрын
Awesome Ned!
@thetooter988
@thetooter988 5 жыл бұрын
Thank you so much, that’s what I needed.
@waynefilkins8394
@waynefilkins8394 3 жыл бұрын
this is the simple way???
@waynefilkins8394
@waynefilkins8394 3 жыл бұрын
is there a simpler way to do just 2 tiny servos?
Control 16 Servos Using A PCA9685
18:22
Toms Trains and Things
Рет қаралды 75 М.
Fun with Transistors
24:33
HackMakeMod
Рет қаралды 619 М.
Леон киллер и Оля Полякова 😹
00:42
Канал Смеха
Рет қаралды 4,1 МЛН
Players push long pins through a cardboard box attempting to pop the balloon!
00:31
Интересно, какой он был в молодости
01:00
БЕЗУМНЫЙ СПОРТ
Рет қаралды 3,7 МЛН
Smooth control of servo motors and drive
18:17
Sam Wane
Рет қаралды 9 М.
PCA9685 16-Channel 12-Bit PWM Servo Motor Driver with Arduino.
10:41
Servo Motor Control for Model Railways Part 1 of 3 - Setup with Arduino
18:17
Little Wicket Railway
Рет қаралды 50 М.
Control a Positional Servo Motor with an Arduino (Lesson #10)
8:28
Science Buddies
Рет қаралды 62 М.
Big Stepper Motors with Arduino
29:43
DroneBot Workshop
Рет қаралды 1,2 МЛН
Arduino | Powering Multiple Servos and Motors
4:43
Adam Jerozolim
Рет қаралды 35 М.
Microsoft Excel - Function Slicers (slice ANYTHING)
27:07
Analog Feedback Servo Motor - Improved Servo Performance
23:15
DroneBot Workshop
Рет қаралды 81 М.