FOC on Ebike hub Motor

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
jenkie2
Posts: 9
Joined: 22 Dec 2015, 14:00
[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 on Ebike hub Motor

Postby jenkie2 » 22 Dec 2015, 14:14

Hello forum,
I am trying to combine the VESC 4.10 with a 250W Ebike hub motor (geared). Firmware is 2.5. Supply for the tests is 30V/5A

Autodetection of BLCD parameters worked, in BLDC mode the motor is spinning and sounds smooth.

Autodetection of FOC parameters worked, too. However, in FOC mode the motor will usually not spin but only give a short noise and then stop with FAULT_CODE_DRV8302. If it eventually starts spinning the sound is not smooth.

I tried a higher startup boost but that did not help. I could not find a description of the additional parameters in FOC mode - can anyone give me a hint where to start optimizing? Has anyone determined FOC parameters for such a motor type?
Thanks in advance
Jens

Details of the fault code in FOC mode after unsuccessful start:
Fault : FAULT_CODE_DRV8302
Current : 0.4
Current filtered : 0.4
Voltage : 29.79
Duty : 0.08
RPM : 199.7
Tacho : 6
Cycles running : 4695
TIM duty : 433
TIM val samp : 5
TIM current samp : 5598
TIM top : 5600
Comm step : 0
Temperature : 24.68
Attachments
FOC.PNG
FOC.PNG (68.1 KiB) Viewed 4231 times
BLDC.PNG
BLDC.PNG (60.5 KiB) Viewed 4231 times
Advanced.PNG
Advanced.PNG (47.11 KiB) Viewed 4231 times

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

Re: FOC on Ebike hub Motor

Postby benjamin » 23 Dec 2015, 07:59

Hi,

I can't see any obvious problems with your setup. What did you set the current limits to?

A few things you can try:

* Decrease the switching frequency to something like 20 KHz
* Increase the time constant for calculating kp and ki to something like 2000µS

jenkie2
Posts: 9
Joined: 22 Dec 2015, 14:00
[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 on Ebike hub Motor

Postby jenkie2 » 23 Dec 2015, 18:59

Hi Benjamin,
thanks for the quick answer!
My current limits were 5A battery current and 10A phase current.

Do you mean changing "TC" and recalculate regulator parameters, or do I have to set the timeconstant elsewhere? What about DTc?

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

Re: FOC on Ebike hub Motor

Postby benjamin » 23 Dec 2015, 19:10

Yes, I mean TC. You should not change DTc unless you have different FETs, because this is the dead time compensation. Decreasing the switching frequency can also help.

Also, I think you can run at least 15A phase current in that motor later, but you can start with 10.

jenkie2
Posts: 9
Joined: 22 Dec 2015, 14:00
[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 on Ebike hub Motor

Postby jenkie2 » 23 Dec 2015, 19:52

Yes I think 15A should easily be possible, I just wanted to start with a lower value while testing with a lab supply.
I will we able to go on testing by beginning of january and will keep this thread updated.

jenkie2
Posts: 9
Joined: 22 Dec 2015, 14:00
[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 on Ebike hub Motor

Postby jenkie2 » 01 Jan 2016, 17:23

I saw that FW 2.7 is online so I updated the firmware with the following results:
- BLCD mode works perfect
- FOC runs very smooth, in less than 1 of 10 cases the motor does not start up under load
- The sensorless startup time and torque is amazing, great work!

I changed the following parameters:
F_SW to 20 kHz (better startup than with 25 or 30 kHz)
TC to 1000 µs (better startup than 1500 or 2000 µs)

Street testing will happen tomorrow :)

One question: is there a possibility to configure that the controller will re-try to start the motor after x seconds if the startup fails?

Edit: Solved, I found the "fault stop time" variable and disabled "safe start" for the ADC app which I use. I set the fault stop time to 100ms. This works like a charm because the controller immediately tries to start again after an unsuccessful attempt.
Attachments
FOC.PNG
FOC.PNG (63.78 KiB) Viewed 3895 times

schwibsi
Posts: 7
Joined: 03 May 2016, 15:03
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 on Ebike hub Motor

Postby schwibsi » 05 May 2016, 14:33

Sorry, for hijacking this thread.
I have a similar problem with an ebike mid-drive motor.
Under load it often doesn't start up and when it does, it's not smooth but comes with a punch.

2016-05-05.png
2016-05-05.png (113.14 KiB) Viewed 3364 times


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