cancel
Showing results for 
Search instead for 
Did you mean: 

MCSDK 5.4.3/5.4.4. FOC ,Sometimes after encoder alignment ,motor run reverse。

CQi.1
Associate

Hi!

I have an I-PMSM motor and interfaces an incremental encoder with A B ,without Z.

Sometimes after doing encoder alignment,the motor runs reverse to the max speed,and it will never recover until i do encoder alignment again。

I set the speed 30RPM,but when start ,the motor goes to -200+RPM.

Most time the motor runs well but sometimes the problem will happen.

(STM32 F303VCT6 ;PWM16000KHZ ;Main Sensor :Incremental Encoder2048 no Z-index)

I hope someone could help me figure out the problem.

Best wishes.

1 ACCEPTED SOLUTION

Accepted Solutions
Bardeen Lai
Associate III

Hi

  1. Please try to google "initial rotor position alignment method", you could get much more ideas to do proper alignment for incremental encoder. Once you get some ideas, modify the enc_align_ctrl.c, the default ST MCSDK just does the alignment once. However, you could do the alignment again after 10~100ms delay to wait for rotor stable. If your problem still persists, consider to use BDLC with Hall-Effect Sensor, drive it by using 6-steps together with sinusoidal PWM. It would even be less cost concern compared with incremental encoder. The efficiency is not bad, pretty close to FOC but the torque ripple is not as good as the FOC.
  2. Also, you could utilize ST Motor Control Workbench, run the Monitor, try to plot and study some Motor runtime variables, for example, Iq and Id (you should modify the MCI_***)
  3. Use oscilloscope to monitor the Ia, Ib (measured by ADCs), dump these values via DAC or PWM (you have to use RC to do conversion), whether these values look like sinusoidal wave forms
  4. Make sure your 3.3V or 5V DC, pk-pk < 100mV or even lower when the motor is not running. LDO is a good choose but power dissipation is an issue if VBus voltage is higher than 12VDC. I recommend that use DC-DC step down. ST provides many switching IC for this kind of applications.
  5. Again, use RLC filter (band-pass filter) to screen 16KHz ripples from the VBus to your MCU and Encoder

Cheers

View solution in original post

19 REPLIES 19
Laurent Ca...
Lead II

Dear CQi.1

Do you have still this problem to solve?

Best regards

Laurent Ca...

Hello Laurent Capella

I'm not CQi.1 but I'm having exactly the same problem. Very hard do debug because it happens so rarly. Any hints on where to start or how to resolve this Problem?

Best Regards

Dear Laurent Ca...

The problem is still there,your team told me it's a bad encoder alignment, increase the alignment currents and time ​may solve the problem, actually it decrease the error rate, but not solved.

So i added a step to check the alignment, if motor runs reverse,I do encoder alignment again.

Best wishes!

Consen Qi.

Laurent Ca...
Lead II

Dear @CQi.1​ , dear @Pascal Klingelhöfer​ 

I do not know if it will help, but according to our "STM32 Forum rules", could you detail your HW configuration (boards, and so on).

Best Regards

Laurent Ca...

Hello Laurent. @Laurent Ca...​ 

I have the same issue and I contacted Japan local team already not yet have the answer

My hardware:

SPIN3201 board, a hub motor, 10 pairs, 340rpm max

start up config:

700ms, 90 degree, 1.95A as default,

use encoder solution, 1024 resolution.

it has about 3% chance that alignment failed in my case. when alignment failed, the speed is -456rpm.

what I can find is that:

when using encoder, the motor started with sensorless, so when I align it to 90 degree, the position the driver got is not that accurate. (maybe sometimes 700ms passed but it has not reach 90 degree, sometimes it just reached and 700ms passed and the rotor moved slight because of initia)

this struck me for about one month.

Dear @ypu​ 

Did you received answer from ST japan local support team?

Best regards

Laurent Ca...

Dear @CQi.1 (Community Member)​ , dear @intek (Community Member)​ 

Any news?

Best Regards

Laurent Ca...

ypu
Associate II

No...

Bardeen Lai
Associate III

Hi, there are possible solutions to fix your problem:

  1. The alignment current could be too small, try to increase the alignment current to motor nominal current. Increase even more close to maximum rated motor current if the motor is under heavy load. Besides, you could also fine tune the alignment duration, for example, 2000ms
  2. Depending on the quality of motor, some motor manufacturer could not align the motor properly in the factory, you could modify the FOC high frequency interrupt procedure
void ADC1_2_IRQHandler(void)
{
    ADC1->SR &= ~(uint32_t) (ADC_FLAG_JEOC | ADC_FLAG_JSTRT);
 
    qd_t Iqd, Vqd;
    ab_t Iab;
    SpeednPosFdbk_Handle_t *speedHandle = STC_GetSpeedSensor(pSTC[M1 ]);
    int16_t hElAngle = SPD_GetElAngle(speedHandle) + m_eAngleAdjustment;
.
.
.
}

NOTE: the variable m_eAngleAdjustment is s16degree, you could try to fine tune the electrical angle between -30 to +30 degree which could adjust the encoder vs rotor magnet miss alignment angle.

Hope can you.

Best regards