Тёмный

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

Blue Robotics
Подписаться 6 тыс.
Просмотров 35 тыс.
50% 1

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...

Наука

Опубликовано:

 

7 мар 2022

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 67   
@ohnonotthevampire7191
@ohnonotthevampire7191 2 года назад
Fully technical and to the point. Wish all robotic tutorials were like your channel man. Keep it up!
@pramodnishant1
@pramodnishant1 8 месяцев назад
Awesome simplified explanation. First time using ESC, it does not say which wire is what. Your video helped me understand that and more. :)
@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 5 месяцев назад
Thank you so much! This is the first tutorial that helped me :)
@TRAZExYT
@TRAZExYT Год назад
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?
@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.
@joeturner3970
@joeturner3970 Год назад
thank-you
@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.
@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!
@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
@StolenPopcatBen
@StolenPopcatBen 4 месяца назад
how could i power this without a battery
@user-tx5ue8sz5j
@user-tx5ue8sz5j 3 месяца назад
How to control only use ecs and servo controler
@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.
@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
@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
@fredbarnes196
@fredbarnes196 6 месяцев назад
How do you know what the thruster min/max values are for the map function?
@BlueRobotics
@BlueRobotics 6 месяцев назад
Hi Fred! This is easier to explain via email - please get in touch with our team at support@bluerobotics.com! Thanks!
@jodrafting
@jodrafting 10 месяцев назад
is this doing forward and reverse or do I have to split the reading and map accordingly
@BlueRobotics
@BlueRobotics 10 месяцев назад
This tutorial does both forward and reverse, but requires a speed controller that is compatible with that!
@th30c0der3
@th30c0der3 4 месяца назад
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 4 месяца назад
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!
@Mi78
@Mi78 2 года назад
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 2 года назад
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).
@Alexisger
@Alexisger Год назад
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 Год назад
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!
@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 2 года назад
Just use a simple "servo tester"....simple and cheap
@brsrc759
@brsrc759 2 года назад
@@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 2 года назад
@@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....
@arduinomaquinas
@arduinomaquinas Год назад
Like 185 ❤
@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?
@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 Год назад
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 11 месяцев назад
can i use 50k potentiometer?
@BlueRobotics
@BlueRobotics 11 месяцев назад
Hi there, yes, that should work fine as well.
@ahmeddiab9778ytr
@ahmeddiab9778ytr 11 месяцев назад
that should i change pwm value or the same?
@BlueRobotics
@BlueRobotics 11 месяцев назад
@@ahmeddiab9778ytr It should result in the same PWM output value.
@ahmeddiab9778ytr
@ahmeddiab9778ytr 11 месяцев назад
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 11 месяцев назад
@@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 Год назад
230$???? A PIECE OF PLASTIC WITH A 10$ MOTOR? WTF IS THE "T200 THruster" WTF
@BlueRobotics
@BlueRobotics Год назад
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 8 месяцев назад
#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 8 месяцев назад
Hi there, the library file "Servo.h" must start with a capital "S".
@Elektrotechnik_EDV_Techniker
@Elektrotechnik_EDV_Techniker 8 месяцев назад
@@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
Далее
НЕ ДЕЛАЙТЕ УКЛАДКИ В САЛОНАХ
00:43
КАКОЙ У ТЕБЯ ЛЮБИМЫЙ МАРМЕЛАД?
00:40
New Product: The T500 Thruster!
4:29
Просмотров 19 тыс.
Open Source ESC based on Arduino - High Speeds
16:58
Просмотров 173 тыс.
Arduino Controlled ESC (Easy+ No Potentiometer!)
7:11
Two Brushless Motors - One ESC
9:40
Просмотров 75 тыс.
What's the difference? Arduino vs Raspberry Pi
6:21
Просмотров 1,8 млн