Тёмный
simplefoc
simplefoc
simplefoc
Подписаться
Hi guys,
Simplefoc is an open-source project attempting to demystify the Field Oriented Control algorithm for BLDC and Stepper motors for hobby community.
The aim of the project is to provide a simple but robust FOC implementation based on the Arduino IDE for as many motor + sensor + current sense + driver + mcu combinations as possible.

This youtube channel is a place where we place our updates and some interesting projects that we hope motivate you to use FOC in your projects as well!
Комментарии
@satipsrl5207
@satipsrl5207 7 дней назад
thank you , is this device reaches 200 Hz as frequency .?
@esser50k
@esser50k 8 дней назад
for the LQR controller, how does one arrive at the K values?
@DJTimParrington
@DJTimParrington 23 дня назад
Can you please share the info on the motor you're using?
@sourav194dey4
@sourav194dey4 28 дней назад
I AM USING IT WITH EAGLEPOWER 8302.BUT IT IS ALWAYS IN FAULT MODE AND NOT WORKING.. CAN U TELL ME WHY??
@gearscodeandfire
@gearscodeandfire Месяц назад
My hobby time life has been simple FOC for two months now… i feel like a motor GOD
@zaprodk
@zaprodk Месяц назад
Why are the pullups done with 1210 resistors? That's a rather large package.
@zaprodk
@zaprodk Месяц назад
0:21 STM? I believe it's just ST. STM is the series of Micro processors :)
@honglinjia2882
@honglinjia2882 Месяц назад
goood!!
@sc0or
@sc0or 2 месяца назад
How the encoder relates to a "field"? That was a big mistake to name this library FOC. Now everyone supposes that FOC means a positioning. Despite the correct preview image, the rest misleads. No torque, no noise management is available with this library, despite FOC originally means exactly this. FOC is about coil to magnet orientation detection. That's it. I'm angry
@sc0or
@sc0or 2 месяца назад
As I can see those days when the first FOC hardware drivers appeared, many YTs began that hype, naming FOC a positioning system. "Field" in FOC means a motor magnetic field. Got this? FOC was designed to manage torque (that reduces a noise and increases an efficiency). I think there was one popular YTer, how started that trend (with improper usage of the term FOC), and then the others copy pasted.
@antunskuric7282
@antunskuric7282 2 месяца назад
Hey @sc0or, You're right, the FOC has a very specific meaning and has been there for many decades now. I'd argue that the FOC was designed to decouple the torque and field control, mostly for Asynchronous motors. For BLDC motors, FOC approach is much simpler, as the rotor field is directly related to the rotor angle, no slip happening. So for BLDC motors, the abstraction that the voltage vector is proportional to the current vector which is proportional to the field vector which is proportional to the torque is relatively reasonable for low speeds. But as you said, this is no longer true for higher velocity. This is an old video, and one that does not anymore correspond to the simplefoc well. It is just a video to make people interested. The library nowdays implements the textbook FOC algorithm for many architectures and does it with a decent level of efficiency. The overall the goal of the library and the project is to demystify (make simple) this approach and to give the people a relatively well documented and gradual way into this topic.
@sc0or
@sc0or 2 месяца назад
@@antunskuric7282 Indeed. However when I search YT for a custom implementation of a real FOC to use an industrial controller that is driven by 3-phase PWM from an MCU, I find tons of videos with the positioning. I only hope that TI has some webinar and a source code for their MCUs. Unfortunately, existing hardware FOC controllers are not powerful enough. They suppose that a user must not care of a noise or efficiency with a high power motor. But my 3kWt motor must be silent and effective.
@johnpotter7069
@johnpotter7069 2 месяца назад
What board is being used in this demo? AgentGBC? I cant find it anywhere
@mgrpe
@mgrpe 2 месяца назад
Nice! 4 years is a long time in tech. What would be the updated hardware version for an equivalent project nowadays?
@gearscodeandfire
@gearscodeandfire 2 месяца назад
Super helpful
@mehmetkilic9518
@mehmetkilic9518 2 месяца назад
Are you french?
@DustanWebb
@DustanWebb 3 месяца назад
Hello Antun, I am still playing with this library and having some issues...still. 1. with the angle control i have to type a target "T6.275" to get 1 full 360 rotation I cannot figure out why its not "T360"??? I have the encoder set to 2048 and everything initializes good...2. I have been using an UNO clone and also esp32 D1 R32 but the esp just will not work correctly it works but is all jittery and makes the motor hot also the simplefoc shield V2.0.4 not the same one you are using. I have mapped the pins correctly but maybe the esp pins need to be a specific type like interrupt pins or pwm pins although im pretty positive they are all interrupt capable???
@theskura
@theskura 3 месяца назад
Hey @DustanWebb, the angle is in radians. So for one full rotation you'd need 2*pi radian = 6.28. Also the velocity is in rad/second. :D
@DustanWebb
@DustanWebb 3 месяца назад
@theskura ah...thank you that makes sense, I just figured I didnt configure something correctly.
@viggob4816
@viggob4816 3 месяца назад
Thank you showing this cool video with motor control. Do the motors you use have any cogging moments, or are the motors special made to keep cogging moments at minimum?
@RASSVET34
@RASSVET34 3 месяца назад
!!
@marcellogcb3181
@marcellogcb3181 3 месяца назад
this pcb can be used like a hoverboard forcefeedback in one simracing?
@xp-4yt
@xp-4yt 4 месяца назад
Jesus, you are awesome!
@marcusjansson5029
@marcusjansson5029 4 месяца назад
Great stuff, but the encoder you are using are probably the AMT102? eu.mouser.com/datasheet/2/670/amt10_v-1775837.pdf
@AljazJelen1992
@AljazJelen1992 4 месяца назад
What is meant here by FOC? For real FOC, you can control the motor in any operating domain (incl MTPA, MPTV, constant voltage curve etc ...), by manipulating Id and Iq current, knowing exact position of your rotor flux (in few degrees accurate). To be honest, I doubt that this here is a real FOC. Its a good basis non the less. Oh and about speee control. If you increase the voltage, the motor shouldn't turn faster. Higher voltage only means lss troubles until Bemf is equalizes. Then you anyway need to do any of field-weakening approaches. Dont get me wrong, I am not demeaning the effort of SimpleFOC community, I just want it to reach the state where you can call it *complete* SimpleFOC
@theskura
@theskura 4 месяца назад
Hey Aljaz, thanks for the comment. You were not the first one to point this out. This is a very first video demonstrating the SimpleFOC . At that point it was a small git repo and the "real FOC" was not implemented. SimpleFOC has gone far from this video. Nowdays SimpleFOC supports the "real FOC" for BLDCs and in the next release for steppers as well. This video does not do justice to the efforts that have been put into this project from the community. :D
@theskura
@theskura 4 месяца назад
I'm not sure that I understood your point about the voltage. If you increase the voltage you will be able to get higher speed because you'll nee higher Bemf to equalize the increase in the voltage and Bemf is proportional to the speed. So higher voltage = higher Bemf = higher sped.
@AljazJelen1992
@AljazJelen1992 4 месяца назад
@@theskura I have been following the SimpleFOC for 3 years now, and tbh, it's probably the best community in this domain. So hats off :)
@AljazJelen1992
@AljazJelen1992 4 месяца назад
@@theskura Yes about Bemf part, I think in the video you mention that we "put the system in speed control loop and speed is stable. And if you increase the voltage, the speed increases." That's the part which I cannot agree with. Of course as you said, with increasing the voltage you can rotate the motor faster, but the speed controller should keep the motor at the same speed, regardless of DC link voltage. Even if Battery voltage is lower than Bemf, then you do field weakening (increasing the D current) but only up to the point, where Q current is still sufficient to produce enough torque to fight the losses at given speed. Now that I mentioned this, it doesn't mean that I think SimpleFOC is bad. Not at all. As you mentioned yourself at that point it was not as mature as it is now / will be in the future. I am doing something similar, but with C and with STM32G431. Trying to do Sensorless with SMO. I wish SimpleFOC was in C, then we would be right now chatting on the forum :)
@theskura
@theskura 4 месяца назад
​@@AljazJelen1992 Absolutely right! I agree, in the speed control the increase in the voltage will not increase the speed. So far we did not get to the field weakening, maybe in the future. :D Yeah, we are bound to cpp at the moment, there are some people that ported simplefoc to C, but I would not suggest doing that. SimpleFOC is probably to big an bulky for experienced embedded developers, there are more efficient ways to write C code and to achieve the same things, and with better performance. Good luck with your project!
@planktonfun1
@planktonfun1 4 месяца назад
balancing stuff is always a flex in the robotic stuff
@jlewis184
@jlewis184 5 месяцев назад
what is the part number for the motor used in this example?
@maalonszuman491
@maalonszuman491 6 месяцев назад
hey i am using a 5010 360kv and i want to make it work with simplefoc mini and as5600 but he can t detect the sensor
@CollinRenaud
@CollinRenaud 6 месяцев назад
Do you need the encoder to do the velocity control?
@fares3651
@fares3651 6 месяцев назад
"For you who can handle this size, it's really good to try" 😂 I see
@jcmtzros
@jcmtzros 6 месяцев назад
Hi, I have used exactly the schema and sketch from the official Simple FOC, Im trying with two different motors and encoders. Both motors move a little just at the beginning, when I plug the system. But nothing more happens. Let me know where can I send you images and videos.
@hidrogenodeuterio
@hidrogenodeuterio 7 месяцев назад
Ese driver me lo encontre en 50 usd, donde se puede encontrar mas barato?
@eduardorosentreter
@eduardorosentreter 7 месяцев назад
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?
@sewingmachinesindetail
@sewingmachinesindetail 7 месяцев назад
Thank you for this video. I shall check out the Simple FOC Community. I got one question about the Hall Sensors used. I think it is to read the position of the shaft. Is it digital hall sensors? I am investigating motor drives for sewing machines. In general you like to have a large speed range of about 1:200 or better. And you like to have good low speed control with fast response to load changes. At low speed you will need short term higher currents (and shaft torque) than the long term current limit of the motor. Furthermore, you like to avoid unpleasant audio noise, but silence is not needed. Unfortunately, most servo motors for industrial sewing machines on the market cannot meet such demands. They do use BLDC motors, but I think the control methods they use are outdated. This is a video that give some idea about the demands: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-uTB8DnyYAlA.html
@leonardofranco7398
@leonardofranco7398 8 месяцев назад
Hi! Will you update these video tutorials to the more recent version of SimpleFOC?
@pocovolvedor
@pocovolvedor 8 месяцев назад
I have a biesse 342 machine that have brushless dc servos with broken servodrives. Do you think I can replace that old servodrives with newer electronics. Servos are gec alsthom 290v brushless dc. Any recommendations?
@Build_the_Future
@Build_the_Future 8 месяцев назад
I'm curious, I thoght the clarke and park transform would be dificalt to do in software would it be easer to use a dedicated FOC chip that dose the clarke and park transform in hardware?
@theskura
@theskura 8 месяцев назад
True, but modern processors are more than capable to do the math and still achieve fast loop times.
@utube521
@utube521 8 месяцев назад
do U have an example with foc mini, but without encoder. i cant make it work with uno and 2408 motor.
@khoabach2042
@khoabach2042 10 месяцев назад
When I control using closeloop, I set the velocity to 5 rad/s, then change the PID parameters. Initially I gave I = 0 then changed P. I realized at motor.PID_velocity.P = 0.2; The motor started to accelerate but I noticed on the serial screen that the voltage gradually increased to 1 value and the wheel stopped rotating. When tested with higher P values, the wheel rotates unevenly. It seems like it only rotates for a while and then spins again, causing the wheel to jerk. Below is a picture of the voltage in the second column. When the voltage is < 0.8, the wheel still rotates, but when it is greater than 0.8V, the wheel stops.
@khoabach2042
@khoabach2042 10 месяцев назад
When I send the command the speed of the wheel rotates an angle and then stops
@khoabach2042
@khoabach2042 10 месяцев назад
Can I ask something? Yesterday I controlled the skateboard motor when in the openloop control loop, the motor rotated quite smoothly but when switching to closeloop the motor started stuttering. Is it because I set the voltage incorrectly? I set motor1.voltage_limit = 6;
@curiousflight5923
@curiousflight5923 11 месяцев назад
great project!
@TwoDogsFighting
@TwoDogsFighting Год назад
Is it possible to use this for an aquarium pump with a bldc motor?
@mahershhab3824
@mahershhab3824 Год назад
احتاج الى كود اردوينو لتشغيل متور دسي بمقابل مادي
@circuitdotlt
@circuitdotlt Год назад
Please, can someone make a foc bldc driver board for 3D printers?... A standard one with step/dir input, to install in place of current TMC drivers? Seems so easy, but can't find any to buy.
@Debraj1978
@Debraj1978 Год назад
On your L298 power board, there is no current sensor. If you cannot sense the current of the motor, how can you run the fOC? FOC is all about current control.
@wintertod74
@wintertod74 Год назад
Propably by voltage? Stepper is a bit different from 3 phase bldc. As you only have 2 "phases" you can just use pwm with a known input voltage to set the motor current.
@pieak4066
@pieak4066 Год назад
For simple FOC, It is not work with the bigger brushless motor.
@GRIDSLER
@GRIDSLER Год назад
What about the link to the code shown in video?
@brianwoodburn2050
@brianwoodburn2050 Год назад
Great driver, could you do an open loop sensorless video with this board and show the hookup schematic? Can you also play with the PWM frequency?
@3eng
@3eng Год назад
FOC Control of 3D printed Brushless Motor ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-gLDUQX1zxV8.html
@3eng
@3eng Год назад
FOC Control of 3D printed Brushless Motor ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-gLDUQX1zxV8.html
@JohnMcKennan
@JohnMcKennan Год назад
Here's a few things that I had to do with the g431b to start programming. Delete the build flag in the ini file for USB FULL speed and use serial 2 vs 1 ie. Serial2.begin(115200);
@georgeoneal5644
@georgeoneal5644 Год назад
Thanks so much.