Reverse direction not as smooth as forward.

General topics and discussions about the VESC and its development.
duststorm
Posts: 7
Joined: 06 Apr 2017, 12:59

Reverse direction not as smooth as forward.

Postby duststorm » 06 Apr 2017, 14:38

Hello,

I'm experimenting with the VESC, running a HALL sensored motor and experience some non-symetrical behaviour when trying to run it.
I am using BLDC mode, as I'd like to get a good grasp of that before moving over to FOC. Also I haven't found the parameters yet to make it run smoothly on FOC.

I'm using this small motor for testing: https://uk.rs-online.com/web/p/dc-motor ... m=536-6024
There's no load on the motor, it's not connected to anything.

With BLDC and HALL:
When I'm driving it at 3A current control forward, it runs smoothly.
When I run it at -3A in the reverse direction it runs, but a lot slower and less efficient. It draws A LOT more current of the power supply as well.
I find it odd that I'm not seeing symmetrical behaviour in both directions. Can somebody point me to where the difference might be?

With BLDC and no HALL:
When I try the same thing sensorless, it spins smoothly in both directions, the behaviour is perfectly symmetrical.
My tuning for sensorless is not quite perfect, so I sometimes need to make it jumpstart by turning the rotor just before applying current to get it to work (also this is perfectly symmetrical). I have no such problems with HALL, so the sensors must be doing their job getting the motor started at lower speeds.

Does BLDC mode use HALL sensors at high speeds? Or does it switch to sensorless from a certain RPM threshold, just like FOC does? If BLDC HALL runs sensorless at higher speeds, then this is another odd thing I don't understand: At 3A, this little motor is running at top speed, so if it switches to sensorless for these speeds anyway, then why is it not running as smoothly in reverse direction as it is when doing sensorless?

arvidb
Posts: 223
Joined: 26 Dec 2015, 14:38
Location: Sweden, Stockholm

Re: Reverse direction not as smooth as forward.

Postby arvidb » 06 Apr 2017, 20:09

I noticed this too and wondered about it but haven't had the time to look into it further.

Perhaps a small misalignment of the hall sensors could cause this? It does run worse in one direction through the whole speed range, so if the VESC switches to sensorless over a certain rpm (which I don't remember if it does in BLDC mode), then we can't blame the hall sensors.

duststorm
Posts: 7
Joined: 06 Apr 2017, 12:59

Re: Reverse direction not as smooth as forward.

Postby duststorm » 07 Apr 2017, 08:24

Since it's running perfectly at high speed in sensorless mode, it probably uses hall sensors all the time in BLDC mode?

I'll have a look at the source code.

Does anyone know whether it is possible that motors have their hall sensors assymetrically positioned? That for example, the sensor is placed slightly before the phase, so that in one direction running it using sensors will be smooth, but not so much in the other direction?

duststorm
Posts: 7
Joined: 06 Apr 2017, 12:59

Re: Reverse direction not as smooth as forward.

Postby duststorm » 07 Apr 2017, 08:31

Aha, I think I spotted it.

Code: Select all

static void update_sensor_mode(void) {
   if (conf->sensor_mode == SENSOR_MODE_SENSORLESS ||
         (conf->sensor_mode == SENSOR_MODE_HYBRID &&
               fabsf(mcpwm_get_rpm()) > conf->hall_sl_erpm)) {
      sensorless_now = true;
   } else {
      sensorless_now = false;
   }
}


So in BLDC mode, "sensored" uses HALL sensors only, at every RPM. Choose "Hybrid" mode to only use HALL sensors at lower speeds, and from a certain eRPM threshold switch to sensorless.

I guess also in BLDC mode sensorless will be more efficient than HALL at higher speeds?
Any pointers whether the hybrid mode is recommended or sub-optimal?


I'm still very interested if someone knows whether this could be due to physical HALL sensor placement on my motor.

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

Re: Reverse direction not as smooth as forward.

Postby benjamin » 07 Apr 2017, 08:45

There are a few problems with the hall sensor implementation in BLDC mode. Most motors are constructed such that the hall sensors give a bit of timing advance in the forward direction, and this means that the hall sensor signals are not symmetric for both directions and the motor will run better in one direction. This timing advance in one direction also leads to negative advance in the other direction, which does not perform well at all. If the advance is to high it is sometimes better to just add one to the output in the reverse direction to get a lot of positive advance instead, but whether this addition should be done depends on the amount of mechanical advance and the motor properties. Hybrid mode is a lot better as running sensorless at speed works much better in general.

The hall sensor implementation for FOC is completely different and does not get affected by this timing advance at all. It works by running the motor in open loop during detection and figuring out the exact hall sensor positions, and uses that information to interpolate the rotor position during runtime. The VESC4 has some reliability problems with FOC on motors with too low resistance and inductance (this is significantly improved on the VESC6), but for the motor you linked FOC should work fine on the VESC4. I strongly recommend giving FOC a try.

duststorm
Posts: 7
Joined: 06 Apr 2017, 12:59

Re: Reverse direction not as smooth as forward.

Postby duststorm » 07 Apr 2017, 11:26

Thanks. That confirms the suspicions I had :)

I definitely will try FOC as well. A quick first attempt with FOC did not get the motor running as smoothly, but I have yet to investigate tuning the parameters. I did try auto detection but I don't think the properties it received are very useful (the motor is not doing that much during detection so I guess that is to blame).

Probably the VESC4 was not tuned with motors like this in mind ;)

duststorm
Posts: 7
Joined: 06 Apr 2017, 12:59

Re: Reverse direction not as smooth as forward.

Postby duststorm » 11 Apr 2017, 11:54

I tried a different, beefier, motor, and it works a lot better.
I tried running the FOC algorithm on it, and after detecting the motor properties it does run a lot better than the other motor.

With both motors I notice that HALL sensor driving (in BLDC mode) works a lot better in one direction than the other. Moreover, I found the HALL/motor phase combination that reverse connects the motor, and now the motor runs smooth in the reverse direction, and worse in forward. This does confirm that the mechanical construction of the motor must be the cause of the observed asymmetry.

The bottom line is that FOC indeed handles HALL sensors a lot better, and should be the preferred choice if running the motor in both directions is desired.


I made another strange observation though. Running the motor in RPM mode (FOC with HALL) has a tendency to oscillate between + and - the desired RPM. The motor will run at the set RPM for half a second, then start reversing immediately with the same RPM, then forward again, ad infinum. I have not yet identified where the sign gets swapped. Might this be a bug or is this due to a configuration problem?

As for current control, while I notice that different current setpoints cause a change in the current drawn by the motor, the observed variation is a lot smaller than requested. A relatively small current range of input options (0.8A - 2.5A) has an impact (while going lower usually just stops the motor, and going above 2.5 won't have any added effect), but I notice it does go through a significant range of the possible duty cycles. Regardless the setting, the power supply indicates it's only drawing about 400mA, and only a very small change is observable when changing the current setting on the VESC. I am running the motor without a load, and I assume this is the cause for having so limited current control options. Is it correct that current control will only really have an impact when the motor is under load?

arvidb
Posts: 223
Joined: 26 Dec 2015, 14:38
Location: Sweden, Stockholm

Re: Reverse direction not as smooth as forward.

Postby arvidb » 12 Apr 2017, 09:50

duststorm wrote:I made another strange observation though. Running the motor in RPM mode (FOC with HALL) has a tendency to oscillate between + and - the desired RPM. The motor will run at the set RPM for half a second, then start reversing immediately with the same RPM, then forward again, ad infinum. I have not yet identified where the sign gets swapped. Might this be a bug or is this due to a configuration problem?

To me that sounds like the rpm PID controller is not tuned correctly (oscillation). The speed control implementation differs between BLDC and FOC modes, and therefore the PID values needed are very different between the two control modes.

duststorm wrote:Is it correct that current control will only really have an impact when the motor is under load?

Yes. The motor only draws current under load - the current is directly proportional to torque. So with no load the motor reaches top speed using only a minor current spike (to overcome its own inertia), and then only draws the current needed to overcome internal losses.

duststorm
Posts: 7
Joined: 06 Apr 2017, 12:59

Re: Reverse direction not as smooth as forward.

Postby duststorm » 12 Apr 2017, 10:08

Thanks for clarifying.

Yes indeed, I'm witnessing an oscillation.
Of course, why didn't I think of that. :geek: I'll try tweaking the PIDs of the speed controller.


benjamin wrote:The VESC4 has some reliability problems with FOC on motors with too low resistance and inductance (this is significantly improved on the VESC6)

That's very interesting. Would you mind going into more depth on which effects are at play that might hinder FOC performance, and what hardware changes you are considering to solve this?
Is this related to the phase voltages not being sampled precisely enough for the observer to properly estimate a position?


Return to “General”

Who is online

Users browsing this forum: No registered users and 3 guests