Go Down

Topic: L298N + ESC + Brushless Motor. (Read 12355 times) previous topic - next topic

Domino60

Hello world :)

1st of all I'd like to present the components that i will talk about.

L298N : Img : http://cdn.instructables.com/FYC/FKR1/HQKYA0P0/FYCFKR1HQKYA0P0.LARGE.jpg
H- Bridge Motor Driver Board.

ESC : http://i01.i.aliimg.com/wsphoto/v0/731238401_1/HobbyWing-Pentium-30A-Brushless-Speed-Controller-ESC-for-X-copter-Quadcopter-20348.jpg
Electronic speed control for brushless motor.
and
Brushless (Outrunner) Motor : http://cdn.hobbyking.com/hobbyking/store/catalog/CF2822.jpg


So what I got here is 3 components that I wanna use to build a self balancing robot, I'm not gonna
talk about the rest of the components.

* What I wanna do.
What I wanna do is to take the L298N and connect the brushless motor to be able to control them
in 2 directions (H-Bridge) as normal DC motors.
and here is the questsion How I'm gonna do that? and Does the L298N able to control brushless
motors?

* Why I wanna use B.Motors and not DC ones.
The reason why i wanna use B.motors and not dc ones is because 1st they are cheaper 2nd I wanna
use them in future projects and spending money for a lot of motors is not my type :D and 3rd is that
I wanna learn how to control B.Motors with the Arduino because I wanna use them later (in other project as i said).

* What I wanna try to do, Am I right or not? It gonna work? If not correct me!
-As we know to drive a motor in 2 directions you need to connect the motor in the 2 pins of the L298N
but that's gonna work only for DC motor what about "AC" Brushless Motor.
-As we know a ESC has 8 Cables 3x for the B.Motor, 2x for the DC LiPo Battery and 3x for the "TX,RX"
wich are for GND (black), VCC(Red) and Signal (Yellow).

For example in this video and many others video on youtube as I searched there is how to active and
control a brushless motor but only in one direction.
(Random)Video.
https://www.youtube.com/watch?v=g0QODm2bRX0

-My problem right now is how to control it in 2 directions and that's where I come here for help.
Does anyone know's how may I be able to control a B.Motor & ESC with L298N in 2 directions?[/u]


Ow and almost forgot as I know the L298N is able to power with a external battery max 2A per motor
if I'm not wrong, the actual ESC use about 10A~40A to power up the B.Motor how the heck I need to
connect them all?

ps (I'm from a long night of internet research and I'm a bit tired, If I made some mistakes pls forgive me, I'm out of ideas and I can't think right now very well about the components..etc)
I'll be active 24/24.

Thanks.  Peace

                 (^)
       (_\    |_|
        \_\   |_|
       _\_\,/_|
      (`\(_|`\|
     (`\,)    \ \
      \,)       |   |     
        \__(__|
To be or not to be? Read a book and you will see.
Join Discord Free_World (Arduino_Room) Live chat
https://discord.gg/bBXEuKQ

ChilliTronix

Brushless motors run on AC 3 phase generated by an ESC at varying frequency. So no, you can't drive them with a L298N.

polymorph

Steve Greenfield AE7HD
Drawing Schematics: tinyurl.com/23mo9pf - tinyurl.com/o97ysyx - https://tinyurl.com/Technote8
Multitasking: forum.arduino.cc/index.php?topic=223286.0
gammon.com.au/blink - gammon.com.au/serial - gammon.com.au/interrupts

raschemmel

#3
Jan 08, 2015, 03:26 am Last Edit: Jan 08, 2015, 04:20 am by raschemmel
Quote
'll be active 24/24.
FYI,
That's 24/7 not 24/24.


Quote
What I wanna do is to take the L298N and connect the brushless motor to be able to control them
in 2 directions (H-Bridge) as normal DC motors.
Well you obviously took the time to do some Googling so we give you credit for that , but when you use the L298 and ESC and BRUSHLESS motor all IN THE SAME SENTENCE, alarm bells start to go off. As already
mentioned , that's never going to happen, but more importantly , this tells us that more than likely you
have no RC experience. How , may I ask did you ever come to associate these two types of circuits as being coexistent ? Perhaps it would help if  you tell us what is your electronics experience ?


Quote
Ow and almost forgot as I know the L298N is able to power with a external battery max 2A per motor
if I'm not wrong, the actual ESC use about 10A~40A to power up the B.Motor how the heck I need to
connect them all?  
Yes, that is a true statement. Actually, depending on the battery you use, you can get more than 40A.
My Striker Long-can INRUNNER brushless motor pulls 60A at full throttle. (it finally smoked after abusing it like that for a year but it was worth it!)  The basics of RC equipment are as follows:
The MOTOR is chosen FIRST, based on the flight weight or payload .
The ESC is then chosen to match the motor.
The BATTERY is chosen last based on the first two and desired flight time or the desired runtime of the
target vehicle (be it car or aircraft). For your application you are not racing a car around a track or flying
a screaming meemie aircraft at 80 mph so you don't need alot of current. The total weight of your balancing robot is a factor that should determine the motors you choose and the battery you choose would depend on the desired continous runtime of the robot and the motor specs. We already know you
have no RC experience so how much electronics experience do you have ?
Arduino UNOs, Pro-Minis, ATMega328, ATtiny85, LCDs, MCP4162, keypads,<br />DS18B20s,74c922,nRF24L01, RS232, SD card, RC fixed wing, quadcopter

Domino60

#4
Jan 08, 2015, 07:29 am Last Edit: Jan 08, 2015, 07:58 am by Domino60
polymorph
Quote
What you need is an ESC meant for an RC car. One that allows a reverse.

http://www.hobbyking.com/hobbyking/store/__11742__HobbyKing_Brushless_Car_ESC_30A_w_Reverse.html

No L298N required.
*
Nice, thx for info but I'd like to use a Brushless ESC.


Quote
FYI,
That's 24/7 not 24/24.
*
I meant to say that I will be 24 hour per day :D but after 2 long nights and with only few hours of sleep
I decided to take a normal nap. :)



Quote
How , may I ask did you ever come to associate these two types of circuits as being coexistent ? Perhaps it would help if  you tell us what is your electronics experience ?
*
Well as an IT Engineer & Programmer, I decided to add the hardware and the software together to
create something "cool", "special". My electronics experience are not so big but i keep "evolving my experience" (and always thinking logical).

I'm not gonna put another "Quote" you said that I don't have RC experience well if you mean
100% then yes I don't. I'm new in this domain trying to learn more and more as a future hobby.


* What I know about RC?
Well I'm mostly a (fan,admirer) of Airplanes and Quadcopters but lately i searched more about airplanes the aerodynamics, motors, esc, battery (LiPo), RX,TX, FPV, GPS, OSD, Gyro's..etc
What I wanna say is that I know what I'm talking about if someone ask me about RC Airplanes :D
Motor: KV, Thrust, Cells (that can handle), battery 7.4 , 11.1, 14.4 each cell have 3.7 and should not be discharged more than 3. something because your battery gonna die...etc
combination of prop and motor and the total thrust and power of the battery and cells, C rating + ESC
so everything to be "cool" not hot...etc

I learned all that and maybe I'm not a professional at this domain yet, I wanna start as a hobby then
make more professional stuff.

* Why L298N and why ESC+B.Motor?
Timeline
Well 1st of all I start searching a H-Bridge to drive DC motors, few months ago I tried to build a
H-Bridge with transistors at High Amp for my (SP1)


but after few days of searching I gave up and done a manual "6pin High Amp H-Bridge Swich"
+so that's where I know about the H-Bridge.

  Few days ago I started to search a H-Bridge microchip, microcontroller or just chip (people call it in different ways) so I found about a lot of them like L293D but after looking
and searching I found that he can handle only 600mA per output so I thought that I need something more powerful than 600mA so I found other m.chips and I stopped at L298N exactly what I need for a 12v DC motor and with "strong" torque so I ordered one.


  After searching good quality DC motors on aliexpress.com and ebay.com
I found out that they are kinda expensive for me and spending money on something that you may not use because they may be bad quality I didn't wanted to buy so I came up with the idea to use
Brushless motor as balancing wheels and after building the balancing robot testing it and collecting all the data on a *.pdf file to take out the Brushless motors and use them for RC Airplane "UAV" (2nd project).


So that's all the story how i came all that way and with that components.
Now you may say that I done bad decision picking up that components and use them but I'm that kind of person that like to hack or how old stile people say "patent" better way to say it is, "To find a way and making everything work as you want" no mater what stop you :D


* Brushless and Brushed motors with ESC
Yes I found out on youtube how they control a brushed motor with ESC in 2 directions It's kinda easier than Brushless, I looked a of videos and the most of them saw how they control a brushless motor (+ESC) only in one direction. So I'm thinking right now.
---->
They use the BEC cables (Yellow->Signal),(Black->Ground),(and Red--> +5 "Only if you wanna power up your arduino from ESC and not your PC or external power"but not recommended)from ESC to "start" the ESC and then thrust the motor.
   My Idea : What if you use 2x ESC for each motor as an H-Bridge so when you wanna rotate the motor right you use 1st ESC giving the signal from the arduino and when you wanna rotate it left you stop the signal from the 1st and active the 2nd ESC. and will be no needed to use the L298N. and ofc using a Y connector for the battery and solder the 6x phases of the 2xESC to the B.Motor with each phase a High Amp Diode so the current will not be able to go back from the active ESC to the 2nd deactivated ESC (signal) and using a (mapping code) or a potenciometer to control the speed.
(3x cables to the 3x motor cables and the 2nd ESC with one cable changed so to drive the motor in the other direction "to be clear if some people didn't not understood what i mean :D")



I hope I covered every answer :D
and I'm waitting questions and advices !!!
If you feel like boring reading skip the Timeline part.

Thanks :)





ps(After few min of posting this I came back to type this: .... Or just make a mini PCB circuit with (ESC wire Gauge) wire connectors with screws to make it easy to connect the ESC's and Motor and the Circuit will have the Diodes and connectors) Like a Y connector. :)

http://p.globalsources.com/IMAGES/PDT/B1051483974/PCBA-Euro-Type-Screw-Terminal-Block-Connector.jpg

 
To be or not to be? Read a book and you will see.
Join Discord Free_World (Arduino_Room) Live chat
https://discord.gg/bBXEuKQ

raschemmel

#5
Jan 08, 2015, 07:57 am Last Edit: Jan 08, 2015, 08:49 am by raschemmel
Do you mean wire the motor to the output of 2 ESCs with opposite
polarity ( + of ESC-1 is - of ESC-2 ? ). It makesmore sense
to get a car RC.  To do what you describe requires 2 batteries.
  I said L298 and B rushless motors can not coexist which is different.
L298 is a DC motor driver not Brushless motor driver.
Also, just for the record, it's one thing to be detrrmined,
it is another to be foolish. If you you post on the forum
you are determined. If you ignore what we tell you then you are foolish.
We are telling yiu to forget about using an L298 with a brushless motor.
Arduino UNOs, Pro-Minis, ATMega328, ATtiny85, LCDs, MCP4162, keypads,<br />DS18B20s,74c922,nRF24L01, RS232, SD card, RC fixed wing, quadcopter

Domino60

raschemmel

Quote
L298 and B rushless motors can not coexist which is different.
L298 is a DC motor driver not Brushless motor driver.
I understand that but there is a possible way to connect the L298N and Brushless Motor.

I said to connect 2x ESC to a single B.Motor to dive the motor in 2 direction, in the way to save
Atmega328p-pu pins you can connect the Singal and Ground of the ESC to the L298N to drive the
B.Motor in 2 directions.

I know it sounds waist of time and pins connecting them like that.

I don't ignore what you and other people on the forum tell me and make a person in forum "foolish" it's not so kind.

Respect to be respected.

Well nvm, I came here with questions and i gave some ideas, some people may find it useful.
and in the end people call me foolish.

Well Thanks anyway
this post is closed, if some people wanna give some ideas or questions im here.
To be or not to be? Read a book and you will see.
Join Discord Free_World (Arduino_Room) Live chat
https://discord.gg/bBXEuKQ

raschemmel

#7
Jan 08, 2015, 08:37 am Last Edit: Jan 08, 2015, 09:06 am by raschemmel
It has nothing to do with respect . A brushless motor is a 3- phase
motor that runs on AC. THERE IS NO POSITIVE OR NEGATVE
LEADS WITH AC AND THE MOTOR HAS 3  WIRES , NOT 2.
I am not shouting.  I am emphasizing since yiu were already told
this. You can't connect a 3-wure AC  motor to a 2- wire DC driver.
Why is that so hard to grasp ?
This post is not closed. It never got out of the gate.
As far as "unkind" is concerned, this is an expert forum.
People come here for FACTS  , not social acceptance. This isn't FACEBOOK.  If you are rushing tiward a cliff
it would be unkind not to warn you.  When you post
on a forum whose job it is to tell you the truth, be careful
what you ask for. You asked "how" ? and we said
NO WAY. Read my post. You are only foolish if you ignore it.
This post title should be "IT techs Gone Wild !
Arduino UNOs, Pro-Minis, ATMega328, ATtiny85, LCDs, MCP4162, keypads,<br />DS18B20s,74c922,nRF24L01, RS232, SD card, RC fixed wing, quadcopter

Domino60

#8
Jan 08, 2015, 09:09 am Last Edit: Jan 08, 2015, 09:12 am by Domino60
lol you totaly didn't understood what I'm talking about.

ESC = 2x wires for battery;
       3x for RX wich are for 1.Singal  2.Positive 3.GND;
       3x for the 3-phase of the Brushless Motor.

B.Motor = 3x wires AC.

As I said (in my example) we take 2x ESC to control the motor in 2 Directions.

We connect the 3xPhase of the 1st ESC to the motor (no mater how it's just an example, we can solder tm).
and the 2nd ESC by the color (most ESC have colored phases, yellow,red,black)
we connect the 1st wire as the 1st ESC yellow -> yellow and the other 2x red to black and black to red. (we need to add some HV Diodes but this is just an example)

In this way if we active the 1st ESC we have rotation to the right.
              if we active the 2nd ESC we have rotation to the left.

To control the ESC we need the wires that are for BEC there is 3x wires but we need only 2x yellow(Signal) and black(GND) to be connected to the arduino  OR
connected to the output1 (1st ESC) of the L298N.

As we know the L298N need to be connected to the arduino to be able to active the 1st output ONLY in one direction BECAUSE for other direction we have 2nd ESC wich is connected to the 2nd output2 of the L298N

and with this example I tell you that we are able to connect and drive the Brushless motor with a L298N
BUT not recomended because we can do that only with the arduino and without L298N.




IN THIS POST.
We are not only talking about the L298N but we are talking about how to control a brushless motor in 2 direction with an arduino.

I hope i made it really clear.


ps(Connectin the ESC with the L298N it's possible but not recommended because we need to be sure that we give the output signal to the actual signal wire to the ESC).
To be or not to be? Read a book and you will see.
Join Discord Free_World (Arduino_Room) Live chat
https://discord.gg/bBXEuKQ

raschemmel

AC != DC

I hope I made that really clear.
Arduino UNOs, Pro-Minis, ATMega328, ATtiny85, LCDs, MCP4162, keypads,<br />DS18B20s,74c922,nRF24L01, RS232, SD card, RC fixed wing, quadcopter

Domino60

We are not f**ing connecting the 3x phases AC to the L298N
we are connecting the BEC signal and ground to actually active the ESC and rotate the brushless motor

wtf is wrong with you?

we are not kindergarten here to not be able to understand what is ac and dc
To be or not to be? Read a book and you will see.
Join Discord Free_World (Arduino_Room) Live chat
https://discord.gg/bBXEuKQ

raschemmel

#11
Jan 08, 2015, 09:44 am Last Edit: Jan 08, 2015, 10:40 am by raschemmel
L298 is a bi- directional motor driver. A BEC is a Battery
Eliminator Circuit and it is an OUTPUT not an INPUT.
The three colored wires on the ESC servo cablle are:
RED : +5V OUTPUT
BLK: GND
YEL: SIGNAL INPUT ( PPM SIGNAL)
L298 is not a PPM compatible chip.
You can't drive a RC servo which for all practical purposes tge ESC is)
with a motor driver because the servo signal input requires
TTL signal not a motor driver output . You are still talking APPLES  and ORANGES
.
Look up:
PPM (Pulse Width Modulation
TTL (Transistor-Transistor-Logic
There is nothing you can say that puts a servo and an L298
in the same sentence. Not the BEC, or the SIGNAL wire.
PPM + L298 Does Not Compute.

The onlyt thing you should connectto the ESC (not BEC. The BEC is the 5V Output) is a servo signal
.from the arduino using the SERVO library.
There is no wire on the ESC  that can be connected to an output
of the L298 because the L298 output
are not TTL or PPM so you to say it is Apples and Oranges
is really an understatement. It would be
more accurate to say it is Onions and Blackberries.
To say you are Left Field would be an understatement.

Frankly, what sets this post apart from others is not that you don't have a clue. We get that all the time. And it's not that you want to do something that is not possible. We get that all the time too. What sets this post apart od that  you come here without a clue wanting to do something impossible and don't ask ANY questions
and proceed to tell US what you are going to do and
when we try to tell you why it is not possible you proceed to argue with us. Go learn Electronics.
Arduino UNOs, Pro-Minis, ATMega328, ATtiny85, LCDs, MCP4162, keypads,<br />DS18B20s,74c922,nRF24L01, RS232, SD card, RC fixed wing, quadcopter

ChilliTronix

You can't drive an ESC with a high current motor controller, you drive it with a servo PWM signal and power. You can use servo control libraries on Arduino to do that.

You can get ESCs to do forward and reverse, you would want one from an RC car. For your application you need 1 ESC per motor, and 1 arduino. You do not need a brushed motor controller to control a brushless motor or an ESC.

raschemmel

#13
Jan 08, 2015, 03:38 pm Last Edit: Jan 08, 2015, 04:21 pm by raschemmel
I take that back, you DID ask ONE question :

Quote
and here is the questsion How I'm gonna do that?

and

Does the L298N able to control brushless
motors?


to which Chilitronix replied:

Quote
Brushless motors run on AC 3 phase generated by an ESC at varying frequency. So no, you can't drive them with a L298N.
Quote
My electronics experience are not so big but i keep "evolving my experience" (and always thinking logical).
 
Quote
To control the ESC we need the wires that are for BEC there is 3x wires but we need only 2x yellow(Signal) and black(GND) to be connected to the arduino  OR
connected to the output1 (1st ESC) of the L298N.
Trying to drive a TTL PPM circuit with a Brushed motor controller is about as IL-Logical as you can get.

Quote
L298 is a DC motor driver not Brushless motor driver.  
Quote
I don't ignore what you and other people on the forum tell me  
Quote
when we try to tell you why it is not possible you proceed to argue with us
Quote
I understand that but there is a possible way to connect the L298N and Brushless Motor.  
No there isn't.
Arduino UNOs, Pro-Minis, ATMega328, ATtiny85, LCDs, MCP4162, keypads,<br />DS18B20s,74c922,nRF24L01, RS232, SD card, RC fixed wing, quadcopter

polymorph

Quote
Nice, thx for info but I'd like to use a Brushless ESC.
Well, isn't it handy then, that I gave you a link to a brushless ESC? It even says that in the URL, and it says it on the page.

http://www.hobbyking.com/hobbyking/store/__11742__HobbyKing_Brushless_Car_ESC_30A_w_Reverse.html

Do you understand how an RC brushless motor ESC works?

A "DC brushless motor" is kind of a misnomer. It is really a 3 phase AC motor with a driver circuit that runs from DC, but the motor itself is AC.

In any case, you put DC into the ESC. And you feed it an RC servo pulse that is between 1ms and 2ms in length to control the speed. The ESC takes care of handling switching voltage to the stator windings, and shifting the phase to get a particular speed and direction.

No L298 or other ICs required. In fact, I don't see how you'd use it with this. You don't reverse voltage to an ESC to reverse the motor. If you did, either nothing would happen, or the circuit would smoke.
Steve Greenfield AE7HD
Drawing Schematics: tinyurl.com/23mo9pf - tinyurl.com/o97ysyx - https://tinyurl.com/Technote8
Multitasking: forum.arduino.cc/index.php?topic=223286.0
gammon.com.au/blink - gammon.com.au/serial - gammon.com.au/interrupts

Go Up