Fast Current control with reverse

General topics and discussions about the VESC and its development.
benjamin
Site Admin
Posts: 280
Joined: 15 Dec 2015, 08:38
Location: Sweden
Contact:

Re: Fast Current control with reverse

Postby benjamin » 07 Apr 2017, 06:58

It sounds like the current controller could be a bit too fast. Try setting the time constant for calculating kp and ki to 2000 µS and try with those values.

blezalex
Posts: 10
Joined: 05 Apr 2017, 04:51
Location: US
[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: Fast Current control with reverse

Postby blezalex » 07 Apr 2017, 16:17


blezalex
Posts: 10
Joined: 05 Apr 2017, 04:51
Location: US
[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: Fast Current control with reverse

Postby blezalex » 09 Apr 2017, 01:54

Found the time constant.

With TC=2000 it works better, but still losses sync under load.
I also noticed that if i sent 0->30A current request motor clicks a few times (though it goes to top speed rather quick).

With TC=4000 I don't get those clicks and seems like motor runs much smoother, but it also seems like it becomes too slow for balancing application board falls to the other side before controller gives enough torque to counter than.

With TC=500 i can still ride the bord. Sync seems to go worse - torque is much lower.

I also played with observer gain, but that does not seem to have much effect (I tested at low speeds)

Is there anything else I can do? I'd really like to use your firmware in my balancing application..

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

Re: Fast Current control with reverse

Postby benjamin » 11 Apr 2017, 07:47


blezalex
Posts: 10
Joined: 05 Apr 2017, 04:51
Location: US
[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: Fast Current control with reverse

Postby blezalex » 12 Apr 2017, 07:49

I asked for 36V 500W version (not sure if they shipped what I asked for :) )

It seems to survive short busts of 40A current just fine..

I lowered current limit from 60 to 40A and got a big improvement, still not 100% stable though.

Then I tried the code modification - with 0.1 I seems to work significantly better than without the change. With 0.2 it seems to loose power and sync issues are back again. (I need to re-tests this).

The two issues I observe with 0.1 setting are:
1. Very short sync issues 1-2 clicks per deceleration. For very rapid deceleration it may loose sync completely but that happens very rarely now.
2. Seems like controller has a noticeable lag, board feels very soft, a lot like surfing (As if i'm standing on the water, not solid floor)

Do you have a quick way to re-flash the controller but keep EEPROM? I'm afraid I can forget to restore something after a flash.

Is there an easy way to produce a log file to see what is going on with the motor?

Here is the data I collected with my primitive ESC firmware (it runs as BLDC, DUTY control with reverse)

Battery 10s
10 seconds of ride time (sampled each 5ms)
Duty: range [-510, 510]



Current:



Data in CSV: https://www.dropbox.com/s/12gdm3nvdz6q00o/data.csv?dl=0

e-biker
Posts: 18
Joined: 14 Aug 2016, 13:20
Location: Lithuania
[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: Fast Current control with reverse

Postby e-biker » 12 Apr 2017, 09:45

Hi blezalex,

You can save all your settings to XML file, then load it back. To log data you can simply create array in the code to store data witch you need, then read it via terminal.

There may be two reasons why your's board feels soft (only my opinion):

1. To big TC constant. I've noticed that "lag" on my ebike then i increased it to 4us.
2. There could be an isue with to low current. Maybe there is not enough power to correct it instantly.

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: Fast Current control with reverse

Postby rew » 13 Apr 2017, 07:34


blezalex
Posts: 10
Joined: 05 Apr 2017, 04:51
Location: US
[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: Fast Current control with reverse

Postby blezalex » 26 Apr 2017, 01:21

Here is the source code for controller if you interested https://github.com/blezalex/WheelBoardMain. I just finished porting it from Arduino, still needs a lot of cleanup.


I still have those issues with FOC. I wonder if raising battery voltage and reducing max current can help with saturation..

blezalex
Posts: 10
Joined: 05 Apr 2017, 04:51
Location: US
[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: Fast Current control with reverse

Postby blezalex » 13 Sep 2017, 21:30

It turns out my problem was setting sensorless ERPM too low. motor max rmp is 4200, I assumed 1000 would be a good value, turns out 2000 is a good value :)

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: Fast Current control with reverse

Postby rew » 14 Sep 2017, 17:17

My guess is that the FOC-parameters (R, L , lambda etc) are not correctly set. Then once the "sensorless" kicks in, you get into trouble. Postponing it for a speed where it somehow doesn't matter is ignoring the problem. Might be a good workaround for you, but it isn't the best solution.

Sensorless should be possible from about 10% of MAX RPM. About 420RPM in your case.


[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 “General”

Who is online

Users browsing this forum: No registered users and 1 guest