Strange noise in the BLDC and support for esp8266

Hello Antun,

First at all, thank you very much for the amazing work you did with this library, but also the Shield and the documentation, the platform… It’s very amazing work ! Thank you very much. As a lot of people (I suppose) I began to use Gimbal Brushless motors with arduino by hacking the cheap gimbal controller boards made for “GoPro gimbal”. I was dealing with it with my own Home-made library, but it was not so easy, because the configuration of timers made a mess with serial functions, delays…

But now, what you did with the library is just a big step forward. It’s well thought of and so easy to use (Again, thanks a lot!)

So I ordered your shield, and tried it with quite a big motor (an HT100), with an arduino uno, and without encoder, just in open-loop Velocity mode.

It works quite well, in the sense that I was able to control the speed, and the torque.

But when I am at low speed, there is an intermittent noise that I can’t take off. I suppose I configured it well, the number of pairs of poles (21 in my case),

And the wiring too (I also tried all the combinations of the order of the pwms, supposing that if I swapped the pwms it would be like swapping the cables of the bldc, is it true?), but I still have the noise. When I run it at very low speed, I have the impression that there is a bad step in the movement. Does it have something to do with the fact that I used an arduino?

In terms of performance, would it be better to use an esp32 board? Does an “Arduino-like” board like this will be compatible?
I’ve had some of these boards but with and esp8266. I tried to compile it, but it didn’t work. Could it be technically possible to use an esp8266 (limitation of timers? Pwms)? Is it a lot of work to adapt the library?

Again, thanks for the amazing work you do!

Julien

Hi,

I can confirm that the ESP32 works well. It is a very nice platform for SimpleFOC because you can immediately control and debug via WiFi.

The ESP8266 I have not tried it. I suspect it might be a bit slow (it does not have so much performance when running WiFi), and I am not sure it has the “MPWM” features of the ESP32, which I think the SimpleFOC code currently depends on…

I highly recommend using an encoder. There is a big performance difference between open/closed loop control, especially if you want to run motors slowly. The AS5048 would be my encoder of choice.

Another question: what Voltage do you run at? I see you’re using a beast of a motor (nice!), and those things typically want 6S, sometimes 12S… So I would expect them to run well above 16V, and maybe more like 30-40V.
And with 3Ω winding resistance I am not sure the driver will handle the current at that voltage?
And if the voltage is too low, you can have strange effects.

Another thought on the noise: I has this type of problem, and I had caused it by turning the mounting screws too far into the motor - one of the screws would rub against some part of the rotor 1x per revolution.

Regards from Vienna,

Richard

Hey @julienhogert,

Regarding the ESP8266, it would be a lot of work to make it work with the library as the implementation of the ESP32 relies fully on the MCPMW unit. To be honest, this is not worth it as the ESP32 is almost the same price and grants a lot of functionalities over the 8266.

Nobody has tried this before, but my guess is that this would be such a nice board to use with the SimpleFOC shield :slight_smile: I want to order one for myself

It’s a ESP32 and it will work… I would encourage you to order this one:
image

It’s the same thing, following the Wemos D1 Mini form factor, but with an extra row of pins on each side. So it is compatible with the D1 shields, but waaaay more of the ESP32’s pins are accessible.

It can be ordered (with prime delivery) on Amazon… and as usual at half the price from China

Its pretty inexpensive, but a nice size and form-factor.

Hey guys,

I am just wondering if the noise is maybe coming form the shield. Unfortunately there is an mistake I’ve made which could potentially cause this.
It is easily fixable though, @julienhogert could you please try this small fix in if you have the version 11/2020 of the SimpleFOCShield v1.3.3:

Hello Guys,

First at all, thanks to everybody for all your answers.

I tried to test all the solutions you proposed.

First, by fixing the shield (It’s not a big issue Antun, don’t worry) : It was still making noise.

Then test with an L298N shield and an esp32: The Wemos D1 esp32.

Yes, I have some of theses boards, Runger I love them ! So powerful and practical, with all the wemos shields…

After a while I understood that I had to change the mpwm.h…

So, Esp32 + L298N and a smaller BLDC motor : no noise!

Then, with a HT100, a 12v 5A power supply and an adjustable voltage-limit kept not too high, so as not to heat up the L298N : it works, and without making noise ! (but heating up obviously)

Was this related to the shield and the L6234?

I tested with the simpleFoc shield and the esp32: No problem, no noise, not too hot.

Was the problem related to the Arduino? The check, I uploaded the same code, changing only the pins, in the arduino uno: No problem, no noise.

So my conclusion is that is was probably related to either the code or the power supply ! But it was a good thing to test the L298N.

While I was reading the documentation and checking the other shield possibilities, I was thinking…

If STM32 is compatible… maybe it could work on the Storm 32 BGC 3 axes Gimbal board?

This probably would not work with encoders but it could be a way of having a very compact board for 3 motors.

The problem is that it has to be flashed from the ftdi, and I didn’t manage to do it from the USB port.

Also, this would require knowing which pins to use… and this is too much work for me to undertake alone.

The other option to find a very compact solution was the drotek L6234 board. But this board seems hard to find now.

I found an alternative to it by “letmeknow”: the board

But 22,50 euros seems quite expensive for a simple board (I don’t see too many components), to be used in an Open-loop mode.

How difficult would be to make a board for the esp32 with the L6234? I have looked into the schematic of the Simplefoc board. Concerning only the L6234, It looks there are only a few caps needed, is this the case? What do you think about this? Is there any interest in pursuing this road?

Thanks for your help,
Julien

Hi Julien,

Nice find on the Storm32 boards… I shall immediately order some and try them out! There seem to be an amazing wealth of them out there. I see no immediate reason why they would not work, assuming they can be reflashed, which should be the case for an open source design.
It would be an improvement over the known to be working “BGC-3” board, which uses ATMega328P. Given the way you can reassign pins on STM, the optimal outcome would be that you can directly use the JST SH ports some of those boards have to connect the magnetic encoders.
I’ll report back when they arrive and I’ve tried them… could be a while if they have to come from AliExpress…

The letmeknow board does indeed look a little expensive for what it is.

And for your big motor with 3Ω resistance I think you will need current sensing to drive it to its capabilities. One option for this (but expensive) is the development boards for the various ST and DRV motor driving chips.

In terms of making a board with ESP32 and L6234, a similar option might be @David_Gonzalez 's Dagor board he is working on. Not sure when he will be selling it though, but certainly excited to order one when he does!
Or perhaps @Antun_Skuric can say when the new version of his SimpleFOC shield is coming out? I think it will do current sensing?

In terms of making a board, I think David is a good person to chat with - his project really seems far along. I have been working on various designs (which will be Wemos D1 form-factor, once they’re finished!) but it is really not simple to do, many concerns, especially if you want a design as compact as David’s. My assessment: not a beginner project, and I’m a beginner, so I’m going at it slowly, and doing some simpler boards that I also need first.

Regards from Vienna,

Richard

Hey guys,

I’m happy you have found the solution to your problem :smiley:
Or that the problem found the solution for itself. :slight_smile:

The strom32 has already been used with the simplefoc for some time. It is a really great baord!
@Owen_Williams will let you know more about it.
There is also a bit older thread of @blackblue007 with very detailed explanation how to configure the strom32 with foc.

Now in terms of the l6234 circuit, it is very very very simple. Few resistors and few capacitors. I would certainly advise everyone who is interested to look into it and try to design their own board. :smiley:
I am not sure is the miniature version of the l6234 board in a short-term future of the simplefoc project but it is something I am thinking about. I would say that the price of production of the such board in would be 7-8$.

At the moment the v2 version of the shield is in the testing phase. With current sensing yes, I am excited really. :smiley:
Here is a current project: https://github.com/simplefoc/Arduino-SimpleFOCShield/tree/dev