Stepper motor driver not working

davey
Sun Jul 02, 2017 4:35 am
Been trying to get a basic DRV8825 working with a Nucleo STM32L432KC. Tried both the AccelStepper lib and Pololu lib ( https://github.com/laurb9/StepperDriver) to work but have had no luck. Tried examples for both libs, tried using different pins. verified the pins functioned by testing with digitalwrite. No matter what i tried the pulse pin doesn’t pulse. Any thoughts on what I can do to get this working?

Thanks

It doesn’t get much simpler than this:
#include <AccelStepper.h>

AccelStepper stepper (1,2,3);

void setup()
{
stepper.setMaxSpeed(1000);
stepper.setSpeed(50);
}

void loop()
{
stepper.runSpeed();
}


stevestrong
Sun Jul 02, 2017 7:03 am
I think you are using the STM32GENERIC core from Daniel, right?
If so, please post under the corresponding thread folder: http://www.stm32duino.com/viewforum.php?f=51

victor_pv
Sun Jul 02, 2017 7:05 am
Looks like you example is for one library but the link is for the other. Could you link to the one you use in that example?
Without seeing it I can’t say, but if they work the same, you are setting the stepper to 1 step, pin 2 for direction, and pin 3 for steps.
Is that right?

davey
Sun Jul 02, 2017 8:33 pm
The example is from the very common AccelStepper lib so i figured that people would know that one. The one I linked to is less common and I only found and tried it after that failed. Since it was not as well know that it was better if I clarified exactly where I got that one.

To add to the confusion, I tried just to pulse pin 2 like with Blink which pulsed the LED on 2 but motor only growled. Turned out the motor was bad! Good motor ran using blink but when I switched back to the stepper libs the LED would not blink and motor would not run.

AccelStepper stepper (1,2,3);
1= type pulse/dir
2=pulse pin
3=dir pin.

http://www.airspayce.com/mikem/arduino/AccelStepper/


davey
Sun Jul 02, 2017 8:37 pm
I think it’s the ‘grumpyoldpizza’ core as that supported the STM32-L series. Things were fuzzy when I was trying to figure out what the heck I was doing lol. How can I tell? Which should I be using?

Thanks!

[stevestrong – Sun Jul 02, 2017 7:03 am] –
I think you are using the STM32GENERIC core from Daniel, right?
If so, please post under the corresponding thread folder: http://www.stm32duino.com/viewforum.php?f=51


victor_pv
Sun Jul 02, 2017 9:50 pm
Not sure if I am misreading something, but when I check that class, the first parameter is supposed ot be the number of wires, and that should be 2:

http://www.airspayce.com/mikem/arduino/ … 273fbb012d

Did I misunderstand it?

Ok I see mode 1 is stepper driver.
Not sure what’s going on, you are going to have to dig a bit in the source code if noone else has used that library.


davey
Mon Jul 03, 2017 7:18 pm
I’m not that skilled at c++ and not at all with STM32 lol. It’s a very common lib so I’d have thought that it would have come up before with somebody. That was one of the reasons I went with the STM32- most arduino chips don’t have the horsepower to do high speed pulses.

Thanks

[victor_pv – Sun Jul 02, 2017 9:50 pm] –

Not sure what’s going on, you are going to have to dig a bit in the source code if noone else has used that library.


davey
Mon Jul 03, 2017 8:14 pm
I don’t see a forum that seems to fit the Nucleo STM32L432KC but maybe it’s just my ignorance about how things work.

[stevestrong – Sun Jul 02, 2017 7:03 am] –
I think you are using the STM32GENERIC core from Daniel, right?
If so, please post under the corresponding thread folder: http://www.stm32duino.com/viewforum.php?f=51


victor_pv
Mon Jul 03, 2017 9:00 pm
[davey – Mon Jul 03, 2017 8:14 pm] –
I don’t see a forum that seems to fit the Nucleo STM32L432KC but maybe it’s just my ignorance about how things work.

[stevestrong – Sun Jul 02, 2017 7:03 am] –
I think you are using the STM32GENERIC core from Daniel, right?
If so, please post under the corresponding thread folder: http://www.stm32duino.com/viewforum.php?f=51

If you are using the core from Grumpyoldpizza, I don’t think it has a dedicated forum. The STM32Generic does have one. Check where did you download your core from and you will now which one you have.
By the way, did you see if the DIR pin changes value if you try to change the direction with the library calls, or that pin doesn’t do anything either?


stevestrong
Mon Jul 03, 2017 9:04 pm
Well, your board is an F4 board, so it would fit under stm32f4 boards thread.
Or, you can classify your topic under the core you use, libmaple or generic.
For grumpyoldpizza core i think we dont have special thread folder.

davey
Mon Jul 03, 2017 10:36 pm
It’s an STM32L432KC not F4 and I don’t see anything for STM32L.

victor_pv
Thu Jul 06, 2017 4:13 pm
Davey, you are probably using Grumpyoldpizza’s core.
There is no specific forum for that one, so I guess this forum is fine.
I do not have experience with that core though, you may want to send a PM to him.

Did you see my question in a previous post?
By the way, did you see if the DIR pin changes value if you try to change the direction with the library calls, or that pin doesn’t do anything either?


Leave a Reply

Your email address will not be published. Required fields are marked *