Author Topic: Testing bi-polar stepper using DRV8825 driver without MCU  (Read 587 times)

0 Members and 1 Guest are viewing this topic.

Offline newtekuserTopic starter

  • Frequent Contributor
  • **
  • Posts: 356
  • Country: us
Testing bi-polar stepper using DRV8825 driver without MCU
« on: February 04, 2024, 06:30:23 pm »
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  :))
 

Offline langwadt

  • Super Contributor
  • ***
  • Posts: 4427
  • Country: dk
Re: Testing bi-polar stepper using DRV8825 driver without MCU
« Reply #1 on: February 04, 2024, 07:03:44 pm »
you are looking at the wrong section of the datasheet, you should look at section 7.6 https://www.ti.com/lit/ds/symlink/drv8825.pdf

and your step frequency should probably be much slower to get the motor started from a stand still
 
The following users thanked this post: newtekuser

Online Doctorandus_P

  • Super Contributor
  • ***
  • Posts: 3362
  • Country: nl
Re: Testing bi-polar stepper using DRV8825 driver without MCU
« Reply #2 on: February 04, 2024, 07:09:23 pm »
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.
 
The following users thanked this post: newtekuser

Online pcprogrammer

  • Super Contributor
  • ***
  • Posts: 3710
  • Country: nl
Re: Testing bi-polar stepper using DRV8825 driver without MCU
« Reply #3 on: February 04, 2024, 07:10:52 pm »
you are looking at the wrong section of the datasheet, you should look at section 7.6 https://www.ti.com/lit/ds/symlink/drv8825.pdf

and your step frequency should probably be much slower to get the motor started from a stand still

Indeed. 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.

Offline MarkT

  • Frequent Contributor
  • **
  • Posts: 367
  • Country: gb
Re: Testing bi-polar stepper using DRV8825 driver without MCU
« Reply #4 on: February 04, 2024, 08:55:30 pm »
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...
 
The following users thanked this post: newtekuser

Offline newtekuserTopic starter

  • Frequent Contributor
  • **
  • Posts: 356
  • Country: us
Re: Testing bi-polar stepper using DRV8825 driver without MCU
« Reply #5 on: February 04, 2024, 11:35:42 pm »
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?
« Last Edit: February 04, 2024, 11:38:11 pm by newtekuser »
 

Offline langwadt

  • Super Contributor
  • ***
  • Posts: 4427
  • Country: dk
Re: Testing bi-polar stepper using DRV8825 driver without MCU
« Reply #6 on: February 05, 2024, 12:08:01 am »
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?

seems 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 driver

though 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


 

Offline newtekuserTopic starter

  • Frequent Contributor
  • **
  • Posts: 356
  • Country: us
Re: Testing bi-polar stepper using DRV8825 driver without MCU
« Reply #7 on: February 05, 2024, 12:32:46 am »
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?

seems 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 driver

though 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

I'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.
 

Offline langwadt

  • Super Contributor
  • ***
  • Posts: 4427
  • Country: dk
Re: Testing bi-polar stepper using DRV8825 driver without MCU
« Reply #8 on: February 05, 2024, 12:45:52 am »
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?

seems 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 driver

though 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

I'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.

the 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



 

Offline newtekuserTopic starter

  • Frequent Contributor
  • **
  • Posts: 356
  • Country: us
Re: Testing bi-polar stepper using DRV8825 driver without MCU
« Reply #9 on: February 05, 2024, 06:22:31 pm »
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?

seems 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 driver

though 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

I'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.

the 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

Thanks! 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.
 

Offline mawyatt

  • Super Contributor
  • ***
  • Posts: 3269
  • Country: us
Re: Testing bi-polar stepper using DRV8825 driver without MCU
« Reply #10 on: February 05, 2024, 06:59:57 pm »


the 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


Thanks! 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.

The 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-boards

https://www.digikey.com/en/products/detail/analog-devices-inc/TMC5160SILENTSTEPSTICK/9990281

Best,
Curiosity killed the cat, also depleted my wallet!
~Wyatt Labs by Mike~
 

Offline newtekuserTopic starter

  • Frequent Contributor
  • **
  • Posts: 356
  • Country: us
Re: Testing bi-polar stepper using DRV8825 driver without MCU
« Reply #11 on: February 05, 2024, 07:24:40 pm »


the 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


Thanks! 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.

The 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-boards

https://www.digikey.com/en/products/detail/analog-devices-inc/TMC5160SILENTSTEPSTICK/9990281

Best,

Commercially 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.
« Last Edit: February 05, 2024, 08:52:25 pm by newtekuser »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf