Welcome Guest 

Show/Hide Header

Welcome Guest, posting in this forum requires registration.

Pages: [1]
Author Topic: L298N driver with 28BJY-48 stepper motors
Posts: 1
Post L298N driver with 28BJY-48 stepper motors
on: February 25, 2019, 00:23

Hi there, first of all thank you for such an awesome project. I built a basic rig using 28BJY-48 unipolar stepper motors that I hacked into bipolar stepper motors by following some online tutorials. I now have a 4 wire stepper motors which I'm running using L298N breakout driver boards.

I am not sure what driver to select under the arduino configuration sketch. I set my pins according to the instructions under the UNL2003 driver in the arduino code. When trying to move pen to a point, it goes in a different direction and just doesn't seem to work. It moves but not in any direction I want I to.

Say I have IN 1,2,3,4 from the driver board connected to pins 5,6,7,8 on the Arduino for one motor, what settings should I use in the arduino sketch? Also, how can I troubleshoot to make sure at least one motor is setup correctly?
Lastly, how can I reverse the clockwise and anticlockwise code in the sketch?
Thanking you in advance.

Posts: 1402
Post Re: L298N driver with 28BJY-48 stepper motors
on: February 25, 2019, 23:59

I haven't used L298Ns before so I can only guess, but I believe the control mechanism is the same as the ULN2003 - four wires that link to an H-bridge, pulsing in the certain order makes the world go round.

Internally, Polargraph uses AccelStepper for motor control, so you could try the example sketches that come with AccelStepper, and try to get them moving.

I notice in configuration.ino, that the pin sequence is odd:

AccelStepper motorA(8, 6,8,7,9);

6, 8, 7, 9. I don't understand why, and this might just be an artefact of how the person who wrote that up had their motors wired. I only accepted the pull request for those lines, I haven't actually used it!

Have a shot trying the examples that come with the accelstepper library, that'll let you troubleshoot your wire connections.

To reverse the motor direction you can just reverse your motor wiring. You can always do it in software, but there isn't an easy way like there is when using serial stepper drivers.

good luck!

Pages: [1]
Mingle Forum by cartpauj
Version: 1.0.34 ; Page loaded in: 0.021 seconds.