Open Source ESC based on Arduino - High Speeds

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
what's up my friends welcome back so I have a new project for you guys actually this is like an update video about the ESC board that we have seen in a previous project because right now I have this new version so I want to show the differences between these boards and also talk a little bit about the parts that I haven't explained in that video as for example how we detect the back EMF using the internal comparator of the atmega chip because a lot of you guys had some problems understanding that part but I really think that it's very interesting so I will do my best to explain that part even better and with more details at the same time we will have some more features for this board that have implemented in the code as for example how to use the brushless motor as a speaker so in that way we don't need a buzzer anymore for notifications and stuff like that and it also have a new version that will be able to rotate the motor both clockwise and also counterclockwise because a lot of you guys ask me for that and I think it is very interesting to make it but for now this code is not that good it still has some errors so it won't release it yet but we'll see some examples in this video about this version and will control the motor both clockwise and Qatar clockwise using the same code so stay tuned for that okay guys but the most important part for this video is this new PCB so I want to show you how I made the PCB smaller and why remove some components from the other version that were so important and also show how the PCB works so for that we'll do some tests and I'll try to show you the maximum speed and also the current ratings but later we'll also see the signals on the oscilloscope and I'll do my best to explain how the ESC works how the commutation is made and stuff like that and once we know how this circuit works I'll try to explain how to use different MOSFETs and maybe use this same circuit but with bigger motors because a lot of you guys ask me for that in the comment section but just one thing I won't share this new PCB and this new code yet because this will be a Kickstarter but don't worry I'm still sharing the schematic the code and the old version of the PCB and you'll have links for that below in case that you want to order all the components and make the same PCB as you know the portable soldering iron wasn't a Kickstarter success but in that case was my first Kickstarter and also I've made some errors by using some components that were very expensive as for example the only display the iron tip and so on and it also included a price of shipping in the tote cost of the product and that made it very difficult for you to purchase but anyway I won't make the same error for this the Kickstarter in this case the board is very small it has fewer components and I will be able to also order some pick-and-place and that way I'll have the PCB already mounted with all the components older and all I have to do is to receive the new board solder some wires from the input and the output I'll pull the new code and ship that to you guys and it will be ready for tests so please comment below this video if you would like the idea of a Kickstarter about this PCB and two that have to watch this entire video because in that way you will know how this PCB works and how the PCB performs so stay tuned for this Kickstarter and don't worry I will announce this on the community tab of YouTube on Facebook Instagram and more okay guys so let's see this new PCB for the new ESC but before we start make sure that you hit the subscribe button and also the notification bell in this way you won't miss any my future videos also a huge tank atomic patterns for supporting my work and if you'd like to be a patron of mine as well you have links for that below this video so guys let's get started what's up my friends welcome back here I have the new PCB that I've designed for this ESC which stands for electronic speed controller this device is used to control a triple phase brushless motor like this ones that are usually used for RC toys for drones electric bikes and so on what's special about this ESC is that is based on Arduino and it is open source so you could get the code and the schematic and make one yourself or even improve the design I recommend you to watch the previous videos as well in order to understand more in this video I will explain the parts I haven't explained in the last video about this open-source ESC and I hope you'll learn a few new things to order this board download the second version of this PCB from below this video then go to GL CPC b.com and select code now upload the zip file you have just downloaded and select your settings I select the back solar mask and 5 PCBs now click checkout and select your shipping services 6 more dollars for shipping to Spain so a total of eight dollars for five PCBs of any solder mask color so I receive the balls and give them a first inspection the black solder mask is quite awesome this new solder mask is made and it has some sort of texture if you are able to see it the silk layer looks good and the finish as well I have a lot of exposed tracks and pads so my PCB has a lot of shiny parts so once again thanks to Jersey PCB for sponsoring this video if you want to make your own PCB consider using the services from Chelsea PCB for only $2 so guys let's first see the physical differences of this new board first of all as you can see the board is way smaller the area is 38% smaller the o'the PCB having two thousand and one hundred and fifty six squared millimeters and the new one only 1331 squared millimeters I've also removed the output pads here the a B and C and now the output wires are soldered directly to the drain of the pads of the MOSFETs and that will make the board even more compact also as you can see the main power tracks are now exposed if we don't apply a solder mask on top of the tracks I can fill this with solder and by that it could withstand more current even if the track is not too thick as you can see below of the solder mask of this old PCB the main power track of this one was four millimeters now the power track is only two millimeters thick but filled with solder next part you will notice is that we have no USB connector anymore at the same time if we don't have the USB connection anymore we don't need the FTDI programmer neither so that will save even more space onto the PCB the reason I remove the USB connector and the FTDI programmer is because this won't be a development board anymore once I know the code works I will only told it just one time and for that I could use an external FTA programmer since I have these pads here these are the serial communication pads for the Worldport with rx TX and DVR pins even better if I would mass-produce this product I would remove the word pads as well and just program the chip before I solder it to the PCB as you can see here I have a commercial es e that is using the atmega8 and it's about the same size I can see no programming pins so the chip must be programmed before soldered to the PCB at the same time I've also put the SPI pins in case that you need to burn a new bootloader because imagine that you ordered this PCB and you solder all the components but you have a brand new atmega chip with no bootloader you could probably manage to upload a code but to make it easier you also have this SPI pins okay guys so let's see more in the past version I wasn't able to make the brushless motor beep because I was using the wrong signals now I've analyzed the beeping signal from a commercial ESC and applied that to my own code in this way we don't need the buzzer or the signal LED anymore let the old PCB had in order to control or program the ESC you will need some sort of notification signal so you better use the motor as a speaker or just add a buzzer or notification LED in this case I'm using the motor as a speaker and by that be able to have a smaller PCB in case that you want to know how the beeping signal is here I have it on my oscilloscope I first thought that this is a simple PWM pause but to make the coil sound you have to alternately convert eight two coils so we activate the ground side of the big coil and then alternately enable a and C coils with pulses of 20 microseconds and then 480 microseconds of pause the entire post is 110 milliseconds and that's how we make those beeps okay now some of you guys were wondering why I still have this buck converter circuit on the board instead of a linear voltage regulator well usually ESC s also have a B C or battery eliminator circuit you see is very common then when you use an ESC you will have to supply not just the controller board but also the radio receiver maybe some servos maybe some LEDs and so on and for that you need a decent amount of current and the simple LDO usually can deliver that and even more the LD o--'s are not efficient at high loads they will get very hot and lose power to heat in case of a drone for example that's not good because you want to save battery and using a buck converter circuit to get the 5 volts regulation is way better than using an L do so in case that you wonder that's why I've used a coil and a buck converter IC to get the 5 volts that I need for the digital part a blue LED will turn on when power is applied to the board and that's in order to notify that the board is powered on these 5 volts will supply the main chip but they are also connected to these three pins these pins are ground 5 volts and PWM signal input ESC s are usually controlled with the PWM input from 1,000 to 2,000 microseconds having these 5 volts here we could supply the radio receiver and maybe other components such as servos LEDs or other parts of our RC toy now ESC SR commutating a lot with high current and that might create some voltage drops at the input that's why usually EEOC's have a big capacitor at the input pins so i've solder a 1 farad capacitor here with the help of some solid wire so that's pretty much with the board design now let's make some tests I upload the One Direction code using the FTDI programmer now I remove the programmer wires and then I connect the receiver to the p mm pins of the throttle channel when you power this up if throttle is minimum the ESC will start in normal mode and you will hear the welcome bits if you don't increase throttle for a few seconds you will get the standby beeps anytime increase trottle the motor will start as you can see it is very responsive and it will have a decent speed so the control works quite good if you want to define the fee mm input range you have to put rattle to maximum before you supply the ESC now I supply the ESC and you'll hear a faster beeping and that means that you are into range configuration mode now lower trottle to the minimum value and the new range will be saved to the EEPROM of the microcontroller so you only have to make this just one time now let's see the maximum speed for that I apply a white strip to the outside of the motor I will use my RPM meter that we've made in a previous tutorial as you can see I get a speed up to fourteen thousand rotation per minute I'm using a supply voltage of 13 votes to simulate a 3s battery this port could work up to 4s batteries but I haven't made too much test with that I now increase the voltage up to 19 volts and it could reach up to 20,000 rotation per minute by breaking the motor I was able to get current spikes of over ten amps and the MOSFETs were not even hot the brushless motor did get a little bit hot but not the MOSFETs the n-channel MOSFETs that I'm using are the IRL are 78 43 and these are rated to 30 volts and 113 amps continuous you could always get higher current ratings by using different and bigger MOSFETs or maybe place few MOSFETs in parallel if you want to use this board with higher voltage you must change the voltage divider values right now I'm using a 10k and a 33 K resistor but you will need a different value in order to lower the voltage under five volts also the back converter circuit won't work with voltages above 24 volts so have that in mind okay guys now about the back EMF sensing in each part of the rotating sequence one coil is connected to positive one to negative and the last one will be floating and that means is not connected to anything the moving magnet on the outside of the motor will induce a voltage drop inside of these coils so in order to know the position of the rotor all we have to do is to join these three coils together to some resistors to limit the current so this will be our common value of virtual zero then each time the floating calls will pass this value will make the switch to the next step so this is called a zero cross switching and the switch could be from positive to negative or from negative to positive and that's why in the code we'll have a falling or rising detection in order to detect this zero cross we have to connect each coil to a comparator and compare that signal with the virtual zero we have made before but for that we need three competitors and also interruptions so a better way to do this is to use the internal comparator that I said in the last video get mega 320 microcontroller has a programmable comparator and the positive input of this comparator is fixed on the digital pin d6 the cool thing about this comparator is that is programmable and we could select in the code what pin will be connected to the negative input of the comparator so in this case when a is high and B is low we connect coil C to the comparator and by that we detect the zero cross then we switch a high and see low and connect the peak oil to the comparator and the TechEd once again the zero cross in this way we don't need external comparators extra tracks or use interruptions everything is done internally and this works quite good in the code I place comments on how to disable the ADC input select the multiplexer for the comparator input and set the comparator to rising or falling edge so read the code for more okay guys now let's make the final test with the reversed function as I said before this code still has some glitches but works quite well for now I upload the second code and now I start with a joystick in the middle position if I lower the joystick as you can see it will rotate into one direction if I increase the joystick above the middle position it will rotate to the opposite direction okay let's see this example once again okay guys so happy mind that a control resolution in this case is lower because we are using the same pwm signal for forward or backwards rotations we can still program the limit of the signal with this code and the beeps are also working I'll try to improve this code the best that I can and share that with you so you could use it for your projects so guys that's the update of this board stay tuned for the Kickstarter I hope I will be able to make that as soon as possible and you will be able to order the board or probably the ESC already mounted leave a comment below if you are interested into buying this board and using this you will learn Arduino programming you would receive the board the code the schematic and also video with all the steps that you need to make this so guys I hope you to learn something new about ESC s I know that a lot of you guys would like this topic in case that you are building a custom made electric bike or something like that if you like this video consider subscribing and please make sure you activate the notification bell because otherwise you won't receive notification when I upload new videos also consider supporting my work on patreon so thanks again and see you later guys [Music]
Info
Channel: Electronoobs
Views: 105,111
Rating: undefined out of 5
Keywords: homemade, ESC, electronic, speed, controller, Arduino, PCB, STM32, DRV8302, open source, code, RC, DIY, VESC, firmware, simonk, circuit, schematic
Id: -ymTE-Nivzw
Channel Id: undefined
Length: 16min 58sec (1018 seconds)
Published: Sun Jul 07 2019
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.