You are here

Can bus and BLDC vs FOC

5 posts / 0 new
Last post
Torbjorn
Offline
Last seen: 1 year 4 months ago
Joined: 2022-10-12 13:40
Posts: 7
Can bus and BLDC vs FOC

Hi. I am experiencing a somewhat strange problem. I am tuning a T-motor multicopter motor for a VTOL UAV, and I am connecting it to the system using DRONECAN (UAVCAN). I have tried tuning the motor using both BLDC and FOC, and both give me a different set of problems.

1. FOC: For this mode, I get a reasonable ok motor tuning, but the problem here is that the motor only works for a few seconds before it stops, and then it turns out that the can bus seems to be shut down. There are some units still on the bus, but the autopilot and some others are not there anymore.

2. BLDC: Here the system never drops out of the can bus, but the motor does not behave good, especially not when it is stopped, then it humms a lot and VESC tool show it still goes some amps through it. It also varies a lot in performance between tests, sometimes it coggs and doesn't start.

My conclusions are that I seem unable to tune BLDC mode good, and FOC mode may have some challenges related to keeping the communication steady (I have also experienced that vesc tool looses comms with it during testing). Can it be related to the fact that FOC is more computationally intensive than BLDC?

This may be settings-related, but I have no idea where to start.

frank
Offline
Last seen: 4 days 15 hours ago
VESC BronzeVESC FreeVESC GoldVESC OriginalVESC PlatinumVESC Silver
Joined: 2016-12-27 20:19
Posts: 847

Have a look here: https://www.youtube.com/watch?v=VGnYwuCFPi8&t=23s

and here: https://www.youtube.com/watch?v=ui_6O5GrbnQ&t=2472s

You probably trigger a fault and the unit re-boots. You can do some logging to your phone or computer and look up the faults in the CSV file.

Torbjorn
Offline
Last seen: 1 year 4 months ago
Joined: 2022-10-12 13:40
Posts: 7

I wil have to look more into that, but one test now, with FOC, went like this:

1. Armed and started motor, ran it for 10 seconds then stopped/disarmed

2. Tried to repeat, but it would not start even though the AP armed. Canbus still has some packets but most are absent after first disarm (this does not happen when BLDC mode is configured)

3. Checked the dev tools terminal, and faults reported none since startup, uptime reported above 1000s (so it has not rebooted it seems).

4. Events total: 30, the last ones are "set duty", "release_motor_override", "set current brake" (last one at 0 sec ago every time I check).

Torbjorn
Offline
Last seen: 1 year 4 months ago
Joined: 2022-10-12 13:40
Posts: 7

I ran some testing while using the debug console, and attempted to interpret the data. After disarming, I no longer was able to command it using CAN BUS.

VESC_tool_debug.png

Torbjorn
Offline
Last seen: 1 year 4 months ago
Joined: 2022-10-12 13:40
Posts: 7

Hi again.

Looking more into this, it is clear that the problem I have using UAVCAN is FOC-algoritm related, since it consistently seems to shut down the CAN BUS when stopped, while BLDC does not (but I do not get usable tuning of BLDC).

Looking at the debug terminal, I get noe faults reported, but in the list of events I see the message "release_motor_override" 1 second after UAVCAN has set duty to 0.00. I assume this is according to timeout settings on the VESC, and so far it is desired behavour.

Then I see in the code that this event comes from the function mc_interface_release_motor_override(void) in the file bldc/mc_interface.c. This function distinguishes on what controller is used. For BLDC it appears to do nothing except add this event entry. For FOC it invokes the function pwm_foc_release_motor(void) in bldc/mcpwm_foc.c.

I am unable to find further what is happening, but the oscilloscope confirmes that once this happens, there is a lot of noise on the CAN BUS, then it goes almost silent, with only a minimum og status packets happening after that, and I need to restart the system for it to come back online on the bus. This is inconvenient for a VTOL UAV if it happens when it transitions to fixed wing mode.