JJRobots COMMUNITY
B-Robot - using L298N motor drivers instead - Printable Version

+- JJRobots COMMUNITY (http://forums.jjrobots.com)
+-- Forum: JJrobots (/forumdisplay.php?fid=1)
+--- Forum: B-Robot (/forumdisplay.php?fid=2)
+--- Thread: B-Robot - using L298N motor drivers instead (/showthread.php?tid=753)



B-Robot - using L298N motor drivers instead - jayadeepk - 11-07-2015 09:35 AM

I have pairs of Stepper motors and L298N driver modules. I am able to control L298N driver with Arduino Uno using Arduino Stepper library. But to run smoothly B-Robot seems to take steps from ISR. Running Stepper::step of Arduino library in ISR blocks the code.
Is it possible to run L298N drivers without arduino stepper library? How should the wiring go?


RE: B-Robot - using L298N motor drivers instead - sasa999 - 11-07-2015 11:23 AM

Is possible. You can write your own driver/code - it is very sample, but:
1. you need 5 Arduino Uno pins for each stepper,
2. microstepping will be real pain - you must write code for pwm and simulate something similar to microstepping,
3. no curent limiting.
4. a4988 (1.25$) is 1.5x cheaper than L298N(2$)
Try DC motors for L298N drivers. You need only 1 driver for two motors.
[Image: 319FxRzR-EL._SY300_.jpg]


RE: B-Robot - using L298N motor drivers instead - jayadeepk - 11-07-2015 05:53 PM

(11-07-2015 11:23 AM)sasa999 Wrote:  You can write your own driver/code - it is very sample, but:
1. you need 5 Arduino Uno pins for each stepper,
2. microstepping will be real pain - you must write code for pwm and simulate something similar to microstepping,

I have tried writing to L298N driver inputs (like in stepMotor function of arduino stepper library) in ISRTimer1 and then changing speed using OCR1A in loop(). Speed control now occurs smoothly. Thanks for response.