Arudino Field Oriented Control (FOC) Library ( Full HMBGC example ) - SimpleFOClibrary

แชร์
ฝัง
  • เผยแพร่เมื่อ 30 เม.ย. 2020
  • Proper low-cost and low-power FOC supporting boards are very hard to find these days and even may not exist. Even harder to find is a stable and simple FOC algorithm code capable of running on Arduino devices. Therefore SimpleFOC project is an attempt to:
    - Demystify FOC algorithm and make a robust but simple Arduino library: Arduino SimpleFOClibrary
    - Develop a modular BLDC driver board: Arduino SimpleFOCShield
    The library is completely open source and can be used with any type of BLDC motor and most of Arduino controllers.
    SimpleFOClibrary is an opensource project :
    Github link: github.com/simplefoc/Arduino-FOC
    Docs link: docs.simplefoc.com/
    Community: community.simplefoc.com/
    Shop: simplefoc.com/
    Let me know what do you think!

ความคิดเห็น • 88

  • @dimchohvarchilkov683
    @dimchohvarchilkov683 3 ปีที่แล้ว +1

    Nice preview. Thank you!

  • @divyaprakashbiswas8781
    @divyaprakashbiswas8781 3 ปีที่แล้ว +1

    Very informative, Thank you so much !!

  • @mustafakaradag7839
    @mustafakaradag7839 3 ปีที่แล้ว +1

    i tried this very nice library
    thanks

  • @danhellgren5671
    @danhellgren5671 3 ปีที่แล้ว

    Just found your channel, great videos! If I understood FOC correct you also need to find motor parameters s.a inductance and resistance. Is this not done in this simpleFOC?

  • @kayaonur5657
    @kayaonur5657 3 ปีที่แล้ว +2

    what application did you use to control the board via serial terminal? or did you modify the code in atmega328? always thought about trying these gimbal drivers but I never know how to control these boards. btw, I appreciate for your efforts and videos mate. I think you are filling a big gap which was missing in the community.

  • @samirsuleymanov2099
    @samirsuleymanov2099 2 ปีที่แล้ว

    Thank you for the video! I got hoverboard motor and I got a couple encoders from an old printer. So, if I get that controller it's the only thing I need to build my steering wheel simulator with force feedback?

  • @mailo66
    @mailo66 ปีที่แล้ว +1

    Hi, very nice! How it is possible to program the board by the IDE? It is possible to upload the bootloader? And if yes, then, it is possible to see the board like an Arduino pro/mini and program it thru the IDE? Or it needs to upload the program by another Arduino? Thank you

  • @warrenschoeberlein9271
    @warrenschoeberlein9271 4 ปีที่แล้ว

    Very cool! Would this work with smaller motors like 12n14p?

  • @vince086
    @vince086 2 ปีที่แล้ว +2

    Could the same results be achieved using a AS5600 sensor instead and the same control board? Interesting project and I'd like to start playing with it.

  • @vidhyasagar1990
    @vidhyasagar1990 4 ปีที่แล้ว

    Awesome man!!

  • @kelvinjaramillo8007
    @kelvinjaramillo8007 2 ปีที่แล้ว +1

    Nice! really really nice video, very usefull

  • @rahulrajan
    @rahulrajan 3 ปีที่แล้ว +1

    Hi, thanks for the explanation, I love the work you are doing. One area, I'm working on right now is Torque control of Brushless motors, specifically for winder/unwinder applications. using the FOC library, is it only possible to set the torque of the motor based on the voltage control method you mentioned last? Or is there some cool control loops for torque control as well? Thanks.

    • @akkudakkupl
      @akkudakkupl 2 ปีที่แล้ว +3

      I know this is old, but your Q current setpoint controls the torque. Also with winders and unwinders you can use speed loops, but you need an outer control loop that has a tension sensor (a dance roll for example), you set some tension for that loop to keep and you are done.

  • @aravinthkumar7924
    @aravinthkumar7924 4 ปีที่แล้ว +2

    Good video. FoC control algorithm much needed part in the domain. You can make explanation of FOC algorithm in future.

    • @aravinthkumar7924
      @aravinthkumar7924 4 ปีที่แล้ว +1

      @@theskura good thoughts. Glad to hear from you.

  • @Jai_Lopez
    @Jai_Lopez ปีที่แล้ว +1

    Great video thank you for sharing, man why don't the biggest thing that was hoping you share was torque how well would it respond while keeping a celebration and direction while maintaining a load that would be perfect for robotics specifically quadrupeds robots like Boston Dynamics spot

  • @jwood6902
    @jwood6902 3 ปีที่แล้ว +1

    very very good. i "get it" now.

  • @mohammadmahdishafiei1872
    @mohammadmahdishafiei1872 2 ปีที่แล้ว

    will it work without a sensor input? i want to attach a reaction wheel to a gimbal bldc motor and i want to use optical encoders cause of the price is that doable?
    tnx for your informative video, liked and subbed

  • @phuctong5300
    @phuctong5300 3 ปีที่แล้ว +1

    Thank you very much

  • @changchao5797
    @changchao5797 ปีที่แล้ว

    Lately I would like to measure a BLDC driving a propeller the thrust and rpm. Could simpleFOC do the job especially in speed control?

  • @Capturing-Memories
    @Capturing-Memories 3 ปีที่แล้ว

    How can I use this with a 30cm diameter out-runner pancake motor with 120 poles that is going to be designed to run in the range of 40-80 RPM, The goal here is to achieve a very steady angular/linear speed once selected, The application is a turntable record player. What method of angle tracking and speed adjustment is better for this application? a hi resolution encoder or back EMF circuit? I would really appreciate your help on the electrical part.

  • @atiframazanoglu
    @atiframazanoglu ปีที่แล้ว

    Very interesting video. Good job. I made this at home by using ardiuno uno and L298N but I want to manage my bldc motor with a potantiometer. When i turn my pot it should move as much as i turn the pot. If pot is turned 10 degrees, the motor should turn 10 degrees as well. And secondly, eventhough i do not turn pot if i turn my motor my my hand force, it should come back to its target position. Briefly close loop foc bldc motor control. Do you have any that kind of project which can help me?

  • @botak333
    @botak333 2 ปีที่แล้ว

    It is posible to control AC servo motor with encorder sir??

  • @raer7844
    @raer7844 ปีที่แล้ว

    sir . Could i use this driver for high power Ac servo motor ? i mean 400V 1 kw . i guess its possible by high voltage power driver stage desing ? What do u think about that ?

  • @Scrogan
    @Scrogan 2 ปีที่แล้ว

    Does it measure current at all, or does it just use the encoder?

  • @saadtiwana
    @saadtiwana 3 ปีที่แล้ว +1

    Very nice. Thanks for sharing.
    May I know what motor you're using in this video and possibly a link to it?
    Thanks in advance

    • @theskura
      @theskura  3 ปีที่แล้ว +1

      Hey Saad!
      you can find the link in the docs:
      docs.simplefoc.com/arduino_simplefoc_library_showcase

  • @Dakii34
    @Dakii34 3 ปีที่แล้ว +2

    verry good job man! is it possible to allow you stop spinning and free rotate by hand than as soon as you leave it starts spinning its exact speed? Like direct drive turntables that dj's uses ?

    • @theskura
      @theskura  3 ปีที่แล้ว

      Hey!
      Yes, you can set the amount of resistance your motor applies when it moves and you'll be to stop it easily when you want. :D

  • @eduardorosentreter
    @eduardorosentreter 2 หลายเดือนก่อน

    hola, queria hacerle una consulta, estoy haciendo un proyecto de brazo robotico y a lo unico que tengo acceso es a los dos motores de una Hoverboard, es posible con ese controlador FOC utilizar los motores de la Hoverboard como motores de precision?

  • @gregh3729
    @gregh3729 2 ปีที่แล้ว +3

    Hi, thank you for the video... I have a question and I would be grateful if you answer, can I connect some mosfet or ssr to the a-b-c cables that carry the impulses to the motor to control bigger motors; this approach is configured well with the functioning of the foc?
    Thanks in advice, i appricieted al lot who share their klowledge with other people

    • @platinumsky845
      @platinumsky845 2 ปีที่แล้ว +1

      It's not that simple to do that, and you can't use a ssr because those are made for ac power not dc.

  • @erikspange9445
    @erikspange9445 3 ปีที่แล้ว

    Congratulations on a very informative video. I wonder if you have also used field oriented control on a stepper motor? Do you have some example code on that?

    • @theskura
      @theskura  3 ปีที่แล้ว

      Yes we have. The latest version of the library support stepper motors.

  • @Dagosaatana
    @Dagosaatana 3 ปีที่แล้ว

    When do you need the sensor? Just for the absolute positioning? So velocity/torque control modes would be possible open-loop?

    • @azalope3768
      @azalope3768 3 ปีที่แล้ว

      Not really man. You always need to know the position, wich indicate the position of the stator. The open loop will not help us to know the position, this technique uses a complex close loop. Also you could use a half sensor, but it brings third harmonic. Another technich uses an observator with encoder . I am still try to understand this stuff. But i hope it helps you.

  • @ravitumu94
    @ravitumu94 2 ปีที่แล้ว

    This pcb in this video is not an arduino shield. I have a few questions.
    1. does this pcb control two low powered motors?
    2. is this specific foc board available? I could not find it anywhere.
    3. does this board take encodere feedback via pwm signal?

  • @anibalvilelarj
    @anibalvilelarj ปีที่แล้ว +1

    Congratulations!
    It is an excellent and sucessfull project.
    Thank you for share it.
    I would like to make some modifications on hardware to design a tool maintenance for air conditioners(inverter with BLDC 310VDC compressor).
    It would be usefull to test the compressor without the complete circuit inside PCB's.
    I think on use this kind of IC's for motor drive, instead L6234D:
    IGCM20F60GA
    IGCM30F60GA
    IKCM30F60GA
    There is no Hall Sensors or Encoder. I think on adding shunt resistors to my test circuit PCB.
    Do you think, it would be possible and/or feasible?
    Thank you.

  • @CollinRenaud
    @CollinRenaud หลายเดือนก่อน

    Do you need the encoder to do the velocity control?

  • @gedr7664
    @gedr7664 4 ปีที่แล้ว +3

    do you have a link on aliexpress for the board? Subbed btw, can't wait for the shield version

    • @theskura
      @theskura  3 ปีที่แล้ว +2

      Hey George,
      I have to admit I was not able to find it any more. It seems like these boards have disappeared. :D
      The board name is HMBGC V2.2 and bought them from Aliexpress and from Ebay many times but now when I look at the links they are not valid any more. :D
      But the good news is that you can do the same thing with any atmega328 gimbal board such as:
      www.ebay.com/itm/BGC-3-1-Control-Board-MOS-Large-Current-Two-axis-Brushless-Gimbal-Controller/222535774436?hash=item33d02a70e4:g:XjUAAOSwvXRejXSO
      or:
      www.ebay.com/itm/For-RC-Quadcopter-BGC-3-1-2-Axis-Brushless-Gimbal-Controller-Board-Sensor/163915959402?hash=item262a270c6a:g:zt8AAOSwb5ZdsC7n
      or even:
      www.ebay.com/itm/H3-Storm32BGC-3-Axis-Gimbal-Controller-Brushless-Control-Board-Dual-Gyroscope/124036658860?hash=item1ce12936ac:g:uL0AAOSwN4BeE~WF

    • @keihi20
      @keihi20 2 ปีที่แล้ว

      @@theskura would this be comparable? BGC 3.1 Brushless Gimbal Controller

  • @aj4090
    @aj4090 2 ปีที่แล้ว

    hi, how to use a flipsky 4.12 esc + arduino + postion control?

  • @ricardrinaldo4791
    @ricardrinaldo4791 ปีที่แล้ว

    Do you have a link for the controller?
    I can't find it :(

  • @skrebneveugene5918
    @skrebneveugene5918 3 ปีที่แล้ว

    Is there any schema so i can put mosfets to breadboard and make my prototype without purchasing shield?

    • @theskura
      @theskura  3 ปีที่แล้ว +1

      Hey Skrebnev,
      To use the simplefoc library absolute simplest way would be to use a l298n boards. they cost about 3$ and you can find them anywhere!
      I'll try to make a video about this soon. Here is a community thread with a bit more details:
      community.simplefoc.com/t/3-bldc-and-stepper-foc-driver-l298n/296/11

  • @haith2407
    @haith2407 3 ปีที่แล้ว

    Does it support sensorless bldc by checking b-emf, sir?

    • @haith2407
      @haith2407 3 ปีที่แล้ว

      @@theskura Thank you Sir, I will wait for further feature.

  • @user-ol2ek6mu5u
    @user-ol2ek6mu5u ปีที่แล้ว

    How did you connect the battery? can I have som information about that connecting cables?

    • @theskura
      @theskura  ปีที่แล้ว

      You have two solutions really. One is to use the banana connector or which ever lipo battery connector your batter has.
      The other way is by using the 4 pin JST connector used for balancing. The wires of the balancing connector are much thinner and they are fine for running gimbal motors (under 2-3 amp currents), but I would definitely suggest the first option if possible in your application.
      Be careful with the polarity. :D

  • @polymetric2614
    @polymetric2614 3 ปีที่แล้ว

    What board is that? it seems perfect for what I'm doing.

    • @theskura
      @theskura  3 ปีที่แล้ว

      Hey,
      It is the HMBGC V2.2 board. It is a cheap gimbal controller board.
      docs.simplefoc.com/gimbal_velocity_example
      It is a great as a starting point, but due to the ATMega328 chip it has limited processing power which will impair foc performance.
      The library will work for many mcu+driver+sensor+motor combinations:
      docs.simplefoc.com/supported_hardware
      So depending on what you want to achieve you can choose the hardware.

  • @HelloNotMe9999
    @HelloNotMe9999 ปีที่แล้ว

    Where can I get one of those motors?

  • @mahershhab3824
    @mahershhab3824 7 หลายเดือนก่อน

    احتاج الى كود اردوينو لتشغيل متور دسي بمقابل مادي

  • @akkudakkupl
    @akkudakkupl 2 ปีที่แล้ว

    At low speed the problem is you are using pure encoder step inputs as position and the difference time between two steps as the speed. What would help is to either use a position estimator (adds lag to the loop though) or a position observer. Both of them give you the speed (and acceleration) for free and those values are way more accurate than doing it the way you are doing it.

    • @antunskuric7282
      @antunskuric7282 2 ปีที่แล้ว

      Hey @akkudakkupl,
      SimpleFOC library actually usies the mixed time-frequency method which does the combination of the measuring the number of pulses in a given timeframe and the measuring time in between the pulses.
      The observers would require relatively good knowledge about motor dynamics ( the motor parameters), which is out of reach for most of our users. But you are right, that from the point of view of the control engineer there is a many many things that would work better :D

    • @akkudakkupl
      @akkudakkupl 2 ปีที่แล้ว

      @@antunskuric7282 good to know 🙂 I think the classical PLL observer (usualy used with resolvers) is quite trivial to implement and the error is somewhere around 2 degrees +/- for constant speed. It doesn't need much knowledge about the motor if I understand it correctly. If you play it right you could even get your sine and cosine for Clarke and Park transforms for free.
      I glanced o we the code and it seems to use some embedded Arduino code for writes and reads, that is quite slow, probably could be speed up (in the Arduino branch) by using registers directly. The faster the FOC loop the better.

    • @akkudakkupl
      @akkudakkupl 2 ปีที่แล้ว

      @@antunskuric7282 But anyway it's a great project and it's amazing someone got FOC running on the Atmega 328 🙂

  • @AvinashBhashkar
    @AvinashBhashkar 3 ปีที่แล้ว

    I want to buy this simplefoc controller board. Please provide link

    • @theskura
      @theskura  3 ปีที่แล้ว

      simplefoc.com/shop

  • @eid0eid0
    @eid0eid0 3 ปีที่แล้ว +1

    hi, simplefoc, it seems that the answers you are doing in the comments are not published, I can't see them only the questions, perhaps they are tagged as private, can you fix it? thanks, and impressive work by the way!!

    • @theskura
      @theskura  3 ปีที่แล้ว +1

      Hey @Euge, thanks for the message.
      This was due to the recent account transfer from my personal account. You should be able to see the comments now (they stil belong to my personal account though).

    • @eid0eid0
      @eid0eid0 3 ปีที่แล้ว +2

      thx@@theskura, it's fixed now. i think your project is a game changer, a lower cost odrive alternative for smaller motors was needed. I'm in.

  • @TheLordbruh
    @TheLordbruh ปีที่แล้ว

    can you share tge model of the motor and the board?

    • @theskura
      @theskura  ปีที่แล้ว

      I am not sure what the tge model is :D
      If you are interested in the electronics of the board in this video, we do not have it, it is an of the shelf board that is hard to find these days unfortunately, its called hmbgc v2.2.
      You can find more about this setup in the docs: docs.simplefoc.com/gimbal_velocity_example

  • @nielsdaemen
    @nielsdaemen ปีที่แล้ว

    1:29 They put all the labels mirrored 😵

  • @nostamine2567
    @nostamine2567 2 ปีที่แล้ว +1

    dude , how the hell did those disappear in one year ? i cant find any board available anymore ... out of stock everywhere

    • @theskura
      @theskura  2 ปีที่แล้ว

      You are right, it's crazy. I liked them so much, but they are impossible to find any more. The good news is that there are other boards with similar characteristics like BCG 3.0: aliexpi.com/eHCs
      Alexmos BGC: aliexpi.com/dCos
      or even much more powerful Storm32 BGC: aliexpi.com/YN8b

    • @nostamine2567
      @nostamine2567 2 ปีที่แล้ว

      @@theskura wow , u just gave me some confidence in my project :))) the droyuke one is pretty nice and close to this board and very cheap

  • @rohitgalgali5512
    @rohitgalgali5512 3 ปีที่แล้ว

    do you ship it to India?

    • @theskura
      @theskura  3 ปีที่แล้ว

      Yes we do :D

  • @syedfawad8245
    @syedfawad8245 3 ปีที่แล้ว

    What is the model of tour motor?

    • @syedfawad8245
      @syedfawad8245 3 ปีที่แล้ว

      @@theskura Thanks

    • @syedfawad8245
      @syedfawad8245 3 ปีที่แล้ว

      @@theskura I was unable to fund its documentation. Can you tell me the max torque that the motor can generate.

    • @syedfawad8245
      @syedfawad8245 3 ปีที่แล้ว

      @@theskura Well my name is Fawad and I am a student, my email is jw606351@gmail.com. May be we can talk. I have a project I want to do and need t learn about motor. Can you help me
      Best Regard
      Fawad

  • @gedr7664
    @gedr7664 4 ปีที่แล้ว

    how does it compare to odrive?

    • @gedr7664
      @gedr7664 4 ปีที่แล้ว

      Antun Skuric Seriously, this is fuxking awesome. Can’t wait to see more!!!

    • @sebastienloisel7983
      @sebastienloisel7983 4 ปีที่แล้ว

      @@theskura How much power/volt/amp/watt is limiting you here? Or, maybe why don't you explain to a simpleton like me what's the difference between a high-power driver like ODrive, and yours? Is it just the MOSFETS and whatever power lines on the PCB or is there something else?

  • @power-max
    @power-max 3 ปีที่แล้ว

    FOC requires measuring current on at least 2 of the 3 phases. Are you just assuming that the voltage applied to a phase (the PWM duty cycle times supply voltage) is directly proportianal to the current via the DC resistance of the coil? or doing something more clever to estimate current? Your links are rotted, BTW. and don't use URL shorteners, they can be malicious.

    • @theskura
      @theskura  3 ปีที่แล้ว +5

      Hey power max, you are absolutely right. For doing FOC by the books you need to measure the current and keep direct value close to 0. Short answer is, the library does exactly what you have said. assuming that setting quadrature voltage and 0 to direct voltage means that you will not have direct current.
      Since this library was first intended for gimbal motors. There isnt really many board today dta support the current sensing for them, due to the low currents. And the other thing is that people don't usually need FOC (full torque control) for their applications. So in that sense this library supports the sinusoidal and space vector modulation for BLDC motors and not by the book FOC.
      Therefore, i would like to argue that due to the architecture of the BLDC motor with permanent magnet by setting only the quadrature voltagr we are actually controlling the field orientation of the rotor magnetic field. Hence the name. :D
      We are working on multiple current based control strategies support for blec and stepper motors at this moment. and one of them is traditional foc as well.
      Thanks for the heads up, I'll look into the links.
      Antun

  • @iphoneandnick
    @iphoneandnick 2 ปีที่แล้ว

    are you dutch.. I hear the accent.

  • @joewulf7378
    @joewulf7378 3 ปีที่แล้ว +1

    my left ear is deaf

    • @theskura
      @theskura  3 ปีที่แล้ว

      Glad you like it :D

  • @mihailucian409
    @mihailucian409 3 ปีที่แล้ว

    It's so hard to follow you! Your English needs more practice.try to reduce the speed when you talk.congrats on the video!

    • @theskura
      @theskura  2 ปีที่แล้ว

      Hey Lucian, thanks for the comment.
      This is an old video, I hope you like the newer ones better.