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.

what is the relation between the Ki,Kp and Sample Frequency?

Other Parts Discussed in Thread: MOTORWARE

Hi everyone,

I found the section 12.2 of  spruhj1c.pdf explains how to calculate the value of Kp,Ki in a PI regulator, Ki = R/L, Kp=L*Bandwidth, equation 37 and 38 on page 305.

But what is the relation between the Ki,Kp and Sample Frequency?

Could you give me any hints? Thanks!

Eli

  • for the current controllers, the equations for how we calculate the default gains are 

    Kp: = [IQ_Current / IQ_Voltage] * Ls * Frequency * 0.25

    [the 0.25 just reduces the gain from ideal stiffness to enable wider initial stability across more motors; for high performance you must increase this back to the full limit and we recommend doing step response testing to tune for your system[

    Ki= Rs / Ls / Frequency

    [during the motor ID process we use the initial RoverL high frequency estimation to set this value]

  • Hi Igor,

    Thanks. your hint is helpful.

    Eli

  • Hi ChrisClearman ,

         Sorry! I have another question about this. If I want to change the PI structure to the incremental form, do the equations to calculate the Kp, Ki  need to be modified? Thanks!

     

  • what do you mean the incremental form?

    are you using a different PID controller than the one provided in MotorWare?

     

  • Hi,

        The incremental form of PID means the output of the PID regulator is not the final output U(k),  just the increment deta_U referes to the last time output U(k-1), so the U(k) = U(k-1)+deta_U.

         If you don't mind, we can communicate with E-mail, then I can give you more detailed information.

         Thanks!

    Eli

  • I know it might be a stupid question, but what is IQ_current and IQ_voltage?

    /Jens

  • beyond the comments that are in the user.h? Essentially they are used to create a per-unit value for all voltages/currents in the system.

    //! \brief Defines the full scale current for the IQ variables, A
    //! \brief All currents are converted into (pu) based on the ratio to this value
    //! \brief WARNING: this value MUST be larger than the maximum current readings that you are expecting from the motor or the reading will roll over to 0, creating a control issue
    #define USER_IQ_FULL_SCALE_CURRENT_A (10.0) // 10.0 Example for hvkit_rev1p1 typical usage

    //! \brief Defines full scale value for the IQ30 variable of Voltage inside the system
    //! \brief All voltages are converted into (pu) based on the ratio to this value
    //! \brief WARNING: this value MUST meet the following condition: USER_IQ_FULL_SCALE_VOLTAGE_V > 0.5 * USER_MOTOR_MAX_CURRENT * USER_MOTOR_Ls_d * USER_VOLTAGE_FILTER_POLE_rps,
    //! \brief WARNING: otherwise the value can saturate and roll-over, causing an inaccurate value
    //! \brief WARNING: this value is OFTEN greater than the maximum measured ADC value, especially with high Bemf motors operating at higher than rated speeds
    //! \brief WARNING: if you know the value of your Bemf constant, and you know you are operating at a multiple speed due to field weakening, be sure to set this value higher than the expected Bemf voltage
    //! \brief It is recommended to start with a value ~3x greater than the USER_ADC_FULL_SCALE_VOLTAGE_V and increase to 4-5x if scenarios where a Bemf calculation may exceed these limits
    //! \brief This value is also used to calculate the minimum flux value: USER_IQ_FULL_SCALE_VOLTAGE_V/USER_EST_FREQ_Hz/0.7
    #define USER_IQ_FULL_SCALE_VOLTAGE_V (450.0) // 450.0 Example for hvkit_rev1p1 typical usage