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.

DRV10987: FGcycle

Part Number: DRV10987

hi,

#define Pole_Num 10

my motor have 10 poles

but, in the config register1 in the FGcycle[3:0]   (bit 11:8) section you wrote :0

this means that the FG motor pole option is GF/1 (2 POLES)

why did you use this config instead of the 10 poles option that means to insert  FGcycle[3:0] =4 ?

thanks,

liraz

  • Hey liraz,

    The intent of the #define Pole_Num 10 and illustrate the two ways of interpretting FG and converting it into RPM. The equation to convert electrical commutation frequency to RPM is defined as:

    RPM = 120*(f_electrical)/(n_poles)        (1)

    Where f_electrical is frequency at which the device applies current, and n_poles is the number of poles of the motor. When FG is used to detect the speed on the MCU, the FGcycle = 0 means that FG will equal the f_electrical. When FGcycle is assigned to the correct number of poles, the equation is replaced with:

    RPM = 120*f_FG         (2)

    This is because f_FG = (f_electrical)/(n_poles) and it assumes the FG cycle was chosen correctly.

    Now Config1 was hard coded for FGcycle = 0 because the writer of the this decided to use equation 1 in the code. Please note that lines 13 or 14 are, therefore, incorrect because they divide by 12 instead of 120. Thank you for pointing this out.

    If you do decide to make FGcycle = 4 to just remember you have changed the equation for calculating RPM of the motor to equation 2. There are benefits to doing this. Sometimes, there are variations in electrical frequency with multiple pole motors because it takes multiple electrical frequencies to finish 1 revolution of the rotor. Changing the FG cycle will ensure the variations are only measured in context of revolutions instead of electrical frequencies. This helps so the PI loop doesn't try to increase or decrease the speed of the motor until the revolution is completed.

    Best,

    -Cole