0
\$\begingroup\$

I'm struggling with a FOC setup, which turns the motor better in one direction than the other and I really don't know, what I could do, to solve this problem, since nothing seems to change it.

enter image description here

You can see, that one direction has higher Id current spikes (depcited in red). So what I tried so far:

  • My first tought was an encoder alignement problem (magnetic absolute encoder), but this seems not to be the case, I can aligne the encoder on the back of the motor as I want, the good direction stays the same until I manually change the phases of the motor
  • Also the electrical angle is fine, I evaluated in manually with an oscilloscope and the performance of the good direction never gets worse than the bad direction when I adjust the electrical offset, up to extrem values.
  • Also an encoder delay is not the case, I tried also to compensate for the delay, up to extrem values, but the good direction never got worse than the bad direction.

From the current measurements, there seems a big difference when the motor is unloaded at +-800rpm. I measured directly the U-phase current and it seems, something goes wrong there, but I cannot see at the moment, what that could cause. Under load, the motor works quit well and the phase current looks the same in both directions.

Good direction U-phase current: enter image description here

Bad direction U-phase current: enter image description here

Here is also the SVPWM implementation, maybe here is something wrong:

float t1;
float t2;

/********************************/
/* Check for the correct sector */
/********************************/
if(foc.ctrl.vbeta_norm_mV >= 0.0f)
{
    if(foc.ctrl.valpha_norm_mV >= 0.0f)
    {
        if(ONE_BY_SQRT3 * foc.ctrl.vbeta_norm_mV > foc.ctrl.valpha_norm_mV)
        {
            foc.svpwm.sector = 2;
        }
        else
        {
            foc.svpwm.sector = 1;
        }
    }
    else
    {
        if(-ONE_BY_SQRT3 * foc.ctrl.vbeta_norm_mV > foc.ctrl.valpha_norm_mV)
        {
            foc.svpwm.sector = 3;
        }
        else
        {
            foc.svpwm.sector = 2;
        }
    }
}
else
{
    if(foc.ctrl.valpha_norm_mV >= 0.0f)
    {
        if(-ONE_BY_SQRT3 * foc.ctrl.vbeta_norm_mV > foc.ctrl.valpha_norm_mV)
        {
            foc.svpwm.sector = 5;
        }
        else
        {
            foc.svpwm.sector = 6;
        }
    }
    else
    {
        if(ONE_BY_SQRT3 * foc.ctrl.vbeta_norm_mV > foc.ctrl.valpha_norm_mV)
        {
            foc.svpwm.sector = 4;
        }
        else
        {
            foc.svpwm.sector = 5;
        }
    }
}

/************************************************/
/* Calculate the sector depending SVPWM timings */
/************************************************/
switch (foc.svpwm.sector)
{
    case 1:
        t1 = foc.ctrl.valpha_norm_mV - ONE_BY_SQRT3 * foc.ctrl.vbeta_norm_mV;
        t2 = TWO_BY_SQRT3 * foc.ctrl.vbeta_norm_mV;

        /********************************/
        /* Calculate the PWM Timings    */
        /********************************/
        foc.svpwm.tU_s = (1.0f - t1 - t2) * 0.5f;
        foc.svpwm.tV_s = foc.svpwm.tU_s + t1;
        foc.svpwm.tW_s = foc.svpwm.tV_s + t2;
        break;
    case 2:
        t1 = foc.ctrl.valpha_norm_mV + ONE_BY_SQRT3 * foc.ctrl.vbeta_norm_mV;
        t2 = -foc.ctrl.valpha_norm_mV + ONE_BY_SQRT3 * foc.ctrl.vbeta_norm_mV;

        /********************************/
        /* Calculate the PWM Timings    */
        /********************************/
        foc.svpwm.tV_s = (1.0f - t1 - t2) * 0.5f;
        foc.svpwm.tU_s = foc.svpwm.tV_s + t2;
        foc.svpwm.tW_s = foc.svpwm.tU_s + t1;
        break;
    case 3:
        t1 = TWO_BY_SQRT3 *foc.ctrl.vbeta_norm_mV;
        t2 = - foc.ctrl.valpha_norm_mV - ONE_BY_SQRT3 * foc.ctrl.vbeta_norm_mV;

        /********************************/
        /* Calculate the PWM Timings    */
        /********************************/
        foc.svpwm.tV_s = (1.0f - t1 - t2) * 0.5f;
        foc.svpwm.tW_s = foc.svpwm.tV_s + t1;
        foc.svpwm.tU_s = foc.svpwm.tW_s + t2;
        break;
    case 4:
        t1 = -foc.ctrl.valpha_norm_mV + ONE_BY_SQRT3 * foc.ctrl.vbeta_norm_mV;
        t2 = -TWO_BY_SQRT3 * foc.ctrl.vbeta_norm_mV;

        /********************************/
        /* Calculate the PWM Timings    */
        /********************************/
        foc.svpwm.tW_s = (1.0f - t1 - t2) * 0.5f;
        foc.svpwm.tV_s = foc.svpwm.tW_s + t2;
        foc.svpwm.tU_s = foc.svpwm.tV_s + t1;
        break;
    case 5:
        t1 = -foc.ctrl.valpha_norm_mV - ONE_BY_SQRT3 * foc.ctrl.vbeta_norm_mV;
        t2 = foc.ctrl.valpha_norm_mV - ONE_BY_SQRT3 * foc.ctrl.vbeta_norm_mV;

        /********************************/
        /* Calculate the PWM Timings    */
        /********************************/
        foc.svpwm.tW_s = (1.0f - t1 - t2) * 0.5f;
        foc.svpwm.tU_s = foc.svpwm.tW_s + t1;
        foc.svpwm.tV_s = foc.svpwm.tU_s + t2;
        break;
    case 6:
        t1 = -TWO_BY_SQRT3 * foc.ctrl.vbeta_norm_mV;
        t2 = foc.ctrl.valpha_norm_mV + ONE_BY_SQRT3 * foc.ctrl.vbeta_norm_mV;

        /********************************/
        /* Calculate the PWM Timings    */
        /********************************/
        foc.svpwm.tU_s = (1.0f - t1 - t2) * 0.5f;
        foc.svpwm.tW_s = foc.svpwm.tU_s + t2;
        foc.svpwm.tV_s = foc.svpwm.tW_s + t1;
        break;

    default:
        return API_MCL_FOC_ERROR_SVPWM_FAILED;
        break;
}
\$\endgroup\$
2
  • \$\begingroup\$ you sure you got your rotor aligned correctly? \$\endgroup\$
    – user16222
    Mar 24, 2021 at 15:16
  • \$\begingroup\$ Yes, I did also manually adjust the offset around the measured offset and the phenomena still occured the same way \$\endgroup\$ Mar 25, 2021 at 6:21

1 Answer 1

1
\$\begingroup\$

TL;DR timing

There are 8 6 combinations of 3 phase vector control

ABC ACB BCA BAC CAB CBA

The correct two vectors must be swapped to match the independent phase reversal for 2 motor phases.

Only 1 sequence is correct in each direction.

Your bad direction may have the wrong combination.

I verified this on a 3ph 100 W fan recently which I modified to be reversible vbl. speed 4600 CFM (powered by 120Vac to 70Vdc). AS luck would have it I found the right connections on the last try, albeit there were Hall sensors. One bad combination reacted just like your plots appear.

(with a lack of DC RMS in 1 phase.)

Oh well justa guess.

To explore further, increase the time resolution on plots and examine acceleration and steady RPM in each direction. Or if you can, plot the 3 phase vectors as a Lissejou plot. (Another guess)

Anecdotal

Glad you got it working.
I've never tried FOC but here is a Webinar Zoom call today 1pm ESTfrom Powersimtech on FOC and high performance PMSM motors. for all who wish to attend free.

More Anecdotal FWIW to others

3 Ph motor reversal for attic roof vent remote-controlled forced air ventilation.

I've never tried FOC, but I reverse engineered a great Hall sensor design with a non-isolated 100W 4600 CFM fan, with FET cooling of course forced air cooling. Very quiet, smooth low acceleration vbl. speed pot which I intend to remote control and power by a weather sensor to the STM32 chip with a bridge controller to 6 FETs for hot day attic forced air ventilation with a 14" fan under a 12" square roof chimney vent.

Photos to follow

Host uC= STM32 They sanded off the most interesting IC part numbers, but I was still able to read them.

Drivers powered by line 120VAC to 75DC non-isolated to 3 pronged 14" Fan 4600 CFM Pre-driver 3ph 100W fan

enter image description here 425/400 ns 3pH full bridge MOS controller $1 from FORTIOR chips.

https://lcsc.com/product-detail/MOS-Drivers_Fortior-Tech-FD6536S_C97682.html (Detailed specs only to volume buyers)

My electrical mods to reverse fan direction. enter image description here enter image description here enter image description here STM8S 903K3T6 uC and FORTIER FD6536S MOS bridge controller enter image description here

Typical 3 Ph signals with PWM speed control. and great smooth acceleration so no surge currents controlled from STM32 firmware.

enter image description here

Fortier MOS controller nicer than this std. designenter image description here

enter image description here

Nice design tools enter image description here

\$\endgroup\$
4
  • \$\begingroup\$ Interesting, but does this really only lead to a "little bit" more noise in the Id vector? The motor seems to turn in both directions pretty good, as far as I know, an incorrect phase pair would lead to much worse effect such as uncontrollable. I will try each combination and give the result here. There should be only 6 combination of ABC, right? \$\endgroup\$ Mar 24, 2021 at 15:08
  • \$\begingroup\$ I tried all 6 combinations, but this seems not to solve the problem \$\endgroup\$ Mar 24, 2021 at 15:20
  • \$\begingroup\$ ok try XY plots and Z if you have it for ABC combos \$\endgroup\$ Mar 24, 2021 at 16:06
  • \$\begingroup\$ Ok, finally it was indeed that, there seems to be two working configurations, but one is noisier in one direction, thank you very much, was looking for this problem for month \$\endgroup\$ Mar 25, 2021 at 7:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.