FOC RPM control keeps reversing direction

Discussions regarding the Field Oriented Control (FOC) implementation on the VESC.
[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
erwincoumans
Posts: 25
Joined: 16 Dec 2015, 02:16
[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 RPM control keeps reversing direction

Postby erwincoumans » 13 Feb 2016, 01:48

When selecting RPM control in FOC mode, the motor spins backward and forward instead of reaching a steady RPM.
This happens in both FOC with encoder and FOC sensorless. When using 'BLDC' mode it works just fine.

Is that a known issue or any workaround?

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

Re: FOC RPM control keeps reversing direction

Postby benjamin » 14 Feb 2016, 12:48

This is because the RPM loop in FOC is current based and not voltage based as with BLDC, so the control parameters need to be different. You can tune them in the Motor configuration > advanced tab. For my longboard I'm currently using:

KP: 0,00400
KI: 0,03250
KD: 0,00020

Those values are by no means optimal, I just spent a minute or so playing around with them. You can also experiment with them a bit until it feels ok. There are a few strategies that you can use for manually tuning the PID loop:
http://robotics.stackexchange.com/quest ... -pid-loops

whitepony
Posts: 38
Joined: 02 Jan 2016, 19:57
Location: Germany
[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 RPM control keeps reversing direction

Postby whitepony » 14 Feb 2016, 19:57

its weird how you always end up with such large integral parts. the default configuration was undriveable for me with an rspecc 6355 in BLCD settings and nunchuck cruise control button. :?

the parameters dont make much sense when you are used to classic PID values, where proportional is ALWAYS the dominant term and integral/differential term are just the little helpers. my setup worked quite well already with just an increased proportional part.

I also noticed really weird behavior with cruise control in FOC mode (release 2.15), even without any load. there is a strong integral part that speeds up the motor wayyy beyond the cruise control set speed. i didnt spend much time playing around though, the weather was nice, so I quickly went back to BLCD to empty another battery. ill have a closer look in spring when I have more days for enjoying the board and less urge to just riding it. 8-)

wdaehn
Posts: 24
Joined: 10 Feb 2016, 10:21
[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 RPM control keeps reversing direction

Postby wdaehn » 15 Feb 2016, 11:29

Last edited by wdaehn on 17 Feb 2016, 18:07, edited 1 time in total.

whitepony
Posts: 38
Joined: 02 Jan 2016, 19:57
Location: Germany
[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 RPM control keeps reversing direction

Postby whitepony » 15 Feb 2016, 15:28

an integral is an integral, its just better or worse approximated by the summand "value x dt" depending on the width of the interval dt. if you call the sum 100x per second, ta will be 1/100th, anything else would be extremely misleading. either way, it roughly leads to the same value.

same with the differential, which is always normalized by the interval (see differential quotient).

wdaehn
Posts: 24
Joined: 10 Feb 2016, 10:21
[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 RPM control keeps reversing direction

Postby wdaehn » 16 Feb 2016, 18:09

True. That does not explain the factor then. :?

kitewinder
Posts: 19
Joined: 29 May 2017, 20:47
Location: Bordeaux
[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 RPM control keeps reversing direction

Postby kitewinder » 17 Aug 2018, 14:19

I tried to tune the pid values as described but my motor keeps reversing .
did this tuning solve the problme finally or is there something else?

olivier

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 RPM control keeps reversing direction

Postby pf26 » 20 Aug 2018, 09:37

I think the speed control based on motor current is very hard to achieve with a PID, especially when your motor has strong load variations and little inertia. The strong currents required for high loading will cause very high acceleration should the load cease.
A voltage based speed regulation is much easier, since motor speed variations automatically translate into current variations, leading to a torque to be applied nearly adequately, even when the voltage control did not even start reacting. Unfortunaltey, FOC requires current based control.


[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
[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