cancel
Showing results for 
Search instead for 
Did you mean: 

Loss of control whenever the motor starts at some specific points

RBrec.1
Associate III

Hi, I am currently developing position control using MCSDK and have stumbled upon a problem I cannot fix. Whenever the motor is positioned at some specific points it is not possible to start it up without it spinning out of control. I'm using a

  • BLDC with 10 pole pairs
  • Encoder, 2048 with index
  • I have 3 commutation signals (H120) available but not used
  • Nucleo G431RB
  • IHM08M1 3shunt motor driver

What I have found is that whenever Com U = low, Com V = high and Com W = low the motor starts to spin very fast in one direction, and do not stop. Meaning if I restart the program while the motor have these signals, it is inevitable. Often the motor stand still for a second (no movement at all) before going berserk.. At some of these points it can recover and move away before losing control if there is no load, but seems to fail if I give it even a little resistance.

Has anyone encountered a similar problem?

13 REPLIES 13
cedric H
ST Employee

Hello @RBrec.1​ ,

Could you test first the MCSDK with speed mode in order to be sure that your motor is correctly connected. From what you describe, it sounds like your phases are not properly connected. Be careful that in sensor mode, phase order does matter. Encoder signals connection order is also important.

Only once you are able to properly control your motor in speed mode, you can try to generate your project for positioning control. Do not forget to load the positioning control UI from the pilot to have access to the positioning control command.

Regards

Cedric

RBrec.1
Associate III

Hi @cedric H​, thank you for reply

I have changed to speed control and implemented a simple ramp up/down test. I have also tried every combination of the three motor phases with both configurations of the two encoder signals. The only difference seems to be the change in direction if the correct combination of the encoder is used (it doesnt spin at all if the wrong combination is used), and that the points where the motor spins out of control changes. E.g. U = low, V = high, W = low, but nevertheless, it still do not work. Any other suggestions? At this point I believe the problem is more in general, considering that it fails for both speed and position.

Best regards

cedric H
ST Employee

Could you provide the version of the MCSDK you are using ?

Did you try to profile your motor with the profiler tool ?

Cedric

@cedric H​ 

I am using version 5.Y.3 (5.5.3?). The motor was profiled using the software. I also removed C3, C5 and C7, as well as R181 from the IHM08 board as sugggested in the user manual and info window for the profiler.

Best regards

I'm sorry, version 5.Y.2 is the one I'm using.

RBrec.1
Associate III

@cedric H​ 

To maybe complement the problem I can explain more in detail. Following the example in the position control application note from your website, the encoder index is aligned at first

  1. MC_StartMotor1();
  2. while (MC_GetAlignmentStatusMotor1() != TC_ALIGNMENT_COMPLETED) {}
  3. MC_StopMotor1();

After this I enter the while loop, where I start the motor again, give a position command and stop when it arrives there. The problem seems to be the first StartMotor command above. If the encoder is aligned successfully, the position control can start from any of the trouble-points mentioned earlier withouth any problem, again and again. This makes me suspect that something is not properly initialized the first time I call the StartMotor command, which I know is the problem itselft (It doesnt get stuck in the while loop in line 2..).

I also previous tried to initialize the motor and encoder everytime I pushed a button, and it worked just fine if it got past the initial encoder alignment. The problem is only whenever the motor has some specific position when the program is started.. Maybe this helps.

Best regards

Quentin Ch
Associate III

Hello,

I confirm I observed similar issue with:

  • MCSDK 5.Y.4
  • BLDC motor, 24V, 4 pairs of poles
  • FOC sensored with 1024 PPR encoder
  • Nucleo F401RE + IHM08M1 boards

In some rare cases, right after my system starts (reset of the Nucleo F401RE), the motor starts spinning very fast and out of control. While this occurs, I read no error flag and a frozen low speed of 10E-3 or so (read via UART and undocumented ASPEP protocol, so not 100% confident about this).

I could not check the phase levels.

This happens both in torque mode and in speed mode, and only after the first call to MC_StartMotor1() (done through ASPEP/MCP protocols and UART, calling MCP_START_MOTOR command).

I first proceed to current ramp for encoder alignment.

Motor was profiled with MCSDK tools and can be correctly controlled in other cases.

There is a gearbox with a little play between the load and the motor, in case it would be a cue.

I'm definitely looking for a solution or a workaround as this makes my robot prototype very dangerous.

Hello !

Just to check if I understood correctly: you mean that the alignment sometimes never completes ? ("It doesnt get stuck in the while loop")

And that's the MC_StartMotor1() at line 1 that trigger the out-of-control spinning ?

That is correct. Starting at the specific hall sensor configuration mentioned above resulted in out-of-control spinning when starting the first time. The only theory I have is that there is an overflow or underflow somewhere, resulting in a big value jump. The motor did spin very smooth so the motor driver must work fine, but when a high precision position control is needed, that doesnt help. It is a pretty weird bug I assume every motor would encounter at some point, but I was not able to solve it. The MCSDK was later abandoned for some other reasons too, so I have nothing else to say than good luck. But please, if either you or anyone else (or ST some time in the future) solve it, feel free to leave a comment. :D