Blue Robotics Tutorial: Controlling an ESC with an Arduino and a Potentiometer

  Переглядів 32,653

Blue Robotics

Blue Robotics

2 роки тому

In this tutorial, we'll show you how to use an Arduino and potentiometer to control the speed of a brushless motor like our T200 Thruster.
Written tutorial: bluerobotics.com/learn/guide-...
Check out the T200 product page here: bluerobotics.com/store/thrust...

КОМЕНТАРІ: 67
@pramodnishant1
@pramodnishant1 6 місяців тому
Awesome simplified explanation. First time using ESC, it does not say which wire is what. Your video helped me understand that and more. :)
@ohnonotthevampire7191
@ohnonotthevampire7191 Рік тому
Fully technical and to the point. Wish all robotic tutorials were like your channel man. Keep it up!
@viktorkarlsohn3705
@viktorkarlsohn3705 Рік тому
Mine did not work. I kept going over the wiring and code. Really made me scratch my head. This morning thought that I would try again. As I was staring at it, I heard a noise that made me jump out of my chair. It was WORKING! I was not waiting the full 7 second delay. Thank you! OBTW: One can discard the pot by connecting 3.3V pin directly to the A0 pin.
@electroctgon7008
@electroctgon7008 3 місяці тому
Thank you so much! This is the first tutorial that helped me :)
@underlecht
@underlecht 2 роки тому
Perfect explanation, thanks. I like your setup of connecting things, so you can plug-&-play with peripherals (no need to solder the battery). I wonder, could such setup be used in real device? Or all these intermediate things add noise/resistance, and can only be used in building proof of concept?
@BlueRobotics
@BlueRobotics 2 роки тому
Hi Mantas, you can absolutely use connections like this in a real device. The connectors we chose here are all rated for the appropriate voltage and current so they don't have a big impact on the system performance.
@adamjacobmoro4657
@adamjacobmoro4657 Рік тому
Great vid! One question, why do the values that the arduino reads from the pot range from zero to 1023? Is this dependent on the value of the pot?
@BlueRobotics
@BlueRobotics Рік тому
Hi Adam, the reason is because the analog to digital converter (ADC) on the Arduino is a "10-bit ADC". 10 bits means it has 2^10 = 1024 possible readings. So, when reading a voltage between 0 to 5V, it maps that reading to one of those values from 0-1023, which is 1024 possible measurements. Google can probably tell you a lot more about the Arduino ADC!
@adamjacobmoro4657
@adamjacobmoro4657 Рік тому
@@BlueRobotics great that clears it up, thank you much!
@tomjoad1060
@tomjoad1060 Рік тому
thank you for the video. I am trying to make nRF24 controlled boat (drone), and need a "reverse" function on the motor, controlled through ESC. I think I may get an idea of how to do it from your video.
@hazzchah
@hazzchah Рік тому
Hii! Were you able to do a reverse function on through a regular ESC? How did you manage to do so via code without swapping 2 of 3 ESC to Motor connections? Thanks in advance.
@tomjoad1060
@tomjoad1060 Рік тому
@@hazzchah I used a bi-directional ESC. Look at the code and you will understand how it reverses direction. I believe it's not possible to do the same through regular ESC. Essentially when joystick is in the middle, it reads as 0. But when I start to move joystick up or down, throttle rotates, either clockwise or counterclockwise. Again look at the code... And good luck!
@hazzchah
@hazzchah Рік тому
@@tomjoad1060 Thank you very much! I spent a whole day just trying to figure out how to reverse the direction via code without adding any additional circuitry or manually swapping 2 of the 3 phase junctions. I'll go find a bi-directional esc now. Thank you again.
@joeturner3970
@joeturner3970 Рік тому
thank-you
@TRAZExYT
@TRAZExYT 11 місяців тому
Can i power up an ardiuno using bec(gnd and +ve to ardiuno 5v and gnd) and also connect a 11.1v 2.6ah battery into ardiuno vin and gnd at the same time or is it bad for the ardiuno like burning up?
@jodrafting
@jodrafting 9 місяців тому
is this doing forward and reverse or do I have to split the reading and map accordingly
@BlueRobotics
@BlueRobotics 9 місяців тому
This tutorial does both forward and reverse, but requires a speed controller that is compatible with that!
@brsrc759
@brsrc759 2 роки тому
How do I wire a regular RC ESC to work with the transmitter and potentiometer feedback like a small servo controller? Basically I want to use an ESC to control a large motor for a custom servo.
@BlueRobotics
@BlueRobotics 2 роки тому
Hi, you can use this technique with any ESC, but you'd have to change the code on the Arduino to start at 1100 and go up to 1900 microseconds signal. The example in this video is for bidirectional ESCs and starts at 1500 microseconds, going to 1100 and 1900 in each direction. Here's the written version as well: bluerobotics.com/learn/guide-for-controlling-the-basic-esc-with-a-potentiometer/
@nickdavis3711
@nickdavis3711 Рік тому
Could I have more precision speed control of I go to a 20k, multi turn pot instead of the 10k? I'm trying to find my EDFs lowest point of operation.
@BlueRobotics
@BlueRobotics Рік тому
Hi Nick, that wouldn't give you any more precision here. If you want to test your EDFs precisely, we'd recommend adjusting the Arduino program to step up a bit at a time until it starts. That way you'll know exactly when it starts as well! If you're not comfortable with Arduino, that would be a great project to get started with. This page has some good examples to start from: makersportal.com/blog/2020/3/14/arduino-servo-motor-control
@fredbarnes196
@fredbarnes196 5 місяців тому
How do you know what the thruster min/max values are for the map function?
@BlueRobotics
@BlueRobotics 5 місяців тому
Hi Fred! This is easier to explain via email - please get in touch with our team at support@bluerobotics.com! Thanks!
@th30c0der3
@th30c0der3 2 місяці тому
I Have a question about values you passed in function map() Why did you pass ,0,1023,1100,1900 i mean why these values and is these values can be determine by brushless motor kv or by esc because if i have different motor and different esc how can i put a values are compitable with mine
@BlueRobotics
@BlueRobotics 2 місяці тому
Hi there! We used 0-1023 as the input range because that is the range measured by the potentiometer with the analogRead function. We used 1100-1900 as the output range because that is the signal range that the ESC accepts as a valid signal. These values should work for the vast majority of ESCs!
@StolenPopcatBen
@StolenPopcatBen 3 місяці тому
how could i power this without a battery
@davidhyland3833
@davidhyland3833 Рік тому
How would you change this code to make the thruster be able to reverse?
@BlueRobotics
@BlueRobotics Рік тому
Hi David, this code already supports having the thruster run in forward and reverse. Note that you do have to have a speed controller (ESC) capable of doing that, and many of them are designed for just one direction. The "Basic ESC" we use here can do both.
@user-tx5ue8sz5j
@user-tx5ue8sz5j 2 місяці тому
How to control only use ecs and servo controler
@arduinomaquinas
@arduinomaquinas Рік тому
Like 185 ❤
@nightleo5331
@nightleo5331 Рік тому
I've tried connecting 2 thrusters to an arduino, but they don't spin. If I tell the arduino to only spin one of the two motors, it spins, but as soon as I try to spin them simultaneously, it doesn't work. Is it even possible for multiple thrusters to spin simultaneously? If so, how do we do it?
@BlueRobotics
@BlueRobotics Рік тому
Hi NightLeo, you can absolutely do this! Can't really say what's wrong without seeing you code and setup. If you make a post on our forums here, we'll be happy to help! discuss.bluerobotics.com/c/blue-robotics-products/escs/29
@mehmetumitack5594
@mehmetumitack5594 Рік тому
The motor only increases to the speed we entered momentarily, then turns slowly at a constant speed again. It repeats this in short periods. What would be the reason?
@BlueRobotics
@BlueRobotics Рік тому
Hi Mehmet, can you share the exact code you are using on our forums? I'm sure there's a reason, but it's hard to know without seeing the code. discuss.bluerobotics.com
@Alexisger
@Alexisger 11 місяців тому
What are the specs of the battery? Also there is no need for battery protection? And how you power Arduino? I mean when not connect it to usb
@BlueRobotics
@BlueRobotics 11 місяців тому
Hi there! It’s a 4S battery with a 230Wh capacity, and it doesn’t have a BMS (battery system management). Arduino boards have five options in which they can be powered: * Powering via USB connector * Powering via the onboard barrel jack connector (if available on the board) * Powering via the onboard battery connector (if available on the board) * Powering via the VIN (Voltage In) pin * Powering via the 3V3/5V pin* If you have other questions, please reach out to our team at support@bluerobotics.com!
@Mi78
@Mi78 Рік тому
I get why you obviously have to connect a signal wire between arduino and esc, but why ground (and then why not 5v)?
@BlueRobotics
@BlueRobotics Рік тому
Hi Milo, the ground connection is required to complete the circuit so that the Arduino can properly measure the signal. With a single wire, there wouldn't be any flow of electricity, just like any electrical circuit. You don't have to connect the 5v wire because that only provides power to each device and they are separately powered (ESC by battery and Arduino through USB port).
@hanselhermawan4596
@hanselhermawan4596 Рік тому
why is this not working with my esc ? after i ran the code, the motor run for a second then it stopped. I tried to recompile and give the input to the esc, but its not working anymore
@BlueRobotics
@BlueRobotics Рік тому
Hi, it should work continuously. Issues like this are typically from insufficient power that causes the voltage to drop and reset the Arduino. Are you powering from a battery?
@brsrc759
@brsrc759 2 роки тому
why is the Arduino needed? Wouldn't the speed control work with the potentiometer if you just plug the potentiometer directly into the three prong that would normally go to a receiver?
@BlueRobotics
@BlueRobotics 2 роки тому
Unfortunately, not. ESCs listen to "servo-style PWM signals" which is a short pulse that indicates the speed. Potentiometers just output an analog voltage that varies as you rotate the knob, but the ESCs typically won't take that as an input. The Arduino is just there to translate from the analog voltage to a PWM signal.
@brsrc759
@brsrc759 2 роки тому
@@BlueRobotics oh now I get it! That really clears it up for me. So is there some way that maybe I can tap into the pwm signal on a small servo circuit board with the ESC 3 wire connector? Thank you so much for your time. I really appreciate it. 🤙
@TheWingnut58
@TheWingnut58 Рік тому
Just use a simple "servo tester"....simple and cheap
@brsrc759
@brsrc759 Рік тому
@@TheWingnut58 yeah that's a good point. I wonder if that will work, using a servo tester as a potentiometer connected to the steering. That would be a heck of a lot easier and cheaper than messing with all that Arduino stuff
@TheWingnut58
@TheWingnut58 Рік тому
@@brsrc759 yes, it will absolutely work.....I've been into R/C 40+ years and have used servo testers on everything from micro servos all the way up to the giant scale stuff as well as for testing motor/ESC combinations on drones. You could use a large servo on the rudder and rig some sort of spring system to "self center" the servo tester as well as using one to controll the motor speed....
@jasonho6040
@jasonho6040 Рік тому
is there a limit to how many thrusters an arduino can control?
@BlueRobotics
@BlueRobotics Рік тому
You can use any digital pin to control a thruster speed controller with an Arduino using the Servo library, so it's quite a few! If you want the thrusters to all behave the same, then you can connect one signal to multiple speed controllers.
@christosvasiliou219
@christosvasiliou219 Рік тому
can you use a similar script for rsapberry pi ?
@DigBipper188
@DigBipper188 11 місяців тому
should be possible. the GPIO on a RasPi should be fast enough to handle firing a PWM signal to an ESC
@zeiadahmedmadbouly8866
@zeiadahmedmadbouly8866 Рік тому
how can i replace the potentiometer with a joystick
@BlueRobotics
@BlueRobotics Рік тому
Hi there, you can use a joystick that has the same type of analog output as a potentiometer, like this one: www.adafruit.com/product/512?gclid=CjwKCAjwuqiiBhBtEiwATgvixDMCx7IXv09zDqk0-3Tk3Z5XYOJqd3f1fsJoWF0q7Cb-WYmNeeP7PhoCTwUQAvD_BwE
@ahmeddiab9778ytr
@ahmeddiab9778ytr 9 місяців тому
can i use 50k potentiometer?
@BlueRobotics
@BlueRobotics 9 місяців тому
Hi there, yes, that should work fine as well.
@ahmeddiab9778ytr
@ahmeddiab9778ytr 9 місяців тому
that should i change pwm value or the same?
@BlueRobotics
@BlueRobotics 9 місяців тому
@@ahmeddiab9778ytr It should result in the same PWM output value.
@ahmeddiab9778ytr
@ahmeddiab9778ytr 9 місяців тому
thank you 😊 i want ask you about something i made robot arm using bruchless motor but I can't know how to control it with arduino or another board
@BlueRobotics
@BlueRobotics 9 місяців тому
@@ahmeddiab9778ytr Cool! That's not something we're familiar with but I'm sure you can find some others online doing robotic arms with Arduinos!
@nicker3115
@nicker3115 10 місяців тому
230$???? A PIECE OF PLASTIC WITH A 10$ MOTOR? WTF IS THE "T200 THruster" WTF
@BlueRobotics
@BlueRobotics 10 місяців тому
Hi there! Please send us a message at sos@bluerobotics.com if you have any issues with your thrusters and we'd be happy to help you there!
@Elektrotechnik_EDV_Techniker
@Elektrotechnik_EDV_Techniker 7 місяців тому
#include byte servoPin = 9; byte potentiometerPin = A0; Servo servo; void setup() { Servo.attach(servoPin); Servo.writeMicroseconds(1500); delay(7000) } void loop() { int potVal = analogRead(potentiometerpin); int pwmval = map(potval,0, 1023, 1100, 1900); servo.writeMicroseconds(pwmval); }C:\Users\jakob\AppData\Local\Temp\.arduinoIDE-unsaved2023911-21968-4mb429.ejflx\sketch_oct11a\sketch_oct11a.ino:1:10: fatal error: servo: No such file or directory #include ^~~~~~~ compilation terminated. exit status 1 Compilation error: servo: No such file or directory help mi
@BlueRobotics
@BlueRobotics 7 місяців тому
Hi there, the library file "Servo.h" must start with a capital "S".
@Elektrotechnik_EDV_Techniker
@Elektrotechnik_EDV_Techniker 7 місяців тому
@@BlueRobotics C:\Users\jakob\OneDrive\Dokumente\Arduino\sketch_oct11a\sketch_oct11a.ino: In function 'void setup()': C:\Users\jakob\OneDrive\Dokumente\Arduino\sketch_oct11a\sketch_oct11a.ino:10:6: error: expected unqualified-id before '.' token Servo.attach(servoPin); ^ C:\Users\jakob\OneDrive\Dokumente\Arduino\sketch_oct11a\sketch_oct11a.ino:11:6: error: expected unqualified-id before '.' token Servo.writeMicroseconds(1500); ^ C:\Users\jakob\OneDrive\Dokumente\Arduino\sketch_oct11a\sketch_oct11a.ino:14:1: error: expected ';' before '}' token } ^ C:\Users\jakob\OneDrive\Dokumente\Arduino\sketch_oct11a\sketch_oct11a.ino: In function 'void loop()': C:\Users\jakob\OneDrive\Dokumente\Arduino\sketch_oct11a\sketch_oct11a.ino:17:27: error: 'potentiometerpin' was not declared in this scope int potVal = analogRead(potentiometerpin); ^~~~~~~~~~~~~~~~ C:\Users\jakob\OneDrive\Dokumente\Arduino\sketch_oct11a\sketch_oct11a.ino:17:27: note: suggested alternative: 'potentiometerPin' int potVal = analogRead(potentiometerpin); ^~~~~~~~~~~~~~~~ potentiometerPin C:\Users\jakob\OneDrive\Dokumente\Arduino\sketch_oct11a\sketch_oct11a.ino:19:20: error: 'potval' was not declared in this scope int pwmval = map(potval,0, 1023, 1100, 1900); ^~~~~~ C:\Users\jakob\OneDrive\Dokumente\Arduino\sketch_oct11a\sketch_oct11a.ino:19:20: note: suggested alternative: 'potVal' int pwmval = map(potval,0, 1023, 1100, 1900); ^~~~~~ potVal exit status 1 Compilation error: expected unqualified-id before '.' token #include byte servoPin = 9; byte potentiometerPin = A0; Servo servo; void setup() { Servo.attach(servoPin); Servo.writeMicroseconds(1500); delay(7000) } void loop() { int potVal = analogRead(potentiometerpin); int pwmval = map(potval,0, 1023, 1100, 1900); servo.writeMicroseconds(pwmval); } weis nicht weiter
Blue Robotics Product Overview: T200 Thruster
3:41
Blue Robotics
Переглядів 11 тис.
Vasiliy Lomachenko vs George Kambosos | INTERNATIONAL LIVE STREAM
3:10:05
Top Rank Boxing
Переглядів 1 млн
Normal vs Smokers !! 😱😱😱
00:12
Tibo InShape
Переглядів 16 млн
Arduino Controlled ESC (Easy+ No Potentiometer!)
7:11
Black Falcon Electronics
Переглядів 29 тис.
Blue Robotics Tutorial: Using the Thruster Commander
8:28
Blue Robotics
Переглядів 6 тис.
I tried the Cheapest Arduino Alternative (that Nobody heard of)
13:31
GreatScott!
Переглядів 471 тис.
BlueROV 2 build guide - most advanced amateur submersible!
20:33
Vosentech
Переглядів 67 тис.
Underwater Thrusters with Brushless Motors for Drones!
4:12
Proto G Engineering
Переглядів 22 тис.
Уроки Ардуино. ПИД регулятор
28:57
Заметки Ардуинщика
Переглядів 448 тис.
Brushless DC Speed Controller
15:11
Hyperspace Pirate
Переглядів 336 тис.
Cheap PVC submarine DIY
13:19
PeterSripol
Переглядів 964 тис.
Наушники Ой🤣
0:26
Listen_pods
Переглядів 450 тис.
Apple Event - May 7
38:22
Apple
Переглядів 6 млн
Samsung UE40D5520RU перезагружается, замена nand памяти
0:46
Слава 100пудово!
Переглядів 3,7 млн
Портативная PS 5 🎮 #ps5 #expressly
0:22
ExpresSLY Shorts
Переглядів 289 тис.