Urgent help with BLDC sensored motor

Showing results for 
Search instead for 
Did you mean: 

Urgent help with BLDC sensored motor

Contributor I

We have designed a  KV58 based motor control board for BLDC with hall sensor motor. Most  software project examples are for sensorless motor.  Is there a project  which uses TWR-KV58F MCU module, TWR-MC-LV3PH motor driver module, a BLDC with Hall sensor.There is an older project for TWR-56F8257 MCU module, TWR-MC-LV3PH TWR-MC-LV3PH motor driver module, and the Linix 45ZWN24-40 BLDC motor running in a sensored configuration but the tools are obsolete. Can somebody help us with this - it is critical need for us. 

0 Kudos
2 Replies

Contributor I

Thanks xiangjun.rong for your help! 

0 Kudos

NXP TechSupport
NXP TechSupport

Hi, Ali,

If you use the boards:TWR-KV58F,  TWR-MC-LV3PH, Linix 45ZWN24-40 BLDC motor, I suggest you refere to the following example based on TWR-8400(MC56F84789),in other words, the example is based on the boards:TWR-8400,  TWR-MC-LV3PH, Linix 45ZWN24-40 BLDC motor.

For TWR-KV58 and TWR-8400, I lists the Hall signal connection:

Hall signals:                   Golden pin index                     TWR-8400                                                     TWR-KV58

ENC_PHase_A               A34                                        GPIOC3/TA0                                                   GPIOC8/FTM3_CH4

ENC_PHase_B               A33                                        GPIOC4/TA1                                                   GPIOC10/FTM3_CH6

ENC_Index                      B34                                        GPIOC6/TA2                                                   GPIOC11/FTM3_CH7

You can use FTM3 channels to trigger capture interrupt once the hall signal generate falling/rising edges, you can read the GPIOC input data register to raed the hall signal logic. The key of the BLDC control is the timing relationship between hall signal logic and PWM signals, which is motor by motor, I copy the code here:

      uw16HallState =     ((uw16HallStateRaw&0x0100)>>6)  | // HS_C, GPIOC8 for TWR-KV58
                            ((uw16HallStateRaw&0x0400)>>9)  | // HS_B            GPIOC10 for TWR-KV58
                            ((uw16HallStateRaw&0x0800)>>11);   // HS_A

Hope it can help you


Xiangjun rong

* Function:         void inline void commutationHS(unsigned int direction)
* Description:
*       The function decodes Hall Sensors signals and provide commutation
* Returns:             None
* Global Data:         hallSensor   - decoded stated of hall sensors
* Arguments:
*                   unsigned int direction  - required direction of rotation
* Range Issues:     None
* Special Issues:     None
static inline void commutationHS(unsigned int uiDirection)
    /* read all GPIO_C pins  */
    uw16HallStateRaw = GPIOC_RAWDATA;
    /* scale to range <0-7> */
      uw16HallState =     ((uw16HallStateRaw&0x0040)>>4)  | // HS_C
                            ((uw16HallStateRaw&0x0010)>>3)  | // HS_B
                            ((uw16HallStateRaw&0x0008)>>3);   // HS_A
      /* for Counterclockwise direction negate HS state */
          uw16HallState = (~uw16HallState)&0x7;                      
      /* mask required PWM pairs according to Hall sensors state */
      PWMA_MASK = commutationTableMask[uw16HallState];
      /* switch to Software control one of bottom transistor according to Hall sensors state */
      PWMA_DTSRCSEL = commutationTableSWC[uw16HallState];
      /* apply FORCE event to change current PWM channel configuration */

0 Kudos