Modified phase table in stepper.cpp to enable stepping a bipolar motor using a twin H-bridge driver.

Fork of stepper by Kenji Arai

Corrected single-stepping, now walking up or down just one phase table. Compile-time options for driving bipolar motor in any of single-phase, two-phase, or half-stepping. Coils remain engaged at end of specifed movement command - de-energize coils by issuing a motor.move(0) while already stopped.

Revision:
2:fd11d89b8ce0
Parent:
0:7b0c724fa658
Child:
3:96bfb8b476f8
--- a/stepper.cpp	Sat Aug 23 06:45:41 2014 +0000
+++ b/stepper.cpp	Thu Dec 18 17:52:40 2014 +0000
@@ -17,9 +17,16 @@
 
 #include    "mbed.h"
 #include    "stepper.h"
-
+/*
+//Firing sequence for uni-polar (5+ wires) stepper (4x open-collector drivers required). 
 const uint8_t pase_cw[4][4]  = {{1, 1, 0, 0}, {0, 1, 1, 0}, {0, 0, 1, 1}, {1, 0, 0, 1}};
 const uint8_t pase_ccw[4][4] = {{1, 1, 0, 0}, {1, 0, 0, 1}, {0, 0, 1, 1}, {0, 1, 1, 0}};
+*/
+//Firing sequence for bi-polar (4 wires) stepper (2x H-Bridge driver required eg L298
+//A+, B+, A-, B-) 
+const uint8_t pase_cw[4][4]  = {{1, 0, 0, 0}, {0, 0, 1, 0}, {0, 1, 0, 0}, {0, 0, 0, 1}};
+const uint8_t pase_ccw[4][4] = {{1, 0, 0, 0}, {0, 0, 0, 1}, {0, 1, 0, 0}, {0, 0, 1, 0}};
+
 extern uint8_t pls_width[];
 
 STEPPER::STEPPER (PinName xp, PinName xn, PinName yp, PinName yn):