The motor do the job sometimes ... sometimes the motor do two or more turns instead of going backwards ... sometimes it seems like it move forward then go backward one step then go forward ... Well not reliable at all.
Sorry but I don't have those parts in my hand. The coloured lines to positions are useless. Schematics show the logic names of the pins.
You need to know the current measuring resistor. Why set the current to 15 mA? That looks like useless. No torque at all.
Please post a link to the datasheet of that stepper!
This is a very special dual stepper for display instruments. The coils are low current / high impedance, and I doubt that the DRV8825 is a suitable driver for this kind of steppers, The DRV8825 is designed for low impedance steppers. But I have no experience with this kind of steppers.
Are you shure you connected the coils correctly?. There are 4 coils, bause the device contains two independet steppers.
setSpeed(1000); means 100 rev/min or - with 1090 steps/rev - 1816 steps/sec. That's far beyond the capabilities of that steppers. From the datasheet it's max 600 steps/sec with acceleration and 200 steps/sec without.
For some reason i realize that the motor1.rotate(-1); part of the code is a problem it turn good if i let motor1.rotate(1); but when i change direction it's like the motor wanted to go both direction
This stepper seems to need a 6-step sequence.
I think most stepper libraries use a 4-step sequence, or 8, 16, 32 etc.
Maybe @MicroBahner can shed some light on that. I think he wrote MobaTools.
The sequence I wrote for a 28BYJ-48 stepper surely did use a 4, 8 sequence.
Leo..
Yes, looking at the datasheet it seems so. But I don't have any experience with these kind of steppers. When using the DRV8825, the library has no influence on the step sequence, it only creates step and dir signals. When using a H-bridge it should be possible to write a test sketch that creates the steps exacly according to the datasheet. I'm also not quite shure if the stepper is able to rotate continuously. This would even not be necessary for the intended use.
From the datasheet:
Low current consumption: less than20mA, 5V, 2X100mW.
Should be even possible to drive them directly from ouput pins
( with flyback diodes)
Yes, the coils seem to be 280 ohm, and 18mA is not a problem for an Uno.
Adding eight 1N5819 diodes is a wise move.
The stepper.h library seems to only cater for 4-sequence and 10-sequence motors.
Maybe some clever kid (not me) can add a custom 6-sequence to that.
Leo..
Yes it's possible to drive it from a uno but i use esp32 which cannot provide 5v on pin.
I should also say that so far i try to make only one part of the motor to turn (so 2 coils)
From my understanding Drv8833 is a H bridge, i have connected it using below scheme :
I set IN1 to IN4 on ESP32 GPIO 12,13,14,27 and OUT1 to OUT4 on the 4 pins of one motor but nothing happend
Not with a DRV8825. This driver only has step and dir inputs. The step sequence is defined internally by the driver. Only with a simple H-bridge the step sequence is defined by the software. Then of course you can change it by changing the library or your own sketch, if you don't use a library.
Btw, the stepper.h is not designed to work with a step/dir driver.