I'm using a DRV8847 as a bipolar stepper motor driver.I want to let the motor work in both CCW dir and CW dir.For the CCW dir,I followed the motor's datasheet(pic below),and the sequence is A-B-C-D-A...,for the CW mode,the sequence is D-C-B-A-D...
I used a key on the board to change the direction. It seems fine when the loop times is long(for example,the A-B-C-D loops 512 times for 360deg),but when the direction changed(for example 16 times A-B-C-D followed by 16 times D-C-B-A),the direction always not changed.
My test program is as below
//CCW dir
for (i = 0;i < loop_times;i++)
{
SEQUENCE A;
delay;
SEQUENCE B;
delay;
SEQUENCE C;
delay;
SEQUENCE D;
delay;
}
//CW dir
for (i = 0;i < loop_times;i++)
{
SEQUENCE D;
delay;
SEQUENCE C;
delay;
SEQUENCE B;
delay;
SEQUENCE A;
delay;
}
Is there something wrong with the driver?
Is there something need to do when I changed the direction?
or is there any suggestion about this issue?
Thanks for your reply.