FOC problems with small motor

Discussions regarding the Field Oriented Control (FOC) implementation on the VESC.
jaroslavnovotny
Posts: 49
Joined: 16 Feb 2016, 13:10
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1236: count(): Parameter must be an array or an object that implements Countable

FOC problems with small motor

Postby jaroslavnovotny » 06 Mar 2016, 16:03

Hi, trying foc with a small 2822 size, 1200kv on 13.2V, 12n14p configuration, 0.382ohm, dLRK star terminated motor. Sensorless FOC is performing very poorly, HW4.8 with firmware 2.16. In BLDC mode the motor behaves very nicely, and has good startup torque.

The detection is without problems, I get R=0.133ohm, L=17.7uH, lamba=0.00064. The Kp is 0.0177 and Ki is 133.26. But the FOC is very poor, the motor rattles and lugs, is very noisy and has almost no power, sometimes has problems to start. Also when holding the up-arrow the motor slows down, sometimes comes to complete stop while the arrow is being hold.

RPM plot showing motor slowing down:
Image

Current/Duty:
Image

Current Plot - the reported position is always 1:
Image

I tried to fiddle with parameters and switching frequency, also went to the advanced tab, but the result was always worst. Sometimes the motor didn't even start.

Here is the best I was able to achieve:



The VESC has probably problems with rotor position reporting by current measuring but I am not sure. Would this get better if I installed encoder to report the position?

Thanks

benjamin
Site Admin
Posts: 280
Joined: 15 Dec 2015, 08:38
Location: Sweden
Contact:

Re: FOC problems with small motor

Postby benjamin » 08 Mar 2016, 12:52

Hi,
FOC does not work well for small motors with the default shunts, since they have low resistance which causes significant noise and offset at low currents. For small motors you need to replace the shunts with higher resistance and build the firmware with a different shunt setting.

jaroslavnovotny
Posts: 49
Joined: 16 Feb 2016, 13:10
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1236: count(): Parameter must be an array or an object that implements Countable

Re: FOC problems with small motor

Postby jaroslavnovotny » 08 Mar 2016, 13:49

Thanks, I see, it makes sense. I saw a version with 5mOhm shunts somewhere before. Would that be enough or will I have to go higher than that?

I also plan to run the motor in FOC position control with encoder - would this mitigate the problem on its own?

benjamin
Site Admin
Posts: 280
Joined: 15 Dec 2015, 08:38
Location: Sweden
Contact:

Re: FOC problems with small motor

Postby benjamin » 08 Mar 2016, 14:14

I think 5 mOhm should work, but I haven't tried. Position control will most likely have similar problems with the 1 mOhm shunts.

sjacek
Posts: 4
Joined: 19 Apr 2016, 13:38
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1236: count(): Parameter must be an array or an object that implements Countable

Re: FOC problems with small motor

Postby sjacek » 19 Apr 2016, 13:53

jaroslavnovotny, did you solve the problem? 5mOhm shunt works?

I''m trying to run exactly this motor:
http://www.rctigermotor.com/html/2015/A ... 2/289.html

With 5 mOhm shunts is better but not perfect. In FOC mode, around 40 A motor current, current measurement start to oscillate very quickly and I get ABS overcurrent.

Moreover, I wonder, what exactly are motor and battery current. I get 40A motor current when my power supply shows 7A. What does it mean?

rew
Posts: 943
Joined: 25 Mar 2016, 12:29
Location: Delft, Netherlands.
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1236: count(): Parameter must be an array or an object that implements Countable

Re: FOC problems with small motor

Postby rew » 20 Apr 2016, 07:35


pf26
Posts: 310
Joined: 28 Mar 2016, 14:37
Location: FR Valence
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1236: count(): Parameter must be an array or an object that implements Countable

Re: FOC problems with small motor

Postby pf26 » 20 Apr 2016, 15:51

@ jaroslavnovotny: I see you have more noise in one phase measurement than in another. I suspect you use HW version 4.6 or below ? (some shunt traces were improved in further HW).
I had the same issue. With a similar motor I guess.
Now I use 5mOhm shunts (with very low currents, generally below 5 Amps), and position control is better (beware I am using FOC with encoder).
I just compared with sensorless FOC, and clearly (at low speed, I can't go fast), there is much less torque on sensorless mode than with encoder.
Running small motors with sensorless FOC at low speed efficiently would require very fast, clean current measurements..

jaroslavnovotny
Posts: 49
Joined: 16 Feb 2016, 13:10
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1236: count(): Parameter must be an array or an object that implements Countable

Re: FOC problems with small motor

Postby jaroslavnovotny » 20 Apr 2016, 16:25

@pf26 I use HW 4.7 board modified to 4.8 and with 4.7uF GND upgrade. I think it has the old traces, so that might be it.

I already soldered the 5mOhm shunts but am waiting for my new battery packs to test it. I am confident it will work fine. The new shunts should be good at measuring +-32A.

What I didn't do yet and what you could help me with a lot is modifying the firmware to reflect the different shunts and to use quadrature encoder instead of halls. I am aiming for the same setup as you have - encoder with FOC. There is already compiled firmware from benjamin for the encoder, but it is for 1mOhm shunts. So I will have to experiment where to change things in the source (the encoder and shunts - I only know where to change the HW version:) and then compile my own.

rew
Posts: 943
Joined: 25 Mar 2016, 12:29
Location: Delft, Netherlands.
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1236: count(): Parameter must be an array or an object that implements Countable

Re: FOC problems with small motor

Postby rew » 20 Apr 2016, 18:28

in the hwconf directory you have two files for each hardware version. Inside the ".h" for your hardware version you can find the definition of your shunt resistor. Just search the file for 001 and you'll find the 0.001 in the define for the shunt.

pf26
Posts: 310
Joined: 28 Mar 2016, 14:37
Location: FR Valence
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1236: count(): Parameter must be an array or an object that implements Countable

Re: FOC problems with small motor

Postby pf26 » 20 Apr 2016, 18:40

It is easy to change this firmware, because the code is very clean (never seen this before.)
Go to hwconf/conf_general.h, and change this:
#define CURRENT_SHUNT_RES 0.005 (this line already exists, remove the // and change value as per your shunts).
Make sure it comes above the HW_VERSION define statement.

as you probably have already done, uncomment this :
#define HW_VERSION_46 // Also for 4.7

Around line 85 :
#define ENCODER_ENABLE 1

Then save / compile / upgrade / enjoy.

I think it is better to change Shunt value in conf_general.h than in the hw_46.h file as Rew suggests, but it is also possible.

It is wise to use a power supply with a current limit to test a Vesc after compiling your own firmware..


[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1236: count(): Parameter must be an array or an object that implements Countable

Return to “FOC”

Who is online

Users browsing this forum: No registered users and 1 guest