VESC not allowing feathered braking when going downhill slowly

General topics and discussions about the VESC and its development.
hohungyi
Posts: 15
Joined: 03 Jun 2017, 12:19
Location: Singapore

VESC not allowing feathered braking when going downhill slowly

Postby hohungyi » 03 Jun 2017, 12:42

Hi, was wondering if anybody else has the same issue as below which I'm experiencing, where my VESC goes into a full braking mode and does not allow for modulation of the braking force when i'm going downhill slowly. Normally at speed, my VESC works perfectly fine when braking, i.e. there is modulation of the braking force.

However, I have found that this is not the case when i'm trying to go slow downhill, and when I apply a brake force until it hits maximum, I will not be able to modulate the braking anymore and the brake force remains at maximum. It is only when I release the trigger close to neutral when the VESC totally lets go and starts to coast downhill.

This is quite concerning as sometimes when you are trying to navigate traffic going downhill, not having the ability to modulate braking and speed becomes a little concerning.

I have tried to make the following adjustments in BLDC Tool but nothing seems to solve the problem:

1. Varying motor and battery current limits and absolute max settings
2. Bringing max ERPM at full brake down to 0 (not recommended but had to try)
3. Varying PPM pulsewidth limits

Would anybody be able to point me in another direction to investigate how I'm able to continue modulating the braking after getting to max brake? Any advise would be appreciated. I'm not sure if it is a voltage issue or the fact that my motor is sensorless, it does not look like either of these could be the cause, but I could be wrong.

I've posted a image file of the realtime capture of data from the VESC on a flat ground going into full brake and releasing pulsewidth into neutral. The jump from full brake to no brake is seen in the circled portion.

My battery/motor setup is as below:

Motor: 5065 Sensorless 190kv
Battery Setup: 9S2P Li-ion

Would appreciate any advice! Thanks!

Screen Shot 2017-05-14 at 5.44.12 PM.png
Screen Shot 2017-05-14 at 5.44.12 PM.png (160.73 KiB) Viewed 1076 times

pf26
Posts: 278
Joined: 28 Mar 2016, 14:37
Location: FR Valence

Re: VESC not allowing feathered braking when going downhill slowly

Postby pf26 » 03 Jun 2017, 16:48

If you are using FOC, I think the reason is in mcpwm_foc.c, there :

Code: Select all

      if (m_control_mode == CONTROL_MODE_CURRENT_BRAKE
            && (m_conf->foc_sensor_mode != FOC_SENSOR_MODE_ENCODER)
            && fabsf(duty_filtered) < 0.03) {
         control_duty = true;
         duty_set = 0.0;
      }

Maybe something like this instead :

Code: Select all

      if (m_control_mode == CONTROL_MODE_CURRENT_BRAKE
            && (m_conf->foc_sensor_mode != FOC_SENSOR_MODE_ENCODER)
            && fabsf(duty_filtered) < 0.03) {
   //      control_duty = true;   
   //      duty_set = 0.0;
            id_set_tmp = 0;
            iq_set_tmp = 0;
      }

I know I got rid of this issue, but I am not so sure there aren't any other changes I made.. Hope this helps.

hohungyi
Posts: 15
Joined: 03 Jun 2017, 12:19
Location: Singapore

Re: VESC not allowing feathered braking when going downhill slowly

Postby hohungyi » 05 Jun 2017, 05:54

Hi!

My apologies for not mentioning this in the original post, but I'm running the VESC in BLDC mode instead of FOC.

Incidentally, I applied FOC mode to the VESC and found that there was braking modulation across the entire braking pulsewidth, so I don't think it has to do with the fact the motor is sensorless.

Would you advise to make the changes you mentioned to the codes for BLDC mode instead of FOC?

I've attached some screenshots of my BLDC tool settings, if that helps.

Thanks for the advice!

Screen Shot 2017-06-05 at 1.34.31 PM.jpg
Screen Shot 2017-06-05 at 1.34.31 PM.jpg (685.79 KiB) Viewed 1024 times


Screen Shot 2017-06-05 at 1.35.18 PM.jpg
Screen Shot 2017-06-05 at 1.35.18 PM.jpg (802.46 KiB) Viewed 1024 times


Screen Shot 2017-06-05 at 1.35.30 PM.jpg
Screen Shot 2017-06-05 at 1.35.30 PM.jpg (547.31 KiB) Viewed 1024 times

rew
Posts: 904
Joined: 25 Mar 2016, 12:29
Location: Delft, Netherlands.

Re: VESC not allowing feathered braking when going downhill slowly

Postby rew » 05 Jun 2017, 07:42

hohungyi wrote:Incidentally, I applied FOC mode to the VESC and found that there was braking modulation across the entire braking pulsewidth, so I don't think it has to do with the fact the motor is sensorless.
FOC or BLDC, the electronics has to have a way to "measure" where the rotor is. That can be done using hall sensors, or using various electric tricks....

The tricks that CAN be used are entirely different between BLDC and FOC. In BLDC mode, two of the phases are driven, and the voltage on the third is measured. That provides enough information about when to proceed to the next "driving phase" so that the motor can turn.

When in FOC mode the trick is different: FOC mode always drives all three phases. You can predict the voltages at the three terminals without any measurement, because you know which phase is driven where. The trick is here to measure the resulting currents.

So, because the tricks are entirely different, the limits of those tricks might be different too. And they are.

hohungyi
Posts: 15
Joined: 03 Jun 2017, 12:19
Location: Singapore

Re: VESC not allowing feathered braking when going downhill slowly

Postby hohungyi » 05 Jun 2017, 08:13

Would these tricks be the same in the case of braking as well? I understand the methods of motor positioning in BLDC and FOC, but can't figure out why in BLDC sensorless mode the start up is relatively smooth, but braking at low RPM induces an automatic full brake.

I've also gone out to grab a sensored 5065 and replaced it on my board, put it up into sensored BLDC mode and the braking at low RPM is still all-or-nothing.

Very weird...

pf26
Posts: 278
Joined: 28 Mar 2016, 14:37
Location: FR Valence

Re: VESC not allowing feathered braking when going downhill slowly

Postby pf26 » 05 Jun 2017, 09:40

The code mod I proposed only applys to FOC mode.
For bldc mode, maybe you want to try and change the parameter named "max_ERPM_at_full_brake_in_control_mode" ?
Most likely you can't lower it too much, otherwise the position estimator may lose track..
To see how this is implemented, you can refer to the function "void mcpwm_set_brake_current(float current)" in mcpwm.c.

rew
Posts: 904
Joined: 25 Mar 2016, 12:29
Location: Delft, Netherlands.

Re: VESC not allowing feathered braking when going downhill slowly

Postby rew » 05 Jun 2017, 12:12

hohungyi wrote:Would these tricks be the same in the case of braking as well?
Yes. There are six "regions" in each (electrical) revolution. In each of these you need to put the battery across two of the three leads. (and there are exactly 6 ways to put a battery across two out of three leads). But turn the battery around and you're braking instead of pushing the motor forward.

hohungyi
Posts: 15
Joined: 03 Jun 2017, 12:19
Location: Singapore

Re: VESC not allowing feathered braking when going downhill slowly

Postby hohungyi » 05 Jun 2017, 12:52

pf26 wrote:The code mod I proposed only applys to FOC mode.
For bldc mode, maybe you want to try and change the parameter named "max_ERPM_at_full_brake_in_control_mode" ?
Most likely you can't lower it too much, otherwise the position estimator may lose track..
To see how this is implemented, you can refer to the function "void mcpwm_set_brake_current(float current)" in mcpwm.c.


I've adjusted the max ERPM settings (both normal and current control mode) from 0 to 1500 but either way the issue still persists. :(

I have half a mind to move the FOC braking function into mcpwm.c, not sure if it will work haha.

hohungyi
Posts: 15
Joined: 03 Jun 2017, 12:19
Location: Singapore

Re: VESC not allowing feathered braking when going downhill slowly

Postby hohungyi » 05 Jun 2017, 12:54

rew wrote:Yes. There are six "regions" in each (electrical) revolution. In each of these you need to put the battery across two of the three leads. (and there are exactly 6 ways to put a battery across two out of three leads). But turn the battery around and you're braking instead of pushing the motor forward.


Got it! I'll see what else I can do. The weird thing is that even when the new motor is in the sensored BLDC mode, it still presents the issue of full braking at low RPM.

Will continue to explore and update if I have any findings!

pf26
Posts: 278
Joined: 28 Mar 2016, 14:37
Location: FR Valence

Re: VESC not allowing feathered braking when going downhill slowly

Postby pf26 » 06 Jun 2017, 09:03

hohungyi wrote: move the FOC braking function into mcpwm.c

I don't think this is a good idea. FOC implementation and control is very different, especially for braking..
I don't understand why changing max ERPM settings has no effect. Maybe you can try to change the following function :
static void full_brake_ll(void) {
return; // Will prevent full braking
...


Return to “General”

Who is online

Users browsing this forum: No registered users and 2 guests