This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Motor knocking noise

Are there any elegant and simple solution to problems below?

1. There is a small motor movement accompanied by a knocking noise at the moment PWM outputs are enabled using HAL_enablePwm(halHandle). The movement and noise can be reduced following last post from here, but not totally. Current waveform shows a spike when this happens.

2. When disabling speed control when motor is running, current changes to 0 (IqRef_A) immediately. What can I do so that it will continue the wave shape until the next zero crossing?

I tried setting IqRef_A to the instantaneous current before turning off speed mode, using the codes below:

_iq currentIq = _IQmpy(CTRL_getIq_in_pu(ctrlHandle), _IQ(USER_IQ_FULL_SCALE_CURRENT_A));
gMotorVars.IqRef_A = currentIq;
CTRL_setFlag_enableSpeedCtrl(ctrlHandle, false);

Current waveform shows a glitch where current still fall back to 0 immediately, before changing to IqRef_A afterwards. The suddenly current drop to 0 and the glitch causes a faint knocking sound, which I need to get rid off.

  • Hi all

    Some updates on the issues mentioned in previous posts

    1a)  If PWM is disabled while InstaSPIN is running, the current Ui drifts and PWM duty cycle will drift from 50%, causing a current transient when PWM is re-enabled. Starting from zero speed, before enabling PWM I used the following code to initialize Id & Iq Ui to zero, and to make sure PWM starts at 50% duty cycle, ADC values for current are written with 0s before passing to CTRL_run().

    PID_setUi(obj->pidHandle_Id,_IQ(0.0));
    PID_setUi(obj->pidHandle_Iq,_IQ(0.0));
    gAdcData.I.value[0] = _IQ(0);
    gAdcData.I.value[1] = _IQ(0);
    gAdcData.I.value[2] = _IQ(0);
    CTRL_run(ctrlHandle,halHandle,&gAdcData,&gPwmData);
    HAL_writePwmData(halHandle,&gPwmData);
    CTRL_setup(ctrlHandle);
    HAL_enablePwm(halHandle);

    What would be the better way to init the PWM output?

    2) Attached capture when disabling speed control. Notice the current fall to zero before continuing at IqRef_A 

    Any help would be much appreciated.

  • The kick or sounds is basically because there is a torque disturbance, what I would suggest doing is to enable torque mode, so you command Iq to the current controllers, and reduce that Iq reference gradually to zero. In order to read the current commanded by the speed controller before disabling the speed controller you can do:

    // while in speed control mode:
    _iq currentIq_A = _IQmpy(CTRL_getSpd_out_pu(ctrlHandle), _IQ(USER_IQ_FULL_SCALE_CURRENT_A));

    // when you want to disable the speed controller:
    CTRL_setIq_ref_pu(ctrlHandle, _IQmpy(currentIq_A, _IQ(1.0 / USER_IQ_FULL_SCALE_CURRENT_A)));
    CTRL_setFlag_enableSpeedCtrl(ctrlHandle, false);

    Now, at that point, the motor will keep running with the same reference, but in torque mode. What you need to do next, is to slowly decrease that Iq reference to zero.

    if(_IQabs(currentIq_A) < min_current_A)
      {
        gMotorVars.Flag_Run_Identify = false;
      }
    else
      {
        if(currentIq_A > _IQ(0.0))
          {
            currentIq_A = currentIq_A - currentIq_delta_A;
          }
     else
          {
            currentIq_A = currentIq_A + currentIq_delta_A;
          }
        CTRL_setIq_ref_pu(ctrlHandle, _IQmpy(currentIq_A, _IQ(1.0 / USER_IQ_FULL_SCALE_CURRENT_A)));
      }

  • Thanks for the solution, I have tested it to work good. The glitch happens because of a delay before CTRL_setIq_ref_pu() is called after disabling speed control, it should be called before, not after.

  • That's a good point, yes, call CTRL_setIq_ref_pu() before disabling the speed controller to avoid a glitch.

    Glad it works

    -Jorge