And in the end, a quick view on my wiring (an attached picture). I attached Power- to the GND, Power+ to 23V, the next four wires are stepper.
EN+ -> 5V
EN- -> GND
DIR+ -> Pin 5
DIR- -> GND (through EN-)
CLK+ -> Pin 6
CLK - -> GND (through EN-)
So this code was supposed to make my stepper move forward and then backward. It does hold the momentum (it's stiff and I cannot move it when I turn the power on) but it's the only thing it does. I would really appreciate your help in this. How could I control? Where am I doing something wrong?
Have a nice day, everybody!
[EDIT] Maybe it's worth to mention that the Direction LED (visible on the pic) is blinking (5s / 5s)
The code looks sensible. Are you sure enable is enabled with voltage applied? The sense may be the other
way (ie you don't need to wire up enable at all). Check this.
And check step and direction are connected the right way round(!). Check the DIP switch
settings against the manual for the motor driver.
Couldn't find your SNC124 driver's datasheet by searching the internet.
Maybe you can post either a direct link to or a copy of the datasheet, so we could check if your wiring and code matches the driver's requirements.
The voltage is applied, I already checked it (and everything else connected to it is working fine [encoder, button, LCD screen]). As I read, the direction LED is blinking because of a code - but I don't know why the motor is still just holding the momentum, not moving.
Every switch is on the "off" position (1/2 step res. and 0.5 A (I tried 1.2A, but the effect was the same, only the motor was starting to get hot quite quickly)).
Hi,
Don't quote me on this , but I think the library you are using is designed for driving stepper drive H-Bridges directly, rather than a controller like yours that just need step and direction signals.
You need to make some simple code, not using AccelStepper library, that outputs a clock signal to the clock input of the driver controller.
It doesn't need to be anything great, just to prove the concept, just use some delays and digitalWrite statements to the clock output and see what happens.
Say 100ms HIGH, then 100ms low, you have the enable already wired up and the direction should be okay LOW.
I already tried that and the effect was the same. I used one of the codes from examples. I'm almost sure that it has to do with the wiring or settings, but I am not 100% sure. I will post the code I used later in the day. I tried various codes since last week and still - the stepper is holding the momentum and nothing else And as far as I know, the AccelStepper library is designed for controllers and stepper that only use CLK and DIR wires (which is exactly my case), but I could be wrong.
TomGeorge:
Hi,
Don't quote me on this , but I think the library you are using is designed for driving stepper drive H-Bridges directly, rather than a controller like yours that just need step and direction signals.
You need to make some simple code, not using AccelStepper library, that outputs a clock signal to the clock input of the driver controller.
Incorrect, the AccelStepper library will drive step+direction drivers and has been explicitly setup to
do just this in the code posted. Please check facts before wading in.
It is better style to use the enum type defined in the library than to just say 1 for the interface type: