cancel
Showing results for 
Search instead for 
Did you mean: 

SVPWM signal seems wrong for some Sectors on MCWSDK 5.4.8

Mateus P. Lourenco
Associate II

Hi guys, I'm new on this forum

I'm using the MCWSDK v5.4.8 to drive a custom control and power board on a big Hub motor (17" from YM) using hall sensors.
The simptom I'm facing is that every time I try to start the motor with a command as MC_ProgramTorqueRampMotor1 or MC_ProgramSpeedRampMotor1 the motor tries to start. It starts, turn for close to 1° and then abruptly stop right after.

I get a MC_SPEED_FDBK right after, because this event pulls lots of current from the power source. The power source protects it by cutting of the supply thus powering off the hall sensors.

While investigating the problem, we disconnected the phases wires and just connected the Hall connections to check the SVPWM signals for each sectors, by turning the motor by hand. We noticed that in some of the sectors, there is only one phase with a PWM signal while the other ones are either fully open (0% duty cycle) or fully closed (100% duty cycle) in a fashion that while one phase is open, the other is closed. I don't know if this behaviour is expected but I imagine that this is the cause to the overcurrent events.

The following contents are measures between phase output conection and GND
These consecutive sectors seems fine

MateusPLourenco_0-1691773187067.pngMateusPLourenco_0-1691773259018.pngMateusPLourenco_1-1691773287792.png

But these following consecutive states, doesn't

MateusPLourenco_2-1691773368356.pngMateusPLourenco_3-1691773380052.pngMateusPLourenco_4-1691773389402.png

The results is the following. Note that on these photos, the motor phase connections where connecte to the board and each phase was evaluated.

MateusPLourenco_5-1691773514709.pngMateusPLourenco_6-1691773528504.pngMateusPLourenco_7-1691773541176.png

These are the SVPWMs beeing generated while the power sourcer is shutting down due the overcurrent. Thats why it has this downward shape.

We know that on the OFFSET_CALIB state, all three phases are on 50% duty for calibration. But as soon as they get different values from each other, the power supply stops powering the circuit thus lowering the SVPWM signal voltage (as shown on the last image).

We already checked the deadtimes for shorts, and the 500ns value we setted up is ok.

My question are:

Why are these 3 sectors signals looks like this? Is this normal?
Is there a API  handdler to control the BUS current? We have ICS on phases A and B.

12 REPLIES 12
RhSilicon
Lead

Wouldn't it be possible to use a smaller Hub motor for tests, and after being able to understand how it works, start working with the bigger Hub motor?

We're acctually going after a smaller one as well. But since the final application will be on the bigger one, We're trying to figure out these described behaviour and if there some kind of limitation on the MCSDK side for these motors.

RhSilicon
Lead

What is the motivation for choosing SDK 5? The ST YouTube channel has several videos about Motor, and I found the SDK 5 initial presentation video from 5 years ago, but it already has the SDK 6 video from a year ago.

Getting started with STM32 Motor control SDK5.0

Getting started with STM32 Motor control SDK6.0

I found this too, I believe it might be interesting to research the subject further:

Long story short, the SVPWM technique isn’t a precise method of control for BLDC motors, but it does reasonably well as can be seen in the video.

https://jkboyce.github.io/electronics/2020/04/13/SVPWM-motor_control.html

The last time we checked the v6, it does not featured Isolated current sensor topology neither custom PCBs. That's why we using the v5.

We appreciate the Link for the GitHub project. We'll check it

Mateus P. Lourenco
Associate II

@Gael A Can you help me on this?
I men, are these 3 sectors right?
I also like to mention that on code auto generation, this low level function is auto generated using TIMx instead of TIM1. I mannualy correct this so it can complie, but Idk if this is right

on the ics_lm1_pwm_curr_fdbk.c file

LL_TIM_CC_EnableChannel( TIMx, TIMxCCER_MASK_CH123 );

MateusPLourenco_0-1692107710316.png

 

I also like to mention that on code auto generation, this low level function is auto generated using TIMx instead of TIM1. I mannualy correct this so it can complie, but Idk if this is right

No keep as TIMx dont change to TIM1.

Gael A
ST Employee

Hello Mateus P Lorenco,

From the look of it, maybe there is an issue with your Hall Sensor setup. Have you correctly configured your "Sensors displacement" and "Placement electrical angle" ? You can change them by clicking on the motor in your WorkBench project, then on "Sensors" tab.
The determination of both values is well explained in MCSDK 6.1.2 documentation. You can access it by executing WB 6.1.2, clicking "About", then "Documentations". The information you are looking for is at the end of the "Hall sensor feedback processing" section in the User Manual.

Hope this will help,
Gaël A.

If you agree with my answer, please consider accepting it by clicking on 'Accept as solution'.

Hope this will help,
Gaël A.

Hi @Gael A thanks for the sugestion.

From the following images I calculated 259° (-101°).

WhatsApp Image 2023-09-08 at 14.35.47.jpeg

WhatsApp Image 2023-09-08 at 14.35.47 (1).jpeg

But even changing that, the motor response on turn on was the same

WhatsApp Image 2023-09-08 at 14.35.46.jpeg

Phase A (Yellow)
Phase B (Light blue)
Phase C (Purple)
Current sensor (dark blue)

Note that the current sensor points 1.9V (450A -> 5V; 0A -> 2.5V; -450A -> 0V). This indicates -108A out of a 5Amax power supply. This event triggers the power supply protection, then reducing the Voltage output, as shown on the phase voltages.

What else could be doing it?

Take a look on the Phase U and Phase V currents

WhatsApp Image 2023-09-08 at 17.20.03.jpeg

 Phase U - Blue
   Phase V - Yellow

   When Phase U is on 67.5A (2.875V), Phase V is on -90A (2V), thus Phase W is on 22.5A.

Does it means that the motor is trying to pull 90A from the power supply?

The weird thing is that I'm trying to slowly feed current to the motor in a low value (0.5A max). But the inverter allways pulls these high currents values when trying to startup. Here's my start-up function 

void slowStart(void)
{
  int16_t targetTorque = (0 * 65536 * 0.004 ) / 3.3;
  MC_ProgramTorqueRampMotor1( targetTorque , 0 );
  MC_StartMotor1();
  for ( int i = 1; i < 5; i++ ){
    targetTorque = (i/10 * 65536 * 0.004 ) / 3.3;
    MC_ProgramTorqueRampMotor1( targetTorque , 0 );
    HAL_Delay( 500 );
  }
};

For such a low value of quadracture current, I would expect that the motor to slowly spin up, maybe not spin at all, but I'm facilng a uncontrolled input current instead. And that uncontrolled current generate this response on the motor:
https://drive.google.com/file/d/13-_p_30jhLF38HM_b355bChdO9DIniQ7/view?usp=sharing

I've already tried to do something like MC_ProgramTorqueRampMotor1( targetTorque , 2000 ), instead of the instantaneous ramp programing over a for loop, but same results.

The documentation doesn't explicitlly says how to convert Current to digits for Isolated current sensors, so I assume that is something like A_digit = (A_real * 65536 * ICS_gain)/3.3. Is that correct?