How can I run the motor both CCW and CW?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How can I run the motor both CCW and CW?

1,143 Views
hbch
Contributor III

Hi,

I run the BLDC well in anti-clockwise with the help of AN4704.

But when I try to run the motor in clockwise,it failed.

How can i run the motor in both direction?

Can anyone give me a tip to modify the source code?

It maybe be an easy work.

The key is MaskVal[6], OutCtl[6], BemfPhase[6].

Labels (1)
Tags (1)
0 Kudos
3 Replies

1,002 Views
marekmusak
NXP Employee
NXP Employee

Hi, 

For clockwise direction, please do following modifications:

For motor, please, keep this phase wires connection:

Connector J24, PHASE 1: blue

Connector J24, PHASE 2: white

Connector J24, PHASE 0: green

 

For Hall sensor, please, keep this wires connection:

Connector J11-1: red

Connector J11-2: black

Connector J11-3: white

Connector J11-4: green

Connector J11-5: blue 

Then, please modify MaskVal[6], OutCtl[6], BemfPhase[6] in software example:

const char MaskVal[2][6]   = {{0x34, 0x1c, 0x13, 0x31, 0x0d, 0x07}, {0x31, 0x13, 0x1c, 0x34, 0x07, 0x0d}};

const char OutCtl[2][6]   = {{0x0c, 0x30, 0x30, 0x03, 0x03, 0x0c}, {0x03, 0x30, 0x30, 0x0c, 0x0c, 0x03}};

const char BemfPhase[2][6] = {{0x03, 0x02, 0x01, 0x03, 0x02, 0x01}, {0x03, 0x01, 0x02, 0x03, 0x01, 0x02}};

const uint8_t BLDCPatternBasedOnHall[2][7] = {{0, 4, 0, 5, 2, 3, 1},{0, 2, 0, 1, 4, 3, 5}};

 

Use variable "direction" to select CW or CCW and apply BLDCPatternBasedOnHall in function:

INTERRUPT void TIMchan1_ISR(void)

{

   ...

         ActualCmtSector = BLDCPatternBasedOnHall[direction][hallPattern];

   ...

}

void AppAlignmentToStart(void)

{

   ...

         ActualCmtSector = BLDCPatternBasedOnHall[direction][hallPattern];

   ...

}

Last and very IMPORTANT step:

Please, open Jumper J9 otherwise it will affect Hall signal   

Regards,

Marek

0 Kudos

1,002 Views
lama
NXP TechSupport
NXP TechSupport

Hi,

we are sorry for being late.

Your issues is being solved and tested in the application team. It will be read soon.

Best regards,

Ladislav

0 Kudos

1,002 Views
hbch
Contributor III

I got the answer from AN4718.

If CCW sector order is  0-1-2-3-4-5, then CW sector order 3-2-1-0-5-4.

Unfornately, the speed dither at a fixed frequency which responses to the speed.

What's the problem?

0 Kudos