Testing bi-polar stepper using DRV8825 driver without MCU - Page 1
Forum section: electronics / beginners

author: newtekuser
author_rank: Frequent Contributor
timestamp: February 04, 2024, 06:30:23 pm
content: I'd like to test the DRV8825 driver without hooking it up to my MCU, I think it should be possible by connecting the STEP pin to the waveform generator using a square wave of 30 KHz with a rise/fall time from 30ns min to 200ns max.The DIR pin has an internal pull down, so it should automatically spin into one direction if left unconnected, if I want to reverse the direction I should connect a pull up resistor to change the logic level.Is this the right approach? The reason I have not tried it yet is because I'm waiting on the PCB to arrive from jlcpcb (yes, I'm building my own to learn)

author: langwadt
author_rank: Super Contributor
timestamp: February 04, 2024, 07:03:44 pm
content: you are looking at the wrong section of the datasheet, you should look at section 7.6https://www.ti.com/lit/ds/symlink/drv8825.pdfand your step frequency should probably be much slower to get the motor started from a stand still

author: Doctorandus_P
author_rank: Super Contributor
timestamp: February 04, 2024, 07:09:23 pm
content: You can not instantly reverse direction on a stepper motor. You have to decelerate, switch direction and accelerate again. The inputs to a stepper driver IC are just digital inputs, and there are a lot of options.1. Put a uC on a breadboard and put GRBL in it (many versions for different uC's available). (Or write some simple test routines yourself).2. Hook it up to a function generator. (Or NE555 or similar)3. Combine it with a rotary encoder. Note that the regular 2-bit grey encoders can be connected directly to a stepper motor's step and direction pulses. You will loose some steps due to jitter, glitches and the exact position in which you switch direction, but it may be enough for some tests.

author: pcprogrammer
author_rank: Super Contributor
timestamp: February 04, 2024, 07:10:52 pm
content: Quote from: langwadt on February 04, 2024, 07:03:44 pmIndeed. Make sure to connect mode pins to set the wanted configuration. Pulsing step will then move the motor depending on the configuration. For testing, full step would be the easiest, and set your pulse generator to maybe 10Hz. This will make the stepper move slowly.

author: MarkT
author_rank: Frequent Contributor
timestamp: February 04, 2024, 08:55:30 pm
content: Normally STEP input is pulsed with positive going pulses but square wave is fine, just make sure its between 0V and 5V, no negative voltages or you may fry the chip. A protection resistor on the pin is a wise precaution, a few kiloohms. And start at low frequency as mentioned.The golden rule with stepper drivers is never hot-swap the motor winding connections - that will fry the chip. Make sure they are solid connections before powering up...

author: newtekuser
author_rank: Frequent Contributor
timestamp: February 04, 2024, 11:35:42 pm
content: Thank you all! In my application I have MODE pins not connected to anything as I want full step capability. Similarly, I left the DECAY pin not connected as I think mixed mode is a good compromise.Speaking of the timing requirements in section 7.6 of the data sheet, how can I ensure those values when connected to the MCU?I take that I can achieve the needed pulse duration by adding a delay between each step, but what about the frequency? Do I need additional HW circuitry on the STEP pin to for clocking?

author: langwadt
author_rank: Super Contributor
timestamp: February 05, 2024, 12:08:01 am
content: Quote from: newtekuser on February 04, 2024, 11:35:42 pmseems like you are missing how a steppermotor and driver works.every time you pulse the step pin (with the required duration) the motor turns one step, you can step as slow as you like, or as fast as within it the limit of the driverthough if you step very fast of change how fast you step abruptly, the motor might not be able keep up, so it stop turning and just vibrate

author: newtekuser
author_rank: Frequent Contributor
timestamp: February 05, 2024, 12:32:46 am
content: Quote from: langwadt on February 05, 2024, 12:08:01 amI've been using uni-polar motors using a darlington array ICs, pretty simple operation except for the firing sequence. I never used a DRV8825 and the details in the data sheet are a bit intimidating compared to what I'm used to. For instance, for the uni-polar motor I do not care about the stepping frequency (seems like I do not need to?), I just set the right sequence for the pins and the motor just moves.

author: langwadt
author_rank: Super Contributor
timestamp: February 05, 2024, 12:45:52 am
content: Quote from: newtekuser on February 05, 2024, 12:32:46 amthe DRV8825 is pretty much the same. just, instead of setting pins for the next step in the sequence like you did before, you just pulse the step pin once

author: newtekuser
author_rank: Frequent Contributor
timestamp: February 05, 2024, 06:22:31 pm
content: Quote from: langwadt on February 05, 2024, 12:45:52 amThanks! That was my initial understanding and what made it so attractive to me. Having a built-in indexer and not having to worry about the order of the pulses for the phases is a great deal to me.

author: mawyatt
author_rank: Super Contributor
timestamp: February 05, 2024, 06:59:57 pm
content: Quote from: newtekuser on February 05, 2024, 06:22:31 pmThe TI DRV types had some bad linearity issues with micro-stepping back when we were involved with developing stepper controllers for precision use, recall later Hack-A-Day or something had a review of such. We avoided these after our own testing and went with the Trinamic types, which are much more capable controllers, with many useful features and no linearity issues.....alto more difficult get one's arms around, but worth the effort!!Dici-Key has various Trinamic chips, PCBs and Modules, some reasonable like these.https://www.digikey.com/en/product-highlight/t/trinamic/bob-breakout-boardshttps://www.digikey.com/en/products/detail/analog-devices-inc/TMC5160SILENTSTEPSTICK/9990281Best,

author: newtekuser
author_rank: Frequent Contributor
timestamp: February 05, 2024, 07:24:40 pm
content: Quote from: mawyatt on February 05, 2024, 06:59:57 pmCommercially available break-out board options are a no-go for me as I want to learn how to implement my own solution, even if it’s based on the DRV8825 chip.However, if there’s sufficient available documentation on getting a TMC chip solution to work from scratch (not using a commercially solution) then I’d be happy to entertain this.