|
|
View previous topic :: View next topic |
Author |
Message |
o_wan Guest
|
877a + bipolar stepper |
Posted: Wed Nov 30, 2005 1:17 am |
|
|
I'm using 877a with half h-bridge driving a bi-polar stepper using code below, it's not quite work although it generates pulse to port B,
Is there anyone working with that too? I suspect the problem would be bit output, please debug,
byte const POSITIONS[4] = { 0b00010000, 0b00100000,
0b01000000,
0b10000000 };
void drive_stepper(byte steps)
{
static byte stepper_state = 0;
byte i;
for( i = 0; i < steps; i++ ) {
output_b(POSITIONS[stepper_state]);
delay_ms(250); //Time delay to change stepping speed
stepper_state = (stepper_state + 1)&(sizeof(POSITIONS) - 1);
}
}
main()
{
int count = 0;
set_tris_b(0x00);
drive_stepper(10);
output_b(0x00);
} |
|
|
arunb
Joined: 08 Sep 2003 Posts: 492 Location: India
|
RE: |
Posted: Wed Nov 30, 2005 3:08 am |
|
|
Hi,
Have you generated the proper pulses, (quadrature) ??
thanks
arunb |
|
|
Ttelmah Guest
|
|
Posted: Wed Nov 30, 2005 4:11 am |
|
|
A big hint has been given, but I'll be a little more explicit. When directly driving a bipolar motor, _two_ of the transistor drives, always have to be 'on', or no current cn actually flow through the coil. Your bit patterns all have single drives on (which would be useable with a unipolar motor). Without knowing how your motor is actually wired (which bit feeds which connection on the bridge), we cannot tell you what petterns are needed.
Best Wishes |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|