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.

LAUNCHXL-F28069M: Why cannot ST-POSCONV show the stable and exact velocity info at the range of low speed?

Part Number: LAUNCHXL-F28069M
Other Parts Discussed in Thread: MOTORWARE

Dear MotorWare team,

I am using SpinTAC-Suite in my application and found an old thing is: the velocity/speed info which is calculated by:

gMotorVars.SpeedQEP_krpm = _IQmpy(STPOSCONV_getVelocityFiltered(stObj->posConvHandle), _IQ(ST_SPEED_KRPM_PER_PU));

which is placed in the updateGlobalVariables() function, always return unstable values when I set the reference velocity at low speed (below 15 to 20 RPM) for the velocity controller. Although the real speed on the motor shaft is still exact and stable.

How can I get the stable and exact velocity information to report them on plot/graph window when debugging?

In addition, in my project, the current position of the encoder QEP need to be sent to a PC software or a higher-level controller to observe and verify this information, but when I used the HAL_getQepPosnCounts() function, I only received the roll-over position value from 0 to (4*USER_MOTOR_ENCODER_LINES-1). How can I get the absolute position information which is defined as a position in comparison with the home position (at QPOSCNT = 0).

Thank you for your support in advance!

  • Tran,

    Can you clarify:

    Tran Binh Duong said:
    always return unstable values

    What do you mean by unstable value?  Is it possible that the signal you are looking at is aliased and appears unstable due to the aliasing?

    You can adjust the low pass filter for SpinTAC Position Converter to smooth out this signal.

  • Dear Adam,

    Thank you for your reply. I am using the default settings for SpinTAC Position Converter like Project Lab13b and Lab13e. I run SpinTAC-MOVE with Velocity Mode to achieve an ability to control motor at very low velocity (below 5 RPM). I observed: The real speed at motor shaft is good (even at 0.1 RPM), but the internal variable which is used to get the velocity info from STPOSCONV_getVelocityFiltered() function showed the result on Watch window while debugging was not stable; it changed its value constantly at low speed. If I set the reference speed to above 50 RPM, it returns the stable results.

    How can I adjust the cut-off frequency of the low-pass filter which is used in SpinTAC Position Converter to smooth out this signal as your suggestion?

    Waiting for your feedback as soon as possible.

  • Tran Binh Duong said:
    function showed the result on Watch window while debugging was not stable

    This indicates that you are getting aliasing effects from the slow sample rate of the watch window.  If you look at this variable under a high frequency sample you will not see this issue.

    Tran Binh Duong said:
    How can I adjust the cut-off frequency of the low-pass filter which is used in SpinTAC Position Converter to smooth out this signal as your suggestion?

    Look for the function: STPOSCONV_setLowPassFilterTime_tick in the file spintac_pos_conv.h

  • Thanks Adam,

    I'll try to follow your guide and inform the result to you soon.

    Best regards,