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.

DRV8301-69M-KIT: PID gains in user.c and ctrl.c

Part Number: DRV8301-69M-KIT

I observed we have 2 different PID equations.

In ctrl.c , 

Kp = _IQ(0.1);
Ki = _IQ(pUserParams->ctrlPeriod_sec/0.004);
Kd = _IQ(0.0);
outMin = _IQ(-0.95);
outMax = _IQ(0.95); and these values are called in main file in user_set_params () function

In user.c

RoverLs_d = Rs/Ls_d;
Kp_Id = _IQ((0.25*Ls_d*fullScaleCurrent)/(ctrlPeriod_sec*fullScaleVoltage));
Ki_Id = _IQ(RoverLs_d*ctrlPeriod_sec);

RoverLs_q = Rs/Ls_q;
Kp_Iq = _IQ((0.25*Ls_q*fullScaleCurrent)/(ctrlPeriod_sec*fullScaleVoltage));
Ki_Iq = _IQ(RoverLs_q*ctrlPeriod_sec);

Kd = _IQ(0.0); 

This equation is called in main in softwareupdate () function in main.

Why both PID's are different , in what condition which one is used?

2. What is difference between Instaspin -FOC and Instaspin -spintac. I understand if qep is used , we dont need speed loop to determine velocity but how this 2 block diagrams are different?  en

3. What equation are used in velocity plan , move and control if qep is not used in 2nd block diagram?

4. What equations of pid is used in 1st block diagram?

  • Q1: The Kp and Ki in ctrl.c are the default values for identification without motor parameters. And the Kp and Ki in user.c are calculated for running based on the identified or setting motor parameters.

    Q2: As you see in InstaSPIN user's guide, InstaSPIN-FOC uses the classical PID for speed loop, the spinTAC uses the ADRC for speed and position control.

    Q3&Q4, Sorry, we can only show how to use the APIs in spinTAC for you to use it, can't provide any more detailed limit to the IP.

    Btw, all the information we can disclose and provide that can be found in InstaSPIN user's guide.